pax_global_header00006660000000000000000000000064147261417730014526gustar00rootroot0000000000000052 comment=4b5b7fa1eef9168ef3e143b248e978aa0d1f19e5 kubernetes-client-go-a2dfcab/000077500000000000000000000000001472614177300164005ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/.github/000077500000000000000000000000001472614177300177405ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000003071472614177300235410ustar00rootroot00000000000000Sorry, we do not accept changes directly against this repository, unless the change is to the `README.md` itself. Please see `CONTRIBUTING.md` for information on where and how to contribute instead. kubernetes-client-go-a2dfcab/CHANGELOG.md000066400000000000000000001257031472614177300202210ustar00rootroot00000000000000TODO: This document was manually maintained so might be incomplete. The automation effort is tracked in https://github.com/kubernetes/test-infra/issues/5843. Changes in `k8s.io/api` and `k8s.io/apimachinery` are mentioned here because `k8s.io/client-go` depends on them. # v10.0.0 **Breaking Changes:** * Action required: client-go will no longer have bootstrap (`k8s.io/client-go/tools/bootstrap`) related code. Any reference to it will break. Please redirect all references to `k8s.io/bootstrap` instead. ([#67356](https://github.com/kubernetes/kubernetes/pull/67356)) * The methods `NewSelfSignedCACert` and `NewSignedCert` now use `crypto.Signer` interface instead of `rsa.PrivateKey` for certificate creation. This is done to allow different kind of private keys (for example: ecdsa). ([#69329](https://github.com/kubernetes/kubernetes/pull/69329)) * `GetScale` and `UpdateScale` methods have been added for `apps/v1` clients and with this, no-verb scale clients have been removed. ([#70437](https://github.com/kubernetes/kubernetes/pull/70437)) * `k8s.io/client-go/util/cert/triple` package has been removed. ([#70966](https://github.com/kubernetes/kubernetes/pull/70966)) **New Features:** * `unfinished_work_microseconds` is added to the workqueue metrics. It can be used to detect stuck worker threads (kube-controller-manager runs many workqueues.). ([#70884](https://github.com/kubernetes/kubernetes/pull/70884)) * A method `GetPorts` is added to expose the ports that were forwarded. This can be used to retrieve the locally-bound port in cases where the input was port 0. ([#67513](https://github.com/kubernetes/kubernetes/pull/67513)) * Dynamic listers and informers, that work with `runtime.Unstructured` objects, are added. These are useful for writing generic, non-generated controllers. ([68748](https://github.com/kubernetes/kubernetes/pull/68748)) * The dynamic fake client now supports JSONPatch. ([#69330](https://github.com/kubernetes/kubernetes/pull/69330)) * The `GetBinding` method is added for pods in the fake client. ([#69412](https://github.com/kubernetes/kubernetes/pull/69412)) **Bug fixes and Improvements:** * The `apiVersion` and action name values for fake evictions are now set. ([#69035](https://github.com/kubernetes/kubernetes/pull/69035)) * PEM files containing both TLS certificate and key can now be parsed in arbitrary order. Previously key was always required to be first. ([#69536](https://github.com/kubernetes/kubernetes/pull/69536)) * Go clients created from a kubeconfig that specifies a `TokenFile` now periodically reload the token from the specified file. ([#70606](https://github.com/kubernetes/kubernetes/pull/70606)) * It is now ensured that oversized data frames are not written to spdystreams in `remotecommand.NewSPDYExecutor`. ([#70999](https://github.com/kubernetes/kubernetes/pull/70999)) * A panic occuring on calling `scheme.Convert` is fixed by populating the fake dynamic client scheme. ([#69125](https://github.com/kubernetes/kubernetes/pull/69125)) * Add step to correctly setup permissions for the in-cluster-client-configuration example. ([#69232](https://github.com/kubernetes/kubernetes/pull/69232)) * The function `Parallelize` is deprecated. Use `ParallelizeUntil` instead. ([#68403](https://github.com/kubernetes/kubernetes/pull/68403)) * [k8s.io/apimachinery] Restrict redirect following from the apiserver to same-host redirects, and ignore redirects in some cases. ([#66516](https://github.com/kubernetes/kubernetes/pull/66516)) ## API changes **New Features:** * GlusterFS PersistentVolumes sources can now reference endpoints in any namespace using the `spec.glusterfs.endpointsNamespace` field. Ensure all kubelets are upgraded to 1.13+ before using this capability. ([#60195](https://github.com/kubernetes/kubernetes/pull/60195)) * The [dynamic audit configuration](https://github.com/kubernetes/community/blob/master/keps/sig-auth/0014-dynamic-audit-configuration.md) API is added. ([#67547](https://github.com/kubernetes/kubernetes/pull/67547)) * A new field `EnableServiceLinks` is added to the `PodSpec` to indicate whether information about services should be injected into pod's environment variables. ([#68754](https://github.com/kubernetes/kubernetes/pull/68754)) * `CSIPersistentVolume` feature, i.e. `PersistentVolumes` with `CSIPersistentVolumeSource`, is GA. `CSIPersistentVolume` feature gate is now deprecated and will be removed according to deprecation policy. ([#69929](https://github.com/kubernetes/kubernetes/pull/69929)) * Raw block volume support is promoted to beta, and enabled by default. This is accessible via the `volumeDevices` container field in pod specs, and the `volumeMode` field in persistent volume and persistent volume claims definitions. ([#71167](https://github.com/kubernetes/kubernetes/pull/71167)) **Bug fixes and Improvements:** * The default value of extensions/v1beta1 Deployment's `RevisionHistoryLimit` is set to `MaxInt32`. ([#66605](https://github.com/kubernetes/kubernetes/pull/66605)) * `procMount` field is no longer incorrectly marked as required in openapi schema. ([#69694](https://github.com/kubernetes/kubernetes/pull/69694)) * The caBundle and service fields in admission webhook API objects now correctly indicate they are optional. ([#70138](https://github.com/kubernetes/kubernetes/pull/70138)) # v9.0.0 **Breaking Changes:** * client-go now supports additional non-alpha-numeric characters in UserInfo "extra" data keys. It should be updated in order to properly support extra data containing "/" characters or other characters disallowed in HTTP headers. Old clients sending keys which were `%`-escaped by the user will have their values unescaped by new API servers. ([#65799](https://github.com/kubernetes/kubernetes/pull/65799)) * `apimachinery/pkg/watch.Until` has been moved to `client-go/tools/watch.UntilWithoutRetry`. While switching please consider using the new `client-go/tools/watch.UntilWithSync` or `client-go/tools/watch.Until`. ([#66906](https://github.com/kubernetes/kubernetes/pull/66906)) * [k8s.io/apimachinery] `Unstructured` metadata accessors now respect omitempty semantics i.e. a field having zero value will now be removed from the unstructured metadata map. ([#67635](https://github.com/kubernetes/kubernetes/pull/67635)) * [k8s.io/apimachinery] The `ObjectConvertor` interface is now changed such that `ConvertFieldLabel` func takes GroupVersionKind as an argument instead of just version and kind. ([#65780](https://github.com/kubernetes/kubernetes/pull/65780)) * [k8s.io/apimachinery] componentconfig `ClientConnectionConfiguration` is moved to `k8s.io/apimachinery/pkg/apis/config`. ([#66058](https://github.com/kubernetes/kubernetes/pull/66058)) * [k8s.io/apimachinery] Renamed ` KubeConfigFile` to `Kubeconfig` in `ClientConnectionConfiguration`. ([#67149](https://github.com/kubernetes/kubernetes/pull/67149)) * [k8s.io/apimachinery] JSON patch no longer supports `int`. ([#63522](https://github.com/kubernetes/kubernetes/pull/63522)) **New Features:** * Add ability to cancel leader election. This also proves useful in integration tests where the whole app is started and stopped in each test. ([#57932](https://github.com/kubernetes/kubernetes/pull/57932)) * An example showing how to use fake clients in tests is added. ([#65291](https://github.com/kubernetes/kubernetes/pull/65291)) * [k8s.io/apimachinery] Create and Update now support `CreateOptions` and `UpdateOptions`. ([#65105](https://github.com/kubernetes/kubernetes/pull/65105)) **Bug fixes and Improvements:** * Decrease the amount of time it takes to modify kubeconfig files with large amounts of contexts. ([#67093](https://github.com/kubernetes/kubernetes/pull/67093)) * The leader election client now renews timeout. ([#65094](https://github.com/kubernetes/kubernetes/pull/65094)) * Switched certificate data replacement from `REDACTED` to `DATA+OMITTED`. ([#66023](https://github.com/kubernetes/kubernetes/pull/66023)) * Fix listing in the fake dynamic client. ([#66078](https://github.com/kubernetes/kubernetes/pull/66078)) * Fix discovery so that plural names are no longer ignored if a singular name is not specified. ([#66249](https://github.com/kubernetes/kubernetes/pull/66249)) * Fix kubelet startup failure when using `ExecPlugin` in kubeconfig. ([#66395](https://github.com/kubernetes/kubernetes/pull/66395)) * Fix panic in the fake `SubjectAccessReview` client when object is nil. ([#66837](https://github.com/kubernetes/kubernetes/pull/66837)) * Periodically reload `InClusterConfig` token. ([#67359](https://github.com/kubernetes/kubernetes/pull/67359)) * [k8s.io/apimachinery] Report parsing error in json serializer. ([#63668](https://github.com/kubernetes/kubernetes/pull/63668)) * [k8s.io/apimachinery] The `metav1.ObjectMeta` accessor does not deepcopy owner references anymore. In general, the accessor interface does not enforce deepcopy nor does it forbid it (e.g. for `unstructured.Unstructured`). ([#64915](https://github.com/kubernetes/kubernetes/pull/64915)) * [k8s.io/apimachinery] Utility functions `SetTransportDefaults` and `DialerFor` once again respect custom Dial functions set on transports. ([#65547](https://github.com/kubernetes/kubernetes/pull/65547)) * [k8s.io/apimachinery] Speed-up conversion function invocation by avoiding `reflect.Call`. Action required: regenerated conversion with conversion-gen. ([#65771](https://github.com/kubernetes/kubernetes/pull/65771)) * [k8s.io/apimachinery] Establish "406 Not Acceptable" response for unmarshable protobuf serialization error. ([#67041](https://github.com/kubernetes/kubernetes/pull/67041)) * [k8s.io/apimachinery] Immediately close the other side of the connection by exiting once one side closes when proxying. ([#67288](https://github.com/kubernetes/kubernetes/pull/67288)) ## API changes **Breaking Changes:** * Volume dynamic provisioning scheduling has been promoted to beta. ACTION REQUIRED: The DynamicProvisioningScheduling alpha feature gate has been removed. The VolumeScheduling beta feature gate is still required for this feature. ([#67432](https://github.com/kubernetes/kubernetes/pull/67432)) * The CSI file system type is no longer defaulted to ext4. All the production drivers listed under https://kubernetes-csi.github.io/docs/drivers.html were inspected and should not be impacted after this change. If you are using a driver not in that list, please test the drivers on an updated test cluster first. ([#65499](https://github.com/kubernetes/kubernetes/pull/65499)) **New Features:** * Support annotations for remote admission webhooks. ([#58679](https://github.com/kubernetes/kubernetes/pull/58679)) * Support both directory and block device for local volume plugin `FileSystem` `VolumeMode`. ([#63011](https://github.com/kubernetes/kubernetes/pull/63011)) * Introduce `autoscaling/v2beta2` and `custom_metrics/v1beta2`, which implement metric selectors for Object and Pods metrics, as well as allowing AverageValue targets on Objects, similar to External metrics. ([#64097](https://github.com/kubernetes/kubernetes/pull/64097)) * Add `Lease` API in the `coordination.k8s.io` API group. ([#64246](https://github.com/kubernetes/kubernetes/pull/64246)) * `ProcMount` added to `SecurityContext` and `AllowedProcMounts` added to `PodSecurityPolicy` to allow paths in the container's `/proc` to not be masked. ([#64283](https://github.com/kubernetes/kubernetes/pull/64283)) * Add the `AuditAnnotations` field to `ImageReviewStatus` to allow the `ImageReview` backend to return annotations to be added to the created pod. ([#64597](https://github.com/kubernetes/kubernetes/pull/64597)) * SCTP is now supported as additional protocol (alpha) alongside TCP and UDP in Pod, Service, Endpoint, and NetworkPolicy. ([#64973](https://github.com/kubernetes/kubernetes/pull/64973)) * The `PodShareProcessNamespace` feature to configure PID namespace sharing within a pod has been promoted to beta. ([#66507](https://github.com/kubernetes/kubernetes/pull/66507)) * Add `TTLSecondsAfterFinished` to `JobSpec` for cleaning up Jobs after they finish. ([#66840](https://github.com/kubernetes/kubernetes/pull/66840)) * Add `DataSource` and `TypedLocalObjectReference` fields to support restoring a volume from a volume snapshot data source. ([#67087](https://github.com/kubernetes/kubernetes/pull/67087)) * `RuntimeClass` is a new API resource for defining different classes of runtimes that may be used to run containers in the cluster. Pods can select a `RunitmeClass` to use via the `RuntimeClassName` field. This feature is in alpha, and the `RuntimeClass` feature gate must be enabled in order to use it. ([#67737](https://github.com/kubernetes/kubernetes/pull/67737)) * To address the possibility dry-run requests overwhelming admission webhooks that rely on side effects and a reconciliation mechanism, a new field is being added to `admissionregistration.k8s.io/v1beta1.ValidatingWebhookConfiguration` and `admissionregistration.k8s.io/v1beta1.MutatingWebhookConfiguration` so that webhooks can explicitly register as having dry-run support. If a dry-run request is made on a resource that triggers a non dry-run supporting webhook, the request will be completely rejected, with "400: Bad Request". Additionally, a new field is being added to the `admission.k8s.io/v1beta1.AdmissionReview` API object, exposing to webhooks whether or not the request being reviewed is a dry-run. ([#66936](https://github.com/kubernetes/kubernetes/pull/66936)) **Bug fixes and Improvements:** * The `DisruptedPods` field in `PodDisruptionBudgetStatus` is now optional. ([#63757](https://github.com/kubernetes/kubernetes/pull/63757)) * `extensions/v1beta1` Deployment's `ProgressDeadlineSeconds` now defaults to `MaxInt32`. ([#66581](https://github.com/kubernetes/kubernetes/pull/66581)) # v8.0.0 **Breaking Changes:** * `KUBE_API_VERSIONS` has been removed. * [https://github.com/kubernetes/kubernetes/pull/63165](https://github.com/kubernetes/kubernetes/pull/63165) * The client-go/discovery `RESTMapper` has been moved to client-go/restmapper. * [https://github.com/kubernetes/kubernetes/pull/63507](https://github.com/kubernetes/kubernetes/pull/63507) * `CachedDiscoveryClient` has been moved from kubectl to client-go. * [https://github.com/kubernetes/kubernetes/pull/63550](https://github.com/kubernetes/kubernetes/pull/63550) * The `EventRecorder` interface is changed to include an `AnnotatedEventf` method, which can add annotations to an event. * [https://github.com/kubernetes/kubernetes/pull/64213](https://github.com/kubernetes/kubernetes/pull/64213) * [k8s.io/apimachinery] The deprecated `RepairMalformedUpdates` flag has been removed. * [https://github.com/kubernetes/kubernetes/pull/61455](https://github.com/kubernetes/kubernetes/pull/61455) **New Features:** * A new easy-to-use dynamic client is added and the old dynamic client is now deprecated. * [https://github.com/kubernetes/kubernetes/pull/62913](https://github.com/kubernetes/kubernetes/pull/62913) * client-go and kubectl now detect and report an error on duplicated name for user, cluster and context, while loading the kubeconfig. * [https://github.com/kubernetes/kubernetes/pull/60464](https://github.com/kubernetes/kubernetes/pull/60464) * The informer code-generator now allows specifying a custom resync period for certain informer types and uses the default resync period if none is specified. * [https://github.com/kubernetes/kubernetes/pull/61400](https://github.com/kubernetes/kubernetes/pull/61400) * Exec authenticator plugin now supports TLS client certificates. * [https://github.com/kubernetes/kubernetes/pull/61803](https://github.com/kubernetes/kubernetes/pull/61803) * The discovery client now has a default request timeout of 32 seconds. * [https://github.com/kubernetes/kubernetes/pull/62733](https://github.com/kubernetes/kubernetes/pull/62733) * The OpenStack auth config from is now read from the client config. If the client config is not available, it falls back to reading from the environment variables. * [https://github.com/kubernetes/kubernetes/pull/60200](https://github.com/kubernetes/kubernetes/pull/60200) * The in-tree support for openstack credentials is now deprecated. Please use the `client-keystone-auth` from the cloud-provider-openstack repository. Details on how to use this new capability is documented [here](https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/using-client-keystone-auth.md) * [https://github.com/kubernetes/kubernetes/pull/64346](https://github.com/kubernetes/kubernetes/pull/64346) **Bug fixes and Improvements:** * 406 mime-type errors are now tolerated while attempting to load new openapi schema. This improves compatibility with older servers when creating/updating API objects. * [https://github.com/kubernetes/kubernetes/pull/61949](https://github.com/kubernetes/kubernetes/pull/61949) * Removes the generated `DeleteCollection()` method for `Services` since the API does not support it. * [https://github.com/kubernetes/kubernetes/pull/63861](https://github.com/kubernetes/kubernetes/pull/63861) * Event object references with apiversion now report an apiversion, instead of just the group. * [https://github.com/kubernetes/kubernetes/pull/63913](https://github.com/kubernetes/kubernetes/pull/63913) [https://github.com/kubernetes/kubernetes/pull/62462](https://github.com/kubernetes/kubernetes/pull/62462) * [k8s.io/apimachinery] `runtime.Unstructured.UnstructuredContent()` no longer mutates the source while returning the contents. * [https://github.com/kubernetes/kubernetes/pull/62063](https://github.com/kubernetes/kubernetes/pull/62063) * [k8s.io/apimachinery] Incomplete support for `uint64` is now removed. This fixes a panic encountered while using `DeepCopyJSON` with `uint64`. * [https://github.com/kubernetes/kubernetes/pull/62981](https://github.com/kubernetes/kubernetes/pull/62981) * [k8s.io/apimachinery] API server can now parse `propagationPolicy` when it sent as a query parameter sent with a delete request. * [https://github.com/kubernetes/kubernetes/pull/63414](https://github.com/kubernetes/kubernetes/pull/63414) * [k8s.io/apimachinery] APIServices with kube-like versions (e.g. v1, v2beta1, etc.) will be sorted appropriately within each group. * [https://github.com/kubernetes/kubernetes/pull/64004](https://github.com/kubernetes/kubernetes/pull/64004) * [k8s.io/apimachinery] `int64` is the only allowed integer for printers. * [https://github.com/kubernetes/kubernetes/pull/64639](https://github.com/kubernetes/kubernetes/pull/64639) ## API changes **Breaking Changes:** * Support for `alpha.kubernetes.io/nvidia-gpu` resource which was deprecated in 1.10 is removed. Please use the resource exposed by `DevicePlugins` instead (`nvidia.com/gpu`). * [https://github.com/kubernetes/kubernetes/pull/61498](https://github.com/kubernetes/kubernetes/pull/61498) * Alpha annotation for `PersistentVolume` node affinity has been removed. Update your `PersistentVolume`s to use the beta `PersistentVolume.nodeAffinity` field before upgrading. * [https://github.com/kubernetes/kubernetes/pull/61816](https://github.com/kubernetes/kubernetes/pull/61816) * `ObjectMeta ` `ListOptions` `DeleteOptions` are removed from the core api group. Please use the ones in `meta/v1` instead. * [https://github.com/kubernetes/kubernetes/pull/61809](https://github.com/kubernetes/kubernetes/pull/61809) * `ExternalID` in `NodeSpec` is deprecated. The externalID of the node is no longer set in the Node spec. * [https://github.com/kubernetes/kubernetes/pull/61877](https://github.com/kubernetes/kubernetes/pull/61877) * PSP-related types in the `extensions/v1beta1` API group are now deprecated. It is suggested to use the `policy/v1beta1` API group instead. * [https://github.com/kubernetes/kubernetes/pull/61777](https://github.com/kubernetes/kubernetes/pull/61777) **New Features:** * `PodSecurityPolicy` now supports restricting hostPath volume mounts to be readOnly and under specific path prefixes. * [https://github.com/kubernetes/kubernetes/pull/58647](https://github.com/kubernetes/kubernetes/pull/58647) * `Node.Spec.ConfigSource.ConfigMap.KubeletConfigKey` must be specified when using dynamic Kubelet config to tell the Kubelet which key of the `ConfigMap` identifies its config file. * [https://github.com/kubernetes/kubernetes/pull/59847](https://github.com/kubernetes/kubernetes/pull/59847) * `serverAddressByClientCIDRs` in `meta/v1` APIGroup is now optional. * [https://github.com/kubernetes/kubernetes/pull/61963](https://github.com/kubernetes/kubernetes/pull/61963) * A new field `MatchFields` is added to `NodeSelectorTerm`. Currently, it only supports `metadata.name`. * [https://github.com/kubernetes/kubernetes/pull/62002](https://github.com/kubernetes/kubernetes/pull/62002) * The `PriorityClass` API is promoted to `scheduling.k8s.io/v1beta1`. * [https://github.com/kubernetes/kubernetes/pull/63100](https://github.com/kubernetes/kubernetes/pull/63100) * The status of dynamic Kubelet config is now reported via `Node.Status.Config`, rather than the `KubeletConfigOk` node condition. * [https://github.com/kubernetes/kubernetes/pull/63314](https://github.com/kubernetes/kubernetes/pull/63314) * The `GitRepo` volume type is deprecated. To provision a container with a git repo, mount an `EmptyDir` into an `InitContainer` that clones the repo using git, then mount the `EmptyDir` into the Pod's container. * [https://github.com/kubernetes/kubernetes/pull/63445](https://github.com/kubernetes/kubernetes/pull/63445) * The Sysctls experimental feature has been promoted to beta (enabled by default via the `Sysctls` feature flag). `PodSecurityPolicy` and `Pod` objects now have fields for specifying and controlling sysctls. Alpha sysctl annotations will be ignored by 1.11+ kubelets. All alpha sysctl annotations in existing deployments must be converted to API fields to be effective. * [https://github.com/kubernetes/kubernetes/pull/63717](https://github.com/kubernetes/kubernetes/pull/63717) * The annotation `service.alpha.kubernetes.io/tolerate-unready-endpoints` is deprecated. Users should use `Service.spec.publishNotReadyAddresses` instead. * [https://github.com/kubernetes/kubernetes/pull/63742](https://github.com/kubernetes/kubernetes/pull/63742) * `VerticalPodAutoscaler` has been added to `autoscaling/v1` API group. * [https://github.com/kubernetes/kubernetes/pull/63797](https://github.com/kubernetes/kubernetes/pull/63797) * Alpha support is added for dynamic volume limits based on node type. * [https://github.com/kubernetes/kubernetes/pull/64154](https://github.com/kubernetes/kubernetes/pull/64154) * `ContainersReady` condition is added to the Pod status. * [https://github.com/kubernetes/kubernetes/pull/64646](https://github.com/kubernetes/kubernetes/pull/64646) **Bug fixes and Improvements:** * Default mount propagation has changed from `HostToContainer` (`rslave` in Linux terminology) to `None` (`private`) to match the behavior in 1.9 and earlier releases. `HostToContainer` as a default caused regressions in some pods. * [https://github.com/kubernetes/kubernetes/pull/62462](https://github.com/kubernetes/kubernetes/pull/62462) # v7.0.0 **Breaking Changes:** * Google Cloud Service Account email addresses can now be used in RBAC Role bindings since the default scopes now include the `userinfo.email` scope. This is a breaking change if the numeric uniqueIDs of the Google service accounts were being used in RBAC role bindings. The behavior can be overridden by explicitly specifying the scope values as comma-separated string in the `users[*].config.scopes` field in the `KUBECONFIG` file. * [https://github.com/kubernetes/kubernetes/pull/58141](https://github.com/kubernetes/kubernetes/pull/58141) * [k8s.io/api] The `ConfigOK` node condition has been renamed to `KubeletConfigOk`. * [https://github.com/kubernetes/kubernetes/pull/59905](https://github.com/kubernetes/kubernetes/pull/59905) **New Features:** * Subresource support is added to the dynamic client. * [https://github.com/kubernetes/kubernetes/pull/56717](https://github.com/kubernetes/kubernetes/pull/56717) * A watch method is added to the Fake Client. * [https://github.com/kubernetes/kubernetes/pull/57504](https://github.com/kubernetes/kubernetes/pull/57504) * `ListOptions` can be modified when creating a `ListWatch`. * [https://github.com/kubernetes/kubernetes/pull/57508](https://github.com/kubernetes/kubernetes/pull/57508) * A `/token` subresource for ServiceAccount is added. * [https://github.com/kubernetes/kubernetes/pull/58111](https://github.com/kubernetes/kubernetes/pull/58111) * If an informer delivery fails, the particular notification is skipped and continued the next time. * [https://github.com/kubernetes/kubernetes/pull/58394](https://github.com/kubernetes/kubernetes/pull/58394) * Certificate manager will no longer wait until the initial rotation succeeds or fails before returning from `Start()`. * [https://github.com/kubernetes/kubernetes/pull/58930](https://github.com/kubernetes/kubernetes/pull/58930) * [k8s.io/api] `VolumeScheduling` and `LocalPersistentVolume` features are beta and enabled by default. The PersistentVolume NodeAffinity alpha annotation is deprecated and will be removed in a future release. * [https://github.com/kubernetes/kubernetes/pull/59391](https://github.com/kubernetes/kubernetes/pull/59391) * [k8s.io/api] The `PodSecurityPolicy` API has been moved to the `policy/v1beta1` API group. The `PodSecurityPolicy` API in the `extensions/v1beta1` API group is deprecated and will be removed in a future release. * [https://github.com/kubernetes/kubernetes/pull/54933](https://github.com/kubernetes/kubernetes/pull/54933) * [k8s.io/api] ConfigMap objects now support binary data via a new `binaryData` field. * [https://github.com/kubernetes/kubernetes/pull/57938](https://github.com/kubernetes/kubernetes/pull/57938) * [k8s.io/api] Service account TokenRequest API is added. * [https://github.com/kubernetes/kubernetes/pull/58027](https://github.com/kubernetes/kubernetes/pull/58027) * [k8s.io/api] FSType is added in CSI volume source to specify filesystems. * [https://github.com/kubernetes/kubernetes/pull/58209](https://github.com/kubernetes/kubernetes/pull/58209) * [k8s.io/api] v1beta1 VolumeAttachment API is added. * [https://github.com/kubernetes/kubernetes/pull/58462](https://github.com/kubernetes/kubernetes/pull/58462) * [k8s.io/api] `v1.Pod` now has a field `ShareProcessNamespace` to configure whether a single process namespace should be shared between all containers in a pod. This feature is in alpha preview. * [https://github.com/kubernetes/kubernetes/pull/58716](https://github.com/kubernetes/kubernetes/pull/58716) * [k8s.io/api] Add `NominatedNodeName` field to `PodStatus`. This field is set when a pod preempts other pods on the node. * [https://github.com/kubernetes/kubernetes/pull/58990](https://github.com/kubernetes/kubernetes/pull/58990) * [k8s.io/api] Promote `CSIPersistentVolumeSourc`e to beta. * [https://github.com/kubernetes/kubernetes/pull/59157](https://github.com/kubernetes/kubernetes/pull/59157) * [k8s.io/api] Promote `DNSPolicy` and `DNSConfig` in `PodSpec` to beta. * [https://github.com/kubernetes/kubernetes/pull/59771](https://github.com/kubernetes/kubernetes/pull/59771) * [k8s.io/api] External metric types are added to the HPA API. * [https://github.com/kubernetes/kubernetes/pull/60096](https://github.com/kubernetes/kubernetes/pull/60096) * [k8s.io/apimachinery] The `meta.k8s.io/v1alpha1` objects for retrieving tabular responses from the server (`Table`) or fetching just the `ObjectMeta` for an object (as `PartialObjectMetadata`) are now beta as part of `meta.k8s.io/v1beta1`. Clients may request alternate representations of normal Kubernetes objects by passing an `Accept` header like `application/json;as=Table;g=meta.k8s.io;v=v1beta1` or `application/json;as=PartialObjectMetadata;g=meta.k8s.io;v1=v1beta1`. Older servers will ignore this representation or return an error if it is not available. Clients may request fallback to the normal object by adding a non-qualified mime-type to their `Accept` header like `application/json` - the server will then respond with either the alternate representation if it is supported or the fallback mime-type which is the normal object response. * [https://github.com/kubernetes/kubernetes/pull/59059](https://github.com/kubernetes/kubernetes/pull/59059) **Bug fixes and Improvements:** * Port-forwarding of TCP6 ports is fixed. * [https://github.com/kubernetes/kubernetes/pull/57457](https://github.com/kubernetes/kubernetes/pull/57457) * A race condition in SharedInformer that could violate the sequential delivery guarantee and cause panics on shutdown is fixed. * [https://github.com/kubernetes/kubernetes/pull/59828](https://github.com/kubernetes/kubernetes/pull/59828) * [k8s.io/api] PersistentVolume flexVolume sources can now reference secrets in a namespace other than the PersistentVolumeClaim's namespace. * [https://github.com/kubernetes/kubernetes/pull/56460](https://github.com/kubernetes/kubernetes/pull/56460) * [k8s.io/apimachinery] YAMLDecoder Read can now return the number of bytes read. * [https://github.com/kubernetes/kubernetes/pull/57000](https://github.com/kubernetes/kubernetes/pull/57000) * [k8s.io/apimachinery] YAMLDecoder Read now tracks rest of buffer on `io.ErrShortBuffer`. * [https://github.com/kubernetes/kubernetes/pull/58817](https://github.com/kubernetes/kubernetes/pull/58817) * [k8s.io/apimachinery] Prompt required merge key in the error message while applying a strategic merge patch. * [https://github.com/kubernetes/kubernetes/pull/57854](https://github.com/kubernetes/kubernetes/pull/57854) # v6.0.0 **Breaking Changes:** * If you upgrade your client-go libs and use the `AppsV1() or Apps()` interface, please note that the default garbage collection behavior is changed. * [https://github.com/kubernetes/kubernetes/pull/55148](https://github.com/kubernetes/kubernetes/pull/55148) * Swagger 1.2 retriever `DiscoveryClient.SwaggerSchema` was removed from the discovery client * [https://github.com/kubernetes/kubernetes/pull/53441](https://github.com/kubernetes/kubernetes/pull/53441) * Informers got a NewFilteredSharedInformerFactory to e.g. filter by namespace * [https://github.com/kubernetes/kubernetes/pull/54660](https://github.com/kubernetes/kubernetes/pull/54660) * [k8s.io/api] The dynamic admission webhook is split into two kinds, mutating and validating. The kinds have changed completely and old code must be ported to `admissionregistration.k8s.io/v1beta1` - `MutatingWebhookConfiguration` and `ValidatingWebhookConfiguration` * [https://github.com/kubernetes/kubernetes/pull/55282](https://github.com/kubernetes/kubernetes/pull/55282) * [k8s.io/api] Renamed `core/v1.ScaleIOVolumeSource` to `ScaleIOPersistentVolumeSource` * [https://github.com/kubernetes/kubernetes/pull/54013](https://github.com/kubernetes/kubernetes/pull/54013) * [k8s.io/api] Renamed `core/v1.RBDVolumeSource` to `RBDPersistentVolumeSource` * [https://github.com/kubernetes/kubernetes/pull/54302](https://github.com/kubernetes/kubernetes/pull/54302) * [k8s.io/api] Removed `core/v1.CreatedByAnnotation` * [https://github.com/kubernetes/kubernetes/pull/54445](https://github.com/kubernetes/kubernetes/pull/54445) * [k8s.io/api] Renamed `core/v1.StorageMediumHugepages` to `StorageMediumHugePages` * [https://github.com/kubernetes/kubernetes/pull/54748](https://github.com/kubernetes/kubernetes/pull/54748) * [k8s.io/api] `core/v1.Taint.TimeAdded` became a pointer * [https://github.com/kubernetes/kubernetes/pull/43016](https://github.com/kubernetes/kubernetes/pull/43016) * [k8s.io/api] `core/v1.DefaultHardPodAffinitySymmetricWeight` type changed from int to int32 * [https://github.com/kubernetes/kubernetes/pull/53850](https://github.com/kubernetes/kubernetes/pull/53850) * [k8s.io/apimachinery] `ObjectCopier` interface was removed (requires switch to new generators with DeepCopy methods) * [https://github.com/kubernetes/kubernetes/pull/53525](https://github.com/kubernetes/kubernetes/pull/53525) **New Features:** * Certificate manager was moved from kubelet to `k8s.io/client-go/util/certificates` * [https://github.com/kubernetes/kubernetes/pull/49654](https://github.com/kubernetes/kubernetes/pull/49654) * [k8s.io/api] Workloads api types are promoted to `apps/v1` version * [https://github.com/kubernetes/kubernetes/pull/53679](https://github.com/kubernetes/kubernetes/pull/53679) * [k8s.io/api] Added `storage.k8s.io/v1alpha1` API group * [https://github.com/kubernetes/kubernetes/pull/54463](https://github.com/kubernetes/kubernetes/pull/54463) * [k8s.io/api] Added support for conditions in StatefulSet status * [https://github.com/kubernetes/kubernetes/pull/55268](https://github.com/kubernetes/kubernetes/pull/55268) * [k8s.io/api] Added support for conditions in DaemonSet status * [https://github.com/kubernetes/kubernetes/pull/55272](https://github.com/kubernetes/kubernetes/pull/55272) * [k8s.io/apimachinery] Added polymorphic scale client in `k8s.io/client-go/scale`, which supports scaling of resources in arbitrary API groups * [https://github.com/kubernetes/kubernetes/pull/53743](https://github.com/kubernetes/kubernetes/pull/53743) * [k8s.io/apimachinery] `meta.MetadataAccessor` got API chunking support * [https://github.com/kubernetes/kubernetes/pull/53768](https://github.com/kubernetes/kubernetes/pull/53768) * [k8s.io/apimachinery] `unstructured.Unstructured` got getters and setters * [https://github.com/kubernetes/kubernetes/pull/51940](https://github.com/kubernetes/kubernetes/pull/51940) **Bug fixes and Improvements:** * The body in glog output is not truncated with log level 10 * [https://github.com/kubernetes/kubernetes/pull/54801](https://github.com/kubernetes/kubernetes/pull/54801) * [k8s.io/api] Unset `creationTimestamp` field is output as null if encoded from an unstructured object * [https://github.com/kubernetes/kubernetes/pull/53464](https://github.com/kubernetes/kubernetes/pull/53464) * [k8s.io/apimachinery] Redirect behavior is restored for proxy subresources * [https://github.com/kubernetes/kubernetes/pull/52933](https://github.com/kubernetes/kubernetes/pull/52933) * [k8s.io/apimachinery] Random string generation functions are optimized * [https://github.com/kubernetes/kubernetes/pull/53720](https://github.com/kubernetes/kubernetes/pull/53720) # v5.0.1 Bug fix: picked up a security fix [kubernetes/kubernetes#53443](https://github.com/kubernetes/kubernetes/pull/53443) for `PodSecurityPolicy`. # v5.0.0 **New features:** * Added paging support * [https://github.com/kubernetes/kubernetes/pull/51876](https://github.com/kubernetes/kubernetes/pull/51876) * Added support for client-side spam filtering of events * [https://github.com/kubernetes/kubernetes/pull/47367](https://github.com/kubernetes/kubernetes/pull/47367) * Added support for http etag and caching * [https://github.com/kubernetes/kubernetes/pull/50404](https://github.com/kubernetes/kubernetes/pull/50404) * Added priority queue support to informer cache * [https://github.com/kubernetes/kubernetes/pull/49752](https://github.com/kubernetes/kubernetes/pull/49752) * Added openstack auth provider * [https://github.com/kubernetes/kubernetes/pull/39587](https://github.com/kubernetes/kubernetes/pull/39587) * Added metrics for checking reflector health * [https://github.com/kubernetes/kubernetes/pull/48224](https://github.com/kubernetes/kubernetes/pull/48224) * Client-go now includes the leaderelection package * [https://github.com/kubernetes/kubernetes/pull/39173](https://github.com/kubernetes/kubernetes/pull/39173) **API changes:** * Promoted Autoscaling v2alpha1 to v2beta1 * [https://github.com/kubernetes/kubernetes/pull/50708](https://github.com/kubernetes/kubernetes/pull/50708) * Promoted CronJobs to batch/v1beta1 * [https://github.com/kubernetes/kubernetes/pull/41901](https://github.com/kubernetes/kubernetes/pull/41901) * Promoted rbac.authorization.k8s.io/v1beta1 to rbac.authorization.k8s.io/v1 * [https://github.com/kubernetes/kubernetes/pull/49642](https://github.com/kubernetes/kubernetes/pull/49642) * Added a new API version apps/v1beta2 * [https://github.com/kubernetes/kubernetes/pull/48746](https://github.com/kubernetes/kubernetes/pull/48746) * Added a new API version scheduling/v1alpha1 * [https://github.com/kubernetes/kubernetes/pull/48377](https://github.com/kubernetes/kubernetes/pull/48377) **Breaking changes:** * Moved pkg/api and pkg/apis to [k8s.io/api](https://github.com/kubernetes/api). Other kubernetes repositories also import types from there, so they are composable with client-go. * Removed helper functions in pkg/api and pkg/apis. They are planned to be exported in other repos. The issue is tracked [here](https://github.com/kubernetes/kubernetes/issues/48209#issuecomment-314537745). During the transition, you'll have to copy the helper functions to your projects. * The discovery client now fetches the protobuf encoded OpenAPI schema and returns `openapi_v2.Document` * [https://github.com/kubernetes/kubernetes/pull/46803](https://github.com/kubernetes/kubernetes/pull/46803) * Enforced explicit references to API group client interfaces in clientsets to avoid ambiguity. * [https://github.com/kubernetes/kubernetes/pull/49370](https://github.com/kubernetes/kubernetes/pull/49370) * The generic RESTClient type (`k8s.io/client-go/rest`) no longer exposes `LabelSelectorParam` or `FieldSelectorParam` methods - use `VersionedParams` with `metav1.ListOptions` instead. The `UintParam` method has been removed. The `timeout` parameter will no longer cause an error when using `Param()`. * [https://github.com/kubernetes/kubernetes/pull/48991](https://github.com/kubernetes/kubernetes/pull/48991) # v4.0.0 No significant changes since v4.0.0-beta.0. # v4.0.0-beta.0 **New features:** * Added OpenAPISchema support in the discovery client * [https://github.com/kubernetes/kubernetes/pull/44531](https://github.com/kubernetes/kubernetes/pull/44531) * Added mutation cache filter: MutationCache is able to take the result of update operations and stores them in an LRU that can be used to provide a more current view of a requested object. * [https://github.com/kubernetes/kubernetes/pull/45838](https://github.com/kubernetes/kubernetes/pull/45838/commits/f88c7725b4f9446c652d160bdcfab7c6201bddea) * Moved the remotecommand package (used by `kubectl exec/attach`) to client-go * [https://github.com/kubernetes/kubernetes/pull/41331](https://github.com/kubernetes/kubernetes/pull/41331) * Added support for following redirects to the SpdyRoundTripper * [https://github.com/kubernetes/kubernetes/pull/44451](https://github.com/kubernetes/kubernetes/pull/44451) * Added Azure Active Directory plugin * [https://github.com/kubernetes/kubernetes/pull/43987](https://github.com/kubernetes/kubernetes/pull/43987) **Usability improvements:** * Added several new examples and reorganized client-go/examples * [Related PRs](https://github.com/kubernetes/kubernetes/commits/release-1.7/staging/src/k8s.io/client-go/examples) **API changes:** * Added networking.k8s.io/v1 API * [https://github.com/kubernetes/kubernetes/pull/39164](https://github.com/kubernetes/kubernetes/pull/39164) * ControllerRevision type added for StatefulSet and DaemonSet history. * [https://github.com/kubernetes/kubernetes/pull/45867](https://github.com/kubernetes/kubernetes/pull/45867) * Added support for initializers * [https://github.com/kubernetes/kubernetes/pull/38058](https://github.com/kubernetes/kubernetes/pull/38058) * Added admissionregistration.k8s.io/v1alpha1 API * [https://github.com/kubernetes/kubernetes/pull/46294](https://github.com/kubernetes/kubernetes/pull/46294) **Breaking changes:** * Moved client-go/util/clock to apimachinery/pkg/util/clock * [https://github.com/kubernetes/kubernetes/pull/45933](https://github.com/kubernetes/kubernetes/pull/45933/commits/8013212db54e95050c622675c6706cce5de42b45) * Some [API helpers](https://github.com/kubernetes/client-go/blob/release-3.0/pkg/api/helpers.go) were removed. * Dynamic client takes GetOptions as an input parameter * [https://github.com/kubernetes/kubernetes/pull/47251](https://github.com/kubernetes/kubernetes/pull/47251) **Bug fixes:** * PortForwarder: don't log an error if net.Listen fails. [https://github.com/kubernetes/kubernetes/pull/44636](https://github.com/kubernetes/kubernetes/pull/44636) * oidc auth plugin not to override the Auth header if it's already exits. [https://github.com/kubernetes/kubernetes/pull/45529](https://github.com/kubernetes/kubernetes/pull/45529) * The --namespace flag is now honored for in-cluster clients that have an empty configuration. [https://github.com/kubernetes/kubernetes/pull/46299](https://github.com/kubernetes/kubernetes/pull/46299) * GCP auth plugin no longer overwrites existing Authorization headers. [https://github.com/kubernetes/kubernetes/pull/45575](https://github.com/kubernetes/kubernetes/pull/45575) # v3.0.0 Bug fixes: * Use OS-specific libs when computing client User-Agent in kubectl, etc. (https://github.com/kubernetes/kubernetes/pull/44423) * kubectl commands run inside a pod using a kubeconfig file now use the namespace specified in the kubeconfig file, instead of using the pod namespace. If no kubeconfig file is used, or the kubeconfig does not specify a namespace, the pod namespace is still used as a fallback. (https://github.com/kubernetes/kubernetes/pull/44570) * Restored the ability of kubectl running inside a pod to consume resource files specifying a different namespace than the one the pod is running in. (https://github.com/kubernetes/kubernetes/pull/44862) # v3.0.0-beta.0 * Added dependency on k8s.io/apimachinery. The impacts include changing import path of API objects like `ListOptions` from `k8s.io/client-go/pkg/api/v1` to `k8s.io/apimachinery/pkg/apis/meta/v1`. * Added generated listers (listers/) and informers (informers/) * Kubernetes API changes: * Added client support for: * authentication/v1 * authorization/v1 * autoscaling/v2alpha1 * rbac/v1beta1 * settings/v1alpha1 * storage/v1 * Changed client support for: * certificates from v1alpha1 to v1beta1 * policy from v1alpha1 to v1beta1 * Deleted client support for: * extensions/v1beta1#Job * CHANGED: pass typed options to dynamic client (https://github.com/kubernetes/kubernetes/pull/41887) # v2.0.0 * Included bug fixes in k8s.io/kuberentes release-1.5 branch, up to commit bde8578d9675129b7a2aa08f1b825ec6cc0f3420 # v2.0.0-alpha.1 * Removed top-level version folder (e.g., 1.4 and 1.5), switching to maintaining separate versions in separate branches. * Clientset supported multiple versions per API group * Added ThirdPartyResources example * Kubernetes API changes * Apps API group graduated to v1beta1 * Policy API group graduated to v1beta1 * Added support for batch/v2alpha1/cronjob * Renamed PetSet to StatefulSet # v1.5.0 * Included the auth plugin (https://github.com/kubernetes/kubernetes/pull/33334) * Added timeout field to RESTClient config (https://github.com/kubernetes/kubernetes/pull/33958) kubernetes-client-go-a2dfcab/CONTRIBUTING.md000066400000000000000000000014261472614177300206340ustar00rootroot00000000000000# Contributing guidelines Do not open pull requests directly against kubernetes/client-go repository (except for README.md); they will be ignored. Instead, please open pull requests and issues against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/client-go](https://git.k8s.io/kubernetes/staging/src/k8s.io/client-go) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information kubernetes-client-go-a2dfcab/INSTALL.md000066400000000000000000000062011472614177300200270ustar00rootroot00000000000000# Installing client-go ## Using the latest version If you want to use the latest version of this library, use go1.16+ and run: ```sh go get k8s.io/client-go@latest ``` This will record a dependency on `k8s.io/client-go` in your go module. You can now import and use the `k8s.io/client-go` APIs in your project. The next time you `go build`, `go test`, or `go run` your project, `k8s.io/client-go` and its dependencies will be downloaded (if needed), and detailed dependency version info will be added to your `go.mod` file (or you can also run `go mod tidy` to do this directly). ## Using a specific version If you want to use a particular version of the `k8s.io/client-go` library, you can indicate which version of `client-go` your project requires: - If you are using Kubernetes versions >= `v1.17.0`, use a corresponding `v0.x.y` tag. For example, `k8s.io/client-go@v0.20.4` corresponds to Kubernetes `v1.20.4`: ```sh go get k8s.io/client-go@v0.20.4 ``` - If you are using Kubernetes versions < `v1.17.0`, use a corresponding `kubernetes-1.x.y` tag. For example, `k8s.io/client-go@kubernetes-1.16.3` corresponds to Kubernetes `v1.16.3`: ```sh go get k8s.io/client-go@kubernetes-1.16.3 ``` You can now import and use the `k8s.io/client-go` APIs in your project. The next time you `go build`, `go test`, or `go run` your project, `k8s.io/client-go` and its dependencies will be downloaded (if needed), and detailed dependency version info will be added to your `go.mod` file (or you can also run `go mod tidy` to do this directly). ## Troubleshooting ### Go versions prior to 1.16 If you get a message like `module k8s.io/client-go@latest found (v1.5.2), but does not contain package k8s.io/client-go/...`, you are likely using a go version prior to 1.16 and must explicitly specify the k8s.io/client-go version you want. For example: ```sh go get k8s.io/client-go@v0.20.4 ``` ### Conflicting requirements for older client-go versions If you get a message like `module k8s.io/api@latest found, but does not contain package k8s.io/api/auditregistration/v1alpha1`, something in your build is likely requiring an old version of `k8s.io/client-go` like `v11.0.0+incompatible`. First, try to fetch a more recent version. For example: ```sh go get k8s.io/client-go@v0.20.4 ``` If that doesn't resolve the problem, see what is requiring an `...+incompatible` version of client-go, and update to use a newer version of that library, if possible: ```sh go mod graph | grep " k8s.io/client-go@" ``` As a last resort, you can force the build to use a specific version of client-go, even if some of your dependencies still want `...+incompatible` versions. For example: ```sh go mod edit -replace=k8s.io/client-go=k8s.io/client-go@v0.20.4 go get k8s.io/client-go@v0.20.4 ``` ### Go modules disabled If you get a message like `cannot use path@version syntax in GOPATH mode`, you likely do not have go modules enabled. This should be on by default in all supported versions of Go. ```sh export GO111MODULE=on ``` Ensure your project has a `go.mod` file defined at the root of your project. If you do not already have one, `go mod init` will create one for you: ```sh go mod init ``` kubernetes-client-go-a2dfcab/LICENSE000066400000000000000000000261361472614177300174150ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. kubernetes-client-go-a2dfcab/OWNERS000066400000000000000000000005451472614177300173440ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - aojea - caesarxuchao - deads2k - liggitt - smarterclayton - sttts - yliaog - jpbetz reviewers: - aojea - apelisse - caesarxuchao - deads2k - jpbetz - liggitt - soltysh - sttts - yliaog - jpbetz labels: - sig/api-machinery emeritus_approvers: - lavalamp kubernetes-client-go-a2dfcab/README.md000066400000000000000000000220701472614177300176600ustar00rootroot00000000000000# client-go Go clients for talking to a [kubernetes](http://kubernetes.io/) cluster. We recommend using the `v0.x.y` tags for Kubernetes releases >= `v1.17.0` and `kubernetes-1.x.y` tags for Kubernetes releases < `v1.17.0`. The fastest way to add this library to a project is to run `go get k8s.io/client-go@latest` with go1.16+. See [INSTALL.md](/INSTALL.md) for detailed installation instructions and troubleshooting. [![GoDocWidget]][GoDocReference] [GoDocWidget]: https://godoc.org/k8s.io/client-go?status.svg [GoDocReference]:https://godoc.org/k8s.io/client-go ## Table of Contents - [What's included](#whats-included) - [Versioning](#versioning) - [Compatibility: your code <-> client-go](#compatibility-your-code---client-go) - [Compatibility: client-go <-> Kubernetes clusters](#compatibility-client-go---kubernetes-clusters) - [Compatibility matrix](#compatibility-matrix) - [Why do the 1.4 and 1.5 branch contain top-level folder named after the version?](#why-do-the-14-and-15-branch-contain-top-level-folder-named-after-the-version) - [Kubernetes tags](#kubernetes-tags) - [How to get it](#how-to-get-it) - [How to use it](#how-to-use-it) - [Dependency management](#dependency-management) - [Contributing code](#contributing-code) ### What's included * The `kubernetes` package contains the clientset to access Kubernetes API. * The `discovery` package is used to discover APIs supported by a Kubernetes API server. * The `dynamic` package contains a dynamic client that can perform generic operations on arbitrary Kubernetes API objects. * The `plugin/pkg/client/auth` packages contain optional authentication plugins for obtaining credentials from external sources. * The `transport` package is used to set up auth and start a connection. * The `tools/cache` package is useful for writing controllers. ### Versioning - For each `v1.x.y` Kubernetes release, the major version (first digit) would remain `0`. - Bugfixes will result in the patch version (third digit) changing. PRs that are cherry-picked into an older Kubernetes release branch will result in an update to the corresponding branch in `client-go`, with a corresponding new tag changing the patch version. #### Branches and tags. We will create a new branch and tag for each increment in the minor version number. We will create only a new tag for each increment in the patch version number. See [semver](http://semver.org/) for definitions of major, minor, and patch. The HEAD of the master branch in client-go will track the HEAD of the master branch in the main Kubernetes repo. #### Compatibility: your code <-> client-go The `v0.x.y` tags indicate that go APIs may change in incompatible ways in different versions. See [INSTALL.md](INSTALL.md) for guidelines on requiring a specific version of client-go. #### Compatibility: client-go <-> Kubernetes clusters Since Kubernetes is backwards compatible with clients, older `client-go` versions will work with many different Kubernetes cluster versions. We will backport bugfixes--but not new features--into older versions of `client-go`. #### Compatibility matrix | | Kubernetes 1.23 | Kubernetes 1.24 | Kubernetes 1.25 | Kubernetes 1.26 | Kubernetes 1.27 | Kubernetes 1.28 | | ----------------------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- | | `kubernetes-1.23.0`/`v0.23.0` | ✓ | +- | +- | +- | +- | +- | | `kubernetes-1.24.0`/`v0.24.0` | +- | ✓ | +- | +- | +- | +- | | `kubernetes-1.25.0`/`v0.25.0` | +- | +- | ✓ | +- | +- | +- | | `kubernetes-1.26.0`/`v0.26.0` | +- | +- | +- | ✓ | +- | +- | | `kubernetes-1.27.0`/`v0.27.0` | +- | +- | +- | +- | ✓ | +- | | `kubernetes-1.28.0`/`v0.28.0` | +- | +- | +- | +- | +- | ✓ | | `HEAD` | +- | +- | +- | +- | +- | +- | Key: * `✓` Exactly the same features / API objects in both client-go and the Kubernetes version. * `+` client-go has features or API objects that may not be present in the Kubernetes cluster, either due to that client-go has additional new API, or that the server has removed old API. However, everything they have in common (i.e., most APIs) will work. Please note that alpha APIs may vanish or change significantly in a single release. * `-` The Kubernetes cluster has features the client-go library can't use, either due to the server has additional new API, or that client-go has removed old API. However, everything they share in common (i.e., most APIs) will work. See the [CHANGELOG](./CHANGELOG.md) for a detailed description of changes between client-go versions. | Branch | Canonical source code location | Maintenance status | | -------------- | ----------------------------------- | ------------------ | | `release-1.19` | Kubernetes main repo, 1.19 branch | =- | | `release-1.20` | Kubernetes main repo, 1.20 branch | =- | | `release-1.21` | Kubernetes main repo, 1.21 branch | =- | | `release-1.22` | Kubernetes main repo, 1.22 branch | =- | | `release-1.23` | Kubernetes main repo, 1.23 branch | =- | | `release-1.24` | Kubernetes main repo, 1.24 branch | =- | | `release-1.25` | Kubernetes main repo, 1.25 branch | ✓ | | `release-1.26` | Kubernetes main repo, 1.26 branch | ✓ | | `release-1.27` | Kubernetes main repo, 1.27 branch | ✓ | | `release-1.28` | Kubernetes main repo, 1.28 branch | ✓ | | client-go HEAD | Kubernetes main repo, master branch | ✓ | Key: * `✓` Changes in main Kubernetes repo are actively published to client-go by a bot * `=` Maintenance is manual, only severe security bugs will be patched. * `-` Deprecated; please upgrade. #### Deprecation policy We will maintain branches for at least six months after their first stable tag is cut. (E.g., the clock for the release-2.0 branch started ticking when we tagged v2.0.0, not when we made the first alpha.) This policy applies to every version greater than or equal to 2.0. #### Why do the 1.4 and 1.5 branch contain top-level folder named after the version? For the initial release of client-go, we thought it would be easiest to keep separate directories for each minor version. That soon proved to be a mistake. We are keeping the top-level folders in the 1.4 and 1.5 branches so that existing users won't be broken. ### Kubernetes tags This repository is still a mirror of [k8s.io/kubernetes/staging/src/client-go](https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/client-go), the code development is still done in the staging area. Since Kubernetes `v1.8.0`, when syncing the code from the staging area, we also sync the Kubernetes version tags to client-go, prefixed with `kubernetes-`. From Kubernetes `v1.17.0`, we also create matching semver `v0.x.y` tags for each `v1.x.y` Kubernetes release. For example, if you check out the `kubernetes-1.17.0` or the `v0.17.0` tag in client-go, the code you get is exactly the same as if you check out the `v1.17.0` tag in Kubernetes, and change directory to `staging/src/k8s.io/client-go`. The purpose is to let users quickly find matching commits among published repos, like [sample-apiserver](https://github.com/kubernetes/sample-apiserver), [apiextension-apiserver](https://github.com/kubernetes/apiextensions-apiserver), etc. The Kubernetes version tag does NOT claim any backwards compatibility guarantees for client-go. Please check the [semantic versions](#versioning) if you care about backwards compatibility. ### How to get it To get the latest version, use go1.16+ and fetch using the `go get` command. For example: ``` go get k8s.io/client-go@latest ``` To get a specific version, use go1.11+ and fetch the desired version using the `go get` command. For example: ``` go get k8s.io/client-go@v0.20.4 ``` See [INSTALL.md](/INSTALL.md) for detailed instructions and troubleshooting. ### How to use it If your application runs in a Pod in the cluster, please refer to the in-cluster [example](examples/in-cluster-client-configuration), otherwise please refer to the out-of-cluster [example](examples/out-of-cluster-client-configuration). ### Dependency management For details on how to correctly use a dependency management for installing client-go, please see [INSTALL.md](INSTALL.md). ### Contributing code Please send pull requests against the client packages in the Kubernetes main [repository](https://github.com/kubernetes/kubernetes). Changes in the staging area will be published to this repository every day. kubernetes-client-go-a2dfcab/SECURITY_CONTACTS000066400000000000000000000010521472614177300210660ustar00rootroot00000000000000# Defined below are the security contacts for this repo. # # They are the contact point for the Product Security Committee to reach out # to for triaging and handling of incoming issues. # # The below names agree to abide by the # [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) # and will be removed and replaced if they violate that agreement. # # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE # INSTRUCTIONS AT https://kubernetes.io/security/ caesarxuchao deads2k lavalamp sttts kubernetes-client-go-a2dfcab/applyconfigurations/000077500000000000000000000000001472614177300225005ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/OWNERS000066400000000000000000000001261472614177300234370ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - apelisse - jpbetz kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/000077500000000000000000000000001472614177300271215ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/000077500000000000000000000000001472614177300274475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/auditannotation.go000066400000000000000000000037251472614177300332060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use // with apply. type AuditAnnotationApplyConfiguration struct { Key *string `json:"key,omitempty"` ValueExpression *string `json:"valueExpression,omitempty"` } // AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with // apply. func AuditAnnotation() *AuditAnnotationApplyConfiguration { return &AuditAnnotationApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration { b.Key = &value return b } // WithValueExpression sets the ValueExpression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ValueExpression field is set to the value of the last call. func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration { b.ValueExpression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/expressionwarning.go000066400000000000000000000037151472614177300335710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use // with apply. type ExpressionWarningApplyConfiguration struct { FieldRef *string `json:"fieldRef,omitempty"` Warning *string `json:"warning,omitempty"` } // ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with // apply. func ExpressionWarning() *ExpressionWarningApplyConfiguration { return &ExpressionWarningApplyConfiguration{} } // WithFieldRef sets the FieldRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldRef field is set to the value of the last call. func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration { b.FieldRef = &value return b } // WithWarning sets the Warning field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Warning field is set to the value of the last call. func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration { b.Warning = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/matchcondition.go000066400000000000000000000036471472614177300330130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use // with apply. type MatchConditionApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } // MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with // apply. func MatchCondition() *MatchConditionApplyConfiguration { return &MatchConditionApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MatchConditionApplyConfiguration) WithName(value string) *MatchConditionApplyConfiguration { b.Name = &value return b } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *MatchConditionApplyConfiguration) WithExpression(value string) *MatchConditionApplyConfiguration { b.Expression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/matchresources.go000066400000000000000000000105011472614177300330220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use // with apply. type MatchResourcesApplyConfiguration struct { NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"` ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"` MatchPolicy *apiadmissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"` } // MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with // apply. func MatchResources() *MatchResourcesApplyConfiguration { return &MatchResourcesApplyConfiguration{} } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { b.NamespaceSelector = value return b } // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObjectSelector field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { b.ObjectSelector = value return b } // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceRules field. func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceRules") } b.ResourceRules = append(b.ResourceRules, *values[i]) } return b } // WithExcludeResourceRules adds the given value to the ExcludeResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ExcludeResourceRules field. func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithExcludeResourceRules") } b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i]) } return b } // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchPolicy field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value apiadmissionregistrationv1.MatchPolicyType) *MatchResourcesApplyConfiguration { b.MatchPolicy = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/mutatingwebhook.go000066400000000000000000000204051472614177300332060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MutatingWebhookApplyConfiguration represents a declarative configuration of the MutatingWebhook type for use // with apply. type MutatingWebhookApplyConfiguration struct { Name *string `json:"name,omitempty"` ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"` Rules []RuleWithOperationsApplyConfiguration `json:"rules,omitempty"` FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"` MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"` NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` SideEffects *admissionregistrationv1.SideEffectClass `json:"sideEffects,omitempty"` TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"` ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"` MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` } // MutatingWebhookApplyConfiguration constructs a declarative configuration of the MutatingWebhook type for use with // apply. func MutatingWebhook() *MutatingWebhookApplyConfiguration { return &MutatingWebhookApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithName(value string) *MutatingWebhookApplyConfiguration { b.Name = &value return b } // WithClientConfig sets the ClientConfig field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClientConfig field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *MutatingWebhookApplyConfiguration { b.ClientConfig = value return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *MutatingWebhookApplyConfiguration) WithRules(values ...*RuleWithOperationsApplyConfiguration) *MutatingWebhookApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailurePolicy field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *MutatingWebhookApplyConfiguration { b.FailurePolicy = &value return b } // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchPolicy field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1.MatchPolicyType) *MutatingWebhookApplyConfiguration { b.MatchPolicy = &value return b } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration { b.NamespaceSelector = value return b } // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObjectSelector field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration { b.ObjectSelector = value return b } // WithSideEffects sets the SideEffects field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SideEffects field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1.SideEffectClass) *MutatingWebhookApplyConfiguration { b.SideEffects = &value return b } // WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeoutSeconds field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *MutatingWebhookApplyConfiguration { b.TimeoutSeconds = &value return b } // WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AdmissionReviewVersions field. func (b *MutatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *MutatingWebhookApplyConfiguration { for i := range values { b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, values[i]) } return b } // WithReinvocationPolicy sets the ReinvocationPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReinvocationPolicy field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithReinvocationPolicy(value admissionregistrationv1.ReinvocationPolicyType) *MutatingWebhookApplyConfiguration { b.ReinvocationPolicy = &value return b } // WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchConditions field. func (b *MutatingWebhookApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *MutatingWebhookApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchConditions") } b.MatchConditions = append(b.MatchConditions, *values[i]) } return b } mutatingwebhookconfiguration.go000066400000000000000000000325211472614177300357210ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MutatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the MutatingWebhookConfiguration type for use // with apply. type MutatingWebhookConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Webhooks []MutatingWebhookApplyConfiguration `json:"webhooks,omitempty"` } // MutatingWebhookConfiguration constructs a declarative configuration of the MutatingWebhookConfiguration type for use with // apply. func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationApplyConfiguration { b := &MutatingWebhookConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("MutatingWebhookConfiguration") b.WithAPIVersion("admissionregistration.k8s.io/v1") return b } // ExtractMutatingWebhookConfiguration extracts the applied configuration owned by fieldManager from // mutatingWebhookConfiguration. If no managedFields are found in mutatingWebhookConfiguration for fieldManager, a // MutatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // mutatingWebhookConfiguration must be a unmodified MutatingWebhookConfiguration API object that was retrieved from the Kubernetes API. // ExtractMutatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractMutatingWebhookConfiguration(mutatingWebhookConfiguration *apiadmissionregistrationv1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) { return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "") } // ExtractMutatingWebhookConfigurationStatus is the same as ExtractMutatingWebhookConfiguration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractMutatingWebhookConfigurationStatus(mutatingWebhookConfiguration *apiadmissionregistrationv1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) { return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "status") } func extractMutatingWebhookConfiguration(mutatingWebhookConfiguration *apiadmissionregistrationv1.MutatingWebhookConfiguration, fieldManager string, subresource string) (*MutatingWebhookConfigurationApplyConfiguration, error) { b := &MutatingWebhookConfigurationApplyConfiguration{} err := managedfields.ExtractInto(mutatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1.MutatingWebhookConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(mutatingWebhookConfiguration.Name) b.WithKind("MutatingWebhookConfiguration") b.WithAPIVersion("admissionregistration.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithKind(value string) *MutatingWebhookConfigurationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithAPIVersion(value string) *MutatingWebhookConfigurationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithName(value string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithGenerateName(value string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithNamespace(value string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithUID(value types.UID) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithResourceVersion(value string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithGeneration(value int64) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *MutatingWebhookConfigurationApplyConfiguration) WithLabels(entries map[string]string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *MutatingWebhookConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *MutatingWebhookConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *MutatingWebhookConfigurationApplyConfiguration) WithFinalizers(values ...string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *MutatingWebhookConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithWebhooks adds the given value to the Webhooks field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Webhooks field. func (b *MutatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ...*MutatingWebhookApplyConfiguration) *MutatingWebhookConfigurationApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithWebhooks") } b.Webhooks = append(b.Webhooks, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *MutatingWebhookConfigurationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go000066400000000000000000000104441472614177300347550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" ) // NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use // with apply. type NamedRuleWithOperationsApplyConfiguration struct { ResourceNames []string `json:"resourceNames,omitempty"` RuleWithOperationsApplyConfiguration `json:",inline"` } // NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with // apply. func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration { return &NamedRuleWithOperationsApplyConfiguration{} } // WithResourceNames adds the given value to the ResourceNames field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceNames field. func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.ResourceNames = append(b.ResourceNames, values[i]) } return b } // WithOperations adds the given value to the Operations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Operations field. func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.Operations = append(b.Operations, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithAPIVersions adds the given value to the APIVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIVersions field. func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.APIVersions = append(b.APIVersions, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithScope sets the Scope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration { b.Scope = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/paramkind.go000066400000000000000000000035531472614177300317520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use // with apply. type ParamKindApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` Kind *string `json:"kind,omitempty"` } // ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with // apply. func ParamKind() *ParamKindApplyConfiguration { return &ParamKindApplyConfiguration{} } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration { b.APIVersion = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration { b.Kind = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/paramref.go000066400000000000000000000063541472614177300316030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use // with apply. type ParamRefApplyConfiguration struct { Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` ParameterNotFoundAction *admissionregistrationv1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"` } // ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with // apply. func ParamRef() *ParamRefApplyConfiguration { return &ParamRefApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration { b.Name = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration { b.Namespace = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration { b.Selector = value return b } // WithParameterNotFoundAction sets the ParameterNotFoundAction field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParameterNotFoundAction field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value admissionregistrationv1.ParameterNotFoundActionType) *ParamRefApplyConfiguration { b.ParameterNotFoundAction = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/rule.go000066400000000000000000000057521472614177300307560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/admissionregistration/v1" ) // RuleApplyConfiguration represents a declarative configuration of the Rule type for use // with apply. type RuleApplyConfiguration struct { APIGroups []string `json:"apiGroups,omitempty"` APIVersions []string `json:"apiVersions,omitempty"` Resources []string `json:"resources,omitempty"` Scope *v1.ScopeType `json:"scope,omitempty"` } // RuleApplyConfiguration constructs a declarative configuration of the Rule type for use with // apply. func Rule() *RuleApplyConfiguration { return &RuleApplyConfiguration{} } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *RuleApplyConfiguration) WithAPIGroups(values ...string) *RuleApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithAPIVersions adds the given value to the APIVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIVersions field. func (b *RuleApplyConfiguration) WithAPIVersions(values ...string) *RuleApplyConfiguration { for i := range values { b.APIVersions = append(b.APIVersions, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *RuleApplyConfiguration) WithResources(values ...string) *RuleApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithScope sets the Scope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *RuleApplyConfiguration) WithScope(value v1.ScopeType) *RuleApplyConfiguration { b.Scope = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/rulewithoperations.go000066400000000000000000000071411472614177300337500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/admissionregistration/v1" ) // RuleWithOperationsApplyConfiguration represents a declarative configuration of the RuleWithOperations type for use // with apply. type RuleWithOperationsApplyConfiguration struct { Operations []v1.OperationType `json:"operations,omitempty"` RuleApplyConfiguration `json:",inline"` } // RuleWithOperationsApplyConfiguration constructs a declarative configuration of the RuleWithOperations type for use with // apply. func RuleWithOperations() *RuleWithOperationsApplyConfiguration { return &RuleWithOperationsApplyConfiguration{} } // WithOperations adds the given value to the Operations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Operations field. func (b *RuleWithOperationsApplyConfiguration) WithOperations(values ...v1.OperationType) *RuleWithOperationsApplyConfiguration { for i := range values { b.Operations = append(b.Operations, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *RuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *RuleWithOperationsApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithAPIVersions adds the given value to the APIVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIVersions field. func (b *RuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *RuleWithOperationsApplyConfiguration { for i := range values { b.APIVersions = append(b.APIVersions, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *RuleWithOperationsApplyConfiguration) WithResources(values ...string) *RuleWithOperationsApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithScope sets the Scope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *RuleWithOperationsApplyConfiguration) WithScope(value v1.ScopeType) *RuleWithOperationsApplyConfiguration { b.Scope = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/servicereference.go000066400000000000000000000054561472614177300333270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ServiceReferenceApplyConfiguration represents a declarative configuration of the ServiceReference type for use // with apply. type ServiceReferenceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Port *int32 `json:"port,omitempty"` } // ServiceReferenceApplyConfiguration constructs a declarative configuration of the ServiceReference type for use with // apply. func ServiceReference() *ServiceReferenceApplyConfiguration { return &ServiceReferenceApplyConfiguration{} } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceReferenceApplyConfiguration) WithNamespace(value string) *ServiceReferenceApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceReferenceApplyConfiguration) WithName(value string) *ServiceReferenceApplyConfiguration { b.Name = &value return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *ServiceReferenceApplyConfiguration) WithPath(value string) *ServiceReferenceApplyConfiguration { b.Path = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *ServiceReferenceApplyConfiguration) WithPort(value int32) *ServiceReferenceApplyConfiguration { b.Port = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/typechecking.go000066400000000000000000000033601472614177300324550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use // with apply. type TypeCheckingApplyConfiguration struct { ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"` } // TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with // apply. func TypeChecking() *TypeCheckingApplyConfiguration { return &TypeCheckingApplyConfiguration{} } // WithExpressionWarnings adds the given value to the ExpressionWarnings field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ExpressionWarnings field. func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithExpressionWarnings") } b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i]) } return b } validatingadmissionpolicy.go000066400000000000000000000330631472614177300351750ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use // with apply. type ValidatingAdmissionPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"` Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"` } // ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with // apply. func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration { b := &ValidatingAdmissionPolicyApplyConfiguration{} b.WithName(name) b.WithKind("ValidatingAdmissionPolicy") b.WithAPIVersion("admissionregistration.k8s.io/v1") return b } // ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from // validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a // ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API. // ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "") } // ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except // that it extracts the status subresource applied configuration. // Experimental! func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status") } func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { b := &ValidatingAdmissionPolicyApplyConfiguration{} err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicy"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(validatingAdmissionPolicy.Name) b.WithKind("ValidatingAdmissionPolicy") b.WithAPIVersion("admissionregistration.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ValidatingAdmissionPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } validatingadmissionpolicybinding.go000066400000000000000000000327671472614177300365420ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use // with apply. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"` } // ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with // apply. func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} b.WithName(name) b.WithKind("ValidatingAdmissionPolicyBinding") b.WithAPIVersion("admissionregistration.k8s.io/v1") return b } // ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from // validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a // ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API. // ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "") } // ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status") } func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(validatingAdmissionPolicyBinding.Name) b.WithKind("ValidatingAdmissionPolicyBinding") b.WithAPIVersion("admissionregistration.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } validatingadmissionpolicybindingspec.go000066400000000000000000000072531472614177300374050ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" ) // ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use // with apply. type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { PolicyName *string `json:"policyName,omitempty"` ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"` MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"` ValidationActions []admissionregistrationv1.ValidationAction `json:"validationActions,omitempty"` } // ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with // apply. func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} } // WithPolicyName sets the PolicyName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PolicyName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.PolicyName = &value return b } // WithParamRef sets the ParamRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParamRef field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.ParamRef = value return b } // WithMatchResources sets the MatchResources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchResources field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.MatchResources = value return b } // WithValidationActions adds the given value to the ValidationActions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ValidationActions field. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { for i := range values { b.ValidationActions = append(b.ValidationActions, values[i]) } return b } validatingadmissionpolicyspec.go000066400000000000000000000135251472614177300360510ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" ) // ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use // with apply. type ValidatingAdmissionPolicySpecApplyConfiguration struct { ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"` Validations []ValidationApplyConfiguration `json:"validations,omitempty"` FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"` AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"` MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` Variables []VariableApplyConfiguration `json:"variables,omitempty"` } // ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with // apply. func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { return &ValidatingAdmissionPolicySpecApplyConfiguration{} } // WithParamKind sets the ParamKind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParamKind field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { b.ParamKind = value return b } // WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchConstraints field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { b.MatchConstraints = value return b } // WithValidations adds the given value to the Validations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Validations field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithValidations") } b.Validations = append(b.Validations, *values[i]) } return b } // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailurePolicy field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration { b.FailurePolicy = &value return b } // WithAuditAnnotations adds the given value to the AuditAnnotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AuditAnnotations field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithAuditAnnotations") } b.AuditAnnotations = append(b.AuditAnnotations, *values[i]) } return b } // WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchConditions field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchConditions") } b.MatchConditions = append(b.MatchConditions, *values[i]) } return b } // WithVariables adds the given value to the Variables field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Variables field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVariables") } b.Variables = append(b.Variables, *values[i]) } return b } validatingadmissionpolicystatus.go000066400000000000000000000061121472614177300364340ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use // with apply. type ValidatingAdmissionPolicyStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"` Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } // ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with // apply. func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration { return &ValidatingAdmissionPolicyStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithTypeChecking sets the TypeChecking field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TypeChecking field is set to the value of the last call. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { b.TypeChecking = value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/validatingwebhook.go000066400000000000000000000172361472614177300335100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingWebhookApplyConfiguration represents a declarative configuration of the ValidatingWebhook type for use // with apply. type ValidatingWebhookApplyConfiguration struct { Name *string `json:"name,omitempty"` ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"` Rules []RuleWithOperationsApplyConfiguration `json:"rules,omitempty"` FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"` MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"` NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` SideEffects *admissionregistrationv1.SideEffectClass `json:"sideEffects,omitempty"` TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"` MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` } // ValidatingWebhookApplyConfiguration constructs a declarative configuration of the ValidatingWebhook type for use with // apply. func ValidatingWebhook() *ValidatingWebhookApplyConfiguration { return &ValidatingWebhookApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithName(value string) *ValidatingWebhookApplyConfiguration { b.Name = &value return b } // WithClientConfig sets the ClientConfig field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClientConfig field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *ValidatingWebhookApplyConfiguration { b.ClientConfig = value return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *ValidatingWebhookApplyConfiguration) WithRules(values ...*RuleWithOperationsApplyConfiguration) *ValidatingWebhookApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailurePolicy field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *ValidatingWebhookApplyConfiguration { b.FailurePolicy = &value return b } // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchPolicy field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1.MatchPolicyType) *ValidatingWebhookApplyConfiguration { b.MatchPolicy = &value return b } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *ValidatingWebhookApplyConfiguration { b.NamespaceSelector = value return b } // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObjectSelector field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *ValidatingWebhookApplyConfiguration { b.ObjectSelector = value return b } // WithSideEffects sets the SideEffects field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SideEffects field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1.SideEffectClass) *ValidatingWebhookApplyConfiguration { b.SideEffects = &value return b } // WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeoutSeconds field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *ValidatingWebhookApplyConfiguration { b.TimeoutSeconds = &value return b } // WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AdmissionReviewVersions field. func (b *ValidatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *ValidatingWebhookApplyConfiguration { for i := range values { b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, values[i]) } return b } // WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchConditions field. func (b *ValidatingWebhookApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingWebhookApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchConditions") } b.MatchConditions = append(b.MatchConditions, *values[i]) } return b } validatingwebhookconfiguration.go000066400000000000000000000327471472614177300362250ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the ValidatingWebhookConfiguration type for use // with apply. type ValidatingWebhookConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Webhooks []ValidatingWebhookApplyConfiguration `json:"webhooks,omitempty"` } // ValidatingWebhookConfiguration constructs a declarative configuration of the ValidatingWebhookConfiguration type for use with // apply. func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfigurationApplyConfiguration { b := &ValidatingWebhookConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("ValidatingWebhookConfiguration") b.WithAPIVersion("admissionregistration.k8s.io/v1") return b } // ExtractValidatingWebhookConfiguration extracts the applied configuration owned by fieldManager from // validatingWebhookConfiguration. If no managedFields are found in validatingWebhookConfiguration for fieldManager, a // ValidatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // validatingWebhookConfiguration must be a unmodified ValidatingWebhookConfiguration API object that was retrieved from the Kubernetes API. // ExtractValidatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractValidatingWebhookConfiguration(validatingWebhookConfiguration *apiadmissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "") } // ExtractValidatingWebhookConfigurationStatus is the same as ExtractValidatingWebhookConfiguration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractValidatingWebhookConfigurationStatus(validatingWebhookConfiguration *apiadmissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "status") } func extractValidatingWebhookConfiguration(validatingWebhookConfiguration *apiadmissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string, subresource string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { b := &ValidatingWebhookConfigurationApplyConfiguration{} err := managedfields.ExtractInto(validatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(validatingWebhookConfiguration.Name) b.WithKind("ValidatingWebhookConfiguration") b.WithAPIVersion("admissionregistration.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithKind(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithAPIVersion(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithName(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithGenerateName(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithNamespace(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithUID(value types.UID) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithResourceVersion(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithGeneration(value int64) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithLabels(entries map[string]string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithFinalizers(values ...string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ValidatingWebhookConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithWebhooks adds the given value to the Webhooks field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Webhooks field. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ...*ValidatingWebhookApplyConfiguration) *ValidatingWebhookConfigurationApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithWebhooks") } b.Webhooks = append(b.Webhooks, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ValidatingWebhookConfigurationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/validation.go000066400000000000000000000057051472614177300321370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ValidationApplyConfiguration represents a declarative configuration of the Validation type for use // with apply. type ValidationApplyConfiguration struct { Expression *string `json:"expression,omitempty"` Message *string `json:"message,omitempty"` Reason *v1.StatusReason `json:"reason,omitempty"` MessageExpression *string `json:"messageExpression,omitempty"` } // ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with // apply. func Validation() *ValidationApplyConfiguration { return &ValidationApplyConfiguration{} } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration { b.Expression = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration { b.Message = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithReason(value v1.StatusReason) *ValidationApplyConfiguration { b.Reason = &value return b } // WithMessageExpression sets the MessageExpression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MessageExpression field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration { b.MessageExpression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/variable.go000066400000000000000000000035371472614177300315730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VariableApplyConfiguration represents a declarative configuration of the Variable type for use // with apply. type VariableApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } // VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with // apply. func Variable() *VariableApplyConfiguration { return &VariableApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration { b.Name = &value return b } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration { b.Expression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1/webhookclientconfig.go000066400000000000000000000051221472614177300340210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // WebhookClientConfigApplyConfiguration represents a declarative configuration of the WebhookClientConfig type for use // with apply. type WebhookClientConfigApplyConfiguration struct { URL *string `json:"url,omitempty"` Service *ServiceReferenceApplyConfiguration `json:"service,omitempty"` CABundle []byte `json:"caBundle,omitempty"` } // WebhookClientConfigApplyConfiguration constructs a declarative configuration of the WebhookClientConfig type for use with // apply. func WebhookClientConfig() *WebhookClientConfigApplyConfiguration { return &WebhookClientConfigApplyConfiguration{} } // WithURL sets the URL field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the URL field is set to the value of the last call. func (b *WebhookClientConfigApplyConfiguration) WithURL(value string) *WebhookClientConfigApplyConfiguration { b.URL = &value return b } // WithService sets the Service field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Service field is set to the value of the last call. func (b *WebhookClientConfigApplyConfiguration) WithService(value *ServiceReferenceApplyConfiguration) *WebhookClientConfigApplyConfiguration { b.Service = value return b } // WithCABundle adds the given value to the CABundle field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CABundle field. func (b *WebhookClientConfigApplyConfiguration) WithCABundle(values ...byte) *WebhookClientConfigApplyConfiguration { for i := range values { b.CABundle = append(b.CABundle, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/000077500000000000000000000000001472614177300305365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/auditannotation.go000066400000000000000000000037331472614177300342740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use // with apply. type AuditAnnotationApplyConfiguration struct { Key *string `json:"key,omitempty"` ValueExpression *string `json:"valueExpression,omitempty"` } // AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with // apply. func AuditAnnotation() *AuditAnnotationApplyConfiguration { return &AuditAnnotationApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration { b.Key = &value return b } // WithValueExpression sets the ValueExpression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ValueExpression field is set to the value of the last call. func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration { b.ValueExpression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/expressionwarning.go000066400000000000000000000037231472614177300346570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use // with apply. type ExpressionWarningApplyConfiguration struct { FieldRef *string `json:"fieldRef,omitempty"` Warning *string `json:"warning,omitempty"` } // ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with // apply. func ExpressionWarning() *ExpressionWarningApplyConfiguration { return &ExpressionWarningApplyConfiguration{} } // WithFieldRef sets the FieldRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldRef field is set to the value of the last call. func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration { b.FieldRef = &value return b } // WithWarning sets the Warning field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Warning field is set to the value of the last call. func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration { b.Warning = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/matchcondition.go000066400000000000000000000036551472614177300341010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use // with apply. type MatchConditionApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } // MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with // apply. func MatchCondition() *MatchConditionApplyConfiguration { return &MatchConditionApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MatchConditionApplyConfiguration) WithName(value string) *MatchConditionApplyConfiguration { b.Name = &value return b } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *MatchConditionApplyConfiguration) WithExpression(value string) *MatchConditionApplyConfiguration { b.Expression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/matchresources.go000066400000000000000000000105421472614177300341160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use // with apply. type MatchResourcesApplyConfiguration struct { NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"` ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"` MatchPolicy *admissionregistrationv1alpha1.MatchPolicyType `json:"matchPolicy,omitempty"` } // MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with // apply. func MatchResources() *MatchResourcesApplyConfiguration { return &MatchResourcesApplyConfiguration{} } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { b.NamespaceSelector = value return b } // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObjectSelector field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { b.ObjectSelector = value return b } // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceRules field. func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceRules") } b.ResourceRules = append(b.ResourceRules, *values[i]) } return b } // WithExcludeResourceRules adds the given value to the ExcludeResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ExcludeResourceRules field. func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithExcludeResourceRules") } b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i]) } return b } // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchPolicy field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value admissionregistrationv1alpha1.MatchPolicyType) *MatchResourcesApplyConfiguration { b.MatchPolicy = &value return b } namedrulewithoperations.go000066400000000000000000000105641472614177300357700ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" ) // NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use // with apply. type NamedRuleWithOperationsApplyConfiguration struct { ResourceNames []string `json:"resourceNames,omitempty"` v1.RuleWithOperationsApplyConfiguration `json:",inline"` } // NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with // apply. func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration { return &NamedRuleWithOperationsApplyConfiguration{} } // WithResourceNames adds the given value to the ResourceNames field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceNames field. func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.ResourceNames = append(b.ResourceNames, values[i]) } return b } // WithOperations adds the given value to the Operations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Operations field. func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.Operations = append(b.Operations, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithAPIVersions adds the given value to the APIVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIVersions field. func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.APIVersions = append(b.APIVersions, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithScope sets the Scope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration { b.Scope = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/paramkind.go000066400000000000000000000035611472614177300330400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use // with apply. type ParamKindApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` Kind *string `json:"kind,omitempty"` } // ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with // apply. func ParamKind() *ParamKindApplyConfiguration { return &ParamKindApplyConfiguration{} } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration { b.APIVersion = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration { b.Kind = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/paramref.go000066400000000000000000000062361472614177300326710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use // with apply. type ParamRefApplyConfiguration struct { Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` ParameterNotFoundAction *v1alpha1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"` } // ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with // apply. func ParamRef() *ParamRefApplyConfiguration { return &ParamRefApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration { b.Name = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration { b.Namespace = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration { b.Selector = value return b } // WithParameterNotFoundAction sets the ParameterNotFoundAction field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParameterNotFoundAction field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value v1alpha1.ParameterNotFoundActionType) *ParamRefApplyConfiguration { b.ParameterNotFoundAction = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/typechecking.go000066400000000000000000000033661472614177300335520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use // with apply. type TypeCheckingApplyConfiguration struct { ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"` } // TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with // apply. func TypeChecking() *TypeCheckingApplyConfiguration { return &TypeCheckingApplyConfiguration{} } // WithExpressionWarnings adds the given value to the ExpressionWarnings field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ExpressionWarnings field. func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithExpressionWarnings") } b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i]) } return b } validatingadmissionpolicy.go000066400000000000000000000331351472614177300362640ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use // with apply. type ValidatingAdmissionPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"` Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"` } // ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with // apply. func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration { b := &ValidatingAdmissionPolicyApplyConfiguration{} b.WithName(name) b.WithKind("ValidatingAdmissionPolicy") b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1") return b } // ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from // validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a // ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API. // ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "") } // ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except // that it extracts the status subresource applied configuration. // Experimental! func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status") } func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { b := &ValidatingAdmissionPolicyApplyConfiguration{} err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicy"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(validatingAdmissionPolicy.Name) b.WithKind("ValidatingAdmissionPolicy") b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ValidatingAdmissionPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } validatingadmissionpolicybinding.go000066400000000000000000000330411472614177300376130ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use // with apply. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"` } // ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with // apply. func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} b.WithName(name) b.WithKind("ValidatingAdmissionPolicyBinding") b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1") return b } // ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from // validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a // ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API. // ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "") } // ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status") } func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(validatingAdmissionPolicyBinding.Name) b.WithKind("ValidatingAdmissionPolicyBinding") b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } validatingadmissionpolicybindingspec.go000066400000000000000000000073331472614177300404730ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" ) // ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use // with apply. type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { PolicyName *string `json:"policyName,omitempty"` ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"` MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"` ValidationActions []admissionregistrationv1alpha1.ValidationAction `json:"validationActions,omitempty"` } // ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with // apply. func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} } // WithPolicyName sets the PolicyName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PolicyName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.PolicyName = &value return b } // WithParamRef sets the ParamRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParamRef field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.ParamRef = value return b } // WithMatchResources sets the MatchResources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchResources field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.MatchResources = value return b } // WithValidationActions adds the given value to the ValidationActions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ValidationActions field. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1alpha1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { for i := range values { b.ValidationActions = append(b.ValidationActions, values[i]) } return b } validatingadmissionpolicyspec.go000066400000000000000000000136271472614177300371430ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" ) // ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use // with apply. type ValidatingAdmissionPolicySpecApplyConfiguration struct { ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"` Validations []ValidationApplyConfiguration `json:"validations,omitempty"` FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"` AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"` MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` Variables []VariableApplyConfiguration `json:"variables,omitempty"` } // ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with // apply. func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { return &ValidatingAdmissionPolicySpecApplyConfiguration{} } // WithParamKind sets the ParamKind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParamKind field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { b.ParamKind = value return b } // WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchConstraints field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { b.MatchConstraints = value return b } // WithValidations adds the given value to the Validations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Validations field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithValidations") } b.Validations = append(b.Validations, *values[i]) } return b } // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailurePolicy field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1alpha1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration { b.FailurePolicy = &value return b } // WithAuditAnnotations adds the given value to the AuditAnnotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AuditAnnotations field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithAuditAnnotations") } b.AuditAnnotations = append(b.AuditAnnotations, *values[i]) } return b } // WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchConditions field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchConditions") } b.MatchConditions = append(b.MatchConditions, *values[i]) } return b } // WithVariables adds the given value to the Variables field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Variables field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVariables") } b.Variables = append(b.Variables, *values[i]) } return b } validatingadmissionpolicystatus.go000066400000000000000000000060741472614177300375320ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use // with apply. type ValidatingAdmissionPolicyStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"` Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } // ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with // apply. func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration { return &ValidatingAdmissionPolicyStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithTypeChecking sets the TypeChecking field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TypeChecking field is set to the value of the last call. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { b.TypeChecking = value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/validation.go000066400000000000000000000057131472614177300332250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ValidationApplyConfiguration represents a declarative configuration of the Validation type for use // with apply. type ValidationApplyConfiguration struct { Expression *string `json:"expression,omitempty"` Message *string `json:"message,omitempty"` Reason *v1.StatusReason `json:"reason,omitempty"` MessageExpression *string `json:"messageExpression,omitempty"` } // ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with // apply. func Validation() *ValidationApplyConfiguration { return &ValidationApplyConfiguration{} } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration { b.Expression = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration { b.Message = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithReason(value v1.StatusReason) *ValidationApplyConfiguration { b.Reason = &value return b } // WithMessageExpression sets the MessageExpression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MessageExpression field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration { b.MessageExpression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1alpha1/variable.go000066400000000000000000000035451472614177300326610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // VariableApplyConfiguration represents a declarative configuration of the Variable type for use // with apply. type VariableApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } // VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with // apply. func Variable() *VariableApplyConfiguration { return &VariableApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration { b.Name = &value return b } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration { b.Expression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/000077500000000000000000000000001472614177300303645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/auditannotation.go000066400000000000000000000037321472614177300341210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use // with apply. type AuditAnnotationApplyConfiguration struct { Key *string `json:"key,omitempty"` ValueExpression *string `json:"valueExpression,omitempty"` } // AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with // apply. func AuditAnnotation() *AuditAnnotationApplyConfiguration { return &AuditAnnotationApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration { b.Key = &value return b } // WithValueExpression sets the ValueExpression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ValueExpression field is set to the value of the last call. func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration { b.ValueExpression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go000066400000000000000000000037221472614177300345040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use // with apply. type ExpressionWarningApplyConfiguration struct { FieldRef *string `json:"fieldRef,omitempty"` Warning *string `json:"warning,omitempty"` } // ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with // apply. func ExpressionWarning() *ExpressionWarningApplyConfiguration { return &ExpressionWarningApplyConfiguration{} } // WithFieldRef sets the FieldRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldRef field is set to the value of the last call. func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration { b.FieldRef = &value return b } // WithWarning sets the Warning field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Warning field is set to the value of the last call. func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration { b.Warning = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/matchcondition.go000066400000000000000000000036541472614177300337260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use // with apply. type MatchConditionApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } // MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with // apply. func MatchCondition() *MatchConditionApplyConfiguration { return &MatchConditionApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MatchConditionApplyConfiguration) WithName(value string) *MatchConditionApplyConfiguration { b.Name = &value return b } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *MatchConditionApplyConfiguration) WithExpression(value string) *MatchConditionApplyConfiguration { b.Expression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/matchresources.go000066400000000000000000000105311472614177300337420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use // with apply. type MatchResourcesApplyConfiguration struct { NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"` ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"` MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"` } // MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with // apply. func MatchResources() *MatchResourcesApplyConfiguration { return &MatchResourcesApplyConfiguration{} } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { b.NamespaceSelector = value return b } // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObjectSelector field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { b.ObjectSelector = value return b } // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceRules field. func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceRules") } b.ResourceRules = append(b.ResourceRules, *values[i]) } return b } // WithExcludeResourceRules adds the given value to the ExcludeResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ExcludeResourceRules field. func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithExcludeResourceRules") } b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i]) } return b } // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchPolicy field is set to the value of the last call. func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value admissionregistrationv1beta1.MatchPolicyType) *MatchResourcesApplyConfiguration { b.MatchPolicy = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/mutatingwebhook.go000066400000000000000000000206531472614177300341300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MutatingWebhookApplyConfiguration represents a declarative configuration of the MutatingWebhook type for use // with apply. type MutatingWebhookApplyConfiguration struct { Name *string `json:"name,omitempty"` ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"` Rules []v1.RuleWithOperationsApplyConfiguration `json:"rules,omitempty"` FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"` MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"` NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` SideEffects *admissionregistrationv1beta1.SideEffectClass `json:"sideEffects,omitempty"` TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"` ReinvocationPolicy *admissionregistrationv1beta1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"` MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` } // MutatingWebhookApplyConfiguration constructs a declarative configuration of the MutatingWebhook type for use with // apply. func MutatingWebhook() *MutatingWebhookApplyConfiguration { return &MutatingWebhookApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithName(value string) *MutatingWebhookApplyConfiguration { b.Name = &value return b } // WithClientConfig sets the ClientConfig field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClientConfig field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *MutatingWebhookApplyConfiguration { b.ClientConfig = value return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *MutatingWebhookApplyConfiguration) WithRules(values ...*v1.RuleWithOperationsApplyConfiguration) *MutatingWebhookApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailurePolicy field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1beta1.FailurePolicyType) *MutatingWebhookApplyConfiguration { b.FailurePolicy = &value return b } // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchPolicy field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1beta1.MatchPolicyType) *MutatingWebhookApplyConfiguration { b.MatchPolicy = &value return b } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration { b.NamespaceSelector = value return b } // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObjectSelector field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration { b.ObjectSelector = value return b } // WithSideEffects sets the SideEffects field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SideEffects field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1beta1.SideEffectClass) *MutatingWebhookApplyConfiguration { b.SideEffects = &value return b } // WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeoutSeconds field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *MutatingWebhookApplyConfiguration { b.TimeoutSeconds = &value return b } // WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AdmissionReviewVersions field. func (b *MutatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *MutatingWebhookApplyConfiguration { for i := range values { b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, values[i]) } return b } // WithReinvocationPolicy sets the ReinvocationPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReinvocationPolicy field is set to the value of the last call. func (b *MutatingWebhookApplyConfiguration) WithReinvocationPolicy(value admissionregistrationv1beta1.ReinvocationPolicyType) *MutatingWebhookApplyConfiguration { b.ReinvocationPolicy = &value return b } // WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchConditions field. func (b *MutatingWebhookApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *MutatingWebhookApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchConditions") } b.MatchConditions = append(b.MatchConditions, *values[i]) } return b } mutatingwebhookconfiguration.go000066400000000000000000000325621472614177300366430ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MutatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the MutatingWebhookConfiguration type for use // with apply. type MutatingWebhookConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Webhooks []MutatingWebhookApplyConfiguration `json:"webhooks,omitempty"` } // MutatingWebhookConfiguration constructs a declarative configuration of the MutatingWebhookConfiguration type for use with // apply. func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationApplyConfiguration { b := &MutatingWebhookConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("MutatingWebhookConfiguration") b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") return b } // ExtractMutatingWebhookConfiguration extracts the applied configuration owned by fieldManager from // mutatingWebhookConfiguration. If no managedFields are found in mutatingWebhookConfiguration for fieldManager, a // MutatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // mutatingWebhookConfiguration must be a unmodified MutatingWebhookConfiguration API object that was retrieved from the Kubernetes API. // ExtractMutatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) { return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "") } // ExtractMutatingWebhookConfigurationStatus is the same as ExtractMutatingWebhookConfiguration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractMutatingWebhookConfigurationStatus(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) { return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "status") } func extractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string, subresource string) (*MutatingWebhookConfigurationApplyConfiguration, error) { b := &MutatingWebhookConfigurationApplyConfiguration{} err := managedfields.ExtractInto(mutatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.MutatingWebhookConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(mutatingWebhookConfiguration.Name) b.WithKind("MutatingWebhookConfiguration") b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithKind(value string) *MutatingWebhookConfigurationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithAPIVersion(value string) *MutatingWebhookConfigurationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithName(value string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithGenerateName(value string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithNamespace(value string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithUID(value types.UID) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithResourceVersion(value string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithGeneration(value int64) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *MutatingWebhookConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *MutatingWebhookConfigurationApplyConfiguration) WithLabels(entries map[string]string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *MutatingWebhookConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *MutatingWebhookConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *MutatingWebhookConfigurationApplyConfiguration) WithFinalizers(values ...string) *MutatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *MutatingWebhookConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithWebhooks adds the given value to the Webhooks field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Webhooks field. func (b *MutatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ...*MutatingWebhookApplyConfiguration) *MutatingWebhookConfigurationApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithWebhooks") } b.Webhooks = append(b.Webhooks, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *MutatingWebhookConfigurationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } namedrulewithoperations.go000066400000000000000000000105631472614177300356150ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" ) // NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use // with apply. type NamedRuleWithOperationsApplyConfiguration struct { ResourceNames []string `json:"resourceNames,omitempty"` v1.RuleWithOperationsApplyConfiguration `json:",inline"` } // NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with // apply. func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration { return &NamedRuleWithOperationsApplyConfiguration{} } // WithResourceNames adds the given value to the ResourceNames field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceNames field. func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.ResourceNames = append(b.ResourceNames, values[i]) } return b } // WithOperations adds the given value to the Operations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Operations field. func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.Operations = append(b.Operations, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithAPIVersions adds the given value to the APIVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIVersions field. func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.APIVersions = append(b.APIVersions, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithScope sets the Scope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration { b.Scope = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/paramkind.go000066400000000000000000000035601472614177300326650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use // with apply. type ParamKindApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` Kind *string `json:"kind,omitempty"` } // ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with // apply. func ParamKind() *ParamKindApplyConfiguration { return &ParamKindApplyConfiguration{} } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration { b.APIVersion = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration { b.Kind = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/paramref.go000066400000000000000000000062261472614177300325160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use // with apply. type ParamRefApplyConfiguration struct { Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` ParameterNotFoundAction *v1beta1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"` } // ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with // apply. func ParamRef() *ParamRefApplyConfiguration { return &ParamRefApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration { b.Name = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration { b.Namespace = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration { b.Selector = value return b } // WithParameterNotFoundAction sets the ParameterNotFoundAction field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParameterNotFoundAction field is set to the value of the last call. func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value v1beta1.ParameterNotFoundActionType) *ParamRefApplyConfiguration { b.ParameterNotFoundAction = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/servicereference.go000066400000000000000000000054631472614177300342420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ServiceReferenceApplyConfiguration represents a declarative configuration of the ServiceReference type for use // with apply. type ServiceReferenceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Port *int32 `json:"port,omitempty"` } // ServiceReferenceApplyConfiguration constructs a declarative configuration of the ServiceReference type for use with // apply. func ServiceReference() *ServiceReferenceApplyConfiguration { return &ServiceReferenceApplyConfiguration{} } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceReferenceApplyConfiguration) WithNamespace(value string) *ServiceReferenceApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceReferenceApplyConfiguration) WithName(value string) *ServiceReferenceApplyConfiguration { b.Name = &value return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *ServiceReferenceApplyConfiguration) WithPath(value string) *ServiceReferenceApplyConfiguration { b.Path = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *ServiceReferenceApplyConfiguration) WithPort(value int32) *ServiceReferenceApplyConfiguration { b.Port = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/typechecking.go000066400000000000000000000033651472614177300333770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use // with apply. type TypeCheckingApplyConfiguration struct { ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"` } // TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with // apply. func TypeChecking() *TypeCheckingApplyConfiguration { return &TypeCheckingApplyConfiguration{} } // WithExpressionWarnings adds the given value to the ExpressionWarnings field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ExpressionWarnings field. func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithExpressionWarnings") } b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i]) } return b } validatingadmissionpolicy.go000066400000000000000000000331241472614177300361100ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use // with apply. type ValidatingAdmissionPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"` Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"` } // ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with // apply. func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration { b := &ValidatingAdmissionPolicyApplyConfiguration{} b.WithName(name) b.WithKind("ValidatingAdmissionPolicy") b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") return b } // ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from // validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a // ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API. // ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "") } // ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except // that it extracts the status subresource applied configuration. // Experimental! func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status") } func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { b := &ValidatingAdmissionPolicyApplyConfiguration{} err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicy"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(validatingAdmissionPolicy.Name) b.WithKind("ValidatingAdmissionPolicy") b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ValidatingAdmissionPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } validatingadmissionpolicybinding.go000066400000000000000000000330301472614177300374370ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use // with apply. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"` } // ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with // apply. func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} b.WithName(name) b.WithKind("ValidatingAdmissionPolicyBinding") b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") return b } // ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from // validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a // ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API. // ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "") } // ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status") } func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(validatingAdmissionPolicyBinding.Name) b.WithKind("ValidatingAdmissionPolicyBinding") b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } validatingadmissionpolicybindingspec.go000066400000000000000000000073231472614177300403200ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" ) // ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use // with apply. type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { PolicyName *string `json:"policyName,omitempty"` ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"` MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"` ValidationActions []admissionregistrationv1beta1.ValidationAction `json:"validationActions,omitempty"` } // ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with // apply. func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} } // WithPolicyName sets the PolicyName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PolicyName field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.PolicyName = &value return b } // WithParamRef sets the ParamRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParamRef field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.ParamRef = value return b } // WithMatchResources sets the MatchResources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchResources field is set to the value of the last call. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { b.MatchResources = value return b } // WithValidationActions adds the given value to the ValidationActions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ValidationActions field. func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1beta1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { for i := range values { b.ValidationActions = append(b.ValidationActions, values[i]) } return b } validatingadmissionpolicyspec.go000066400000000000000000000136141472614177300367650ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" ) // ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use // with apply. type ValidatingAdmissionPolicySpecApplyConfiguration struct { ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"` Validations []ValidationApplyConfiguration `json:"validations,omitempty"` FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"` AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"` MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` Variables []VariableApplyConfiguration `json:"variables,omitempty"` } // ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with // apply. func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { return &ValidatingAdmissionPolicySpecApplyConfiguration{} } // WithParamKind sets the ParamKind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParamKind field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { b.ParamKind = value return b } // WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchConstraints field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { b.MatchConstraints = value return b } // WithValidations adds the given value to the Validations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Validations field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithValidations") } b.Validations = append(b.Validations, *values[i]) } return b } // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailurePolicy field is set to the value of the last call. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1beta1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration { b.FailurePolicy = &value return b } // WithAuditAnnotations adds the given value to the AuditAnnotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AuditAnnotations field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithAuditAnnotations") } b.AuditAnnotations = append(b.AuditAnnotations, *values[i]) } return b } // WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchConditions field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchConditions") } b.MatchConditions = append(b.MatchConditions, *values[i]) } return b } // WithVariables adds the given value to the Variables field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Variables field. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVariables") } b.Variables = append(b.Variables, *values[i]) } return b } validatingadmissionpolicystatus.go000066400000000000000000000060731472614177300373570ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use // with apply. type ValidatingAdmissionPolicyStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"` Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } // ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with // apply. func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration { return &ValidatingAdmissionPolicyStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithTypeChecking sets the TypeChecking field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TypeChecking field is set to the value of the last call. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { b.TypeChecking = value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/validatingwebhook.go000066400000000000000000000174721472614177300344270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingWebhookApplyConfiguration represents a declarative configuration of the ValidatingWebhook type for use // with apply. type ValidatingWebhookApplyConfiguration struct { Name *string `json:"name,omitempty"` ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"` Rules []v1.RuleWithOperationsApplyConfiguration `json:"rules,omitempty"` FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"` MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"` NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` SideEffects *admissionregistrationv1beta1.SideEffectClass `json:"sideEffects,omitempty"` TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"` MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` } // ValidatingWebhookApplyConfiguration constructs a declarative configuration of the ValidatingWebhook type for use with // apply. func ValidatingWebhook() *ValidatingWebhookApplyConfiguration { return &ValidatingWebhookApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithName(value string) *ValidatingWebhookApplyConfiguration { b.Name = &value return b } // WithClientConfig sets the ClientConfig field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClientConfig field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *ValidatingWebhookApplyConfiguration { b.ClientConfig = value return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *ValidatingWebhookApplyConfiguration) WithRules(values ...*v1.RuleWithOperationsApplyConfiguration) *ValidatingWebhookApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailurePolicy field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1beta1.FailurePolicyType) *ValidatingWebhookApplyConfiguration { b.FailurePolicy = &value return b } // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchPolicy field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1beta1.MatchPolicyType) *ValidatingWebhookApplyConfiguration { b.MatchPolicy = &value return b } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *ValidatingWebhookApplyConfiguration { b.NamespaceSelector = value return b } // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObjectSelector field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *ValidatingWebhookApplyConfiguration { b.ObjectSelector = value return b } // WithSideEffects sets the SideEffects field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SideEffects field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1beta1.SideEffectClass) *ValidatingWebhookApplyConfiguration { b.SideEffects = &value return b } // WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeoutSeconds field is set to the value of the last call. func (b *ValidatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *ValidatingWebhookApplyConfiguration { b.TimeoutSeconds = &value return b } // WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AdmissionReviewVersions field. func (b *ValidatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *ValidatingWebhookApplyConfiguration { for i := range values { b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, values[i]) } return b } // WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchConditions field. func (b *ValidatingWebhookApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingWebhookApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchConditions") } b.MatchConditions = append(b.MatchConditions, *values[i]) } return b } validatingwebhookconfiguration.go000066400000000000000000000330101472614177300371220ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ValidatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the ValidatingWebhookConfiguration type for use // with apply. type ValidatingWebhookConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Webhooks []ValidatingWebhookApplyConfiguration `json:"webhooks,omitempty"` } // ValidatingWebhookConfiguration constructs a declarative configuration of the ValidatingWebhookConfiguration type for use with // apply. func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfigurationApplyConfiguration { b := &ValidatingWebhookConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("ValidatingWebhookConfiguration") b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") return b } // ExtractValidatingWebhookConfiguration extracts the applied configuration owned by fieldManager from // validatingWebhookConfiguration. If no managedFields are found in validatingWebhookConfiguration for fieldManager, a // ValidatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // validatingWebhookConfiguration must be a unmodified ValidatingWebhookConfiguration API object that was retrieved from the Kubernetes API. // ExtractValidatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "") } // ExtractValidatingWebhookConfigurationStatus is the same as ExtractValidatingWebhookConfiguration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractValidatingWebhookConfigurationStatus(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "status") } func extractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string, subresource string) (*ValidatingWebhookConfigurationApplyConfiguration, error) { b := &ValidatingWebhookConfigurationApplyConfiguration{} err := managedfields.ExtractInto(validatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingWebhookConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(validatingWebhookConfiguration.Name) b.WithKind("ValidatingWebhookConfiguration") b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithKind(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithAPIVersion(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithName(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithGenerateName(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithNamespace(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithUID(value types.UID) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithResourceVersion(value string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithGeneration(value int64) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithLabels(entries map[string]string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithFinalizers(values ...string) *ValidatingWebhookConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ValidatingWebhookConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithWebhooks adds the given value to the Webhooks field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Webhooks field. func (b *ValidatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ...*ValidatingWebhookApplyConfiguration) *ValidatingWebhookConfigurationApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithWebhooks") } b.Webhooks = append(b.Webhooks, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ValidatingWebhookConfigurationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/validation.go000066400000000000000000000057121472614177300330520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ValidationApplyConfiguration represents a declarative configuration of the Validation type for use // with apply. type ValidationApplyConfiguration struct { Expression *string `json:"expression,omitempty"` Message *string `json:"message,omitempty"` Reason *v1.StatusReason `json:"reason,omitempty"` MessageExpression *string `json:"messageExpression,omitempty"` } // ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with // apply. func Validation() *ValidationApplyConfiguration { return &ValidationApplyConfiguration{} } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration { b.Expression = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration { b.Message = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithReason(value v1.StatusReason) *ValidationApplyConfiguration { b.Reason = &value return b } // WithMessageExpression sets the MessageExpression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MessageExpression field is set to the value of the last call. func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration { b.MessageExpression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/variable.go000066400000000000000000000035441472614177300325060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // VariableApplyConfiguration represents a declarative configuration of the Variable type for use // with apply. type VariableApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } // VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with // apply. func Variable() *VariableApplyConfiguration { return &VariableApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration { b.Name = &value return b } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration { b.Expression = &value return b } webhookclientconfig.go000066400000000000000000000051271472614177300346640ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // WebhookClientConfigApplyConfiguration represents a declarative configuration of the WebhookClientConfig type for use // with apply. type WebhookClientConfigApplyConfiguration struct { URL *string `json:"url,omitempty"` Service *ServiceReferenceApplyConfiguration `json:"service,omitempty"` CABundle []byte `json:"caBundle,omitempty"` } // WebhookClientConfigApplyConfiguration constructs a declarative configuration of the WebhookClientConfig type for use with // apply. func WebhookClientConfig() *WebhookClientConfigApplyConfiguration { return &WebhookClientConfigApplyConfiguration{} } // WithURL sets the URL field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the URL field is set to the value of the last call. func (b *WebhookClientConfigApplyConfiguration) WithURL(value string) *WebhookClientConfigApplyConfiguration { b.URL = &value return b } // WithService sets the Service field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Service field is set to the value of the last call. func (b *WebhookClientConfigApplyConfiguration) WithService(value *ServiceReferenceApplyConfiguration) *WebhookClientConfigApplyConfiguration { b.Service = value return b } // WithCABundle adds the given value to the CABundle field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CABundle field. func (b *WebhookClientConfigApplyConfiguration) WithCABundle(values ...byte) *WebhookClientConfigApplyConfiguration { for i := range values { b.CABundle = append(b.CABundle, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/apiserverinternal/000077500000000000000000000000001472614177300262355ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apiserverinternal/v1alpha1/000077500000000000000000000000001472614177300276525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apiserverinternal/v1alpha1/serverstorageversion.go000066400000000000000000000064101472614177300345030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ServerStorageVersionApplyConfiguration represents a declarative configuration of the ServerStorageVersion type for use // with apply. type ServerStorageVersionApplyConfiguration struct { APIServerID *string `json:"apiServerID,omitempty"` EncodingVersion *string `json:"encodingVersion,omitempty"` DecodableVersions []string `json:"decodableVersions,omitempty"` ServedVersions []string `json:"servedVersions,omitempty"` } // ServerStorageVersionApplyConfiguration constructs a declarative configuration of the ServerStorageVersion type for use with // apply. func ServerStorageVersion() *ServerStorageVersionApplyConfiguration { return &ServerStorageVersionApplyConfiguration{} } // WithAPIServerID sets the APIServerID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIServerID field is set to the value of the last call. func (b *ServerStorageVersionApplyConfiguration) WithAPIServerID(value string) *ServerStorageVersionApplyConfiguration { b.APIServerID = &value return b } // WithEncodingVersion sets the EncodingVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EncodingVersion field is set to the value of the last call. func (b *ServerStorageVersionApplyConfiguration) WithEncodingVersion(value string) *ServerStorageVersionApplyConfiguration { b.EncodingVersion = &value return b } // WithDecodableVersions adds the given value to the DecodableVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the DecodableVersions field. func (b *ServerStorageVersionApplyConfiguration) WithDecodableVersions(values ...string) *ServerStorageVersionApplyConfiguration { for i := range values { b.DecodableVersions = append(b.DecodableVersions, values[i]) } return b } // WithServedVersions adds the given value to the ServedVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ServedVersions field. func (b *ServerStorageVersionApplyConfiguration) WithServedVersions(values ...string) *ServerStorageVersionApplyConfiguration { for i := range values { b.ServedVersions = append(b.ServedVersions, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go000066400000000000000000000312151472614177300332550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StorageVersionApplyConfiguration represents a declarative configuration of the StorageVersion type for use // with apply. type StorageVersionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *v1alpha1.StorageVersionSpec `json:"spec,omitempty"` Status *StorageVersionStatusApplyConfiguration `json:"status,omitempty"` } // StorageVersion constructs a declarative configuration of the StorageVersion type for use with // apply. func StorageVersion(name string) *StorageVersionApplyConfiguration { b := &StorageVersionApplyConfiguration{} b.WithName(name) b.WithKind("StorageVersion") b.WithAPIVersion("internal.apiserver.k8s.io/v1alpha1") return b } // ExtractStorageVersion extracts the applied configuration owned by fieldManager from // storageVersion. If no managedFields are found in storageVersion for fieldManager, a // StorageVersionApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // storageVersion must be a unmodified StorageVersion API object that was retrieved from the Kubernetes API. // ExtractStorageVersion provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractStorageVersion(storageVersion *v1alpha1.StorageVersion, fieldManager string) (*StorageVersionApplyConfiguration, error) { return extractStorageVersion(storageVersion, fieldManager, "") } // ExtractStorageVersionStatus is the same as ExtractStorageVersion except // that it extracts the status subresource applied configuration. // Experimental! func ExtractStorageVersionStatus(storageVersion *v1alpha1.StorageVersion, fieldManager string) (*StorageVersionApplyConfiguration, error) { return extractStorageVersion(storageVersion, fieldManager, "status") } func extractStorageVersion(storageVersion *v1alpha1.StorageVersion, fieldManager string, subresource string) (*StorageVersionApplyConfiguration, error) { b := &StorageVersionApplyConfiguration{} err := managedfields.ExtractInto(storageVersion, internal.Parser().Type("io.k8s.api.apiserverinternal.v1alpha1.StorageVersion"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(storageVersion.Name) b.WithKind("StorageVersion") b.WithAPIVersion("internal.apiserver.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithKind(value string) *StorageVersionApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithAPIVersion(value string) *StorageVersionApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithName(value string) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithGenerateName(value string) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithNamespace(value string) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithUID(value types.UID) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithResourceVersion(value string) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithGeneration(value int64) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *StorageVersionApplyConfiguration) WithLabels(entries map[string]string) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *StorageVersionApplyConfiguration) WithAnnotations(entries map[string]string) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *StorageVersionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *StorageVersionApplyConfiguration) WithFinalizers(values ...string) *StorageVersionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *StorageVersionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithSpec(value v1alpha1.StorageVersionSpec) *StorageVersionApplyConfiguration { b.Spec = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StorageVersionApplyConfiguration) WithStatus(value *StorageVersionStatusApplyConfiguration) *StorageVersionApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *StorageVersionApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } storageversioncondition.go000066400000000000000000000105601472614177300351050ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apiserverinternal/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // StorageVersionConditionApplyConfiguration represents a declarative configuration of the StorageVersionCondition type for use // with apply. type StorageVersionConditionApplyConfiguration struct { Type *v1alpha1.StorageVersionConditionType `json:"type,omitempty"` Status *v1alpha1.ConditionStatus `json:"status,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // StorageVersionConditionApplyConfiguration constructs a declarative configuration of the StorageVersionCondition type for use with // apply. func StorageVersionCondition() *StorageVersionConditionApplyConfiguration { return &StorageVersionConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *StorageVersionConditionApplyConfiguration) WithType(value v1alpha1.StorageVersionConditionType) *StorageVersionConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StorageVersionConditionApplyConfiguration) WithStatus(value v1alpha1.ConditionStatus) *StorageVersionConditionApplyConfiguration { b.Status = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *StorageVersionConditionApplyConfiguration) WithObservedGeneration(value int64) *StorageVersionConditionApplyConfiguration { b.ObservedGeneration = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *StorageVersionConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *StorageVersionConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *StorageVersionConditionApplyConfiguration) WithReason(value string) *StorageVersionConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *StorageVersionConditionApplyConfiguration) WithMessage(value string) *StorageVersionConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apiserverinternal/v1alpha1/storageversionstatus.go000066400000000000000000000061421472614177300345220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // StorageVersionStatusApplyConfiguration represents a declarative configuration of the StorageVersionStatus type for use // with apply. type StorageVersionStatusApplyConfiguration struct { StorageVersions []ServerStorageVersionApplyConfiguration `json:"storageVersions,omitempty"` CommonEncodingVersion *string `json:"commonEncodingVersion,omitempty"` Conditions []StorageVersionConditionApplyConfiguration `json:"conditions,omitempty"` } // StorageVersionStatusApplyConfiguration constructs a declarative configuration of the StorageVersionStatus type for use with // apply. func StorageVersionStatus() *StorageVersionStatusApplyConfiguration { return &StorageVersionStatusApplyConfiguration{} } // WithStorageVersions adds the given value to the StorageVersions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the StorageVersions field. func (b *StorageVersionStatusApplyConfiguration) WithStorageVersions(values ...*ServerStorageVersionApplyConfiguration) *StorageVersionStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithStorageVersions") } b.StorageVersions = append(b.StorageVersions, *values[i]) } return b } // WithCommonEncodingVersion sets the CommonEncodingVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CommonEncodingVersion field is set to the value of the last call. func (b *StorageVersionStatusApplyConfiguration) WithCommonEncodingVersion(value string) *StorageVersionStatusApplyConfiguration { b.CommonEncodingVersion = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *StorageVersionStatusApplyConfiguration) WithConditions(values ...*StorageVersionConditionApplyConfiguration) *StorageVersionStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/000077500000000000000000000000001472614177300234435ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/000077500000000000000000000000001472614177300237715ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/controllerrevision.go000066400000000000000000000316201472614177300302640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ControllerRevisionApplyConfiguration represents a declarative configuration of the ControllerRevision type for use // with apply. type ControllerRevisionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Data *runtime.RawExtension `json:"data,omitempty"` Revision *int64 `json:"revision,omitempty"` } // ControllerRevision constructs a declarative configuration of the ControllerRevision type for use with // apply. func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfiguration { b := &ControllerRevisionApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ControllerRevision") b.WithAPIVersion("apps/v1") return b } // ExtractControllerRevision extracts the applied configuration owned by fieldManager from // controllerRevision. If no managedFields are found in controllerRevision for fieldManager, a // ControllerRevisionApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // controllerRevision must be a unmodified ControllerRevision API object that was retrieved from the Kubernetes API. // ExtractControllerRevision provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractControllerRevision(controllerRevision *appsv1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { return extractControllerRevision(controllerRevision, fieldManager, "") } // ExtractControllerRevisionStatus is the same as ExtractControllerRevision except // that it extracts the status subresource applied configuration. // Experimental! func ExtractControllerRevisionStatus(controllerRevision *appsv1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { return extractControllerRevision(controllerRevision, fieldManager, "status") } func extractControllerRevision(controllerRevision *appsv1.ControllerRevision, fieldManager string, subresource string) (*ControllerRevisionApplyConfiguration, error) { b := &ControllerRevisionApplyConfiguration{} err := managedfields.ExtractInto(controllerRevision, internal.Parser().Type("io.k8s.api.apps.v1.ControllerRevision"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(controllerRevision.Name) b.WithNamespace(controllerRevision.Namespace) b.WithKind("ControllerRevision") b.WithAPIVersion("apps/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithKind(value string) *ControllerRevisionApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithAPIVersion(value string) *ControllerRevisionApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithName(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithGenerateName(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithNamespace(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithUID(value types.UID) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithResourceVersion(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithGeneration(value int64) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ControllerRevisionApplyConfiguration) WithLabels(entries map[string]string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ControllerRevisionApplyConfiguration) WithAnnotations(entries map[string]string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ControllerRevisionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ControllerRevisionApplyConfiguration) WithFinalizers(values ...string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ControllerRevisionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithData sets the Data field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Data field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithData(value runtime.RawExtension) *ControllerRevisionApplyConfiguration { b.Data = &value return b } // WithRevision sets the Revision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Revision field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithRevision(value int64) *ControllerRevisionApplyConfiguration { b.Revision = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ControllerRevisionApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/daemonset.go000066400000000000000000000303721472614177300263040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiappsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DaemonSetApplyConfiguration represents a declarative configuration of the DaemonSet type for use // with apply. type DaemonSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *DaemonSetSpecApplyConfiguration `json:"spec,omitempty"` Status *DaemonSetStatusApplyConfiguration `json:"status,omitempty"` } // DaemonSet constructs a declarative configuration of the DaemonSet type for use with // apply. func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration { b := &DaemonSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("DaemonSet") b.WithAPIVersion("apps/v1") return b } // ExtractDaemonSet extracts the applied configuration owned by fieldManager from // daemonSet. If no managedFields are found in daemonSet for fieldManager, a // DaemonSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // daemonSet must be a unmodified DaemonSet API object that was retrieved from the Kubernetes API. // ExtractDaemonSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractDaemonSet(daemonSet *apiappsv1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { return extractDaemonSet(daemonSet, fieldManager, "") } // ExtractDaemonSetStatus is the same as ExtractDaemonSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractDaemonSetStatus(daemonSet *apiappsv1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { return extractDaemonSet(daemonSet, fieldManager, "status") } func extractDaemonSet(daemonSet *apiappsv1.DaemonSet, fieldManager string, subresource string) (*DaemonSetApplyConfiguration, error) { b := &DaemonSetApplyConfiguration{} err := managedfields.ExtractInto(daemonSet, internal.Parser().Type("io.k8s.api.apps.v1.DaemonSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(daemonSet.Name) b.WithNamespace(daemonSet.Namespace) b.WithKind("DaemonSet") b.WithAPIVersion("apps/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithKind(value string) *DaemonSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithAPIVersion(value string) *DaemonSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithName(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithGenerateName(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithNamespace(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithUID(value types.UID) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithResourceVersion(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithGeneration(value int64) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *DaemonSetApplyConfiguration) WithLabels(entries map[string]string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *DaemonSetApplyConfiguration) WithAnnotations(entries map[string]string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *DaemonSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *DaemonSetApplyConfiguration) WithFinalizers(values ...string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *DaemonSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithSpec(value *DaemonSetSpecApplyConfiguration) *DaemonSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithStatus(value *DaemonSetStatusApplyConfiguration) *DaemonSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *DaemonSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/daemonsetcondition.go000066400000000000000000000072241472614177300302130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DaemonSetConditionApplyConfiguration represents a declarative configuration of the DaemonSetCondition type for use // with apply. type DaemonSetConditionApplyConfiguration struct { Type *v1.DaemonSetConditionType `json:"type,omitempty"` Status *corev1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // DaemonSetConditionApplyConfiguration constructs a declarative configuration of the DaemonSetCondition type for use with // apply. func DaemonSetCondition() *DaemonSetConditionApplyConfiguration { return &DaemonSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithType(value v1.DaemonSetConditionType) *DaemonSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *DaemonSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DaemonSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithReason(value string) *DaemonSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithMessage(value string) *DaemonSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/daemonsetspec.go000066400000000000000000000075401472614177300271600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DaemonSetSpecApplyConfiguration represents a declarative configuration of the DaemonSetSpec type for use // with apply. type DaemonSetSpecApplyConfiguration struct { Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` UpdateStrategy *DaemonSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` } // DaemonSetSpecApplyConfiguration constructs a declarative configuration of the DaemonSetSpec type for use with // apply. func DaemonSetSpec() *DaemonSetSpecApplyConfiguration { return &DaemonSetSpecApplyConfiguration{} } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.Template = value return b } // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateStrategy field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithUpdateStrategy(value *DaemonSetUpdateStrategyApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.UpdateStrategy = value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *DaemonSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DaemonSetSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/daemonsetstatus.go000066400000000000000000000153031472614177300275450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // DaemonSetStatusApplyConfiguration represents a declarative configuration of the DaemonSetStatus type for use // with apply. type DaemonSetStatusApplyConfiguration struct { CurrentNumberScheduled *int32 `json:"currentNumberScheduled,omitempty"` NumberMisscheduled *int32 `json:"numberMisscheduled,omitempty"` DesiredNumberScheduled *int32 `json:"desiredNumberScheduled,omitempty"` NumberReady *int32 `json:"numberReady,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` UpdatedNumberScheduled *int32 `json:"updatedNumberScheduled,omitempty"` NumberAvailable *int32 `json:"numberAvailable,omitempty"` NumberUnavailable *int32 `json:"numberUnavailable,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []DaemonSetConditionApplyConfiguration `json:"conditions,omitempty"` } // DaemonSetStatusApplyConfiguration constructs a declarative configuration of the DaemonSetStatus type for use with // apply. func DaemonSetStatus() *DaemonSetStatusApplyConfiguration { return &DaemonSetStatusApplyConfiguration{} } // WithCurrentNumberScheduled sets the CurrentNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithCurrentNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.CurrentNumberScheduled = &value return b } // WithNumberMisscheduled sets the NumberMisscheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberMisscheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberMisscheduled(value int32) *DaemonSetStatusApplyConfiguration { b.NumberMisscheduled = &value return b } // WithDesiredNumberScheduled sets the DesiredNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithDesiredNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.DesiredNumberScheduled = &value return b } // WithNumberReady sets the NumberReady field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberReady field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberReady(value int32) *DaemonSetStatusApplyConfiguration { b.NumberReady = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithObservedGeneration(value int64) *DaemonSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithUpdatedNumberScheduled sets the UpdatedNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithUpdatedNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.UpdatedNumberScheduled = &value return b } // WithNumberAvailable sets the NumberAvailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberAvailable field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberAvailable(value int32) *DaemonSetStatusApplyConfiguration { b.NumberAvailable = &value return b } // WithNumberUnavailable sets the NumberUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberUnavailable field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberUnavailable(value int32) *DaemonSetStatusApplyConfiguration { b.NumberUnavailable = &value return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithCollisionCount(value int32) *DaemonSetStatusApplyConfiguration { b.CollisionCount = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *DaemonSetStatusApplyConfiguration) WithConditions(values ...*DaemonSetConditionApplyConfiguration) *DaemonSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/daemonsetupdatestrategy.go000066400000000000000000000043161472614177300312710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" ) // DaemonSetUpdateStrategyApplyConfiguration represents a declarative configuration of the DaemonSetUpdateStrategy type for use // with apply. type DaemonSetUpdateStrategyApplyConfiguration struct { Type *v1.DaemonSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDaemonSetApplyConfiguration `json:"rollingUpdate,omitempty"` } // DaemonSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the DaemonSetUpdateStrategy type for use with // apply. func DaemonSetUpdateStrategy() *DaemonSetUpdateStrategyApplyConfiguration { return &DaemonSetUpdateStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DaemonSetUpdateStrategyApplyConfiguration) WithType(value v1.DaemonSetUpdateStrategyType) *DaemonSetUpdateStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *DaemonSetUpdateStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDaemonSetApplyConfiguration) *DaemonSetUpdateStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/deployment.go000066400000000000000000000305121472614177300265010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiappsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use // with apply. type DeploymentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *DeploymentSpecApplyConfiguration `json:"spec,omitempty"` Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"` } // Deployment constructs a declarative configuration of the Deployment type for use with // apply. func Deployment(name, namespace string) *DeploymentApplyConfiguration { b := &DeploymentApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Deployment") b.WithAPIVersion("apps/v1") return b } // ExtractDeployment extracts the applied configuration owned by fieldManager from // deployment. If no managedFields are found in deployment for fieldManager, a // DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API. // ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractDeployment(deployment *apiappsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { return extractDeployment(deployment, fieldManager, "") } // ExtractDeploymentStatus is the same as ExtractDeployment except // that it extracts the status subresource applied configuration. // Experimental! func ExtractDeploymentStatus(deployment *apiappsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { return extractDeployment(deployment, fieldManager, "status") } func extractDeployment(deployment *apiappsv1.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) { b := &DeploymentApplyConfiguration{} err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.apps.v1.Deployment"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(deployment.Name) b.WithNamespace(deployment.Namespace) b.WithKind("Deployment") b.WithAPIVersion("apps/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithKind(value string) *DeploymentApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithAPIVersion(value string) *DeploymentApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithName(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithGenerateName(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithNamespace(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithUID(value types.UID) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithResourceVersion(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithGeneration(value int64) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *DeploymentApplyConfiguration) WithLabels(entries map[string]string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *DeploymentApplyConfiguration) WithAnnotations(entries map[string]string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *DeploymentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *DeploymentApplyConfiguration) WithFinalizers(values ...string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *DeploymentApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithSpec(value *DeploymentSpecApplyConfiguration) *DeploymentApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyConfiguration) *DeploymentApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *DeploymentApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/deploymentcondition.go000066400000000000000000000103141472614177300304060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use // with apply. type DeploymentConditionApplyConfiguration struct { Type *v1.DeploymentConditionType `json:"type,omitempty"` Status *corev1.ConditionStatus `json:"status,omitempty"` LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with // apply. func DeploymentCondition() *DeploymentConditionApplyConfiguration { return &DeploymentConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithType(value v1.DeploymentConditionType) *DeploymentConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *DeploymentConditionApplyConfiguration { b.Status = &value return b } // WithLastUpdateTime sets the LastUpdateTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastUpdateTime field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *DeploymentConditionApplyConfiguration { b.LastUpdateTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DeploymentConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithReason(value string) *DeploymentConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithMessage(value string) *DeploymentConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/deploymentspec.go000066400000000000000000000126351472614177300273620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use // with apply. type DeploymentSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` Strategy *DeploymentStrategyApplyConfiguration `json:"strategy,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` Paused *bool `json:"paused,omitempty"` ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } // DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with // apply. func DeploymentSpec() *DeploymentSpecApplyConfiguration { return &DeploymentSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithReplicas(value int32) *DeploymentSpecApplyConfiguration { b.Replicas = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Template = value return b } // WithStrategy sets the Strategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Strategy field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithStrategy(value *DeploymentStrategyApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Strategy = value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithMinReadySeconds(value int32) *DeploymentSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DeploymentSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } // WithPaused sets the Paused field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Paused field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithPaused(value bool) *DeploymentSpecApplyConfiguration { b.Paused = &value return b } // WithProgressDeadlineSeconds sets the ProgressDeadlineSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProgressDeadlineSeconds field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithProgressDeadlineSeconds(value int32) *DeploymentSpecApplyConfiguration { b.ProgressDeadlineSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/deploymentstatus.go000066400000000000000000000127501472614177300277510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use // with apply. type DeploymentStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Replicas *int32 `json:"replicas,omitempty"` UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } // DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with // apply. func DeploymentStatus() *DeploymentStatusApplyConfiguration { return &DeploymentStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithObservedGeneration(value int64) *DeploymentStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithReplicas(value int32) *DeploymentStatusApplyConfiguration { b.Replicas = &value return b } // WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithUpdatedReplicas(value int32) *DeploymentStatusApplyConfiguration { b.UpdatedReplicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithReadyReplicas(value int32) *DeploymentStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithAvailableReplicas(value int32) *DeploymentStatusApplyConfiguration { b.AvailableReplicas = &value return b } // WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UnavailableReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32) *DeploymentStatusApplyConfiguration { b.UnavailableReplicas = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *DeploymentStatusApplyConfiguration) WithConditions(values ...*DeploymentConditionApplyConfiguration) *DeploymentStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithCollisionCount(value int32) *DeploymentStatusApplyConfiguration { b.CollisionCount = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/deploymentstrategy.go000066400000000000000000000042201472614177300302610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" ) // DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use // with apply. type DeploymentStrategyApplyConfiguration struct { Type *v1.DeploymentStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"` } // DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with // apply. func DeploymentStrategy() *DeploymentStrategyApplyConfiguration { return &DeploymentStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DeploymentStrategyApplyConfiguration) WithType(value v1.DeploymentStrategyType) *DeploymentStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *DeploymentStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDeploymentApplyConfiguration) *DeploymentStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/replicaset.go000066400000000000000000000305121472614177300264540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiappsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ReplicaSetApplyConfiguration represents a declarative configuration of the ReplicaSet type for use // with apply. type ReplicaSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ReplicaSetSpecApplyConfiguration `json:"spec,omitempty"` Status *ReplicaSetStatusApplyConfiguration `json:"status,omitempty"` } // ReplicaSet constructs a declarative configuration of the ReplicaSet type for use with // apply. func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { b := &ReplicaSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ReplicaSet") b.WithAPIVersion("apps/v1") return b } // ExtractReplicaSet extracts the applied configuration owned by fieldManager from // replicaSet. If no managedFields are found in replicaSet for fieldManager, a // ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API. // ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractReplicaSet(replicaSet *apiappsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { return extractReplicaSet(replicaSet, fieldManager, "") } // ExtractReplicaSetStatus is the same as ExtractReplicaSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractReplicaSetStatus(replicaSet *apiappsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { return extractReplicaSet(replicaSet, fieldManager, "status") } func extractReplicaSet(replicaSet *apiappsv1.ReplicaSet, fieldManager string, subresource string) (*ReplicaSetApplyConfiguration, error) { b := &ReplicaSetApplyConfiguration{} err := managedfields.ExtractInto(replicaSet, internal.Parser().Type("io.k8s.api.apps.v1.ReplicaSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(replicaSet.Name) b.WithNamespace(replicaSet.Namespace) b.WithKind("ReplicaSet") b.WithAPIVersion("apps/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithKind(value string) *ReplicaSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithAPIVersion(value string) *ReplicaSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithName(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithGenerateName(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithNamespace(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithUID(value types.UID) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithResourceVersion(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithGeneration(value int64) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ReplicaSetApplyConfiguration) WithLabels(entries map[string]string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ReplicaSetApplyConfiguration) WithAnnotations(entries map[string]string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ReplicaSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ReplicaSetApplyConfiguration) WithFinalizers(values ...string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ReplicaSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithSpec(value *ReplicaSetSpecApplyConfiguration) *ReplicaSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithStatus(value *ReplicaSetStatusApplyConfiguration) *ReplicaSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ReplicaSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/replicasetcondition.go000066400000000000000000000072541472614177300303720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ReplicaSetConditionApplyConfiguration represents a declarative configuration of the ReplicaSetCondition type for use // with apply. type ReplicaSetConditionApplyConfiguration struct { Type *v1.ReplicaSetConditionType `json:"type,omitempty"` Status *corev1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // ReplicaSetConditionApplyConfiguration constructs a declarative configuration of the ReplicaSetCondition type for use with // apply. func ReplicaSetCondition() *ReplicaSetConditionApplyConfiguration { return &ReplicaSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithType(value v1.ReplicaSetConditionType) *ReplicaSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *ReplicaSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ReplicaSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithReason(value string) *ReplicaSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithMessage(value string) *ReplicaSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/replicasetspec.go000066400000000000000000000063151472614177300273330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ReplicaSetSpecApplyConfiguration represents a declarative configuration of the ReplicaSetSpec type for use // with apply. type ReplicaSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } // ReplicaSetSpecApplyConfiguration constructs a declarative configuration of the ReplicaSetSpec type for use with // apply. func ReplicaSetSpec() *ReplicaSetSpecApplyConfiguration { return &ReplicaSetSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithReplicas(value int32) *ReplicaSetSpecApplyConfiguration { b.Replicas = &value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *ReplicaSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ReplicaSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *ReplicaSetSpecApplyConfiguration { b.Template = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/replicasetstatus.go000066400000000000000000000106541472614177300277250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ReplicaSetStatusApplyConfiguration represents a declarative configuration of the ReplicaSetStatus type for use // with apply. type ReplicaSetStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } // ReplicaSetStatusApplyConfiguration constructs a declarative configuration of the ReplicaSetStatus type for use with // apply. func ReplicaSetStatus() *ReplicaSetStatusApplyConfiguration { return &ReplicaSetStatusApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.Replicas = &value return b } // WithFullyLabeledReplicas sets the FullyLabeledReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FullyLabeledReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.FullyLabeledReplicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithReadyReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.AvailableReplicas = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithObservedGeneration(value int64) *ReplicaSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ReplicaSetStatusApplyConfiguration) WithConditions(values ...*ReplicaSetConditionApplyConfiguration) *ReplicaSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/rollingupdatedaemonset.go000066400000000000000000000042511472614177300310730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateDaemonSetApplyConfiguration represents a declarative configuration of the RollingUpdateDaemonSet type for use // with apply. type RollingUpdateDaemonSetApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } // RollingUpdateDaemonSetApplyConfiguration constructs a declarative configuration of the RollingUpdateDaemonSet type for use with // apply. func RollingUpdateDaemonSet() *RollingUpdateDaemonSetApplyConfiguration { return &RollingUpdateDaemonSetApplyConfiguration{} } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateDaemonSetApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateDaemonSetApplyConfiguration { b.MaxUnavailable = &value return b } // WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxSurge field is set to the value of the last call. func (b *RollingUpdateDaemonSetApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *RollingUpdateDaemonSetApplyConfiguration { b.MaxSurge = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/rollingupdatedeployment.go000066400000000000000000000042651472614177300313010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use // with apply. type RollingUpdateDeploymentApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } // RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with // apply. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration { return &RollingUpdateDeploymentApplyConfiguration{} } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration { b.MaxUnavailable = &value return b } // WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxSurge field is set to the value of the last call. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration { b.MaxSurge = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go000066400000000000000000000044321472614177300332430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateStatefulSetStrategyApplyConfiguration represents a declarative configuration of the RollingUpdateStatefulSetStrategy type for use // with apply. type RollingUpdateStatefulSetStrategyApplyConfiguration struct { Partition *int32 `json:"partition,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` } // RollingUpdateStatefulSetStrategyApplyConfiguration constructs a declarative configuration of the RollingUpdateStatefulSetStrategy type for use with // apply. func RollingUpdateStatefulSetStrategy() *RollingUpdateStatefulSetStrategyApplyConfiguration { return &RollingUpdateStatefulSetStrategyApplyConfiguration{} } // WithPartition sets the Partition field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Partition field is set to the value of the last call. func (b *RollingUpdateStatefulSetStrategyApplyConfiguration) WithPartition(value int32) *RollingUpdateStatefulSetStrategyApplyConfiguration { b.Partition = &value return b } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateStatefulSetStrategyApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateStatefulSetStrategyApplyConfiguration { b.MaxUnavailable = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/statefulset.go000066400000000000000000000306321472614177300266670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiappsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StatefulSetApplyConfiguration represents a declarative configuration of the StatefulSet type for use // with apply. type StatefulSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *StatefulSetSpecApplyConfiguration `json:"spec,omitempty"` Status *StatefulSetStatusApplyConfiguration `json:"status,omitempty"` } // StatefulSet constructs a declarative configuration of the StatefulSet type for use with // apply. func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { b := &StatefulSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("StatefulSet") b.WithAPIVersion("apps/v1") return b } // ExtractStatefulSet extracts the applied configuration owned by fieldManager from // statefulSet. If no managedFields are found in statefulSet for fieldManager, a // StatefulSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // statefulSet must be a unmodified StatefulSet API object that was retrieved from the Kubernetes API. // ExtractStatefulSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractStatefulSet(statefulSet *apiappsv1.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { return extractStatefulSet(statefulSet, fieldManager, "") } // ExtractStatefulSetStatus is the same as ExtractStatefulSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractStatefulSetStatus(statefulSet *apiappsv1.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { return extractStatefulSet(statefulSet, fieldManager, "status") } func extractStatefulSet(statefulSet *apiappsv1.StatefulSet, fieldManager string, subresource string) (*StatefulSetApplyConfiguration, error) { b := &StatefulSetApplyConfiguration{} err := managedfields.ExtractInto(statefulSet, internal.Parser().Type("io.k8s.api.apps.v1.StatefulSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(statefulSet.Name) b.WithNamespace(statefulSet.Namespace) b.WithKind("StatefulSet") b.WithAPIVersion("apps/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithKind(value string) *StatefulSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithAPIVersion(value string) *StatefulSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithName(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithGenerateName(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithNamespace(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithUID(value types.UID) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithResourceVersion(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithGeneration(value int64) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *StatefulSetApplyConfiguration) WithLabels(entries map[string]string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *StatefulSetApplyConfiguration) WithAnnotations(entries map[string]string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *StatefulSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *StatefulSetApplyConfiguration) WithFinalizers(values ...string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *StatefulSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithSpec(value *StatefulSetSpecApplyConfiguration) *StatefulSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithStatus(value *StatefulSetStatusApplyConfiguration) *StatefulSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *StatefulSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/statefulsetcondition.go000066400000000000000000000073041472614177300305760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // StatefulSetConditionApplyConfiguration represents a declarative configuration of the StatefulSetCondition type for use // with apply. type StatefulSetConditionApplyConfiguration struct { Type *v1.StatefulSetConditionType `json:"type,omitempty"` Status *corev1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // StatefulSetConditionApplyConfiguration constructs a declarative configuration of the StatefulSetCondition type for use with // apply. func StatefulSetCondition() *StatefulSetConditionApplyConfiguration { return &StatefulSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithType(value v1.StatefulSetConditionType) *StatefulSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *StatefulSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *StatefulSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithReason(value string) *StatefulSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithMessage(value string) *StatefulSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/statefulsetordinals.go000066400000000000000000000027731472614177300304300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // StatefulSetOrdinalsApplyConfiguration represents a declarative configuration of the StatefulSetOrdinals type for use // with apply. type StatefulSetOrdinalsApplyConfiguration struct { Start *int32 `json:"start,omitempty"` } // StatefulSetOrdinalsApplyConfiguration constructs a declarative configuration of the StatefulSetOrdinals type for use with // apply. func StatefulSetOrdinals() *StatefulSetOrdinalsApplyConfiguration { return &StatefulSetOrdinalsApplyConfiguration{} } // WithStart sets the Start field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Start field is set to the value of the last call. func (b *StatefulSetOrdinalsApplyConfiguration) WithStart(value int32) *StatefulSetOrdinalsApplyConfiguration { b.Start = &value return b } statefulsetpersistentvolumeclaimretentionpolicy.go000066400000000000000000000050301472614177300363310ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" ) // StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use // with apply. type StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration struct { WhenDeleted *v1.PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty"` WhenScaled *v1.PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty"` } // StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with // apply. func StatefulSetPersistentVolumeClaimRetentionPolicy() *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { return &StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} } // WithWhenDeleted sets the WhenDeleted field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WhenDeleted field is set to the value of the last call. func (b *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) WithWhenDeleted(value v1.PersistentVolumeClaimRetentionPolicyType) *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { b.WhenDeleted = &value return b } // WithWhenScaled sets the WhenScaled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WhenScaled field is set to the value of the last call. func (b *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) WithWhenScaled(value v1.PersistentVolumeClaimRetentionPolicyType) *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { b.WhenScaled = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/statefulsetspec.go000066400000000000000000000177371472614177300275550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StatefulSetSpecApplyConfiguration represents a declarative configuration of the StatefulSetSpec type for use // with apply. type StatefulSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` VolumeClaimTemplates []corev1.PersistentVolumeClaimApplyConfiguration `json:"volumeClaimTemplates,omitempty"` ServiceName *string `json:"serviceName,omitempty"` PodManagementPolicy *appsv1.PodManagementPolicyType `json:"podManagementPolicy,omitempty"` UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` PersistentVolumeClaimRetentionPolicy *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration `json:"persistentVolumeClaimRetentionPolicy,omitempty"` Ordinals *StatefulSetOrdinalsApplyConfiguration `json:"ordinals,omitempty"` } // StatefulSetSpecApplyConfiguration constructs a declarative configuration of the StatefulSetSpec type for use with // apply. func StatefulSetSpec() *StatefulSetSpecApplyConfiguration { return &StatefulSetSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithReplicas(value int32) *StatefulSetSpecApplyConfiguration { b.Replicas = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Template = value return b } // WithVolumeClaimTemplates adds the given value to the VolumeClaimTemplates field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeClaimTemplates field. func (b *StatefulSetSpecApplyConfiguration) WithVolumeClaimTemplates(values ...*corev1.PersistentVolumeClaimApplyConfiguration) *StatefulSetSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeClaimTemplates") } b.VolumeClaimTemplates = append(b.VolumeClaimTemplates, *values[i]) } return b } // WithServiceName sets the ServiceName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceName field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithServiceName(value string) *StatefulSetSpecApplyConfiguration { b.ServiceName = &value return b } // WithPodManagementPolicy sets the PodManagementPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodManagementPolicy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithPodManagementPolicy(value appsv1.PodManagementPolicyType) *StatefulSetSpecApplyConfiguration { b.PodManagementPolicy = &value return b } // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateStrategy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithUpdateStrategy(value *StatefulSetUpdateStrategyApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.UpdateStrategy = value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *StatefulSetSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithPersistentVolumeClaimRetentionPolicy sets the PersistentVolumeClaimRetentionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeClaimRetentionPolicy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithPersistentVolumeClaimRetentionPolicy(value *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.PersistentVolumeClaimRetentionPolicy = value return b } // WithOrdinals sets the Ordinals field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ordinals field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithOrdinals(value *StatefulSetOrdinalsApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Ordinals = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/statefulsetstatus.go000066400000000000000000000150671472614177300301400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // StatefulSetStatusApplyConfiguration represents a declarative configuration of the StatefulSetStatus type for use // with apply. type StatefulSetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Replicas *int32 `json:"replicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` CurrentReplicas *int32 `json:"currentReplicas,omitempty"` UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` CurrentRevision *string `json:"currentRevision,omitempty"` UpdateRevision *string `json:"updateRevision,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []StatefulSetConditionApplyConfiguration `json:"conditions,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } // StatefulSetStatusApplyConfiguration constructs a declarative configuration of the StatefulSetStatus type for use with // apply. func StatefulSetStatus() *StatefulSetStatusApplyConfiguration { return &StatefulSetStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithObservedGeneration(value int64) *StatefulSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.Replicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithReadyReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCurrentReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.CurrentReplicas = &value return b } // WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithUpdatedReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.UpdatedReplicas = &value return b } // WithCurrentRevision sets the CurrentRevision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentRevision field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCurrentRevision(value string) *StatefulSetStatusApplyConfiguration { b.CurrentRevision = &value return b } // WithUpdateRevision sets the UpdateRevision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateRevision field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithUpdateRevision(value string) *StatefulSetStatusApplyConfiguration { b.UpdateRevision = &value return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCollisionCount(value int32) *StatefulSetStatusApplyConfiguration { b.CollisionCount = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *StatefulSetStatusApplyConfiguration) WithConditions(values ...*StatefulSetConditionApplyConfiguration) *StatefulSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.AvailableReplicas = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1/statefulsetupdatestrategy.go000066400000000000000000000044061472614177300316550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" ) // StatefulSetUpdateStrategyApplyConfiguration represents a declarative configuration of the StatefulSetUpdateStrategy type for use // with apply. type StatefulSetUpdateStrategyApplyConfiguration struct { Type *v1.StatefulSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateStatefulSetStrategyApplyConfiguration `json:"rollingUpdate,omitempty"` } // StatefulSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the StatefulSetUpdateStrategy type for use with // apply. func StatefulSetUpdateStrategy() *StatefulSetUpdateStrategyApplyConfiguration { return &StatefulSetUpdateStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *StatefulSetUpdateStrategyApplyConfiguration) WithType(value v1.StatefulSetUpdateStrategyType) *StatefulSetUpdateStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *StatefulSetUpdateStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateStatefulSetStrategyApplyConfiguration) *StatefulSetUpdateStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/000077500000000000000000000000001472614177300247065ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/controllerrevision.go000066400000000000000000000316551472614177300312110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ControllerRevisionApplyConfiguration represents a declarative configuration of the ControllerRevision type for use // with apply. type ControllerRevisionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Data *runtime.RawExtension `json:"data,omitempty"` Revision *int64 `json:"revision,omitempty"` } // ControllerRevision constructs a declarative configuration of the ControllerRevision type for use with // apply. func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfiguration { b := &ControllerRevisionApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ControllerRevision") b.WithAPIVersion("apps/v1beta1") return b } // ExtractControllerRevision extracts the applied configuration owned by fieldManager from // controllerRevision. If no managedFields are found in controllerRevision for fieldManager, a // ControllerRevisionApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // controllerRevision must be a unmodified ControllerRevision API object that was retrieved from the Kubernetes API. // ExtractControllerRevision provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractControllerRevision(controllerRevision *v1beta1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { return extractControllerRevision(controllerRevision, fieldManager, "") } // ExtractControllerRevisionStatus is the same as ExtractControllerRevision except // that it extracts the status subresource applied configuration. // Experimental! func ExtractControllerRevisionStatus(controllerRevision *v1beta1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { return extractControllerRevision(controllerRevision, fieldManager, "status") } func extractControllerRevision(controllerRevision *v1beta1.ControllerRevision, fieldManager string, subresource string) (*ControllerRevisionApplyConfiguration, error) { b := &ControllerRevisionApplyConfiguration{} err := managedfields.ExtractInto(controllerRevision, internal.Parser().Type("io.k8s.api.apps.v1beta1.ControllerRevision"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(controllerRevision.Name) b.WithNamespace(controllerRevision.Namespace) b.WithKind("ControllerRevision") b.WithAPIVersion("apps/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithKind(value string) *ControllerRevisionApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithAPIVersion(value string) *ControllerRevisionApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithName(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithGenerateName(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithNamespace(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithUID(value types.UID) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithResourceVersion(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithGeneration(value int64) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ControllerRevisionApplyConfiguration) WithLabels(entries map[string]string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ControllerRevisionApplyConfiguration) WithAnnotations(entries map[string]string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ControllerRevisionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ControllerRevisionApplyConfiguration) WithFinalizers(values ...string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ControllerRevisionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithData sets the Data field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Data field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithData(value runtime.RawExtension) *ControllerRevisionApplyConfiguration { b.Data = &value return b } // WithRevision sets the Revision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Revision field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithRevision(value int64) *ControllerRevisionApplyConfiguration { b.Revision = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ControllerRevisionApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/deployment.go000066400000000000000000000305531472614177300274230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use // with apply. type DeploymentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *DeploymentSpecApplyConfiguration `json:"spec,omitempty"` Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"` } // Deployment constructs a declarative configuration of the Deployment type for use with // apply. func Deployment(name, namespace string) *DeploymentApplyConfiguration { b := &DeploymentApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Deployment") b.WithAPIVersion("apps/v1beta1") return b } // ExtractDeployment extracts the applied configuration owned by fieldManager from // deployment. If no managedFields are found in deployment for fieldManager, a // DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API. // ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractDeployment(deployment *appsv1beta1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { return extractDeployment(deployment, fieldManager, "") } // ExtractDeploymentStatus is the same as ExtractDeployment except // that it extracts the status subresource applied configuration. // Experimental! func ExtractDeploymentStatus(deployment *appsv1beta1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { return extractDeployment(deployment, fieldManager, "status") } func extractDeployment(deployment *appsv1beta1.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) { b := &DeploymentApplyConfiguration{} err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.apps.v1beta1.Deployment"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(deployment.Name) b.WithNamespace(deployment.Namespace) b.WithKind("Deployment") b.WithAPIVersion("apps/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithKind(value string) *DeploymentApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithAPIVersion(value string) *DeploymentApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithName(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithGenerateName(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithNamespace(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithUID(value types.UID) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithResourceVersion(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithGeneration(value int64) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *DeploymentApplyConfiguration) WithLabels(entries map[string]string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *DeploymentApplyConfiguration) WithAnnotations(entries map[string]string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *DeploymentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *DeploymentApplyConfiguration) WithFinalizers(values ...string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *DeploymentApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithSpec(value *DeploymentSpecApplyConfiguration) *DeploymentApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyConfiguration) *DeploymentApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *DeploymentApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/deploymentcondition.go000066400000000000000000000103661472614177300313320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use // with apply. type DeploymentConditionApplyConfiguration struct { Type *v1beta1.DeploymentConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with // apply. func DeploymentCondition() *DeploymentConditionApplyConfiguration { return &DeploymentConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithType(value v1beta1.DeploymentConditionType) *DeploymentConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *DeploymentConditionApplyConfiguration { b.Status = &value return b } // WithLastUpdateTime sets the LastUpdateTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastUpdateTime field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *DeploymentConditionApplyConfiguration { b.LastUpdateTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DeploymentConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithReason(value string) *DeploymentConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithMessage(value string) *DeploymentConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/deploymentspec.go000066400000000000000000000137101472614177300302720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use // with apply. type DeploymentSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` Strategy *DeploymentStrategyApplyConfiguration `json:"strategy,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` Paused *bool `json:"paused,omitempty"` RollbackTo *RollbackConfigApplyConfiguration `json:"rollbackTo,omitempty"` ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } // DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with // apply. func DeploymentSpec() *DeploymentSpecApplyConfiguration { return &DeploymentSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithReplicas(value int32) *DeploymentSpecApplyConfiguration { b.Replicas = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Template = value return b } // WithStrategy sets the Strategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Strategy field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithStrategy(value *DeploymentStrategyApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Strategy = value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithMinReadySeconds(value int32) *DeploymentSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DeploymentSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } // WithPaused sets the Paused field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Paused field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithPaused(value bool) *DeploymentSpecApplyConfiguration { b.Paused = &value return b } // WithRollbackTo sets the RollbackTo field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollbackTo field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithRollbackTo(value *RollbackConfigApplyConfiguration) *DeploymentSpecApplyConfiguration { b.RollbackTo = value return b } // WithProgressDeadlineSeconds sets the ProgressDeadlineSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProgressDeadlineSeconds field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithProgressDeadlineSeconds(value int32) *DeploymentSpecApplyConfiguration { b.ProgressDeadlineSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/deploymentstatus.go000066400000000000000000000127551472614177300306730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use // with apply. type DeploymentStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Replicas *int32 `json:"replicas,omitempty"` UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } // DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with // apply. func DeploymentStatus() *DeploymentStatusApplyConfiguration { return &DeploymentStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithObservedGeneration(value int64) *DeploymentStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithReplicas(value int32) *DeploymentStatusApplyConfiguration { b.Replicas = &value return b } // WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithUpdatedReplicas(value int32) *DeploymentStatusApplyConfiguration { b.UpdatedReplicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithReadyReplicas(value int32) *DeploymentStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithAvailableReplicas(value int32) *DeploymentStatusApplyConfiguration { b.AvailableReplicas = &value return b } // WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UnavailableReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32) *DeploymentStatusApplyConfiguration { b.UnavailableReplicas = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *DeploymentStatusApplyConfiguration) WithConditions(values ...*DeploymentConditionApplyConfiguration) *DeploymentStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithCollisionCount(value int32) *DeploymentStatusApplyConfiguration { b.CollisionCount = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/deploymentstrategy.go000066400000000000000000000042441472614177300312040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" ) // DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use // with apply. type DeploymentStrategyApplyConfiguration struct { Type *v1beta1.DeploymentStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"` } // DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with // apply. func DeploymentStrategy() *DeploymentStrategyApplyConfiguration { return &DeploymentStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DeploymentStrategyApplyConfiguration) WithType(value v1beta1.DeploymentStrategyType) *DeploymentStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *DeploymentStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDeploymentApplyConfiguration) *DeploymentStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/rollbackconfig.go000066400000000000000000000027431472614177300302220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // RollbackConfigApplyConfiguration represents a declarative configuration of the RollbackConfig type for use // with apply. type RollbackConfigApplyConfiguration struct { Revision *int64 `json:"revision,omitempty"` } // RollbackConfigApplyConfiguration constructs a declarative configuration of the RollbackConfig type for use with // apply. func RollbackConfig() *RollbackConfigApplyConfiguration { return &RollbackConfigApplyConfiguration{} } // WithRevision sets the Revision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Revision field is set to the value of the last call. func (b *RollbackConfigApplyConfiguration) WithRevision(value int64) *RollbackConfigApplyConfiguration { b.Revision = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/rollingupdatedeployment.go000066400000000000000000000042721472614177300322140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use // with apply. type RollingUpdateDeploymentApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } // RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with // apply. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration { return &RollingUpdateDeploymentApplyConfiguration{} } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration { b.MaxUnavailable = &value return b } // WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxSurge field is set to the value of the last call. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration { b.MaxSurge = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/rollingupdatestatefulsetstrategy.go000066400000000000000000000044371472614177300341650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateStatefulSetStrategyApplyConfiguration represents a declarative configuration of the RollingUpdateStatefulSetStrategy type for use // with apply. type RollingUpdateStatefulSetStrategyApplyConfiguration struct { Partition *int32 `json:"partition,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` } // RollingUpdateStatefulSetStrategyApplyConfiguration constructs a declarative configuration of the RollingUpdateStatefulSetStrategy type for use with // apply. func RollingUpdateStatefulSetStrategy() *RollingUpdateStatefulSetStrategyApplyConfiguration { return &RollingUpdateStatefulSetStrategyApplyConfiguration{} } // WithPartition sets the Partition field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Partition field is set to the value of the last call. func (b *RollingUpdateStatefulSetStrategyApplyConfiguration) WithPartition(value int32) *RollingUpdateStatefulSetStrategyApplyConfiguration { b.Partition = &value return b } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateStatefulSetStrategyApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateStatefulSetStrategyApplyConfiguration { b.MaxUnavailable = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/statefulset.go000066400000000000000000000306731472614177300276110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StatefulSetApplyConfiguration represents a declarative configuration of the StatefulSet type for use // with apply. type StatefulSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *StatefulSetSpecApplyConfiguration `json:"spec,omitempty"` Status *StatefulSetStatusApplyConfiguration `json:"status,omitempty"` } // StatefulSet constructs a declarative configuration of the StatefulSet type for use with // apply. func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { b := &StatefulSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("StatefulSet") b.WithAPIVersion("apps/v1beta1") return b } // ExtractStatefulSet extracts the applied configuration owned by fieldManager from // statefulSet. If no managedFields are found in statefulSet for fieldManager, a // StatefulSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // statefulSet must be a unmodified StatefulSet API object that was retrieved from the Kubernetes API. // ExtractStatefulSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractStatefulSet(statefulSet *appsv1beta1.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { return extractStatefulSet(statefulSet, fieldManager, "") } // ExtractStatefulSetStatus is the same as ExtractStatefulSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractStatefulSetStatus(statefulSet *appsv1beta1.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { return extractStatefulSet(statefulSet, fieldManager, "status") } func extractStatefulSet(statefulSet *appsv1beta1.StatefulSet, fieldManager string, subresource string) (*StatefulSetApplyConfiguration, error) { b := &StatefulSetApplyConfiguration{} err := managedfields.ExtractInto(statefulSet, internal.Parser().Type("io.k8s.api.apps.v1beta1.StatefulSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(statefulSet.Name) b.WithNamespace(statefulSet.Namespace) b.WithKind("StatefulSet") b.WithAPIVersion("apps/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithKind(value string) *StatefulSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithAPIVersion(value string) *StatefulSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithName(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithGenerateName(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithNamespace(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithUID(value types.UID) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithResourceVersion(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithGeneration(value int64) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *StatefulSetApplyConfiguration) WithLabels(entries map[string]string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *StatefulSetApplyConfiguration) WithAnnotations(entries map[string]string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *StatefulSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *StatefulSetApplyConfiguration) WithFinalizers(values ...string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *StatefulSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithSpec(value *StatefulSetSpecApplyConfiguration) *StatefulSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithStatus(value *StatefulSetStatusApplyConfiguration) *StatefulSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *StatefulSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/statefulsetcondition.go000066400000000000000000000073511472614177300315150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // StatefulSetConditionApplyConfiguration represents a declarative configuration of the StatefulSetCondition type for use // with apply. type StatefulSetConditionApplyConfiguration struct { Type *v1beta1.StatefulSetConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // StatefulSetConditionApplyConfiguration constructs a declarative configuration of the StatefulSetCondition type for use with // apply. func StatefulSetCondition() *StatefulSetConditionApplyConfiguration { return &StatefulSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithType(value v1beta1.StatefulSetConditionType) *StatefulSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *StatefulSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *StatefulSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithReason(value string) *StatefulSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithMessage(value string) *StatefulSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/statefulsetordinals.go000066400000000000000000000030001472614177300313250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // StatefulSetOrdinalsApplyConfiguration represents a declarative configuration of the StatefulSetOrdinals type for use // with apply. type StatefulSetOrdinalsApplyConfiguration struct { Start *int32 `json:"start,omitempty"` } // StatefulSetOrdinalsApplyConfiguration constructs a declarative configuration of the StatefulSetOrdinals type for use with // apply. func StatefulSetOrdinals() *StatefulSetOrdinalsApplyConfiguration { return &StatefulSetOrdinalsApplyConfiguration{} } // WithStart sets the Start field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Start field is set to the value of the last call. func (b *StatefulSetOrdinalsApplyConfiguration) WithStart(value int32) *StatefulSetOrdinalsApplyConfiguration { b.Start = &value return b } statefulsetpersistentvolumeclaimretentionpolicy.go000066400000000000000000000050731472614177300372550ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" ) // StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use // with apply. type StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration struct { WhenDeleted *v1beta1.PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty"` WhenScaled *v1beta1.PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty"` } // StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with // apply. func StatefulSetPersistentVolumeClaimRetentionPolicy() *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { return &StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} } // WithWhenDeleted sets the WhenDeleted field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WhenDeleted field is set to the value of the last call. func (b *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) WithWhenDeleted(value v1beta1.PersistentVolumeClaimRetentionPolicyType) *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { b.WhenDeleted = &value return b } // WithWhenScaled sets the WhenScaled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WhenScaled field is set to the value of the last call. func (b *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) WithWhenScaled(value v1beta1.PersistentVolumeClaimRetentionPolicyType) *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { b.WhenScaled = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/statefulsetspec.go000066400000000000000000000177531472614177300304700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StatefulSetSpecApplyConfiguration represents a declarative configuration of the StatefulSetSpec type for use // with apply. type StatefulSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` VolumeClaimTemplates []corev1.PersistentVolumeClaimApplyConfiguration `json:"volumeClaimTemplates,omitempty"` ServiceName *string `json:"serviceName,omitempty"` PodManagementPolicy *v1beta1.PodManagementPolicyType `json:"podManagementPolicy,omitempty"` UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` PersistentVolumeClaimRetentionPolicy *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration `json:"persistentVolumeClaimRetentionPolicy,omitempty"` Ordinals *StatefulSetOrdinalsApplyConfiguration `json:"ordinals,omitempty"` } // StatefulSetSpecApplyConfiguration constructs a declarative configuration of the StatefulSetSpec type for use with // apply. func StatefulSetSpec() *StatefulSetSpecApplyConfiguration { return &StatefulSetSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithReplicas(value int32) *StatefulSetSpecApplyConfiguration { b.Replicas = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Template = value return b } // WithVolumeClaimTemplates adds the given value to the VolumeClaimTemplates field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeClaimTemplates field. func (b *StatefulSetSpecApplyConfiguration) WithVolumeClaimTemplates(values ...*corev1.PersistentVolumeClaimApplyConfiguration) *StatefulSetSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeClaimTemplates") } b.VolumeClaimTemplates = append(b.VolumeClaimTemplates, *values[i]) } return b } // WithServiceName sets the ServiceName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceName field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithServiceName(value string) *StatefulSetSpecApplyConfiguration { b.ServiceName = &value return b } // WithPodManagementPolicy sets the PodManagementPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodManagementPolicy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithPodManagementPolicy(value v1beta1.PodManagementPolicyType) *StatefulSetSpecApplyConfiguration { b.PodManagementPolicy = &value return b } // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateStrategy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithUpdateStrategy(value *StatefulSetUpdateStrategyApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.UpdateStrategy = value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *StatefulSetSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithPersistentVolumeClaimRetentionPolicy sets the PersistentVolumeClaimRetentionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeClaimRetentionPolicy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithPersistentVolumeClaimRetentionPolicy(value *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.PersistentVolumeClaimRetentionPolicy = value return b } // WithOrdinals sets the Ordinals field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ordinals field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithOrdinals(value *StatefulSetOrdinalsApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Ordinals = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/statefulsetstatus.go000066400000000000000000000150741472614177300310530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // StatefulSetStatusApplyConfiguration represents a declarative configuration of the StatefulSetStatus type for use // with apply. type StatefulSetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Replicas *int32 `json:"replicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` CurrentReplicas *int32 `json:"currentReplicas,omitempty"` UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` CurrentRevision *string `json:"currentRevision,omitempty"` UpdateRevision *string `json:"updateRevision,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []StatefulSetConditionApplyConfiguration `json:"conditions,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } // StatefulSetStatusApplyConfiguration constructs a declarative configuration of the StatefulSetStatus type for use with // apply. func StatefulSetStatus() *StatefulSetStatusApplyConfiguration { return &StatefulSetStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithObservedGeneration(value int64) *StatefulSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.Replicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithReadyReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCurrentReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.CurrentReplicas = &value return b } // WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithUpdatedReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.UpdatedReplicas = &value return b } // WithCurrentRevision sets the CurrentRevision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentRevision field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCurrentRevision(value string) *StatefulSetStatusApplyConfiguration { b.CurrentRevision = &value return b } // WithUpdateRevision sets the UpdateRevision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateRevision field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithUpdateRevision(value string) *StatefulSetStatusApplyConfiguration { b.UpdateRevision = &value return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCollisionCount(value int32) *StatefulSetStatusApplyConfiguration { b.CollisionCount = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *StatefulSetStatusApplyConfiguration) WithConditions(values ...*StatefulSetConditionApplyConfiguration) *StatefulSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.AvailableReplicas = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta1/statefulsetupdatestrategy.go000066400000000000000000000044321472614177300325710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" ) // StatefulSetUpdateStrategyApplyConfiguration represents a declarative configuration of the StatefulSetUpdateStrategy type for use // with apply. type StatefulSetUpdateStrategyApplyConfiguration struct { Type *v1beta1.StatefulSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateStatefulSetStrategyApplyConfiguration `json:"rollingUpdate,omitempty"` } // StatefulSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the StatefulSetUpdateStrategy type for use with // apply. func StatefulSetUpdateStrategy() *StatefulSetUpdateStrategyApplyConfiguration { return &StatefulSetUpdateStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *StatefulSetUpdateStrategyApplyConfiguration) WithType(value v1beta1.StatefulSetUpdateStrategyType) *StatefulSetUpdateStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *StatefulSetUpdateStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateStatefulSetStrategyApplyConfiguration) *StatefulSetUpdateStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/000077500000000000000000000000001472614177300247075ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/controllerrevision.go000066400000000000000000000316551472614177300312120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ControllerRevisionApplyConfiguration represents a declarative configuration of the ControllerRevision type for use // with apply. type ControllerRevisionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Data *runtime.RawExtension `json:"data,omitempty"` Revision *int64 `json:"revision,omitempty"` } // ControllerRevision constructs a declarative configuration of the ControllerRevision type for use with // apply. func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfiguration { b := &ControllerRevisionApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ControllerRevision") b.WithAPIVersion("apps/v1beta2") return b } // ExtractControllerRevision extracts the applied configuration owned by fieldManager from // controllerRevision. If no managedFields are found in controllerRevision for fieldManager, a // ControllerRevisionApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // controllerRevision must be a unmodified ControllerRevision API object that was retrieved from the Kubernetes API. // ExtractControllerRevision provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractControllerRevision(controllerRevision *v1beta2.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { return extractControllerRevision(controllerRevision, fieldManager, "") } // ExtractControllerRevisionStatus is the same as ExtractControllerRevision except // that it extracts the status subresource applied configuration. // Experimental! func ExtractControllerRevisionStatus(controllerRevision *v1beta2.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) { return extractControllerRevision(controllerRevision, fieldManager, "status") } func extractControllerRevision(controllerRevision *v1beta2.ControllerRevision, fieldManager string, subresource string) (*ControllerRevisionApplyConfiguration, error) { b := &ControllerRevisionApplyConfiguration{} err := managedfields.ExtractInto(controllerRevision, internal.Parser().Type("io.k8s.api.apps.v1beta2.ControllerRevision"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(controllerRevision.Name) b.WithNamespace(controllerRevision.Namespace) b.WithKind("ControllerRevision") b.WithAPIVersion("apps/v1beta2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithKind(value string) *ControllerRevisionApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithAPIVersion(value string) *ControllerRevisionApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithName(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithGenerateName(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithNamespace(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithUID(value types.UID) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithResourceVersion(value string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithGeneration(value int64) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ControllerRevisionApplyConfiguration) WithLabels(entries map[string]string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ControllerRevisionApplyConfiguration) WithAnnotations(entries map[string]string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ControllerRevisionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ControllerRevisionApplyConfiguration) WithFinalizers(values ...string) *ControllerRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ControllerRevisionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithData sets the Data field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Data field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithData(value runtime.RawExtension) *ControllerRevisionApplyConfiguration { b.Data = &value return b } // WithRevision sets the Revision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Revision field is set to the value of the last call. func (b *ControllerRevisionApplyConfiguration) WithRevision(value int64) *ControllerRevisionApplyConfiguration { b.Revision = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ControllerRevisionApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/daemonset.go000066400000000000000000000304331472614177300272200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DaemonSetApplyConfiguration represents a declarative configuration of the DaemonSet type for use // with apply. type DaemonSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *DaemonSetSpecApplyConfiguration `json:"spec,omitempty"` Status *DaemonSetStatusApplyConfiguration `json:"status,omitempty"` } // DaemonSet constructs a declarative configuration of the DaemonSet type for use with // apply. func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration { b := &DaemonSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("DaemonSet") b.WithAPIVersion("apps/v1beta2") return b } // ExtractDaemonSet extracts the applied configuration owned by fieldManager from // daemonSet. If no managedFields are found in daemonSet for fieldManager, a // DaemonSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // daemonSet must be a unmodified DaemonSet API object that was retrieved from the Kubernetes API. // ExtractDaemonSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractDaemonSet(daemonSet *appsv1beta2.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { return extractDaemonSet(daemonSet, fieldManager, "") } // ExtractDaemonSetStatus is the same as ExtractDaemonSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractDaemonSetStatus(daemonSet *appsv1beta2.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { return extractDaemonSet(daemonSet, fieldManager, "status") } func extractDaemonSet(daemonSet *appsv1beta2.DaemonSet, fieldManager string, subresource string) (*DaemonSetApplyConfiguration, error) { b := &DaemonSetApplyConfiguration{} err := managedfields.ExtractInto(daemonSet, internal.Parser().Type("io.k8s.api.apps.v1beta2.DaemonSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(daemonSet.Name) b.WithNamespace(daemonSet.Namespace) b.WithKind("DaemonSet") b.WithAPIVersion("apps/v1beta2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithKind(value string) *DaemonSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithAPIVersion(value string) *DaemonSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithName(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithGenerateName(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithNamespace(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithUID(value types.UID) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithResourceVersion(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithGeneration(value int64) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *DaemonSetApplyConfiguration) WithLabels(entries map[string]string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *DaemonSetApplyConfiguration) WithAnnotations(entries map[string]string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *DaemonSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *DaemonSetApplyConfiguration) WithFinalizers(values ...string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *DaemonSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithSpec(value *DaemonSetSpecApplyConfiguration) *DaemonSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithStatus(value *DaemonSetStatusApplyConfiguration) *DaemonSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *DaemonSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/daemonsetcondition.go000066400000000000000000000072711472614177300311330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DaemonSetConditionApplyConfiguration represents a declarative configuration of the DaemonSetCondition type for use // with apply. type DaemonSetConditionApplyConfiguration struct { Type *v1beta2.DaemonSetConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // DaemonSetConditionApplyConfiguration constructs a declarative configuration of the DaemonSetCondition type for use with // apply. func DaemonSetCondition() *DaemonSetConditionApplyConfiguration { return &DaemonSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithType(value v1beta2.DaemonSetConditionType) *DaemonSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *DaemonSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DaemonSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithReason(value string) *DaemonSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithMessage(value string) *DaemonSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/daemonsetspec.go000066400000000000000000000075451472614177300301030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DaemonSetSpecApplyConfiguration represents a declarative configuration of the DaemonSetSpec type for use // with apply. type DaemonSetSpecApplyConfiguration struct { Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` UpdateStrategy *DaemonSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` } // DaemonSetSpecApplyConfiguration constructs a declarative configuration of the DaemonSetSpec type for use with // apply. func DaemonSetSpec() *DaemonSetSpecApplyConfiguration { return &DaemonSetSpecApplyConfiguration{} } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.Template = value return b } // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateStrategy field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithUpdateStrategy(value *DaemonSetUpdateStrategyApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.UpdateStrategy = value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *DaemonSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DaemonSetSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/daemonsetstatus.go000066400000000000000000000153101472614177300304610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // DaemonSetStatusApplyConfiguration represents a declarative configuration of the DaemonSetStatus type for use // with apply. type DaemonSetStatusApplyConfiguration struct { CurrentNumberScheduled *int32 `json:"currentNumberScheduled,omitempty"` NumberMisscheduled *int32 `json:"numberMisscheduled,omitempty"` DesiredNumberScheduled *int32 `json:"desiredNumberScheduled,omitempty"` NumberReady *int32 `json:"numberReady,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` UpdatedNumberScheduled *int32 `json:"updatedNumberScheduled,omitempty"` NumberAvailable *int32 `json:"numberAvailable,omitempty"` NumberUnavailable *int32 `json:"numberUnavailable,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []DaemonSetConditionApplyConfiguration `json:"conditions,omitempty"` } // DaemonSetStatusApplyConfiguration constructs a declarative configuration of the DaemonSetStatus type for use with // apply. func DaemonSetStatus() *DaemonSetStatusApplyConfiguration { return &DaemonSetStatusApplyConfiguration{} } // WithCurrentNumberScheduled sets the CurrentNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithCurrentNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.CurrentNumberScheduled = &value return b } // WithNumberMisscheduled sets the NumberMisscheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberMisscheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberMisscheduled(value int32) *DaemonSetStatusApplyConfiguration { b.NumberMisscheduled = &value return b } // WithDesiredNumberScheduled sets the DesiredNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithDesiredNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.DesiredNumberScheduled = &value return b } // WithNumberReady sets the NumberReady field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberReady field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberReady(value int32) *DaemonSetStatusApplyConfiguration { b.NumberReady = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithObservedGeneration(value int64) *DaemonSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithUpdatedNumberScheduled sets the UpdatedNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithUpdatedNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.UpdatedNumberScheduled = &value return b } // WithNumberAvailable sets the NumberAvailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberAvailable field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberAvailable(value int32) *DaemonSetStatusApplyConfiguration { b.NumberAvailable = &value return b } // WithNumberUnavailable sets the NumberUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberUnavailable field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberUnavailable(value int32) *DaemonSetStatusApplyConfiguration { b.NumberUnavailable = &value return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithCollisionCount(value int32) *DaemonSetStatusApplyConfiguration { b.CollisionCount = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *DaemonSetStatusApplyConfiguration) WithConditions(values ...*DaemonSetConditionApplyConfiguration) *DaemonSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/daemonsetupdatestrategy.go000066400000000000000000000043421472614177300322060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" ) // DaemonSetUpdateStrategyApplyConfiguration represents a declarative configuration of the DaemonSetUpdateStrategy type for use // with apply. type DaemonSetUpdateStrategyApplyConfiguration struct { Type *v1beta2.DaemonSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDaemonSetApplyConfiguration `json:"rollingUpdate,omitempty"` } // DaemonSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the DaemonSetUpdateStrategy type for use with // apply. func DaemonSetUpdateStrategy() *DaemonSetUpdateStrategyApplyConfiguration { return &DaemonSetUpdateStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DaemonSetUpdateStrategyApplyConfiguration) WithType(value v1beta2.DaemonSetUpdateStrategyType) *DaemonSetUpdateStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *DaemonSetUpdateStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDaemonSetApplyConfiguration) *DaemonSetUpdateStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/deployment.go000066400000000000000000000305531472614177300274240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use // with apply. type DeploymentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *DeploymentSpecApplyConfiguration `json:"spec,omitempty"` Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"` } // Deployment constructs a declarative configuration of the Deployment type for use with // apply. func Deployment(name, namespace string) *DeploymentApplyConfiguration { b := &DeploymentApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Deployment") b.WithAPIVersion("apps/v1beta2") return b } // ExtractDeployment extracts the applied configuration owned by fieldManager from // deployment. If no managedFields are found in deployment for fieldManager, a // DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API. // ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractDeployment(deployment *appsv1beta2.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { return extractDeployment(deployment, fieldManager, "") } // ExtractDeploymentStatus is the same as ExtractDeployment except // that it extracts the status subresource applied configuration. // Experimental! func ExtractDeploymentStatus(deployment *appsv1beta2.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { return extractDeployment(deployment, fieldManager, "status") } func extractDeployment(deployment *appsv1beta2.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) { b := &DeploymentApplyConfiguration{} err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.apps.v1beta2.Deployment"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(deployment.Name) b.WithNamespace(deployment.Namespace) b.WithKind("Deployment") b.WithAPIVersion("apps/v1beta2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithKind(value string) *DeploymentApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithAPIVersion(value string) *DeploymentApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithName(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithGenerateName(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithNamespace(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithUID(value types.UID) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithResourceVersion(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithGeneration(value int64) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *DeploymentApplyConfiguration) WithLabels(entries map[string]string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *DeploymentApplyConfiguration) WithAnnotations(entries map[string]string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *DeploymentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *DeploymentApplyConfiguration) WithFinalizers(values ...string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *DeploymentApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithSpec(value *DeploymentSpecApplyConfiguration) *DeploymentApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyConfiguration) *DeploymentApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *DeploymentApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/deploymentcondition.go000066400000000000000000000103661472614177300313330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use // with apply. type DeploymentConditionApplyConfiguration struct { Type *v1beta2.DeploymentConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with // apply. func DeploymentCondition() *DeploymentConditionApplyConfiguration { return &DeploymentConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithType(value v1beta2.DeploymentConditionType) *DeploymentConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *DeploymentConditionApplyConfiguration { b.Status = &value return b } // WithLastUpdateTime sets the LastUpdateTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastUpdateTime field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *DeploymentConditionApplyConfiguration { b.LastUpdateTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DeploymentConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithReason(value string) *DeploymentConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithMessage(value string) *DeploymentConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/deploymentspec.go000066400000000000000000000126421472614177300302760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use // with apply. type DeploymentSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` Strategy *DeploymentStrategyApplyConfiguration `json:"strategy,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` Paused *bool `json:"paused,omitempty"` ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } // DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with // apply. func DeploymentSpec() *DeploymentSpecApplyConfiguration { return &DeploymentSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithReplicas(value int32) *DeploymentSpecApplyConfiguration { b.Replicas = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Template = value return b } // WithStrategy sets the Strategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Strategy field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithStrategy(value *DeploymentStrategyApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Strategy = value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithMinReadySeconds(value int32) *DeploymentSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DeploymentSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } // WithPaused sets the Paused field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Paused field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithPaused(value bool) *DeploymentSpecApplyConfiguration { b.Paused = &value return b } // WithProgressDeadlineSeconds sets the ProgressDeadlineSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProgressDeadlineSeconds field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithProgressDeadlineSeconds(value int32) *DeploymentSpecApplyConfiguration { b.ProgressDeadlineSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/deploymentstatus.go000066400000000000000000000127551472614177300306740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use // with apply. type DeploymentStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Replicas *int32 `json:"replicas,omitempty"` UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } // DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with // apply. func DeploymentStatus() *DeploymentStatusApplyConfiguration { return &DeploymentStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithObservedGeneration(value int64) *DeploymentStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithReplicas(value int32) *DeploymentStatusApplyConfiguration { b.Replicas = &value return b } // WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithUpdatedReplicas(value int32) *DeploymentStatusApplyConfiguration { b.UpdatedReplicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithReadyReplicas(value int32) *DeploymentStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithAvailableReplicas(value int32) *DeploymentStatusApplyConfiguration { b.AvailableReplicas = &value return b } // WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UnavailableReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32) *DeploymentStatusApplyConfiguration { b.UnavailableReplicas = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *DeploymentStatusApplyConfiguration) WithConditions(values ...*DeploymentConditionApplyConfiguration) *DeploymentStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithCollisionCount(value int32) *DeploymentStatusApplyConfiguration { b.CollisionCount = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/deploymentstrategy.go000066400000000000000000000042441472614177300312050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" ) // DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use // with apply. type DeploymentStrategyApplyConfiguration struct { Type *v1beta2.DeploymentStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"` } // DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with // apply. func DeploymentStrategy() *DeploymentStrategyApplyConfiguration { return &DeploymentStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DeploymentStrategyApplyConfiguration) WithType(value v1beta2.DeploymentStrategyType) *DeploymentStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *DeploymentStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDeploymentApplyConfiguration) *DeploymentStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/replicaset.go000066400000000000000000000305531472614177300273770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ReplicaSetApplyConfiguration represents a declarative configuration of the ReplicaSet type for use // with apply. type ReplicaSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ReplicaSetSpecApplyConfiguration `json:"spec,omitempty"` Status *ReplicaSetStatusApplyConfiguration `json:"status,omitempty"` } // ReplicaSet constructs a declarative configuration of the ReplicaSet type for use with // apply. func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { b := &ReplicaSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ReplicaSet") b.WithAPIVersion("apps/v1beta2") return b } // ExtractReplicaSet extracts the applied configuration owned by fieldManager from // replicaSet. If no managedFields are found in replicaSet for fieldManager, a // ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API. // ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractReplicaSet(replicaSet *appsv1beta2.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { return extractReplicaSet(replicaSet, fieldManager, "") } // ExtractReplicaSetStatus is the same as ExtractReplicaSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractReplicaSetStatus(replicaSet *appsv1beta2.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { return extractReplicaSet(replicaSet, fieldManager, "status") } func extractReplicaSet(replicaSet *appsv1beta2.ReplicaSet, fieldManager string, subresource string) (*ReplicaSetApplyConfiguration, error) { b := &ReplicaSetApplyConfiguration{} err := managedfields.ExtractInto(replicaSet, internal.Parser().Type("io.k8s.api.apps.v1beta2.ReplicaSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(replicaSet.Name) b.WithNamespace(replicaSet.Namespace) b.WithKind("ReplicaSet") b.WithAPIVersion("apps/v1beta2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithKind(value string) *ReplicaSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithAPIVersion(value string) *ReplicaSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithName(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithGenerateName(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithNamespace(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithUID(value types.UID) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithResourceVersion(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithGeneration(value int64) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ReplicaSetApplyConfiguration) WithLabels(entries map[string]string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ReplicaSetApplyConfiguration) WithAnnotations(entries map[string]string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ReplicaSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ReplicaSetApplyConfiguration) WithFinalizers(values ...string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ReplicaSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithSpec(value *ReplicaSetSpecApplyConfiguration) *ReplicaSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithStatus(value *ReplicaSetStatusApplyConfiguration) *ReplicaSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ReplicaSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/replicasetcondition.go000066400000000000000000000073211472614177300313030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ReplicaSetConditionApplyConfiguration represents a declarative configuration of the ReplicaSetCondition type for use // with apply. type ReplicaSetConditionApplyConfiguration struct { Type *v1beta2.ReplicaSetConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // ReplicaSetConditionApplyConfiguration constructs a declarative configuration of the ReplicaSetCondition type for use with // apply. func ReplicaSetCondition() *ReplicaSetConditionApplyConfiguration { return &ReplicaSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithType(value v1beta2.ReplicaSetConditionType) *ReplicaSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ReplicaSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ReplicaSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithReason(value string) *ReplicaSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithMessage(value string) *ReplicaSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/replicasetspec.go000066400000000000000000000063221472614177300302470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ReplicaSetSpecApplyConfiguration represents a declarative configuration of the ReplicaSetSpec type for use // with apply. type ReplicaSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } // ReplicaSetSpecApplyConfiguration constructs a declarative configuration of the ReplicaSetSpec type for use with // apply. func ReplicaSetSpec() *ReplicaSetSpecApplyConfiguration { return &ReplicaSetSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithReplicas(value int32) *ReplicaSetSpecApplyConfiguration { b.Replicas = &value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *ReplicaSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ReplicaSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *ReplicaSetSpecApplyConfiguration { b.Template = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/replicasetstatus.go000066400000000000000000000106611472614177300306410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // ReplicaSetStatusApplyConfiguration represents a declarative configuration of the ReplicaSetStatus type for use // with apply. type ReplicaSetStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } // ReplicaSetStatusApplyConfiguration constructs a declarative configuration of the ReplicaSetStatus type for use with // apply. func ReplicaSetStatus() *ReplicaSetStatusApplyConfiguration { return &ReplicaSetStatusApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.Replicas = &value return b } // WithFullyLabeledReplicas sets the FullyLabeledReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FullyLabeledReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.FullyLabeledReplicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithReadyReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.AvailableReplicas = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithObservedGeneration(value int64) *ReplicaSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ReplicaSetStatusApplyConfiguration) WithConditions(values ...*ReplicaSetConditionApplyConfiguration) *ReplicaSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/rollingupdatedaemonset.go000066400000000000000000000042561472614177300320160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateDaemonSetApplyConfiguration represents a declarative configuration of the RollingUpdateDaemonSet type for use // with apply. type RollingUpdateDaemonSetApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } // RollingUpdateDaemonSetApplyConfiguration constructs a declarative configuration of the RollingUpdateDaemonSet type for use with // apply. func RollingUpdateDaemonSet() *RollingUpdateDaemonSetApplyConfiguration { return &RollingUpdateDaemonSetApplyConfiguration{} } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateDaemonSetApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateDaemonSetApplyConfiguration { b.MaxUnavailable = &value return b } // WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxSurge field is set to the value of the last call. func (b *RollingUpdateDaemonSetApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *RollingUpdateDaemonSetApplyConfiguration { b.MaxSurge = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/rollingupdatedeployment.go000066400000000000000000000042721472614177300322150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use // with apply. type RollingUpdateDeploymentApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } // RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with // apply. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration { return &RollingUpdateDeploymentApplyConfiguration{} } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration { b.MaxUnavailable = &value return b } // WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxSurge field is set to the value of the last call. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration { b.MaxSurge = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/rollingupdatestatefulsetstrategy.go000066400000000000000000000044371472614177300341660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateStatefulSetStrategyApplyConfiguration represents a declarative configuration of the RollingUpdateStatefulSetStrategy type for use // with apply. type RollingUpdateStatefulSetStrategyApplyConfiguration struct { Partition *int32 `json:"partition,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` } // RollingUpdateStatefulSetStrategyApplyConfiguration constructs a declarative configuration of the RollingUpdateStatefulSetStrategy type for use with // apply. func RollingUpdateStatefulSetStrategy() *RollingUpdateStatefulSetStrategyApplyConfiguration { return &RollingUpdateStatefulSetStrategyApplyConfiguration{} } // WithPartition sets the Partition field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Partition field is set to the value of the last call. func (b *RollingUpdateStatefulSetStrategyApplyConfiguration) WithPartition(value int32) *RollingUpdateStatefulSetStrategyApplyConfiguration { b.Partition = &value return b } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateStatefulSetStrategyApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateStatefulSetStrategyApplyConfiguration { b.MaxUnavailable = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/scale.go000066400000000000000000000240041472614177300263250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ScaleApplyConfiguration represents a declarative configuration of the Scale type for use // with apply. type ScaleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *v1beta2.ScaleSpec `json:"spec,omitempty"` Status *v1beta2.ScaleStatus `json:"status,omitempty"` } // ScaleApplyConfiguration constructs a declarative configuration of the Scale type for use with // apply. func Scale() *ScaleApplyConfiguration { b := &ScaleApplyConfiguration{} b.WithKind("Scale") b.WithAPIVersion("apps/v1beta2") return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithSpec(value v1beta2.ScaleSpec) *ScaleApplyConfiguration { b.Spec = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithStatus(value v1beta2.ScaleStatus) *ScaleApplyConfiguration { b.Status = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ScaleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/statefulset.go000066400000000000000000000306731472614177300276120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StatefulSetApplyConfiguration represents a declarative configuration of the StatefulSet type for use // with apply. type StatefulSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *StatefulSetSpecApplyConfiguration `json:"spec,omitempty"` Status *StatefulSetStatusApplyConfiguration `json:"status,omitempty"` } // StatefulSet constructs a declarative configuration of the StatefulSet type for use with // apply. func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { b := &StatefulSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("StatefulSet") b.WithAPIVersion("apps/v1beta2") return b } // ExtractStatefulSet extracts the applied configuration owned by fieldManager from // statefulSet. If no managedFields are found in statefulSet for fieldManager, a // StatefulSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // statefulSet must be a unmodified StatefulSet API object that was retrieved from the Kubernetes API. // ExtractStatefulSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractStatefulSet(statefulSet *appsv1beta2.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { return extractStatefulSet(statefulSet, fieldManager, "") } // ExtractStatefulSetStatus is the same as ExtractStatefulSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractStatefulSetStatus(statefulSet *appsv1beta2.StatefulSet, fieldManager string) (*StatefulSetApplyConfiguration, error) { return extractStatefulSet(statefulSet, fieldManager, "status") } func extractStatefulSet(statefulSet *appsv1beta2.StatefulSet, fieldManager string, subresource string) (*StatefulSetApplyConfiguration, error) { b := &StatefulSetApplyConfiguration{} err := managedfields.ExtractInto(statefulSet, internal.Parser().Type("io.k8s.api.apps.v1beta2.StatefulSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(statefulSet.Name) b.WithNamespace(statefulSet.Namespace) b.WithKind("StatefulSet") b.WithAPIVersion("apps/v1beta2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithKind(value string) *StatefulSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithAPIVersion(value string) *StatefulSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithName(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithGenerateName(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithNamespace(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithUID(value types.UID) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithResourceVersion(value string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithGeneration(value int64) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *StatefulSetApplyConfiguration) WithLabels(entries map[string]string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *StatefulSetApplyConfiguration) WithAnnotations(entries map[string]string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *StatefulSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *StatefulSetApplyConfiguration) WithFinalizers(values ...string) *StatefulSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *StatefulSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithSpec(value *StatefulSetSpecApplyConfiguration) *StatefulSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StatefulSetApplyConfiguration) WithStatus(value *StatefulSetStatusApplyConfiguration) *StatefulSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *StatefulSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/statefulsetcondition.go000066400000000000000000000073511472614177300315160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // StatefulSetConditionApplyConfiguration represents a declarative configuration of the StatefulSetCondition type for use // with apply. type StatefulSetConditionApplyConfiguration struct { Type *v1beta2.StatefulSetConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // StatefulSetConditionApplyConfiguration constructs a declarative configuration of the StatefulSetCondition type for use with // apply. func StatefulSetCondition() *StatefulSetConditionApplyConfiguration { return &StatefulSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithType(value v1beta2.StatefulSetConditionType) *StatefulSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *StatefulSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *StatefulSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithReason(value string) *StatefulSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *StatefulSetConditionApplyConfiguration) WithMessage(value string) *StatefulSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/statefulsetordinals.go000066400000000000000000000030001472614177300313260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // StatefulSetOrdinalsApplyConfiguration represents a declarative configuration of the StatefulSetOrdinals type for use // with apply. type StatefulSetOrdinalsApplyConfiguration struct { Start *int32 `json:"start,omitempty"` } // StatefulSetOrdinalsApplyConfiguration constructs a declarative configuration of the StatefulSetOrdinals type for use with // apply. func StatefulSetOrdinals() *StatefulSetOrdinalsApplyConfiguration { return &StatefulSetOrdinalsApplyConfiguration{} } // WithStart sets the Start field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Start field is set to the value of the last call. func (b *StatefulSetOrdinalsApplyConfiguration) WithStart(value int32) *StatefulSetOrdinalsApplyConfiguration { b.Start = &value return b } statefulsetpersistentvolumeclaimretentionpolicy.go000066400000000000000000000050731472614177300372560ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" ) // StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use // with apply. type StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration struct { WhenDeleted *v1beta2.PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty"` WhenScaled *v1beta2.PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty"` } // StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with // apply. func StatefulSetPersistentVolumeClaimRetentionPolicy() *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { return &StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} } // WithWhenDeleted sets the WhenDeleted field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WhenDeleted field is set to the value of the last call. func (b *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) WithWhenDeleted(value v1beta2.PersistentVolumeClaimRetentionPolicyType) *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { b.WhenDeleted = &value return b } // WithWhenScaled sets the WhenScaled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WhenScaled field is set to the value of the last call. func (b *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) WithWhenScaled(value v1beta2.PersistentVolumeClaimRetentionPolicyType) *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { b.WhenScaled = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/statefulsetspec.go000066400000000000000000000177531472614177300304710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StatefulSetSpecApplyConfiguration represents a declarative configuration of the StatefulSetSpec type for use // with apply. type StatefulSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` VolumeClaimTemplates []corev1.PersistentVolumeClaimApplyConfiguration `json:"volumeClaimTemplates,omitempty"` ServiceName *string `json:"serviceName,omitempty"` PodManagementPolicy *v1beta2.PodManagementPolicyType `json:"podManagementPolicy,omitempty"` UpdateStrategy *StatefulSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` PersistentVolumeClaimRetentionPolicy *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration `json:"persistentVolumeClaimRetentionPolicy,omitempty"` Ordinals *StatefulSetOrdinalsApplyConfiguration `json:"ordinals,omitempty"` } // StatefulSetSpecApplyConfiguration constructs a declarative configuration of the StatefulSetSpec type for use with // apply. func StatefulSetSpec() *StatefulSetSpecApplyConfiguration { return &StatefulSetSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithReplicas(value int32) *StatefulSetSpecApplyConfiguration { b.Replicas = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Template = value return b } // WithVolumeClaimTemplates adds the given value to the VolumeClaimTemplates field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeClaimTemplates field. func (b *StatefulSetSpecApplyConfiguration) WithVolumeClaimTemplates(values ...*corev1.PersistentVolumeClaimApplyConfiguration) *StatefulSetSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeClaimTemplates") } b.VolumeClaimTemplates = append(b.VolumeClaimTemplates, *values[i]) } return b } // WithServiceName sets the ServiceName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceName field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithServiceName(value string) *StatefulSetSpecApplyConfiguration { b.ServiceName = &value return b } // WithPodManagementPolicy sets the PodManagementPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodManagementPolicy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithPodManagementPolicy(value v1beta2.PodManagementPolicyType) *StatefulSetSpecApplyConfiguration { b.PodManagementPolicy = &value return b } // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateStrategy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithUpdateStrategy(value *StatefulSetUpdateStrategyApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.UpdateStrategy = value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *StatefulSetSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *StatefulSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithPersistentVolumeClaimRetentionPolicy sets the PersistentVolumeClaimRetentionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeClaimRetentionPolicy field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithPersistentVolumeClaimRetentionPolicy(value *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.PersistentVolumeClaimRetentionPolicy = value return b } // WithOrdinals sets the Ordinals field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ordinals field is set to the value of the last call. func (b *StatefulSetSpecApplyConfiguration) WithOrdinals(value *StatefulSetOrdinalsApplyConfiguration) *StatefulSetSpecApplyConfiguration { b.Ordinals = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/statefulsetstatus.go000066400000000000000000000150741472614177300310540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // StatefulSetStatusApplyConfiguration represents a declarative configuration of the StatefulSetStatus type for use // with apply. type StatefulSetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Replicas *int32 `json:"replicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` CurrentReplicas *int32 `json:"currentReplicas,omitempty"` UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` CurrentRevision *string `json:"currentRevision,omitempty"` UpdateRevision *string `json:"updateRevision,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []StatefulSetConditionApplyConfiguration `json:"conditions,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } // StatefulSetStatusApplyConfiguration constructs a declarative configuration of the StatefulSetStatus type for use with // apply. func StatefulSetStatus() *StatefulSetStatusApplyConfiguration { return &StatefulSetStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithObservedGeneration(value int64) *StatefulSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.Replicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithReadyReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCurrentReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.CurrentReplicas = &value return b } // WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithUpdatedReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.UpdatedReplicas = &value return b } // WithCurrentRevision sets the CurrentRevision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentRevision field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCurrentRevision(value string) *StatefulSetStatusApplyConfiguration { b.CurrentRevision = &value return b } // WithUpdateRevision sets the UpdateRevision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateRevision field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithUpdateRevision(value string) *StatefulSetStatusApplyConfiguration { b.UpdateRevision = &value return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithCollisionCount(value int32) *StatefulSetStatusApplyConfiguration { b.CollisionCount = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *StatefulSetStatusApplyConfiguration) WithConditions(values ...*StatefulSetConditionApplyConfiguration) *StatefulSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *StatefulSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *StatefulSetStatusApplyConfiguration { b.AvailableReplicas = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/apps/v1beta2/statefulsetupdatestrategy.go000066400000000000000000000044321472614177300325720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" ) // StatefulSetUpdateStrategyApplyConfiguration represents a declarative configuration of the StatefulSetUpdateStrategy type for use // with apply. type StatefulSetUpdateStrategyApplyConfiguration struct { Type *v1beta2.StatefulSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateStatefulSetStrategyApplyConfiguration `json:"rollingUpdate,omitempty"` } // StatefulSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the StatefulSetUpdateStrategy type for use with // apply. func StatefulSetUpdateStrategy() *StatefulSetUpdateStrategyApplyConfiguration { return &StatefulSetUpdateStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *StatefulSetUpdateStrategyApplyConfiguration) WithType(value v1beta2.StatefulSetUpdateStrategyType) *StatefulSetUpdateStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *StatefulSetUpdateStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateStatefulSetStrategyApplyConfiguration) *StatefulSetUpdateStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/000077500000000000000000000000001472614177300250115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v1/000077500000000000000000000000001472614177300253375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v1/crossversionobjectreference.go000066400000000000000000000050261472614177300334760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CrossVersionObjectReferenceApplyConfiguration represents a declarative configuration of the CrossVersionObjectReference type for use // with apply. type CrossVersionObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` } // CrossVersionObjectReferenceApplyConfiguration constructs a declarative configuration of the CrossVersionObjectReference type for use with // apply. func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { return &CrossVersionObjectReferenceApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithKind(value string) *CrossVersionObjectReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithName(value string) *CrossVersionObjectReferenceApplyConfiguration { b.Name = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithAPIVersion(value string) *CrossVersionObjectReferenceApplyConfiguration { b.APIVersion = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go000066400000000000000000000326221472614177300326520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiautoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // HorizontalPodAutoscalerApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscaler type for use // with apply. type HorizontalPodAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *HorizontalPodAutoscalerSpecApplyConfiguration `json:"spec,omitempty"` Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` } // HorizontalPodAutoscaler constructs a declarative configuration of the HorizontalPodAutoscaler type for use with // apply. func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { b := &HorizontalPodAutoscalerApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("HorizontalPodAutoscaler") b.WithAPIVersion("autoscaling/v1") return b } // ExtractHorizontalPodAutoscaler extracts the applied configuration owned by fieldManager from // horizontalPodAutoscaler. If no managedFields are found in horizontalPodAutoscaler for fieldManager, a // HorizontalPodAutoscalerApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // horizontalPodAutoscaler must be a unmodified HorizontalPodAutoscaler API object that was retrieved from the Kubernetes API. // ExtractHorizontalPodAutoscaler provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "") } // ExtractHorizontalPodAutoscalerStatus is the same as ExtractHorizontalPodAutoscaler except // that it extracts the status subresource applied configuration. // Experimental! func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status") } func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) { b := &HorizontalPodAutoscalerApplyConfiguration{} err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v1.HorizontalPodAutoscaler"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(horizontalPodAutoscaler.Name) b.WithNamespace(horizontalPodAutoscaler.Namespace) b.WithKind("HorizontalPodAutoscaler") b.WithAPIVersion("autoscaling/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithKind(value string) *HorizontalPodAutoscalerApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithAPIVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithName(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithGenerateName(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithNamespace(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithUID(value types.UID) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithResourceVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithGeneration(value int64) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *HorizontalPodAutoscalerApplyConfiguration) WithLabels(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *HorizontalPodAutoscalerApplyConfiguration) WithAnnotations(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *HorizontalPodAutoscalerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *HorizontalPodAutoscalerApplyConfiguration) WithFinalizers(values ...string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *HorizontalPodAutoscalerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithSpec(value *HorizontalPodAutoscalerSpecApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *HorizontalPodAutoscalerStatusApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *HorizontalPodAutoscalerApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go000066400000000000000000000070011472614177300335160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // HorizontalPodAutoscalerSpecApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerSpec type for use // with apply. type HorizontalPodAutoscalerSpecApplyConfiguration struct { ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` MinReplicas *int32 `json:"minReplicas,omitempty"` MaxReplicas *int32 `json:"maxReplicas,omitempty"` TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty"` } // HorizontalPodAutoscalerSpecApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerSpec type for use with // apply. func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { return &HorizontalPodAutoscalerSpecApplyConfiguration{} } // WithScaleTargetRef sets the ScaleTargetRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleTargetRef field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithScaleTargetRef(value *CrossVersionObjectReferenceApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { b.ScaleTargetRef = value return b } // WithMinReplicas sets the MinReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMinReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.MinReplicas = &value return b } // WithMaxReplicas sets the MaxReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMaxReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.MaxReplicas = &value return b } // WithTargetCPUUtilizationPercentage sets the TargetCPUUtilizationPercentage field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetCPUUtilizationPercentage field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithTargetCPUUtilizationPercentage(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.TargetCPUUtilizationPercentage = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v1/horizontalpodautoscalerstatus.go000066400000000000000000000100161472614177300341070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // HorizontalPodAutoscalerStatusApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerStatus type for use // with apply. type HorizontalPodAutoscalerStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` LastScaleTime *v1.Time `json:"lastScaleTime,omitempty"` CurrentReplicas *int32 `json:"currentReplicas,omitempty"` DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"` } // HorizontalPodAutoscalerStatusApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerStatus type for use with // apply. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { return &HorizontalPodAutoscalerStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithObservedGeneration(value int64) *HorizontalPodAutoscalerStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithLastScaleTime sets the LastScaleTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastScaleTime field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithLastScaleTime(value v1.Time) *HorizontalPodAutoscalerStatusApplyConfiguration { b.LastScaleTime = &value return b } // WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.CurrentReplicas = &value return b } // WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithDesiredReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.DesiredReplicas = &value return b } // WithCurrentCPUUtilizationPercentage sets the CurrentCPUUtilizationPercentage field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentCPUUtilizationPercentage field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentCPUUtilizationPercentage(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.CurrentCPUUtilizationPercentage = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v1/scale.go000066400000000000000000000240061472614177300267570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ScaleApplyConfiguration represents a declarative configuration of the Scale type for use // with apply. type ScaleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ScaleSpecApplyConfiguration `json:"spec,omitempty"` Status *ScaleStatusApplyConfiguration `json:"status,omitempty"` } // ScaleApplyConfiguration constructs a declarative configuration of the Scale type for use with // apply. func Scale() *ScaleApplyConfiguration { b := &ScaleApplyConfiguration{} b.WithKind("Scale") b.WithAPIVersion("autoscaling/v1") return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithSpec(value *ScaleSpecApplyConfiguration) *ScaleApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithStatus(value *ScaleStatusApplyConfiguration) *ScaleApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ScaleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v1/scalespec.go000066400000000000000000000026541472614177300276370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ScaleSpecApplyConfiguration represents a declarative configuration of the ScaleSpec type for use // with apply. type ScaleSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` } // ScaleSpecApplyConfiguration constructs a declarative configuration of the ScaleSpec type for use with // apply. func ScaleSpec() *ScaleSpecApplyConfiguration { return &ScaleSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ScaleSpecApplyConfiguration) WithReplicas(value int32) *ScaleSpecApplyConfiguration { b.Replicas = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v1/scalestatus.go000066400000000000000000000036121472614177300302230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ScaleStatusApplyConfiguration represents a declarative configuration of the ScaleStatus type for use // with apply. type ScaleStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *string `json:"selector,omitempty"` } // ScaleStatusApplyConfiguration constructs a declarative configuration of the ScaleStatus type for use with // apply. func ScaleStatus() *ScaleStatusApplyConfiguration { return &ScaleStatusApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ScaleStatusApplyConfiguration) WithReplicas(value int32) *ScaleStatusApplyConfiguration { b.Replicas = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ScaleStatusApplyConfiguration) WithSelector(value string) *ScaleStatusApplyConfiguration { b.Selector = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/000077500000000000000000000000001472614177300253405ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/containerresourcemetricsource.go000066400000000000000000000053031472614177300340470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v1 "k8s.io/api/core/v1" ) // ContainerResourceMetricSourceApplyConfiguration represents a declarative configuration of the ContainerResourceMetricSource type for use // with apply. type ContainerResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` Container *string `json:"container,omitempty"` } // ContainerResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricSource type for use with // apply. func ContainerResourceMetricSource() *ContainerResourceMetricSourceApplyConfiguration { return &ContainerResourceMetricSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithName(value v1.ResourceName) *ContainerResourceMetricSourceApplyConfiguration { b.Name = &value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *ContainerResourceMetricSourceApplyConfiguration { b.Target = value return b } // WithContainer sets the Container field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Container field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithContainer(value string) *ContainerResourceMetricSourceApplyConfiguration { b.Container = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/containerresourcemetricstatus.go000066400000000000000000000053351472614177300340770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v1 "k8s.io/api/core/v1" ) // ContainerResourceMetricStatusApplyConfiguration represents a declarative configuration of the ContainerResourceMetricStatus type for use // with apply. type ContainerResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` Container *string `json:"container,omitempty"` } // ContainerResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricStatus type for use with // apply. func ContainerResourceMetricStatus() *ContainerResourceMetricStatusApplyConfiguration { return &ContainerResourceMetricStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithName(value v1.ResourceName) *ContainerResourceMetricStatusApplyConfiguration { b.Name = &value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *ContainerResourceMetricStatusApplyConfiguration { b.Current = value return b } // WithContainer sets the Container field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Container field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithContainer(value string) *ContainerResourceMetricStatusApplyConfiguration { b.Container = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/crossversionobjectreference.go000066400000000000000000000050261472614177300334770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // CrossVersionObjectReferenceApplyConfiguration represents a declarative configuration of the CrossVersionObjectReference type for use // with apply. type CrossVersionObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` } // CrossVersionObjectReferenceApplyConfiguration constructs a declarative configuration of the CrossVersionObjectReference type for use with // apply. func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { return &CrossVersionObjectReferenceApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithKind(value string) *CrossVersionObjectReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithName(value string) *CrossVersionObjectReferenceApplyConfiguration { b.Name = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithAPIVersion(value string) *CrossVersionObjectReferenceApplyConfiguration { b.APIVersion = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/externalmetricsource.go000066400000000000000000000041071472614177300321400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // ExternalMetricSourceApplyConfiguration represents a declarative configuration of the ExternalMetricSource type for use // with apply. type ExternalMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } // ExternalMetricSourceApplyConfiguration constructs a declarative configuration of the ExternalMetricSource type for use with // apply. func ExternalMetricSource() *ExternalMetricSourceApplyConfiguration { return &ExternalMetricSourceApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *ExternalMetricSourceApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *ExternalMetricSourceApplyConfiguration { b.Metric = value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ExternalMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *ExternalMetricSourceApplyConfiguration { b.Target = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/externalmetricstatus.go000066400000000000000000000041261472614177300321640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // ExternalMetricStatusApplyConfiguration represents a declarative configuration of the ExternalMetricStatus type for use // with apply. type ExternalMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } // ExternalMetricStatusApplyConfiguration constructs a declarative configuration of the ExternalMetricStatus type for use with // apply. func ExternalMetricStatus() *ExternalMetricStatusApplyConfiguration { return &ExternalMetricStatusApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *ExternalMetricStatusApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *ExternalMetricStatusApplyConfiguration { b.Metric = value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *ExternalMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *ExternalMetricStatusApplyConfiguration { b.Current = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go000066400000000000000000000326061472614177300326550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( autoscalingv2 "k8s.io/api/autoscaling/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // HorizontalPodAutoscalerApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscaler type for use // with apply. type HorizontalPodAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *HorizontalPodAutoscalerSpecApplyConfiguration `json:"spec,omitempty"` Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` } // HorizontalPodAutoscaler constructs a declarative configuration of the HorizontalPodAutoscaler type for use with // apply. func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { b := &HorizontalPodAutoscalerApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("HorizontalPodAutoscaler") b.WithAPIVersion("autoscaling/v2") return b } // ExtractHorizontalPodAutoscaler extracts the applied configuration owned by fieldManager from // horizontalPodAutoscaler. If no managedFields are found in horizontalPodAutoscaler for fieldManager, a // HorizontalPodAutoscalerApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // horizontalPodAutoscaler must be a unmodified HorizontalPodAutoscaler API object that was retrieved from the Kubernetes API. // ExtractHorizontalPodAutoscaler provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "") } // ExtractHorizontalPodAutoscalerStatus is the same as ExtractHorizontalPodAutoscaler except // that it extracts the status subresource applied configuration. // Experimental! func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status") } func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) { b := &HorizontalPodAutoscalerApplyConfiguration{} err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v2.HorizontalPodAutoscaler"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(horizontalPodAutoscaler.Name) b.WithNamespace(horizontalPodAutoscaler.Namespace) b.WithKind("HorizontalPodAutoscaler") b.WithAPIVersion("autoscaling/v2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithKind(value string) *HorizontalPodAutoscalerApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithAPIVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithName(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithGenerateName(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithNamespace(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithUID(value types.UID) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithResourceVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithGeneration(value int64) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *HorizontalPodAutoscalerApplyConfiguration) WithLabels(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *HorizontalPodAutoscalerApplyConfiguration) WithAnnotations(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *HorizontalPodAutoscalerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *HorizontalPodAutoscalerApplyConfiguration) WithFinalizers(values ...string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *HorizontalPodAutoscalerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithSpec(value *HorizontalPodAutoscalerSpecApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *HorizontalPodAutoscalerStatusApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *HorizontalPodAutoscalerApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/horizontalpodautoscalerbehavior.go000066400000000000000000000043511472614177300343710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // HorizontalPodAutoscalerBehaviorApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerBehavior type for use // with apply. type HorizontalPodAutoscalerBehaviorApplyConfiguration struct { ScaleUp *HPAScalingRulesApplyConfiguration `json:"scaleUp,omitempty"` ScaleDown *HPAScalingRulesApplyConfiguration `json:"scaleDown,omitempty"` } // HorizontalPodAutoscalerBehaviorApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerBehavior type for use with // apply. func HorizontalPodAutoscalerBehavior() *HorizontalPodAutoscalerBehaviorApplyConfiguration { return &HorizontalPodAutoscalerBehaviorApplyConfiguration{} } // WithScaleUp sets the ScaleUp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleUp field is set to the value of the last call. func (b *HorizontalPodAutoscalerBehaviorApplyConfiguration) WithScaleUp(value *HPAScalingRulesApplyConfiguration) *HorizontalPodAutoscalerBehaviorApplyConfiguration { b.ScaleUp = value return b } // WithScaleDown sets the ScaleDown field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleDown field is set to the value of the last call. func (b *HorizontalPodAutoscalerBehaviorApplyConfiguration) WithScaleDown(value *HPAScalingRulesApplyConfiguration) *HorizontalPodAutoscalerBehaviorApplyConfiguration { b.ScaleDown = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go000066400000000000000000000077431472614177300345700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v2 "k8s.io/api/autoscaling/v2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // HorizontalPodAutoscalerConditionApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerCondition type for use // with apply. type HorizontalPodAutoscalerConditionApplyConfiguration struct { Type *v2.HorizontalPodAutoscalerConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // HorizontalPodAutoscalerConditionApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerCondition type for use with // apply. func HorizontalPodAutoscalerCondition() *HorizontalPodAutoscalerConditionApplyConfiguration { return &HorizontalPodAutoscalerConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithType(value v2.HorizontalPodAutoscalerConditionType) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *HorizontalPodAutoscalerConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithReason(value string) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithMessage(value string) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/horizontalpodautoscalerspec.go000066400000000000000000000100601472614177300335160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // HorizontalPodAutoscalerSpecApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerSpec type for use // with apply. type HorizontalPodAutoscalerSpecApplyConfiguration struct { ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` MinReplicas *int32 `json:"minReplicas,omitempty"` MaxReplicas *int32 `json:"maxReplicas,omitempty"` Metrics []MetricSpecApplyConfiguration `json:"metrics,omitempty"` Behavior *HorizontalPodAutoscalerBehaviorApplyConfiguration `json:"behavior,omitempty"` } // HorizontalPodAutoscalerSpecApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerSpec type for use with // apply. func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { return &HorizontalPodAutoscalerSpecApplyConfiguration{} } // WithScaleTargetRef sets the ScaleTargetRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleTargetRef field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithScaleTargetRef(value *CrossVersionObjectReferenceApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { b.ScaleTargetRef = value return b } // WithMinReplicas sets the MinReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMinReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.MinReplicas = &value return b } // WithMaxReplicas sets the MaxReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMaxReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.MaxReplicas = &value return b } // WithMetrics adds the given value to the Metrics field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Metrics field. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMetrics(values ...*MetricSpecApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMetrics") } b.Metrics = append(b.Metrics, *values[i]) } return b } // WithBehavior sets the Behavior field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Behavior field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithBehavior(value *HorizontalPodAutoscalerBehaviorApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { b.Behavior = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/horizontalpodautoscalerstatus.go000066400000000000000000000117461472614177300341230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // HorizontalPodAutoscalerStatusApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerStatus type for use // with apply. type HorizontalPodAutoscalerStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` LastScaleTime *v1.Time `json:"lastScaleTime,omitempty"` CurrentReplicas *int32 `json:"currentReplicas,omitempty"` DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` CurrentMetrics []MetricStatusApplyConfiguration `json:"currentMetrics,omitempty"` Conditions []HorizontalPodAutoscalerConditionApplyConfiguration `json:"conditions,omitempty"` } // HorizontalPodAutoscalerStatusApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerStatus type for use with // apply. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { return &HorizontalPodAutoscalerStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithObservedGeneration(value int64) *HorizontalPodAutoscalerStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithLastScaleTime sets the LastScaleTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastScaleTime field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithLastScaleTime(value v1.Time) *HorizontalPodAutoscalerStatusApplyConfiguration { b.LastScaleTime = &value return b } // WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.CurrentReplicas = &value return b } // WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithDesiredReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.DesiredReplicas = &value return b } // WithCurrentMetrics adds the given value to the CurrentMetrics field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CurrentMetrics field. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentMetrics(values ...*MetricStatusApplyConfiguration) *HorizontalPodAutoscalerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithCurrentMetrics") } b.CurrentMetrics = append(b.CurrentMetrics, *values[i]) } return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithConditions(values ...*HorizontalPodAutoscalerConditionApplyConfiguration) *HorizontalPodAutoscalerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/hpascalingpolicy.go000066400000000000000000000050131472614177300312170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v2 "k8s.io/api/autoscaling/v2" ) // HPAScalingPolicyApplyConfiguration represents a declarative configuration of the HPAScalingPolicy type for use // with apply. type HPAScalingPolicyApplyConfiguration struct { Type *v2.HPAScalingPolicyType `json:"type,omitempty"` Value *int32 `json:"value,omitempty"` PeriodSeconds *int32 `json:"periodSeconds,omitempty"` } // HPAScalingPolicyApplyConfiguration constructs a declarative configuration of the HPAScalingPolicy type for use with // apply. func HPAScalingPolicy() *HPAScalingPolicyApplyConfiguration { return &HPAScalingPolicyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *HPAScalingPolicyApplyConfiguration) WithType(value v2.HPAScalingPolicyType) *HPAScalingPolicyApplyConfiguration { b.Type = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *HPAScalingPolicyApplyConfiguration) WithValue(value int32) *HPAScalingPolicyApplyConfiguration { b.Value = &value return b } // WithPeriodSeconds sets the PeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PeriodSeconds field is set to the value of the last call. func (b *HPAScalingPolicyApplyConfiguration) WithPeriodSeconds(value int32) *HPAScalingPolicyApplyConfiguration { b.PeriodSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/hpascalingrules.go000066400000000000000000000056031472614177300310570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v2 "k8s.io/api/autoscaling/v2" ) // HPAScalingRulesApplyConfiguration represents a declarative configuration of the HPAScalingRules type for use // with apply. type HPAScalingRulesApplyConfiguration struct { StabilizationWindowSeconds *int32 `json:"stabilizationWindowSeconds,omitempty"` SelectPolicy *v2.ScalingPolicySelect `json:"selectPolicy,omitempty"` Policies []HPAScalingPolicyApplyConfiguration `json:"policies,omitempty"` } // HPAScalingRulesApplyConfiguration constructs a declarative configuration of the HPAScalingRules type for use with // apply. func HPAScalingRules() *HPAScalingRulesApplyConfiguration { return &HPAScalingRulesApplyConfiguration{} } // WithStabilizationWindowSeconds sets the StabilizationWindowSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StabilizationWindowSeconds field is set to the value of the last call. func (b *HPAScalingRulesApplyConfiguration) WithStabilizationWindowSeconds(value int32) *HPAScalingRulesApplyConfiguration { b.StabilizationWindowSeconds = &value return b } // WithSelectPolicy sets the SelectPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SelectPolicy field is set to the value of the last call. func (b *HPAScalingRulesApplyConfiguration) WithSelectPolicy(value v2.ScalingPolicySelect) *HPAScalingRulesApplyConfiguration { b.SelectPolicy = &value return b } // WithPolicies adds the given value to the Policies field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Policies field. func (b *HPAScalingRulesApplyConfiguration) WithPolicies(values ...*HPAScalingPolicyApplyConfiguration) *HPAScalingRulesApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPolicies") } b.Policies = append(b.Policies, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/metricidentifier.go000066400000000000000000000041021472614177300312120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MetricIdentifierApplyConfiguration represents a declarative configuration of the MetricIdentifier type for use // with apply. type MetricIdentifierApplyConfiguration struct { Name *string `json:"name,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } // MetricIdentifierApplyConfiguration constructs a declarative configuration of the MetricIdentifier type for use with // apply. func MetricIdentifier() *MetricIdentifierApplyConfiguration { return &MetricIdentifierApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MetricIdentifierApplyConfiguration) WithName(value string) *MetricIdentifierApplyConfiguration { b.Name = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *MetricIdentifierApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *MetricIdentifierApplyConfiguration { b.Selector = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/metricspec.go000066400000000000000000000102351472614177300300260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v2 "k8s.io/api/autoscaling/v2" ) // MetricSpecApplyConfiguration represents a declarative configuration of the MetricSpec type for use // with apply. type MetricSpecApplyConfiguration struct { Type *v2.MetricSourceType `json:"type,omitempty"` Object *ObjectMetricSourceApplyConfiguration `json:"object,omitempty"` Pods *PodsMetricSourceApplyConfiguration `json:"pods,omitempty"` Resource *ResourceMetricSourceApplyConfiguration `json:"resource,omitempty"` ContainerResource *ContainerResourceMetricSourceApplyConfiguration `json:"containerResource,omitempty"` External *ExternalMetricSourceApplyConfiguration `json:"external,omitempty"` } // MetricSpecApplyConfiguration constructs a declarative configuration of the MetricSpec type for use with // apply. func MetricSpec() *MetricSpecApplyConfiguration { return &MetricSpecApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithType(value v2.MetricSourceType) *MetricSpecApplyConfiguration { b.Type = &value return b } // WithObject sets the Object field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Object field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithObject(value *ObjectMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Object = value return b } // WithPods sets the Pods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Pods field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithPods(value *PodsMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Pods = value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithResource(value *ResourceMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Resource = value return b } // WithContainerResource sets the ContainerResource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerResource field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithContainerResource(value *ContainerResourceMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.ContainerResource = value return b } // WithExternal sets the External field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the External field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithExternal(value *ExternalMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.External = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/metricstatus.go000066400000000000000000000103051472614177300304150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v2 "k8s.io/api/autoscaling/v2" ) // MetricStatusApplyConfiguration represents a declarative configuration of the MetricStatus type for use // with apply. type MetricStatusApplyConfiguration struct { Type *v2.MetricSourceType `json:"type,omitempty"` Object *ObjectMetricStatusApplyConfiguration `json:"object,omitempty"` Pods *PodsMetricStatusApplyConfiguration `json:"pods,omitempty"` Resource *ResourceMetricStatusApplyConfiguration `json:"resource,omitempty"` ContainerResource *ContainerResourceMetricStatusApplyConfiguration `json:"containerResource,omitempty"` External *ExternalMetricStatusApplyConfiguration `json:"external,omitempty"` } // MetricStatusApplyConfiguration constructs a declarative configuration of the MetricStatus type for use with // apply. func MetricStatus() *MetricStatusApplyConfiguration { return &MetricStatusApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithType(value v2.MetricSourceType) *MetricStatusApplyConfiguration { b.Type = &value return b } // WithObject sets the Object field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Object field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithObject(value *ObjectMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Object = value return b } // WithPods sets the Pods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Pods field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithPods(value *PodsMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Pods = value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithResource(value *ResourceMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Resource = value return b } // WithContainerResource sets the ContainerResource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerResource field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithContainerResource(value *ContainerResourceMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.ContainerResource = value return b } // WithExternal sets the External field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the External field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithExternal(value *ExternalMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.External = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/metrictarget.go000066400000000000000000000060621472614177300303650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v2 "k8s.io/api/autoscaling/v2" resource "k8s.io/apimachinery/pkg/api/resource" ) // MetricTargetApplyConfiguration represents a declarative configuration of the MetricTarget type for use // with apply. type MetricTargetApplyConfiguration struct { Type *v2.MetricTargetType `json:"type,omitempty"` Value *resource.Quantity `json:"value,omitempty"` AverageValue *resource.Quantity `json:"averageValue,omitempty"` AverageUtilization *int32 `json:"averageUtilization,omitempty"` } // MetricTargetApplyConfiguration constructs a declarative configuration of the MetricTarget type for use with // apply. func MetricTarget() *MetricTargetApplyConfiguration { return &MetricTargetApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MetricTargetApplyConfiguration) WithType(value v2.MetricTargetType) *MetricTargetApplyConfiguration { b.Type = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *MetricTargetApplyConfiguration) WithValue(value resource.Quantity) *MetricTargetApplyConfiguration { b.Value = &value return b } // WithAverageValue sets the AverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageValue field is set to the value of the last call. func (b *MetricTargetApplyConfiguration) WithAverageValue(value resource.Quantity) *MetricTargetApplyConfiguration { b.AverageValue = &value return b } // WithAverageUtilization sets the AverageUtilization field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageUtilization field is set to the value of the last call. func (b *MetricTargetApplyConfiguration) WithAverageUtilization(value int32) *MetricTargetApplyConfiguration { b.AverageUtilization = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/metricvaluestatus.go000066400000000000000000000051731472614177300314610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( resource "k8s.io/apimachinery/pkg/api/resource" ) // MetricValueStatusApplyConfiguration represents a declarative configuration of the MetricValueStatus type for use // with apply. type MetricValueStatusApplyConfiguration struct { Value *resource.Quantity `json:"value,omitempty"` AverageValue *resource.Quantity `json:"averageValue,omitempty"` AverageUtilization *int32 `json:"averageUtilization,omitempty"` } // MetricValueStatusApplyConfiguration constructs a declarative configuration of the MetricValueStatus type for use with // apply. func MetricValueStatus() *MetricValueStatusApplyConfiguration { return &MetricValueStatusApplyConfiguration{} } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *MetricValueStatusApplyConfiguration) WithValue(value resource.Quantity) *MetricValueStatusApplyConfiguration { b.Value = &value return b } // WithAverageValue sets the AverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageValue field is set to the value of the last call. func (b *MetricValueStatusApplyConfiguration) WithAverageValue(value resource.Quantity) *MetricValueStatusApplyConfiguration { b.AverageValue = &value return b } // WithAverageUtilization sets the AverageUtilization field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageUtilization field is set to the value of the last call. func (b *MetricValueStatusApplyConfiguration) WithAverageUtilization(value int32) *MetricValueStatusApplyConfiguration { b.AverageUtilization = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/objectmetricsource.go000066400000000000000000000052551472614177300315710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // ObjectMetricSourceApplyConfiguration represents a declarative configuration of the ObjectMetricSource type for use // with apply. type ObjectMetricSourceApplyConfiguration struct { DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` } // ObjectMetricSourceApplyConfiguration constructs a declarative configuration of the ObjectMetricSource type for use with // apply. func ObjectMetricSource() *ObjectMetricSourceApplyConfiguration { return &ObjectMetricSourceApplyConfiguration{} } // WithDescribedObject sets the DescribedObject field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DescribedObject field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithDescribedObject(value *CrossVersionObjectReferenceApplyConfiguration) *ObjectMetricSourceApplyConfiguration { b.DescribedObject = value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *ObjectMetricSourceApplyConfiguration { b.Target = value return b } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *ObjectMetricSourceApplyConfiguration { b.Metric = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/objectmetricstatus.go000066400000000000000000000052701472614177300316110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // ObjectMetricStatusApplyConfiguration represents a declarative configuration of the ObjectMetricStatus type for use // with apply. type ObjectMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` } // ObjectMetricStatusApplyConfiguration constructs a declarative configuration of the ObjectMetricStatus type for use with // apply. func ObjectMetricStatus() *ObjectMetricStatusApplyConfiguration { return &ObjectMetricStatusApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *ObjectMetricStatusApplyConfiguration { b.Metric = value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *ObjectMetricStatusApplyConfiguration { b.Current = value return b } // WithDescribedObject sets the DescribedObject field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DescribedObject field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithDescribedObject(value *CrossVersionObjectReferenceApplyConfiguration) *ObjectMetricStatusApplyConfiguration { b.DescribedObject = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/podsmetricsource.go000066400000000000000000000040271472614177300312640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // PodsMetricSourceApplyConfiguration represents a declarative configuration of the PodsMetricSource type for use // with apply. type PodsMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } // PodsMetricSourceApplyConfiguration constructs a declarative configuration of the PodsMetricSource type for use with // apply. func PodsMetricSource() *PodsMetricSourceApplyConfiguration { return &PodsMetricSourceApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *PodsMetricSourceApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *PodsMetricSourceApplyConfiguration { b.Metric = value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *PodsMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *PodsMetricSourceApplyConfiguration { b.Target = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/podsmetricstatus.go000066400000000000000000000040461472614177300313100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 // PodsMetricStatusApplyConfiguration represents a declarative configuration of the PodsMetricStatus type for use // with apply. type PodsMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } // PodsMetricStatusApplyConfiguration constructs a declarative configuration of the PodsMetricStatus type for use with // apply. func PodsMetricStatus() *PodsMetricStatusApplyConfiguration { return &PodsMetricStatusApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *PodsMetricStatusApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *PodsMetricStatusApplyConfiguration { b.Metric = value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *PodsMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *PodsMetricStatusApplyConfiguration { b.Current = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/resourcemetricsource.go000066400000000000000000000041051472614177300321430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v1 "k8s.io/api/core/v1" ) // ResourceMetricSourceApplyConfiguration represents a declarative configuration of the ResourceMetricSource type for use // with apply. type ResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } // ResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ResourceMetricSource type for use with // apply. func ResourceMetricSource() *ResourceMetricSourceApplyConfiguration { return &ResourceMetricSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceMetricSourceApplyConfiguration) WithName(value v1.ResourceName) *ResourceMetricSourceApplyConfiguration { b.Name = &value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ResourceMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *ResourceMetricSourceApplyConfiguration { b.Target = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2/resourcemetricstatus.go000066400000000000000000000041341472614177300321700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2 import ( v1 "k8s.io/api/core/v1" ) // ResourceMetricStatusApplyConfiguration represents a declarative configuration of the ResourceMetricStatus type for use // with apply. type ResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } // ResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ResourceMetricStatus type for use with // apply. func ResourceMetricStatus() *ResourceMetricStatusApplyConfiguration { return &ResourceMetricStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceMetricStatusApplyConfiguration) WithName(value v1.ResourceName) *ResourceMetricStatusApplyConfiguration { b.Name = &value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *ResourceMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *ResourceMetricStatusApplyConfiguration { b.Current = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/000077500000000000000000000000001472614177300262555ustar00rootroot00000000000000containerresourcemetricsource.go000066400000000000000000000066411472614177300347130ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" ) // ContainerResourceMetricSourceApplyConfiguration represents a declarative configuration of the ContainerResourceMetricSource type for use // with apply. type ContainerResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` TargetAverageUtilization *int32 `json:"targetAverageUtilization,omitempty"` TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty"` Container *string `json:"container,omitempty"` } // ContainerResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricSource type for use with // apply. func ContainerResourceMetricSource() *ContainerResourceMetricSourceApplyConfiguration { return &ContainerResourceMetricSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithName(value v1.ResourceName) *ContainerResourceMetricSourceApplyConfiguration { b.Name = &value return b } // WithTargetAverageUtilization sets the TargetAverageUtilization field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetAverageUtilization field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithTargetAverageUtilization(value int32) *ContainerResourceMetricSourceApplyConfiguration { b.TargetAverageUtilization = &value return b } // WithTargetAverageValue sets the TargetAverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetAverageValue field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithTargetAverageValue(value resource.Quantity) *ContainerResourceMetricSourceApplyConfiguration { b.TargetAverageValue = &value return b } // WithContainer sets the Container field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Container field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithContainer(value string) *ContainerResourceMetricSourceApplyConfiguration { b.Container = &value return b } containerresourcemetricstatus.go000066400000000000000000000066611472614177300347400ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" ) // ContainerResourceMetricStatusApplyConfiguration represents a declarative configuration of the ContainerResourceMetricStatus type for use // with apply. type ContainerResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` CurrentAverageUtilization *int32 `json:"currentAverageUtilization,omitempty"` CurrentAverageValue *resource.Quantity `json:"currentAverageValue,omitempty"` Container *string `json:"container,omitempty"` } // ContainerResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricStatus type for use with // apply. func ContainerResourceMetricStatus() *ContainerResourceMetricStatusApplyConfiguration { return &ContainerResourceMetricStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithName(value v1.ResourceName) *ContainerResourceMetricStatusApplyConfiguration { b.Name = &value return b } // WithCurrentAverageUtilization sets the CurrentAverageUtilization field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentAverageUtilization field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithCurrentAverageUtilization(value int32) *ContainerResourceMetricStatusApplyConfiguration { b.CurrentAverageUtilization = &value return b } // WithCurrentAverageValue sets the CurrentAverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentAverageValue field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithCurrentAverageValue(value resource.Quantity) *ContainerResourceMetricStatusApplyConfiguration { b.CurrentAverageValue = &value return b } // WithContainer sets the Container field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Container field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithContainer(value string) *ContainerResourceMetricStatusApplyConfiguration { b.Container = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/crossversionobjectreference.go000066400000000000000000000050331472614177300344120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 // CrossVersionObjectReferenceApplyConfiguration represents a declarative configuration of the CrossVersionObjectReference type for use // with apply. type CrossVersionObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` } // CrossVersionObjectReferenceApplyConfiguration constructs a declarative configuration of the CrossVersionObjectReference type for use with // apply. func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { return &CrossVersionObjectReferenceApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithKind(value string) *CrossVersionObjectReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithName(value string) *CrossVersionObjectReferenceApplyConfiguration { b.Name = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithAPIVersion(value string) *CrossVersionObjectReferenceApplyConfiguration { b.APIVersion = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/externalmetricsource.go000066400000000000000000000065521472614177300330630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ExternalMetricSourceApplyConfiguration represents a declarative configuration of the ExternalMetricSource type for use // with apply. type ExternalMetricSourceApplyConfiguration struct { MetricName *string `json:"metricName,omitempty"` MetricSelector *v1.LabelSelectorApplyConfiguration `json:"metricSelector,omitempty"` TargetValue *resource.Quantity `json:"targetValue,omitempty"` TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty"` } // ExternalMetricSourceApplyConfiguration constructs a declarative configuration of the ExternalMetricSource type for use with // apply. func ExternalMetricSource() *ExternalMetricSourceApplyConfiguration { return &ExternalMetricSourceApplyConfiguration{} } // WithMetricName sets the MetricName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricName field is set to the value of the last call. func (b *ExternalMetricSourceApplyConfiguration) WithMetricName(value string) *ExternalMetricSourceApplyConfiguration { b.MetricName = &value return b } // WithMetricSelector sets the MetricSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricSelector field is set to the value of the last call. func (b *ExternalMetricSourceApplyConfiguration) WithMetricSelector(value *v1.LabelSelectorApplyConfiguration) *ExternalMetricSourceApplyConfiguration { b.MetricSelector = value return b } // WithTargetValue sets the TargetValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetValue field is set to the value of the last call. func (b *ExternalMetricSourceApplyConfiguration) WithTargetValue(value resource.Quantity) *ExternalMetricSourceApplyConfiguration { b.TargetValue = &value return b } // WithTargetAverageValue sets the TargetAverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetAverageValue field is set to the value of the last call. func (b *ExternalMetricSourceApplyConfiguration) WithTargetAverageValue(value resource.Quantity) *ExternalMetricSourceApplyConfiguration { b.TargetAverageValue = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/externalmetricstatus.go000066400000000000000000000065721472614177300331100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ExternalMetricStatusApplyConfiguration represents a declarative configuration of the ExternalMetricStatus type for use // with apply. type ExternalMetricStatusApplyConfiguration struct { MetricName *string `json:"metricName,omitempty"` MetricSelector *v1.LabelSelectorApplyConfiguration `json:"metricSelector,omitempty"` CurrentValue *resource.Quantity `json:"currentValue,omitempty"` CurrentAverageValue *resource.Quantity `json:"currentAverageValue,omitempty"` } // ExternalMetricStatusApplyConfiguration constructs a declarative configuration of the ExternalMetricStatus type for use with // apply. func ExternalMetricStatus() *ExternalMetricStatusApplyConfiguration { return &ExternalMetricStatusApplyConfiguration{} } // WithMetricName sets the MetricName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricName field is set to the value of the last call. func (b *ExternalMetricStatusApplyConfiguration) WithMetricName(value string) *ExternalMetricStatusApplyConfiguration { b.MetricName = &value return b } // WithMetricSelector sets the MetricSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricSelector field is set to the value of the last call. func (b *ExternalMetricStatusApplyConfiguration) WithMetricSelector(value *v1.LabelSelectorApplyConfiguration) *ExternalMetricStatusApplyConfiguration { b.MetricSelector = value return b } // WithCurrentValue sets the CurrentValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentValue field is set to the value of the last call. func (b *ExternalMetricStatusApplyConfiguration) WithCurrentValue(value resource.Quantity) *ExternalMetricStatusApplyConfiguration { b.CurrentValue = &value return b } // WithCurrentAverageValue sets the CurrentAverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentAverageValue field is set to the value of the last call. func (b *ExternalMetricStatusApplyConfiguration) WithCurrentAverageValue(value resource.Quantity) *ExternalMetricStatusApplyConfiguration { b.CurrentAverageValue = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go000066400000000000000000000326631472614177300335750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // HorizontalPodAutoscalerApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscaler type for use // with apply. type HorizontalPodAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *HorizontalPodAutoscalerSpecApplyConfiguration `json:"spec,omitempty"` Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` } // HorizontalPodAutoscaler constructs a declarative configuration of the HorizontalPodAutoscaler type for use with // apply. func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { b := &HorizontalPodAutoscalerApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("HorizontalPodAutoscaler") b.WithAPIVersion("autoscaling/v2beta1") return b } // ExtractHorizontalPodAutoscaler extracts the applied configuration owned by fieldManager from // horizontalPodAutoscaler. If no managedFields are found in horizontalPodAutoscaler for fieldManager, a // HorizontalPodAutoscalerApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // horizontalPodAutoscaler must be a unmodified HorizontalPodAutoscaler API object that was retrieved from the Kubernetes API. // ExtractHorizontalPodAutoscaler provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "") } // ExtractHorizontalPodAutoscalerStatus is the same as ExtractHorizontalPodAutoscaler except // that it extracts the status subresource applied configuration. // Experimental! func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status") } func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) { b := &HorizontalPodAutoscalerApplyConfiguration{} err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscaler"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(horizontalPodAutoscaler.Name) b.WithNamespace(horizontalPodAutoscaler.Namespace) b.WithKind("HorizontalPodAutoscaler") b.WithAPIVersion("autoscaling/v2beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithKind(value string) *HorizontalPodAutoscalerApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithAPIVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithName(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithGenerateName(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithNamespace(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithUID(value types.UID) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithResourceVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithGeneration(value int64) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *HorizontalPodAutoscalerApplyConfiguration) WithLabels(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *HorizontalPodAutoscalerApplyConfiguration) WithAnnotations(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *HorizontalPodAutoscalerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *HorizontalPodAutoscalerApplyConfiguration) WithFinalizers(values ...string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *HorizontalPodAutoscalerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithSpec(value *HorizontalPodAutoscalerSpecApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *HorizontalPodAutoscalerStatusApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *HorizontalPodAutoscalerApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } horizontalpodautoscalercondition.go000066400000000000000000000100201472614177300354040ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( v2beta1 "k8s.io/api/autoscaling/v2beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // HorizontalPodAutoscalerConditionApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerCondition type for use // with apply. type HorizontalPodAutoscalerConditionApplyConfiguration struct { Type *v2beta1.HorizontalPodAutoscalerConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // HorizontalPodAutoscalerConditionApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerCondition type for use with // apply. func HorizontalPodAutoscalerCondition() *HorizontalPodAutoscalerConditionApplyConfiguration { return &HorizontalPodAutoscalerConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithType(value v2beta1.HorizontalPodAutoscalerConditionType) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *HorizontalPodAutoscalerConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithReason(value string) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithMessage(value string) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerspec.go000066400000000000000000000067401472614177300344450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 // HorizontalPodAutoscalerSpecApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerSpec type for use // with apply. type HorizontalPodAutoscalerSpecApplyConfiguration struct { ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` MinReplicas *int32 `json:"minReplicas,omitempty"` MaxReplicas *int32 `json:"maxReplicas,omitempty"` Metrics []MetricSpecApplyConfiguration `json:"metrics,omitempty"` } // HorizontalPodAutoscalerSpecApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerSpec type for use with // apply. func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { return &HorizontalPodAutoscalerSpecApplyConfiguration{} } // WithScaleTargetRef sets the ScaleTargetRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleTargetRef field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithScaleTargetRef(value *CrossVersionObjectReferenceApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { b.ScaleTargetRef = value return b } // WithMinReplicas sets the MinReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMinReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.MinReplicas = &value return b } // WithMaxReplicas sets the MaxReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMaxReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.MaxReplicas = &value return b } // WithMetrics adds the given value to the Metrics field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Metrics field. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMetrics(values ...*MetricSpecApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMetrics") } b.Metrics = append(b.Metrics, *values[i]) } return b } horizontalpodautoscalerstatus.go000066400000000000000000000117531472614177300347570ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // HorizontalPodAutoscalerStatusApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerStatus type for use // with apply. type HorizontalPodAutoscalerStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` LastScaleTime *v1.Time `json:"lastScaleTime,omitempty"` CurrentReplicas *int32 `json:"currentReplicas,omitempty"` DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` CurrentMetrics []MetricStatusApplyConfiguration `json:"currentMetrics,omitempty"` Conditions []HorizontalPodAutoscalerConditionApplyConfiguration `json:"conditions,omitempty"` } // HorizontalPodAutoscalerStatusApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerStatus type for use with // apply. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { return &HorizontalPodAutoscalerStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithObservedGeneration(value int64) *HorizontalPodAutoscalerStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithLastScaleTime sets the LastScaleTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastScaleTime field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithLastScaleTime(value v1.Time) *HorizontalPodAutoscalerStatusApplyConfiguration { b.LastScaleTime = &value return b } // WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.CurrentReplicas = &value return b } // WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithDesiredReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.DesiredReplicas = &value return b } // WithCurrentMetrics adds the given value to the CurrentMetrics field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CurrentMetrics field. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentMetrics(values ...*MetricStatusApplyConfiguration) *HorizontalPodAutoscalerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithCurrentMetrics") } b.CurrentMetrics = append(b.CurrentMetrics, *values[i]) } return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithConditions(values ...*HorizontalPodAutoscalerConditionApplyConfiguration) *HorizontalPodAutoscalerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/metricspec.go000066400000000000000000000102611472614177300307420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( v2beta1 "k8s.io/api/autoscaling/v2beta1" ) // MetricSpecApplyConfiguration represents a declarative configuration of the MetricSpec type for use // with apply. type MetricSpecApplyConfiguration struct { Type *v2beta1.MetricSourceType `json:"type,omitempty"` Object *ObjectMetricSourceApplyConfiguration `json:"object,omitempty"` Pods *PodsMetricSourceApplyConfiguration `json:"pods,omitempty"` Resource *ResourceMetricSourceApplyConfiguration `json:"resource,omitempty"` ContainerResource *ContainerResourceMetricSourceApplyConfiguration `json:"containerResource,omitempty"` External *ExternalMetricSourceApplyConfiguration `json:"external,omitempty"` } // MetricSpecApplyConfiguration constructs a declarative configuration of the MetricSpec type for use with // apply. func MetricSpec() *MetricSpecApplyConfiguration { return &MetricSpecApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithType(value v2beta1.MetricSourceType) *MetricSpecApplyConfiguration { b.Type = &value return b } // WithObject sets the Object field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Object field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithObject(value *ObjectMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Object = value return b } // WithPods sets the Pods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Pods field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithPods(value *PodsMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Pods = value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithResource(value *ResourceMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Resource = value return b } // WithContainerResource sets the ContainerResource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerResource field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithContainerResource(value *ContainerResourceMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.ContainerResource = value return b } // WithExternal sets the External field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the External field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithExternal(value *ExternalMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.External = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/metricstatus.go000066400000000000000000000103311472614177300313310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( v2beta1 "k8s.io/api/autoscaling/v2beta1" ) // MetricStatusApplyConfiguration represents a declarative configuration of the MetricStatus type for use // with apply. type MetricStatusApplyConfiguration struct { Type *v2beta1.MetricSourceType `json:"type,omitempty"` Object *ObjectMetricStatusApplyConfiguration `json:"object,omitempty"` Pods *PodsMetricStatusApplyConfiguration `json:"pods,omitempty"` Resource *ResourceMetricStatusApplyConfiguration `json:"resource,omitempty"` ContainerResource *ContainerResourceMetricStatusApplyConfiguration `json:"containerResource,omitempty"` External *ExternalMetricStatusApplyConfiguration `json:"external,omitempty"` } // MetricStatusApplyConfiguration constructs a declarative configuration of the MetricStatus type for use with // apply. func MetricStatus() *MetricStatusApplyConfiguration { return &MetricStatusApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithType(value v2beta1.MetricSourceType) *MetricStatusApplyConfiguration { b.Type = &value return b } // WithObject sets the Object field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Object field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithObject(value *ObjectMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Object = value return b } // WithPods sets the Pods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Pods field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithPods(value *PodsMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Pods = value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithResource(value *ResourceMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Resource = value return b } // WithContainerResource sets the ContainerResource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerResource field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithContainerResource(value *ContainerResourceMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.ContainerResource = value return b } // WithExternal sets the External field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the External field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithExternal(value *ExternalMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.External = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/objectmetricsource.go000066400000000000000000000074631472614177300325110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ObjectMetricSourceApplyConfiguration represents a declarative configuration of the ObjectMetricSource type for use // with apply. type ObjectMetricSourceApplyConfiguration struct { Target *CrossVersionObjectReferenceApplyConfiguration `json:"target,omitempty"` MetricName *string `json:"metricName,omitempty"` TargetValue *resource.Quantity `json:"targetValue,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` AverageValue *resource.Quantity `json:"averageValue,omitempty"` } // ObjectMetricSourceApplyConfiguration constructs a declarative configuration of the ObjectMetricSource type for use with // apply. func ObjectMetricSource() *ObjectMetricSourceApplyConfiguration { return &ObjectMetricSourceApplyConfiguration{} } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithTarget(value *CrossVersionObjectReferenceApplyConfiguration) *ObjectMetricSourceApplyConfiguration { b.Target = value return b } // WithMetricName sets the MetricName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricName field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithMetricName(value string) *ObjectMetricSourceApplyConfiguration { b.MetricName = &value return b } // WithTargetValue sets the TargetValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetValue field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithTargetValue(value resource.Quantity) *ObjectMetricSourceApplyConfiguration { b.TargetValue = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ObjectMetricSourceApplyConfiguration { b.Selector = value return b } // WithAverageValue sets the AverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageValue field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithAverageValue(value resource.Quantity) *ObjectMetricSourceApplyConfiguration { b.AverageValue = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/objectmetricstatus.go000066400000000000000000000074711472614177300325330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ObjectMetricStatusApplyConfiguration represents a declarative configuration of the ObjectMetricStatus type for use // with apply. type ObjectMetricStatusApplyConfiguration struct { Target *CrossVersionObjectReferenceApplyConfiguration `json:"target,omitempty"` MetricName *string `json:"metricName,omitempty"` CurrentValue *resource.Quantity `json:"currentValue,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` AverageValue *resource.Quantity `json:"averageValue,omitempty"` } // ObjectMetricStatusApplyConfiguration constructs a declarative configuration of the ObjectMetricStatus type for use with // apply. func ObjectMetricStatus() *ObjectMetricStatusApplyConfiguration { return &ObjectMetricStatusApplyConfiguration{} } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithTarget(value *CrossVersionObjectReferenceApplyConfiguration) *ObjectMetricStatusApplyConfiguration { b.Target = value return b } // WithMetricName sets the MetricName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricName field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithMetricName(value string) *ObjectMetricStatusApplyConfiguration { b.MetricName = &value return b } // WithCurrentValue sets the CurrentValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentValue field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithCurrentValue(value resource.Quantity) *ObjectMetricStatusApplyConfiguration { b.CurrentValue = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ObjectMetricStatusApplyConfiguration { b.Selector = value return b } // WithAverageValue sets the AverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageValue field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithAverageValue(value resource.Quantity) *ObjectMetricStatusApplyConfiguration { b.AverageValue = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/podsmetricsource.go000066400000000000000000000053601472614177300322020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodsMetricSourceApplyConfiguration represents a declarative configuration of the PodsMetricSource type for use // with apply. type PodsMetricSourceApplyConfiguration struct { MetricName *string `json:"metricName,omitempty"` TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } // PodsMetricSourceApplyConfiguration constructs a declarative configuration of the PodsMetricSource type for use with // apply. func PodsMetricSource() *PodsMetricSourceApplyConfiguration { return &PodsMetricSourceApplyConfiguration{} } // WithMetricName sets the MetricName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricName field is set to the value of the last call. func (b *PodsMetricSourceApplyConfiguration) WithMetricName(value string) *PodsMetricSourceApplyConfiguration { b.MetricName = &value return b } // WithTargetAverageValue sets the TargetAverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetAverageValue field is set to the value of the last call. func (b *PodsMetricSourceApplyConfiguration) WithTargetAverageValue(value resource.Quantity) *PodsMetricSourceApplyConfiguration { b.TargetAverageValue = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *PodsMetricSourceApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *PodsMetricSourceApplyConfiguration { b.Selector = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/podsmetricstatus.go000066400000000000000000000053711472614177300322270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodsMetricStatusApplyConfiguration represents a declarative configuration of the PodsMetricStatus type for use // with apply. type PodsMetricStatusApplyConfiguration struct { MetricName *string `json:"metricName,omitempty"` CurrentAverageValue *resource.Quantity `json:"currentAverageValue,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } // PodsMetricStatusApplyConfiguration constructs a declarative configuration of the PodsMetricStatus type for use with // apply. func PodsMetricStatus() *PodsMetricStatusApplyConfiguration { return &PodsMetricStatusApplyConfiguration{} } // WithMetricName sets the MetricName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MetricName field is set to the value of the last call. func (b *PodsMetricStatusApplyConfiguration) WithMetricName(value string) *PodsMetricStatusApplyConfiguration { b.MetricName = &value return b } // WithCurrentAverageValue sets the CurrentAverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentAverageValue field is set to the value of the last call. func (b *PodsMetricStatusApplyConfiguration) WithCurrentAverageValue(value resource.Quantity) *PodsMetricStatusApplyConfiguration { b.CurrentAverageValue = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *PodsMetricStatusApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *PodsMetricStatusApplyConfiguration { b.Selector = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/resourcemetricsource.go000066400000000000000000000054251472614177300330660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" ) // ResourceMetricSourceApplyConfiguration represents a declarative configuration of the ResourceMetricSource type for use // with apply. type ResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` TargetAverageUtilization *int32 `json:"targetAverageUtilization,omitempty"` TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty"` } // ResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ResourceMetricSource type for use with // apply. func ResourceMetricSource() *ResourceMetricSourceApplyConfiguration { return &ResourceMetricSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceMetricSourceApplyConfiguration) WithName(value v1.ResourceName) *ResourceMetricSourceApplyConfiguration { b.Name = &value return b } // WithTargetAverageUtilization sets the TargetAverageUtilization field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetAverageUtilization field is set to the value of the last call. func (b *ResourceMetricSourceApplyConfiguration) WithTargetAverageUtilization(value int32) *ResourceMetricSourceApplyConfiguration { b.TargetAverageUtilization = &value return b } // WithTargetAverageValue sets the TargetAverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetAverageValue field is set to the value of the last call. func (b *ResourceMetricSourceApplyConfiguration) WithTargetAverageValue(value resource.Quantity) *ResourceMetricSourceApplyConfiguration { b.TargetAverageValue = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta1/resourcemetricstatus.go000066400000000000000000000054441472614177300331120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta1 import ( v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" ) // ResourceMetricStatusApplyConfiguration represents a declarative configuration of the ResourceMetricStatus type for use // with apply. type ResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` CurrentAverageUtilization *int32 `json:"currentAverageUtilization,omitempty"` CurrentAverageValue *resource.Quantity `json:"currentAverageValue,omitempty"` } // ResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ResourceMetricStatus type for use with // apply. func ResourceMetricStatus() *ResourceMetricStatusApplyConfiguration { return &ResourceMetricStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceMetricStatusApplyConfiguration) WithName(value v1.ResourceName) *ResourceMetricStatusApplyConfiguration { b.Name = &value return b } // WithCurrentAverageUtilization sets the CurrentAverageUtilization field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentAverageUtilization field is set to the value of the last call. func (b *ResourceMetricStatusApplyConfiguration) WithCurrentAverageUtilization(value int32) *ResourceMetricStatusApplyConfiguration { b.CurrentAverageUtilization = &value return b } // WithCurrentAverageValue sets the CurrentAverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentAverageValue field is set to the value of the last call. func (b *ResourceMetricStatusApplyConfiguration) WithCurrentAverageValue(value resource.Quantity) *ResourceMetricStatusApplyConfiguration { b.CurrentAverageValue = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/000077500000000000000000000000001472614177300262565ustar00rootroot00000000000000containerresourcemetricsource.go000066400000000000000000000053101472614177300347040ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v1 "k8s.io/api/core/v1" ) // ContainerResourceMetricSourceApplyConfiguration represents a declarative configuration of the ContainerResourceMetricSource type for use // with apply. type ContainerResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` Container *string `json:"container,omitempty"` } // ContainerResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricSource type for use with // apply. func ContainerResourceMetricSource() *ContainerResourceMetricSourceApplyConfiguration { return &ContainerResourceMetricSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithName(value v1.ResourceName) *ContainerResourceMetricSourceApplyConfiguration { b.Name = &value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *ContainerResourceMetricSourceApplyConfiguration { b.Target = value return b } // WithContainer sets the Container field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Container field is set to the value of the last call. func (b *ContainerResourceMetricSourceApplyConfiguration) WithContainer(value string) *ContainerResourceMetricSourceApplyConfiguration { b.Container = &value return b } containerresourcemetricstatus.go000066400000000000000000000053421472614177300347340ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v1 "k8s.io/api/core/v1" ) // ContainerResourceMetricStatusApplyConfiguration represents a declarative configuration of the ContainerResourceMetricStatus type for use // with apply. type ContainerResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` Container *string `json:"container,omitempty"` } // ContainerResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricStatus type for use with // apply. func ContainerResourceMetricStatus() *ContainerResourceMetricStatusApplyConfiguration { return &ContainerResourceMetricStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithName(value v1.ResourceName) *ContainerResourceMetricStatusApplyConfiguration { b.Name = &value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *ContainerResourceMetricStatusApplyConfiguration { b.Current = value return b } // WithContainer sets the Container field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Container field is set to the value of the last call. func (b *ContainerResourceMetricStatusApplyConfiguration) WithContainer(value string) *ContainerResourceMetricStatusApplyConfiguration { b.Container = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/crossversionobjectreference.go000066400000000000000000000050331472614177300344130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // CrossVersionObjectReferenceApplyConfiguration represents a declarative configuration of the CrossVersionObjectReference type for use // with apply. type CrossVersionObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` } // CrossVersionObjectReferenceApplyConfiguration constructs a declarative configuration of the CrossVersionObjectReference type for use with // apply. func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { return &CrossVersionObjectReferenceApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithKind(value string) *CrossVersionObjectReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithName(value string) *CrossVersionObjectReferenceApplyConfiguration { b.Name = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CrossVersionObjectReferenceApplyConfiguration) WithAPIVersion(value string) *CrossVersionObjectReferenceApplyConfiguration { b.APIVersion = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/externalmetricsource.go000066400000000000000000000041141472614177300330540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // ExternalMetricSourceApplyConfiguration represents a declarative configuration of the ExternalMetricSource type for use // with apply. type ExternalMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } // ExternalMetricSourceApplyConfiguration constructs a declarative configuration of the ExternalMetricSource type for use with // apply. func ExternalMetricSource() *ExternalMetricSourceApplyConfiguration { return &ExternalMetricSourceApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *ExternalMetricSourceApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *ExternalMetricSourceApplyConfiguration { b.Metric = value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ExternalMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *ExternalMetricSourceApplyConfiguration { b.Target = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/externalmetricstatus.go000066400000000000000000000041331472614177300331000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // ExternalMetricStatusApplyConfiguration represents a declarative configuration of the ExternalMetricStatus type for use // with apply. type ExternalMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } // ExternalMetricStatusApplyConfiguration constructs a declarative configuration of the ExternalMetricStatus type for use with // apply. func ExternalMetricStatus() *ExternalMetricStatusApplyConfiguration { return &ExternalMetricStatusApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *ExternalMetricStatusApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *ExternalMetricStatusApplyConfiguration { b.Metric = value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *ExternalMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *ExternalMetricStatusApplyConfiguration { b.Current = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go000066400000000000000000000326631472614177300335760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // HorizontalPodAutoscalerApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscaler type for use // with apply. type HorizontalPodAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *HorizontalPodAutoscalerSpecApplyConfiguration `json:"spec,omitempty"` Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` } // HorizontalPodAutoscaler constructs a declarative configuration of the HorizontalPodAutoscaler type for use with // apply. func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { b := &HorizontalPodAutoscalerApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("HorizontalPodAutoscaler") b.WithAPIVersion("autoscaling/v2beta2") return b } // ExtractHorizontalPodAutoscaler extracts the applied configuration owned by fieldManager from // horizontalPodAutoscaler. If no managedFields are found in horizontalPodAutoscaler for fieldManager, a // HorizontalPodAutoscalerApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // horizontalPodAutoscaler must be a unmodified HorizontalPodAutoscaler API object that was retrieved from the Kubernetes API. // ExtractHorizontalPodAutoscaler provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "") } // ExtractHorizontalPodAutoscalerStatus is the same as ExtractHorizontalPodAutoscaler except // that it extracts the status subresource applied configuration. // Experimental! func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status") } func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) { b := &HorizontalPodAutoscalerApplyConfiguration{} err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(horizontalPodAutoscaler.Name) b.WithNamespace(horizontalPodAutoscaler.Namespace) b.WithKind("HorizontalPodAutoscaler") b.WithAPIVersion("autoscaling/v2beta2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithKind(value string) *HorizontalPodAutoscalerApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithAPIVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithName(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithGenerateName(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithNamespace(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithUID(value types.UID) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithResourceVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithGeneration(value int64) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *HorizontalPodAutoscalerApplyConfiguration) WithLabels(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *HorizontalPodAutoscalerApplyConfiguration) WithAnnotations(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *HorizontalPodAutoscalerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *HorizontalPodAutoscalerApplyConfiguration) WithFinalizers(values ...string) *HorizontalPodAutoscalerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *HorizontalPodAutoscalerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithSpec(value *HorizontalPodAutoscalerSpecApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *HorizontalPodAutoscalerStatusApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *HorizontalPodAutoscalerApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } horizontalpodautoscalerbehavior.go000066400000000000000000000043561472614177300352350ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // HorizontalPodAutoscalerBehaviorApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerBehavior type for use // with apply. type HorizontalPodAutoscalerBehaviorApplyConfiguration struct { ScaleUp *HPAScalingRulesApplyConfiguration `json:"scaleUp,omitempty"` ScaleDown *HPAScalingRulesApplyConfiguration `json:"scaleDown,omitempty"` } // HorizontalPodAutoscalerBehaviorApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerBehavior type for use with // apply. func HorizontalPodAutoscalerBehavior() *HorizontalPodAutoscalerBehaviorApplyConfiguration { return &HorizontalPodAutoscalerBehaviorApplyConfiguration{} } // WithScaleUp sets the ScaleUp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleUp field is set to the value of the last call. func (b *HorizontalPodAutoscalerBehaviorApplyConfiguration) WithScaleUp(value *HPAScalingRulesApplyConfiguration) *HorizontalPodAutoscalerBehaviorApplyConfiguration { b.ScaleUp = value return b } // WithScaleDown sets the ScaleDown field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleDown field is set to the value of the last call. func (b *HorizontalPodAutoscalerBehaviorApplyConfiguration) WithScaleDown(value *HPAScalingRulesApplyConfiguration) *HorizontalPodAutoscalerBehaviorApplyConfiguration { b.ScaleDown = value return b } horizontalpodautoscalercondition.go000066400000000000000000000100201472614177300354050ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // HorizontalPodAutoscalerConditionApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerCondition type for use // with apply. type HorizontalPodAutoscalerConditionApplyConfiguration struct { Type *v2beta2.HorizontalPodAutoscalerConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // HorizontalPodAutoscalerConditionApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerCondition type for use with // apply. func HorizontalPodAutoscalerCondition() *HorizontalPodAutoscalerConditionApplyConfiguration { return &HorizontalPodAutoscalerConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithType(value v2beta2.HorizontalPodAutoscalerConditionType) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *HorizontalPodAutoscalerConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithReason(value string) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithMessage(value string) *HorizontalPodAutoscalerConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerspec.go000066400000000000000000000100651472614177300344410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // HorizontalPodAutoscalerSpecApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerSpec type for use // with apply. type HorizontalPodAutoscalerSpecApplyConfiguration struct { ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` MinReplicas *int32 `json:"minReplicas,omitempty"` MaxReplicas *int32 `json:"maxReplicas,omitempty"` Metrics []MetricSpecApplyConfiguration `json:"metrics,omitempty"` Behavior *HorizontalPodAutoscalerBehaviorApplyConfiguration `json:"behavior,omitempty"` } // HorizontalPodAutoscalerSpecApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerSpec type for use with // apply. func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { return &HorizontalPodAutoscalerSpecApplyConfiguration{} } // WithScaleTargetRef sets the ScaleTargetRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleTargetRef field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithScaleTargetRef(value *CrossVersionObjectReferenceApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { b.ScaleTargetRef = value return b } // WithMinReplicas sets the MinReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMinReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.MinReplicas = &value return b } // WithMaxReplicas sets the MaxReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMaxReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { b.MaxReplicas = &value return b } // WithMetrics adds the given value to the Metrics field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Metrics field. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMetrics(values ...*MetricSpecApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMetrics") } b.Metrics = append(b.Metrics, *values[i]) } return b } // WithBehavior sets the Behavior field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Behavior field is set to the value of the last call. func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithBehavior(value *HorizontalPodAutoscalerBehaviorApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { b.Behavior = value return b } horizontalpodautoscalerstatus.go000066400000000000000000000117531472614177300347600ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // HorizontalPodAutoscalerStatusApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerStatus type for use // with apply. type HorizontalPodAutoscalerStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` LastScaleTime *v1.Time `json:"lastScaleTime,omitempty"` CurrentReplicas *int32 `json:"currentReplicas,omitempty"` DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` CurrentMetrics []MetricStatusApplyConfiguration `json:"currentMetrics,omitempty"` Conditions []HorizontalPodAutoscalerConditionApplyConfiguration `json:"conditions,omitempty"` } // HorizontalPodAutoscalerStatusApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerStatus type for use with // apply. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { return &HorizontalPodAutoscalerStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithObservedGeneration(value int64) *HorizontalPodAutoscalerStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithLastScaleTime sets the LastScaleTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastScaleTime field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithLastScaleTime(value v1.Time) *HorizontalPodAutoscalerStatusApplyConfiguration { b.LastScaleTime = &value return b } // WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.CurrentReplicas = &value return b } // WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredReplicas field is set to the value of the last call. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithDesiredReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { b.DesiredReplicas = &value return b } // WithCurrentMetrics adds the given value to the CurrentMetrics field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CurrentMetrics field. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentMetrics(values ...*MetricStatusApplyConfiguration) *HorizontalPodAutoscalerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithCurrentMetrics") } b.CurrentMetrics = append(b.CurrentMetrics, *values[i]) } return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithConditions(values ...*HorizontalPodAutoscalerConditionApplyConfiguration) *HorizontalPodAutoscalerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/hpascalingpolicy.go000066400000000000000000000050561472614177300321440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" ) // HPAScalingPolicyApplyConfiguration represents a declarative configuration of the HPAScalingPolicy type for use // with apply. type HPAScalingPolicyApplyConfiguration struct { Type *v2beta2.HPAScalingPolicyType `json:"type,omitempty"` Value *int32 `json:"value,omitempty"` PeriodSeconds *int32 `json:"periodSeconds,omitempty"` } // HPAScalingPolicyApplyConfiguration constructs a declarative configuration of the HPAScalingPolicy type for use with // apply. func HPAScalingPolicy() *HPAScalingPolicyApplyConfiguration { return &HPAScalingPolicyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *HPAScalingPolicyApplyConfiguration) WithType(value v2beta2.HPAScalingPolicyType) *HPAScalingPolicyApplyConfiguration { b.Type = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *HPAScalingPolicyApplyConfiguration) WithValue(value int32) *HPAScalingPolicyApplyConfiguration { b.Value = &value return b } // WithPeriodSeconds sets the PeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PeriodSeconds field is set to the value of the last call. func (b *HPAScalingPolicyApplyConfiguration) WithPeriodSeconds(value int32) *HPAScalingPolicyApplyConfiguration { b.PeriodSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/hpascalingrules.go000066400000000000000000000056271472614177300320030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" ) // HPAScalingRulesApplyConfiguration represents a declarative configuration of the HPAScalingRules type for use // with apply. type HPAScalingRulesApplyConfiguration struct { StabilizationWindowSeconds *int32 `json:"stabilizationWindowSeconds,omitempty"` SelectPolicy *v2beta2.ScalingPolicySelect `json:"selectPolicy,omitempty"` Policies []HPAScalingPolicyApplyConfiguration `json:"policies,omitempty"` } // HPAScalingRulesApplyConfiguration constructs a declarative configuration of the HPAScalingRules type for use with // apply. func HPAScalingRules() *HPAScalingRulesApplyConfiguration { return &HPAScalingRulesApplyConfiguration{} } // WithStabilizationWindowSeconds sets the StabilizationWindowSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StabilizationWindowSeconds field is set to the value of the last call. func (b *HPAScalingRulesApplyConfiguration) WithStabilizationWindowSeconds(value int32) *HPAScalingRulesApplyConfiguration { b.StabilizationWindowSeconds = &value return b } // WithSelectPolicy sets the SelectPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SelectPolicy field is set to the value of the last call. func (b *HPAScalingRulesApplyConfiguration) WithSelectPolicy(value v2beta2.ScalingPolicySelect) *HPAScalingRulesApplyConfiguration { b.SelectPolicy = &value return b } // WithPolicies adds the given value to the Policies field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Policies field. func (b *HPAScalingRulesApplyConfiguration) WithPolicies(values ...*HPAScalingPolicyApplyConfiguration) *HPAScalingRulesApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPolicies") } b.Policies = append(b.Policies, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/metricidentifier.go000066400000000000000000000041071472614177300321350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // MetricIdentifierApplyConfiguration represents a declarative configuration of the MetricIdentifier type for use // with apply. type MetricIdentifierApplyConfiguration struct { Name *string `json:"name,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } // MetricIdentifierApplyConfiguration constructs a declarative configuration of the MetricIdentifier type for use with // apply. func MetricIdentifier() *MetricIdentifierApplyConfiguration { return &MetricIdentifierApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *MetricIdentifierApplyConfiguration) WithName(value string) *MetricIdentifierApplyConfiguration { b.Name = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *MetricIdentifierApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *MetricIdentifierApplyConfiguration { b.Selector = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/metricspec.go000066400000000000000000000102611472614177300307430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" ) // MetricSpecApplyConfiguration represents a declarative configuration of the MetricSpec type for use // with apply. type MetricSpecApplyConfiguration struct { Type *v2beta2.MetricSourceType `json:"type,omitempty"` Object *ObjectMetricSourceApplyConfiguration `json:"object,omitempty"` Pods *PodsMetricSourceApplyConfiguration `json:"pods,omitempty"` Resource *ResourceMetricSourceApplyConfiguration `json:"resource,omitempty"` ContainerResource *ContainerResourceMetricSourceApplyConfiguration `json:"containerResource,omitempty"` External *ExternalMetricSourceApplyConfiguration `json:"external,omitempty"` } // MetricSpecApplyConfiguration constructs a declarative configuration of the MetricSpec type for use with // apply. func MetricSpec() *MetricSpecApplyConfiguration { return &MetricSpecApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithType(value v2beta2.MetricSourceType) *MetricSpecApplyConfiguration { b.Type = &value return b } // WithObject sets the Object field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Object field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithObject(value *ObjectMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Object = value return b } // WithPods sets the Pods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Pods field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithPods(value *PodsMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Pods = value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithResource(value *ResourceMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.Resource = value return b } // WithContainerResource sets the ContainerResource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerResource field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithContainerResource(value *ContainerResourceMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.ContainerResource = value return b } // WithExternal sets the External field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the External field is set to the value of the last call. func (b *MetricSpecApplyConfiguration) WithExternal(value *ExternalMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration { b.External = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/metricstatus.go000066400000000000000000000103311472614177300313320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" ) // MetricStatusApplyConfiguration represents a declarative configuration of the MetricStatus type for use // with apply. type MetricStatusApplyConfiguration struct { Type *v2beta2.MetricSourceType `json:"type,omitempty"` Object *ObjectMetricStatusApplyConfiguration `json:"object,omitempty"` Pods *PodsMetricStatusApplyConfiguration `json:"pods,omitempty"` Resource *ResourceMetricStatusApplyConfiguration `json:"resource,omitempty"` ContainerResource *ContainerResourceMetricStatusApplyConfiguration `json:"containerResource,omitempty"` External *ExternalMetricStatusApplyConfiguration `json:"external,omitempty"` } // MetricStatusApplyConfiguration constructs a declarative configuration of the MetricStatus type for use with // apply. func MetricStatus() *MetricStatusApplyConfiguration { return &MetricStatusApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithType(value v2beta2.MetricSourceType) *MetricStatusApplyConfiguration { b.Type = &value return b } // WithObject sets the Object field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Object field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithObject(value *ObjectMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Object = value return b } // WithPods sets the Pods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Pods field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithPods(value *PodsMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Pods = value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithResource(value *ResourceMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.Resource = value return b } // WithContainerResource sets the ContainerResource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerResource field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithContainerResource(value *ContainerResourceMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.ContainerResource = value return b } // WithExternal sets the External field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the External field is set to the value of the last call. func (b *MetricStatusApplyConfiguration) WithExternal(value *ExternalMetricStatusApplyConfiguration) *MetricStatusApplyConfiguration { b.External = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/metrictarget.go000066400000000000000000000061321472614177300313010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" resource "k8s.io/apimachinery/pkg/api/resource" ) // MetricTargetApplyConfiguration represents a declarative configuration of the MetricTarget type for use // with apply. type MetricTargetApplyConfiguration struct { Type *v2beta2.MetricTargetType `json:"type,omitempty"` Value *resource.Quantity `json:"value,omitempty"` AverageValue *resource.Quantity `json:"averageValue,omitempty"` AverageUtilization *int32 `json:"averageUtilization,omitempty"` } // MetricTargetApplyConfiguration constructs a declarative configuration of the MetricTarget type for use with // apply. func MetricTarget() *MetricTargetApplyConfiguration { return &MetricTargetApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MetricTargetApplyConfiguration) WithType(value v2beta2.MetricTargetType) *MetricTargetApplyConfiguration { b.Type = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *MetricTargetApplyConfiguration) WithValue(value resource.Quantity) *MetricTargetApplyConfiguration { b.Value = &value return b } // WithAverageValue sets the AverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageValue field is set to the value of the last call. func (b *MetricTargetApplyConfiguration) WithAverageValue(value resource.Quantity) *MetricTargetApplyConfiguration { b.AverageValue = &value return b } // WithAverageUtilization sets the AverageUtilization field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageUtilization field is set to the value of the last call. func (b *MetricTargetApplyConfiguration) WithAverageUtilization(value int32) *MetricTargetApplyConfiguration { b.AverageUtilization = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/metricvaluestatus.go000066400000000000000000000052001472614177300323660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( resource "k8s.io/apimachinery/pkg/api/resource" ) // MetricValueStatusApplyConfiguration represents a declarative configuration of the MetricValueStatus type for use // with apply. type MetricValueStatusApplyConfiguration struct { Value *resource.Quantity `json:"value,omitempty"` AverageValue *resource.Quantity `json:"averageValue,omitempty"` AverageUtilization *int32 `json:"averageUtilization,omitempty"` } // MetricValueStatusApplyConfiguration constructs a declarative configuration of the MetricValueStatus type for use with // apply. func MetricValueStatus() *MetricValueStatusApplyConfiguration { return &MetricValueStatusApplyConfiguration{} } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *MetricValueStatusApplyConfiguration) WithValue(value resource.Quantity) *MetricValueStatusApplyConfiguration { b.Value = &value return b } // WithAverageValue sets the AverageValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageValue field is set to the value of the last call. func (b *MetricValueStatusApplyConfiguration) WithAverageValue(value resource.Quantity) *MetricValueStatusApplyConfiguration { b.AverageValue = &value return b } // WithAverageUtilization sets the AverageUtilization field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AverageUtilization field is set to the value of the last call. func (b *MetricValueStatusApplyConfiguration) WithAverageUtilization(value int32) *MetricValueStatusApplyConfiguration { b.AverageUtilization = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/objectmetricsource.go000066400000000000000000000052621472614177300325050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // ObjectMetricSourceApplyConfiguration represents a declarative configuration of the ObjectMetricSource type for use // with apply. type ObjectMetricSourceApplyConfiguration struct { DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` } // ObjectMetricSourceApplyConfiguration constructs a declarative configuration of the ObjectMetricSource type for use with // apply. func ObjectMetricSource() *ObjectMetricSourceApplyConfiguration { return &ObjectMetricSourceApplyConfiguration{} } // WithDescribedObject sets the DescribedObject field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DescribedObject field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithDescribedObject(value *CrossVersionObjectReferenceApplyConfiguration) *ObjectMetricSourceApplyConfiguration { b.DescribedObject = value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *ObjectMetricSourceApplyConfiguration { b.Target = value return b } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *ObjectMetricSourceApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *ObjectMetricSourceApplyConfiguration { b.Metric = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/objectmetricstatus.go000066400000000000000000000052751472614177300325340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // ObjectMetricStatusApplyConfiguration represents a declarative configuration of the ObjectMetricStatus type for use // with apply. type ObjectMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` } // ObjectMetricStatusApplyConfiguration constructs a declarative configuration of the ObjectMetricStatus type for use with // apply. func ObjectMetricStatus() *ObjectMetricStatusApplyConfiguration { return &ObjectMetricStatusApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *ObjectMetricStatusApplyConfiguration { b.Metric = value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *ObjectMetricStatusApplyConfiguration { b.Current = value return b } // WithDescribedObject sets the DescribedObject field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DescribedObject field is set to the value of the last call. func (b *ObjectMetricStatusApplyConfiguration) WithDescribedObject(value *CrossVersionObjectReferenceApplyConfiguration) *ObjectMetricStatusApplyConfiguration { b.DescribedObject = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/podsmetricsource.go000066400000000000000000000040341472614177300322000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // PodsMetricSourceApplyConfiguration represents a declarative configuration of the PodsMetricSource type for use // with apply. type PodsMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } // PodsMetricSourceApplyConfiguration constructs a declarative configuration of the PodsMetricSource type for use with // apply. func PodsMetricSource() *PodsMetricSourceApplyConfiguration { return &PodsMetricSourceApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *PodsMetricSourceApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *PodsMetricSourceApplyConfiguration { b.Metric = value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *PodsMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *PodsMetricSourceApplyConfiguration { b.Target = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/podsmetricstatus.go000066400000000000000000000040531472614177300322240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 // PodsMetricStatusApplyConfiguration represents a declarative configuration of the PodsMetricStatus type for use // with apply. type PodsMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } // PodsMetricStatusApplyConfiguration constructs a declarative configuration of the PodsMetricStatus type for use with // apply. func PodsMetricStatus() *PodsMetricStatusApplyConfiguration { return &PodsMetricStatusApplyConfiguration{} } // WithMetric sets the Metric field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Metric field is set to the value of the last call. func (b *PodsMetricStatusApplyConfiguration) WithMetric(value *MetricIdentifierApplyConfiguration) *PodsMetricStatusApplyConfiguration { b.Metric = value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *PodsMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *PodsMetricStatusApplyConfiguration { b.Current = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/resourcemetricsource.go000066400000000000000000000041121472614177300330570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v1 "k8s.io/api/core/v1" ) // ResourceMetricSourceApplyConfiguration represents a declarative configuration of the ResourceMetricSource type for use // with apply. type ResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } // ResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ResourceMetricSource type for use with // apply. func ResourceMetricSource() *ResourceMetricSourceApplyConfiguration { return &ResourceMetricSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceMetricSourceApplyConfiguration) WithName(value v1.ResourceName) *ResourceMetricSourceApplyConfiguration { b.Name = &value return b } // WithTarget sets the Target field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Target field is set to the value of the last call. func (b *ResourceMetricSourceApplyConfiguration) WithTarget(value *MetricTargetApplyConfiguration) *ResourceMetricSourceApplyConfiguration { b.Target = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/autoscaling/v2beta2/resourcemetricstatus.go000066400000000000000000000041411472614177300331040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v2beta2 import ( v1 "k8s.io/api/core/v1" ) // ResourceMetricStatusApplyConfiguration represents a declarative configuration of the ResourceMetricStatus type for use // with apply. type ResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } // ResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ResourceMetricStatus type for use with // apply. func ResourceMetricStatus() *ResourceMetricStatusApplyConfiguration { return &ResourceMetricStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceMetricStatusApplyConfiguration) WithName(value v1.ResourceName) *ResourceMetricStatusApplyConfiguration { b.Name = &value return b } // WithCurrent sets the Current field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Current field is set to the value of the last call. func (b *ResourceMetricStatusApplyConfiguration) WithCurrent(value *MetricValueStatusApplyConfiguration) *ResourceMetricStatusApplyConfiguration { b.Current = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/000077500000000000000000000000001472614177300235615ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/000077500000000000000000000000001472614177300241075ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/cronjob.go000066400000000000000000000301421472614177300260720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apibatchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CronJobApplyConfiguration represents a declarative configuration of the CronJob type for use // with apply. type CronJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CronJobSpecApplyConfiguration `json:"spec,omitempty"` Status *CronJobStatusApplyConfiguration `json:"status,omitempty"` } // CronJob constructs a declarative configuration of the CronJob type for use with // apply. func CronJob(name, namespace string) *CronJobApplyConfiguration { b := &CronJobApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("CronJob") b.WithAPIVersion("batch/v1") return b } // ExtractCronJob extracts the applied configuration owned by fieldManager from // cronJob. If no managedFields are found in cronJob for fieldManager, a // CronJobApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cronJob must be a unmodified CronJob API object that was retrieved from the Kubernetes API. // ExtractCronJob provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCronJob(cronJob *apibatchv1.CronJob, fieldManager string) (*CronJobApplyConfiguration, error) { return extractCronJob(cronJob, fieldManager, "") } // ExtractCronJobStatus is the same as ExtractCronJob except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCronJobStatus(cronJob *apibatchv1.CronJob, fieldManager string) (*CronJobApplyConfiguration, error) { return extractCronJob(cronJob, fieldManager, "status") } func extractCronJob(cronJob *apibatchv1.CronJob, fieldManager string, subresource string) (*CronJobApplyConfiguration, error) { b := &CronJobApplyConfiguration{} err := managedfields.ExtractInto(cronJob, internal.Parser().Type("io.k8s.api.batch.v1.CronJob"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cronJob.Name) b.WithNamespace(cronJob.Namespace) b.WithKind("CronJob") b.WithAPIVersion("batch/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithKind(value string) *CronJobApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithAPIVersion(value string) *CronJobApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithName(value string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithGenerateName(value string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithNamespace(value string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithUID(value types.UID) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithResourceVersion(value string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithGeneration(value int64) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CronJobApplyConfiguration) WithLabels(entries map[string]string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CronJobApplyConfiguration) WithAnnotations(entries map[string]string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CronJobApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CronJobApplyConfiguration) WithFinalizers(values ...string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CronJobApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithSpec(value *CronJobSpecApplyConfiguration) *CronJobApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithStatus(value *CronJobStatusApplyConfiguration) *CronJobApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CronJobApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/cronjobspec.go000066400000000000000000000125171472614177300267530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/batch/v1" ) // CronJobSpecApplyConfiguration represents a declarative configuration of the CronJobSpec type for use // with apply. type CronJobSpecApplyConfiguration struct { Schedule *string `json:"schedule,omitempty"` TimeZone *string `json:"timeZone,omitempty"` StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"` ConcurrencyPolicy *v1.ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"` Suspend *bool `json:"suspend,omitempty"` JobTemplate *JobTemplateSpecApplyConfiguration `json:"jobTemplate,omitempty"` SuccessfulJobsHistoryLimit *int32 `json:"successfulJobsHistoryLimit,omitempty"` FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"` } // CronJobSpecApplyConfiguration constructs a declarative configuration of the CronJobSpec type for use with // apply. func CronJobSpec() *CronJobSpecApplyConfiguration { return &CronJobSpecApplyConfiguration{} } // WithSchedule sets the Schedule field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Schedule field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithSchedule(value string) *CronJobSpecApplyConfiguration { b.Schedule = &value return b } // WithTimeZone sets the TimeZone field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeZone field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithTimeZone(value string) *CronJobSpecApplyConfiguration { b.TimeZone = &value return b } // WithStartingDeadlineSeconds sets the StartingDeadlineSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartingDeadlineSeconds field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithStartingDeadlineSeconds(value int64) *CronJobSpecApplyConfiguration { b.StartingDeadlineSeconds = &value return b } // WithConcurrencyPolicy sets the ConcurrencyPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConcurrencyPolicy field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithConcurrencyPolicy(value v1.ConcurrencyPolicy) *CronJobSpecApplyConfiguration { b.ConcurrencyPolicy = &value return b } // WithSuspend sets the Suspend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Suspend field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithSuspend(value bool) *CronJobSpecApplyConfiguration { b.Suspend = &value return b } // WithJobTemplate sets the JobTemplate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the JobTemplate field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithJobTemplate(value *JobTemplateSpecApplyConfiguration) *CronJobSpecApplyConfiguration { b.JobTemplate = value return b } // WithSuccessfulJobsHistoryLimit sets the SuccessfulJobsHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SuccessfulJobsHistoryLimit field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithSuccessfulJobsHistoryLimit(value int32) *CronJobSpecApplyConfiguration { b.SuccessfulJobsHistoryLimit = &value return b } // WithFailedJobsHistoryLimit sets the FailedJobsHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailedJobsHistoryLimit field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithFailedJobsHistoryLimit(value int32) *CronJobSpecApplyConfiguration { b.FailedJobsHistoryLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/cronjobstatus.go000066400000000000000000000055541472614177300273470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // CronJobStatusApplyConfiguration represents a declarative configuration of the CronJobStatus type for use // with apply. type CronJobStatusApplyConfiguration struct { Active []v1.ObjectReferenceApplyConfiguration `json:"active,omitempty"` LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"` LastSuccessfulTime *metav1.Time `json:"lastSuccessfulTime,omitempty"` } // CronJobStatusApplyConfiguration constructs a declarative configuration of the CronJobStatus type for use with // apply. func CronJobStatus() *CronJobStatusApplyConfiguration { return &CronJobStatusApplyConfiguration{} } // WithActive adds the given value to the Active field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Active field. func (b *CronJobStatusApplyConfiguration) WithActive(values ...*v1.ObjectReferenceApplyConfiguration) *CronJobStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithActive") } b.Active = append(b.Active, *values[i]) } return b } // WithLastScheduleTime sets the LastScheduleTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastScheduleTime field is set to the value of the last call. func (b *CronJobStatusApplyConfiguration) WithLastScheduleTime(value metav1.Time) *CronJobStatusApplyConfiguration { b.LastScheduleTime = &value return b } // WithLastSuccessfulTime sets the LastSuccessfulTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastSuccessfulTime field is set to the value of the last call. func (b *CronJobStatusApplyConfiguration) WithLastSuccessfulTime(value metav1.Time) *CronJobStatusApplyConfiguration { b.LastSuccessfulTime = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/job.go000066400000000000000000000274421472614177300252210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apibatchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // JobApplyConfiguration represents a declarative configuration of the Job type for use // with apply. type JobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *JobSpecApplyConfiguration `json:"spec,omitempty"` Status *JobStatusApplyConfiguration `json:"status,omitempty"` } // Job constructs a declarative configuration of the Job type for use with // apply. func Job(name, namespace string) *JobApplyConfiguration { b := &JobApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Job") b.WithAPIVersion("batch/v1") return b } // ExtractJob extracts the applied configuration owned by fieldManager from // job. If no managedFields are found in job for fieldManager, a // JobApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // job must be a unmodified Job API object that was retrieved from the Kubernetes API. // ExtractJob provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractJob(job *apibatchv1.Job, fieldManager string) (*JobApplyConfiguration, error) { return extractJob(job, fieldManager, "") } // ExtractJobStatus is the same as ExtractJob except // that it extracts the status subresource applied configuration. // Experimental! func ExtractJobStatus(job *apibatchv1.Job, fieldManager string) (*JobApplyConfiguration, error) { return extractJob(job, fieldManager, "status") } func extractJob(job *apibatchv1.Job, fieldManager string, subresource string) (*JobApplyConfiguration, error) { b := &JobApplyConfiguration{} err := managedfields.ExtractInto(job, internal.Parser().Type("io.k8s.api.batch.v1.Job"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(job.Name) b.WithNamespace(job.Namespace) b.WithKind("Job") b.WithAPIVersion("batch/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *JobApplyConfiguration) WithKind(value string) *JobApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *JobApplyConfiguration) WithAPIVersion(value string) *JobApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *JobApplyConfiguration) WithName(value string) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *JobApplyConfiguration) WithGenerateName(value string) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *JobApplyConfiguration) WithNamespace(value string) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *JobApplyConfiguration) WithUID(value types.UID) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *JobApplyConfiguration) WithResourceVersion(value string) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *JobApplyConfiguration) WithGeneration(value int64) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *JobApplyConfiguration) WithCreationTimestamp(value metav1.Time) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *JobApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *JobApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *JobApplyConfiguration) WithLabels(entries map[string]string) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *JobApplyConfiguration) WithAnnotations(entries map[string]string) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *JobApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *JobApplyConfiguration) WithFinalizers(values ...string) *JobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *JobApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *JobApplyConfiguration) WithSpec(value *JobSpecApplyConfiguration) *JobApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *JobApplyConfiguration) WithStatus(value *JobStatusApplyConfiguration) *JobApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *JobApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/jobcondition.go000066400000000000000000000100341472614177300271150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // JobConditionApplyConfiguration represents a declarative configuration of the JobCondition type for use // with apply. type JobConditionApplyConfiguration struct { Type *v1.JobConditionType `json:"type,omitempty"` Status *corev1.ConditionStatus `json:"status,omitempty"` LastProbeTime *metav1.Time `json:"lastProbeTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // JobConditionApplyConfiguration constructs a declarative configuration of the JobCondition type for use with // apply. func JobCondition() *JobConditionApplyConfiguration { return &JobConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *JobConditionApplyConfiguration) WithType(value v1.JobConditionType) *JobConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *JobConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *JobConditionApplyConfiguration { b.Status = &value return b } // WithLastProbeTime sets the LastProbeTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastProbeTime field is set to the value of the last call. func (b *JobConditionApplyConfiguration) WithLastProbeTime(value metav1.Time) *JobConditionApplyConfiguration { b.LastProbeTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *JobConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *JobConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *JobConditionApplyConfiguration) WithReason(value string) *JobConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *JobConditionApplyConfiguration) WithMessage(value string) *JobConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/jobspec.go000066400000000000000000000231361472614177300260700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/client-go/applyconfigurations/core/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // JobSpecApplyConfiguration represents a declarative configuration of the JobSpec type for use // with apply. type JobSpecApplyConfiguration struct { Parallelism *int32 `json:"parallelism,omitempty"` Completions *int32 `json:"completions,omitempty"` ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` PodFailurePolicy *PodFailurePolicyApplyConfiguration `json:"podFailurePolicy,omitempty"` SuccessPolicy *SuccessPolicyApplyConfiguration `json:"successPolicy,omitempty"` BackoffLimit *int32 `json:"backoffLimit,omitempty"` BackoffLimitPerIndex *int32 `json:"backoffLimitPerIndex,omitempty"` MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty"` Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` ManualSelector *bool `json:"manualSelector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"` Suspend *bool `json:"suspend,omitempty"` PodReplacementPolicy *batchv1.PodReplacementPolicy `json:"podReplacementPolicy,omitempty"` ManagedBy *string `json:"managedBy,omitempty"` } // JobSpecApplyConfiguration constructs a declarative configuration of the JobSpec type for use with // apply. func JobSpec() *JobSpecApplyConfiguration { return &JobSpecApplyConfiguration{} } // WithParallelism sets the Parallelism field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Parallelism field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithParallelism(value int32) *JobSpecApplyConfiguration { b.Parallelism = &value return b } // WithCompletions sets the Completions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Completions field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithCompletions(value int32) *JobSpecApplyConfiguration { b.Completions = &value return b } // WithActiveDeadlineSeconds sets the ActiveDeadlineSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ActiveDeadlineSeconds field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithActiveDeadlineSeconds(value int64) *JobSpecApplyConfiguration { b.ActiveDeadlineSeconds = &value return b } // WithPodFailurePolicy sets the PodFailurePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodFailurePolicy field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithPodFailurePolicy(value *PodFailurePolicyApplyConfiguration) *JobSpecApplyConfiguration { b.PodFailurePolicy = value return b } // WithSuccessPolicy sets the SuccessPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SuccessPolicy field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithSuccessPolicy(value *SuccessPolicyApplyConfiguration) *JobSpecApplyConfiguration { b.SuccessPolicy = value return b } // WithBackoffLimit sets the BackoffLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BackoffLimit field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithBackoffLimit(value int32) *JobSpecApplyConfiguration { b.BackoffLimit = &value return b } // WithBackoffLimitPerIndex sets the BackoffLimitPerIndex field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BackoffLimitPerIndex field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithBackoffLimitPerIndex(value int32) *JobSpecApplyConfiguration { b.BackoffLimitPerIndex = &value return b } // WithMaxFailedIndexes sets the MaxFailedIndexes field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxFailedIndexes field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithMaxFailedIndexes(value int32) *JobSpecApplyConfiguration { b.MaxFailedIndexes = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *JobSpecApplyConfiguration { b.Selector = value return b } // WithManualSelector sets the ManualSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ManualSelector field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithManualSelector(value bool) *JobSpecApplyConfiguration { b.ManualSelector = &value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *JobSpecApplyConfiguration { b.Template = value return b } // WithTTLSecondsAfterFinished sets the TTLSecondsAfterFinished field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TTLSecondsAfterFinished field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithTTLSecondsAfterFinished(value int32) *JobSpecApplyConfiguration { b.TTLSecondsAfterFinished = &value return b } // WithCompletionMode sets the CompletionMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CompletionMode field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithCompletionMode(value batchv1.CompletionMode) *JobSpecApplyConfiguration { b.CompletionMode = &value return b } // WithSuspend sets the Suspend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Suspend field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithSuspend(value bool) *JobSpecApplyConfiguration { b.Suspend = &value return b } // WithPodReplacementPolicy sets the PodReplacementPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodReplacementPolicy field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithPodReplacementPolicy(value batchv1.PodReplacementPolicy) *JobSpecApplyConfiguration { b.PodReplacementPolicy = &value return b } // WithManagedBy sets the ManagedBy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ManagedBy field is set to the value of the last call. func (b *JobSpecApplyConfiguration) WithManagedBy(value string) *JobSpecApplyConfiguration { b.ManagedBy = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/jobstatus.go000066400000000000000000000155401472614177300264610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // JobStatusApplyConfiguration represents a declarative configuration of the JobStatus type for use // with apply. type JobStatusApplyConfiguration struct { Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"` StartTime *metav1.Time `json:"startTime,omitempty"` CompletionTime *metav1.Time `json:"completionTime,omitempty"` Active *int32 `json:"active,omitempty"` Succeeded *int32 `json:"succeeded,omitempty"` Failed *int32 `json:"failed,omitempty"` Terminating *int32 `json:"terminating,omitempty"` CompletedIndexes *string `json:"completedIndexes,omitempty"` FailedIndexes *string `json:"failedIndexes,omitempty"` UncountedTerminatedPods *UncountedTerminatedPodsApplyConfiguration `json:"uncountedTerminatedPods,omitempty"` Ready *int32 `json:"ready,omitempty"` } // JobStatusApplyConfiguration constructs a declarative configuration of the JobStatus type for use with // apply. func JobStatus() *JobStatusApplyConfiguration { return &JobStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *JobStatusApplyConfiguration) WithConditions(values ...*JobConditionApplyConfiguration) *JobStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithStartTime sets the StartTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartTime field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithStartTime(value metav1.Time) *JobStatusApplyConfiguration { b.StartTime = &value return b } // WithCompletionTime sets the CompletionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CompletionTime field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithCompletionTime(value metav1.Time) *JobStatusApplyConfiguration { b.CompletionTime = &value return b } // WithActive sets the Active field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Active field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithActive(value int32) *JobStatusApplyConfiguration { b.Active = &value return b } // WithSucceeded sets the Succeeded field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Succeeded field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithSucceeded(value int32) *JobStatusApplyConfiguration { b.Succeeded = &value return b } // WithFailed sets the Failed field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Failed field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithFailed(value int32) *JobStatusApplyConfiguration { b.Failed = &value return b } // WithTerminating sets the Terminating field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Terminating field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithTerminating(value int32) *JobStatusApplyConfiguration { b.Terminating = &value return b } // WithCompletedIndexes sets the CompletedIndexes field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CompletedIndexes field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithCompletedIndexes(value string) *JobStatusApplyConfiguration { b.CompletedIndexes = &value return b } // WithFailedIndexes sets the FailedIndexes field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailedIndexes field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithFailedIndexes(value string) *JobStatusApplyConfiguration { b.FailedIndexes = &value return b } // WithUncountedTerminatedPods sets the UncountedTerminatedPods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UncountedTerminatedPods field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithUncountedTerminatedPods(value *UncountedTerminatedPodsApplyConfiguration) *JobStatusApplyConfiguration { b.UncountedTerminatedPods = value return b } // WithReady sets the Ready field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ready field is set to the value of the last call. func (b *JobStatusApplyConfiguration) WithReady(value int32) *JobStatusApplyConfiguration { b.Ready = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/jobtemplatespec.go000066400000000000000000000217751472614177300276330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // JobTemplateSpecApplyConfiguration represents a declarative configuration of the JobTemplateSpec type for use // with apply. type JobTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *JobSpecApplyConfiguration `json:"spec,omitempty"` } // JobTemplateSpecApplyConfiguration constructs a declarative configuration of the JobTemplateSpec type for use with // apply. func JobTemplateSpec() *JobTemplateSpecApplyConfiguration { return &JobTemplateSpecApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithName(value string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithGenerateName(value string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithNamespace(value string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithUID(value types.UID) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithResourceVersion(value string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithGeneration(value int64) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *JobTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *JobTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *JobTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *JobTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *JobTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithSpec(value *JobSpecApplyConfiguration) *JobTemplateSpecApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *JobTemplateSpecApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/podfailurepolicy.go000066400000000000000000000032511472614177300300110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodFailurePolicyApplyConfiguration represents a declarative configuration of the PodFailurePolicy type for use // with apply. type PodFailurePolicyApplyConfiguration struct { Rules []PodFailurePolicyRuleApplyConfiguration `json:"rules,omitempty"` } // PodFailurePolicyApplyConfiguration constructs a declarative configuration of the PodFailurePolicy type for use with // apply. func PodFailurePolicy() *PodFailurePolicyApplyConfiguration { return &PodFailurePolicyApplyConfiguration{} } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *PodFailurePolicyApplyConfiguration) WithRules(values ...*PodFailurePolicyRuleApplyConfiguration) *PodFailurePolicyApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/podfailurepolicyonexitcodesrequirement.go000066400000000000000000000057261472614177300345500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/batch/v1" ) // PodFailurePolicyOnExitCodesRequirementApplyConfiguration represents a declarative configuration of the PodFailurePolicyOnExitCodesRequirement type for use // with apply. type PodFailurePolicyOnExitCodesRequirementApplyConfiguration struct { ContainerName *string `json:"containerName,omitempty"` Operator *v1.PodFailurePolicyOnExitCodesOperator `json:"operator,omitempty"` Values []int32 `json:"values,omitempty"` } // PodFailurePolicyOnExitCodesRequirementApplyConfiguration constructs a declarative configuration of the PodFailurePolicyOnExitCodesRequirement type for use with // apply. func PodFailurePolicyOnExitCodesRequirement() *PodFailurePolicyOnExitCodesRequirementApplyConfiguration { return &PodFailurePolicyOnExitCodesRequirementApplyConfiguration{} } // WithContainerName sets the ContainerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerName field is set to the value of the last call. func (b *PodFailurePolicyOnExitCodesRequirementApplyConfiguration) WithContainerName(value string) *PodFailurePolicyOnExitCodesRequirementApplyConfiguration { b.ContainerName = &value return b } // WithOperator sets the Operator field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Operator field is set to the value of the last call. func (b *PodFailurePolicyOnExitCodesRequirementApplyConfiguration) WithOperator(value v1.PodFailurePolicyOnExitCodesOperator) *PodFailurePolicyOnExitCodesRequirementApplyConfiguration { b.Operator = &value return b } // WithValues adds the given value to the Values field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Values field. func (b *PodFailurePolicyOnExitCodesRequirementApplyConfiguration) WithValues(values ...int32) *PodFailurePolicyOnExitCodesRequirementApplyConfiguration { for i := range values { b.Values = append(b.Values, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/podfailurepolicyonpodconditionspattern.go000066400000000000000000000043771472614177300345530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // PodFailurePolicyOnPodConditionsPatternApplyConfiguration represents a declarative configuration of the PodFailurePolicyOnPodConditionsPattern type for use // with apply. type PodFailurePolicyOnPodConditionsPatternApplyConfiguration struct { Type *v1.PodConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` } // PodFailurePolicyOnPodConditionsPatternApplyConfiguration constructs a declarative configuration of the PodFailurePolicyOnPodConditionsPattern type for use with // apply. func PodFailurePolicyOnPodConditionsPattern() *PodFailurePolicyOnPodConditionsPatternApplyConfiguration { return &PodFailurePolicyOnPodConditionsPatternApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PodFailurePolicyOnPodConditionsPatternApplyConfiguration) WithType(value v1.PodConditionType) *PodFailurePolicyOnPodConditionsPatternApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PodFailurePolicyOnPodConditionsPatternApplyConfiguration) WithStatus(value v1.ConditionStatus) *PodFailurePolicyOnPodConditionsPatternApplyConfiguration { b.Status = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/podfailurepolicyrule.go000066400000000000000000000057521472614177300307110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/batch/v1" ) // PodFailurePolicyRuleApplyConfiguration represents a declarative configuration of the PodFailurePolicyRule type for use // with apply. type PodFailurePolicyRuleApplyConfiguration struct { Action *v1.PodFailurePolicyAction `json:"action,omitempty"` OnExitCodes *PodFailurePolicyOnExitCodesRequirementApplyConfiguration `json:"onExitCodes,omitempty"` OnPodConditions []PodFailurePolicyOnPodConditionsPatternApplyConfiguration `json:"onPodConditions,omitempty"` } // PodFailurePolicyRuleApplyConfiguration constructs a declarative configuration of the PodFailurePolicyRule type for use with // apply. func PodFailurePolicyRule() *PodFailurePolicyRuleApplyConfiguration { return &PodFailurePolicyRuleApplyConfiguration{} } // WithAction sets the Action field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Action field is set to the value of the last call. func (b *PodFailurePolicyRuleApplyConfiguration) WithAction(value v1.PodFailurePolicyAction) *PodFailurePolicyRuleApplyConfiguration { b.Action = &value return b } // WithOnExitCodes sets the OnExitCodes field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the OnExitCodes field is set to the value of the last call. func (b *PodFailurePolicyRuleApplyConfiguration) WithOnExitCodes(value *PodFailurePolicyOnExitCodesRequirementApplyConfiguration) *PodFailurePolicyRuleApplyConfiguration { b.OnExitCodes = value return b } // WithOnPodConditions adds the given value to the OnPodConditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OnPodConditions field. func (b *PodFailurePolicyRuleApplyConfiguration) WithOnPodConditions(values ...*PodFailurePolicyOnPodConditionsPatternApplyConfiguration) *PodFailurePolicyRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithOnPodConditions") } b.OnPodConditions = append(b.OnPodConditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/successpolicy.go000066400000000000000000000032051472614177300273260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SuccessPolicyApplyConfiguration represents a declarative configuration of the SuccessPolicy type for use // with apply. type SuccessPolicyApplyConfiguration struct { Rules []SuccessPolicyRuleApplyConfiguration `json:"rules,omitempty"` } // SuccessPolicyApplyConfiguration constructs a declarative configuration of the SuccessPolicy type for use with // apply. func SuccessPolicy() *SuccessPolicyApplyConfiguration { return &SuccessPolicyApplyConfiguration{} } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *SuccessPolicyApplyConfiguration) WithRules(values ...*SuccessPolicyRuleApplyConfiguration) *SuccessPolicyApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/successpolicyrule.go000066400000000000000000000040661472614177300302240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SuccessPolicyRuleApplyConfiguration represents a declarative configuration of the SuccessPolicyRule type for use // with apply. type SuccessPolicyRuleApplyConfiguration struct { SucceededIndexes *string `json:"succeededIndexes,omitempty"` SucceededCount *int32 `json:"succeededCount,omitempty"` } // SuccessPolicyRuleApplyConfiguration constructs a declarative configuration of the SuccessPolicyRule type for use with // apply. func SuccessPolicyRule() *SuccessPolicyRuleApplyConfiguration { return &SuccessPolicyRuleApplyConfiguration{} } // WithSucceededIndexes sets the SucceededIndexes field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SucceededIndexes field is set to the value of the last call. func (b *SuccessPolicyRuleApplyConfiguration) WithSucceededIndexes(value string) *SuccessPolicyRuleApplyConfiguration { b.SucceededIndexes = &value return b } // WithSucceededCount sets the SucceededCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SucceededCount field is set to the value of the last call. func (b *SuccessPolicyRuleApplyConfiguration) WithSucceededCount(value int32) *SuccessPolicyRuleApplyConfiguration { b.SucceededCount = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1/uncountedterminatedpods.go000066400000000000000000000043371472614177300314140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( types "k8s.io/apimachinery/pkg/types" ) // UncountedTerminatedPodsApplyConfiguration represents a declarative configuration of the UncountedTerminatedPods type for use // with apply. type UncountedTerminatedPodsApplyConfiguration struct { Succeeded []types.UID `json:"succeeded,omitempty"` Failed []types.UID `json:"failed,omitempty"` } // UncountedTerminatedPodsApplyConfiguration constructs a declarative configuration of the UncountedTerminatedPods type for use with // apply. func UncountedTerminatedPods() *UncountedTerminatedPodsApplyConfiguration { return &UncountedTerminatedPodsApplyConfiguration{} } // WithSucceeded adds the given value to the Succeeded field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Succeeded field. func (b *UncountedTerminatedPodsApplyConfiguration) WithSucceeded(values ...types.UID) *UncountedTerminatedPodsApplyConfiguration { for i := range values { b.Succeeded = append(b.Succeeded, values[i]) } return b } // WithFailed adds the given value to the Failed field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Failed field. func (b *UncountedTerminatedPodsApplyConfiguration) WithFailed(values ...types.UID) *UncountedTerminatedPodsApplyConfiguration { for i := range values { b.Failed = append(b.Failed, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1beta1/000077500000000000000000000000001472614177300250245ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1beta1/cronjob.go000066400000000000000000000302031472614177300270050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( batchv1beta1 "k8s.io/api/batch/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CronJobApplyConfiguration represents a declarative configuration of the CronJob type for use // with apply. type CronJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CronJobSpecApplyConfiguration `json:"spec,omitempty"` Status *CronJobStatusApplyConfiguration `json:"status,omitempty"` } // CronJob constructs a declarative configuration of the CronJob type for use with // apply. func CronJob(name, namespace string) *CronJobApplyConfiguration { b := &CronJobApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("CronJob") b.WithAPIVersion("batch/v1beta1") return b } // ExtractCronJob extracts the applied configuration owned by fieldManager from // cronJob. If no managedFields are found in cronJob for fieldManager, a // CronJobApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cronJob must be a unmodified CronJob API object that was retrieved from the Kubernetes API. // ExtractCronJob provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCronJob(cronJob *batchv1beta1.CronJob, fieldManager string) (*CronJobApplyConfiguration, error) { return extractCronJob(cronJob, fieldManager, "") } // ExtractCronJobStatus is the same as ExtractCronJob except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCronJobStatus(cronJob *batchv1beta1.CronJob, fieldManager string) (*CronJobApplyConfiguration, error) { return extractCronJob(cronJob, fieldManager, "status") } func extractCronJob(cronJob *batchv1beta1.CronJob, fieldManager string, subresource string) (*CronJobApplyConfiguration, error) { b := &CronJobApplyConfiguration{} err := managedfields.ExtractInto(cronJob, internal.Parser().Type("io.k8s.api.batch.v1beta1.CronJob"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cronJob.Name) b.WithNamespace(cronJob.Namespace) b.WithKind("CronJob") b.WithAPIVersion("batch/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithKind(value string) *CronJobApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithAPIVersion(value string) *CronJobApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithName(value string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithGenerateName(value string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithNamespace(value string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithUID(value types.UID) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithResourceVersion(value string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithGeneration(value int64) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CronJobApplyConfiguration) WithLabels(entries map[string]string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CronJobApplyConfiguration) WithAnnotations(entries map[string]string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CronJobApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CronJobApplyConfiguration) WithFinalizers(values ...string) *CronJobApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CronJobApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithSpec(value *CronJobSpecApplyConfiguration) *CronJobApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *CronJobApplyConfiguration) WithStatus(value *CronJobStatusApplyConfiguration) *CronJobApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CronJobApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1beta1/cronjobspec.go000066400000000000000000000125431472614177300276670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/batch/v1beta1" ) // CronJobSpecApplyConfiguration represents a declarative configuration of the CronJobSpec type for use // with apply. type CronJobSpecApplyConfiguration struct { Schedule *string `json:"schedule,omitempty"` TimeZone *string `json:"timeZone,omitempty"` StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"` ConcurrencyPolicy *v1beta1.ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"` Suspend *bool `json:"suspend,omitempty"` JobTemplate *JobTemplateSpecApplyConfiguration `json:"jobTemplate,omitempty"` SuccessfulJobsHistoryLimit *int32 `json:"successfulJobsHistoryLimit,omitempty"` FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"` } // CronJobSpecApplyConfiguration constructs a declarative configuration of the CronJobSpec type for use with // apply. func CronJobSpec() *CronJobSpecApplyConfiguration { return &CronJobSpecApplyConfiguration{} } // WithSchedule sets the Schedule field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Schedule field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithSchedule(value string) *CronJobSpecApplyConfiguration { b.Schedule = &value return b } // WithTimeZone sets the TimeZone field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeZone field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithTimeZone(value string) *CronJobSpecApplyConfiguration { b.TimeZone = &value return b } // WithStartingDeadlineSeconds sets the StartingDeadlineSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartingDeadlineSeconds field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithStartingDeadlineSeconds(value int64) *CronJobSpecApplyConfiguration { b.StartingDeadlineSeconds = &value return b } // WithConcurrencyPolicy sets the ConcurrencyPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConcurrencyPolicy field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithConcurrencyPolicy(value v1beta1.ConcurrencyPolicy) *CronJobSpecApplyConfiguration { b.ConcurrencyPolicy = &value return b } // WithSuspend sets the Suspend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Suspend field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithSuspend(value bool) *CronJobSpecApplyConfiguration { b.Suspend = &value return b } // WithJobTemplate sets the JobTemplate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the JobTemplate field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithJobTemplate(value *JobTemplateSpecApplyConfiguration) *CronJobSpecApplyConfiguration { b.JobTemplate = value return b } // WithSuccessfulJobsHistoryLimit sets the SuccessfulJobsHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SuccessfulJobsHistoryLimit field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithSuccessfulJobsHistoryLimit(value int32) *CronJobSpecApplyConfiguration { b.SuccessfulJobsHistoryLimit = &value return b } // WithFailedJobsHistoryLimit sets the FailedJobsHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailedJobsHistoryLimit field is set to the value of the last call. func (b *CronJobSpecApplyConfiguration) WithFailedJobsHistoryLimit(value int32) *CronJobSpecApplyConfiguration { b.FailedJobsHistoryLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1beta1/cronjobstatus.go000066400000000000000000000055611472614177300302620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // CronJobStatusApplyConfiguration represents a declarative configuration of the CronJobStatus type for use // with apply. type CronJobStatusApplyConfiguration struct { Active []v1.ObjectReferenceApplyConfiguration `json:"active,omitempty"` LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"` LastSuccessfulTime *metav1.Time `json:"lastSuccessfulTime,omitempty"` } // CronJobStatusApplyConfiguration constructs a declarative configuration of the CronJobStatus type for use with // apply. func CronJobStatus() *CronJobStatusApplyConfiguration { return &CronJobStatusApplyConfiguration{} } // WithActive adds the given value to the Active field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Active field. func (b *CronJobStatusApplyConfiguration) WithActive(values ...*v1.ObjectReferenceApplyConfiguration) *CronJobStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithActive") } b.Active = append(b.Active, *values[i]) } return b } // WithLastScheduleTime sets the LastScheduleTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastScheduleTime field is set to the value of the last call. func (b *CronJobStatusApplyConfiguration) WithLastScheduleTime(value metav1.Time) *CronJobStatusApplyConfiguration { b.LastScheduleTime = &value return b } // WithLastSuccessfulTime sets the LastSuccessfulTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastSuccessfulTime field is set to the value of the last call. func (b *CronJobStatusApplyConfiguration) WithLastSuccessfulTime(value metav1.Time) *CronJobStatusApplyConfiguration { b.LastSuccessfulTime = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/batch/v1beta1/jobtemplatespec.go000066400000000000000000000221131472614177300305330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // JobTemplateSpecApplyConfiguration represents a declarative configuration of the JobTemplateSpec type for use // with apply. type JobTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *batchv1.JobSpecApplyConfiguration `json:"spec,omitempty"` } // JobTemplateSpecApplyConfiguration constructs a declarative configuration of the JobTemplateSpec type for use with // apply. func JobTemplateSpec() *JobTemplateSpecApplyConfiguration { return &JobTemplateSpecApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithName(value string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithGenerateName(value string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithNamespace(value string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithUID(value types.UID) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithResourceVersion(value string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithGeneration(value int64) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *JobTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *JobTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *JobTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *JobTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *JobTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *JobTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *JobTemplateSpecApplyConfiguration) WithSpec(value *batchv1.JobSpecApplyConfiguration) *JobTemplateSpecApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *JobTemplateSpecApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/certificates/000077500000000000000000000000001472614177300251455ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1/000077500000000000000000000000001472614177300254735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1/certificatesigningrequest.go000066400000000000000000000327531472614177300333060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicertificatesv1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CertificateSigningRequestApplyConfiguration represents a declarative configuration of the CertificateSigningRequest type for use // with apply. type CertificateSigningRequestApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CertificateSigningRequestSpecApplyConfiguration `json:"spec,omitempty"` Status *CertificateSigningRequestStatusApplyConfiguration `json:"status,omitempty"` } // CertificateSigningRequest constructs a declarative configuration of the CertificateSigningRequest type for use with // apply. func CertificateSigningRequest(name string) *CertificateSigningRequestApplyConfiguration { b := &CertificateSigningRequestApplyConfiguration{} b.WithName(name) b.WithKind("CertificateSigningRequest") b.WithAPIVersion("certificates.k8s.io/v1") return b } // ExtractCertificateSigningRequest extracts the applied configuration owned by fieldManager from // certificateSigningRequest. If no managedFields are found in certificateSigningRequest for fieldManager, a // CertificateSigningRequestApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // certificateSigningRequest must be a unmodified CertificateSigningRequest API object that was retrieved from the Kubernetes API. // ExtractCertificateSigningRequest provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCertificateSigningRequest(certificateSigningRequest *apicertificatesv1.CertificateSigningRequest, fieldManager string) (*CertificateSigningRequestApplyConfiguration, error) { return extractCertificateSigningRequest(certificateSigningRequest, fieldManager, "") } // ExtractCertificateSigningRequestStatus is the same as ExtractCertificateSigningRequest except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCertificateSigningRequestStatus(certificateSigningRequest *apicertificatesv1.CertificateSigningRequest, fieldManager string) (*CertificateSigningRequestApplyConfiguration, error) { return extractCertificateSigningRequest(certificateSigningRequest, fieldManager, "status") } func extractCertificateSigningRequest(certificateSigningRequest *apicertificatesv1.CertificateSigningRequest, fieldManager string, subresource string) (*CertificateSigningRequestApplyConfiguration, error) { b := &CertificateSigningRequestApplyConfiguration{} err := managedfields.ExtractInto(certificateSigningRequest, internal.Parser().Type("io.k8s.api.certificates.v1.CertificateSigningRequest"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(certificateSigningRequest.Name) b.WithKind("CertificateSigningRequest") b.WithAPIVersion("certificates.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithKind(value string) *CertificateSigningRequestApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithAPIVersion(value string) *CertificateSigningRequestApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithName(value string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithGenerateName(value string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithNamespace(value string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithUID(value types.UID) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithResourceVersion(value string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithGeneration(value int64) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CertificateSigningRequestApplyConfiguration) WithLabels(entries map[string]string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CertificateSigningRequestApplyConfiguration) WithAnnotations(entries map[string]string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CertificateSigningRequestApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CertificateSigningRequestApplyConfiguration) WithFinalizers(values ...string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CertificateSigningRequestApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithSpec(value *CertificateSigningRequestSpecApplyConfiguration) *CertificateSigningRequestApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithStatus(value *CertificateSigningRequestStatusApplyConfiguration) *CertificateSigningRequestApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CertificateSigningRequestApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } certificatesigningrequestcondition.go000066400000000000000000000107531472614177300351320ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/certificates/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // CertificateSigningRequestConditionApplyConfiguration represents a declarative configuration of the CertificateSigningRequestCondition type for use // with apply. type CertificateSigningRequestConditionApplyConfiguration struct { Type *v1.RequestConditionType `json:"type,omitempty"` Status *corev1.ConditionStatus `json:"status,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } // CertificateSigningRequestConditionApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestCondition type for use with // apply. func CertificateSigningRequestCondition() *CertificateSigningRequestConditionApplyConfiguration { return &CertificateSigningRequestConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithType(value v1.RequestConditionType) *CertificateSigningRequestConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *CertificateSigningRequestConditionApplyConfiguration { b.Status = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithReason(value string) *CertificateSigningRequestConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithMessage(value string) *CertificateSigningRequestConditionApplyConfiguration { b.Message = &value return b } // WithLastUpdateTime sets the LastUpdateTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastUpdateTime field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *CertificateSigningRequestConditionApplyConfiguration { b.LastUpdateTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *CertificateSigningRequestConditionApplyConfiguration { b.LastTransitionTime = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1/certificatesigningrequestspec.go000066400000000000000000000132261472614177300341530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/certificates/v1" ) // CertificateSigningRequestSpecApplyConfiguration represents a declarative configuration of the CertificateSigningRequestSpec type for use // with apply. type CertificateSigningRequestSpecApplyConfiguration struct { Request []byte `json:"request,omitempty"` SignerName *string `json:"signerName,omitempty"` ExpirationSeconds *int32 `json:"expirationSeconds,omitempty"` Usages []v1.KeyUsage `json:"usages,omitempty"` Username *string `json:"username,omitempty"` UID *string `json:"uid,omitempty"` Groups []string `json:"groups,omitempty"` Extra map[string]v1.ExtraValue `json:"extra,omitempty"` } // CertificateSigningRequestSpecApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestSpec type for use with // apply. func CertificateSigningRequestSpec() *CertificateSigningRequestSpecApplyConfiguration { return &CertificateSigningRequestSpecApplyConfiguration{} } // WithRequest adds the given value to the Request field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Request field. func (b *CertificateSigningRequestSpecApplyConfiguration) WithRequest(values ...byte) *CertificateSigningRequestSpecApplyConfiguration { for i := range values { b.Request = append(b.Request, values[i]) } return b } // WithSignerName sets the SignerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SignerName field is set to the value of the last call. func (b *CertificateSigningRequestSpecApplyConfiguration) WithSignerName(value string) *CertificateSigningRequestSpecApplyConfiguration { b.SignerName = &value return b } // WithExpirationSeconds sets the ExpirationSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExpirationSeconds field is set to the value of the last call. func (b *CertificateSigningRequestSpecApplyConfiguration) WithExpirationSeconds(value int32) *CertificateSigningRequestSpecApplyConfiguration { b.ExpirationSeconds = &value return b } // WithUsages adds the given value to the Usages field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Usages field. func (b *CertificateSigningRequestSpecApplyConfiguration) WithUsages(values ...v1.KeyUsage) *CertificateSigningRequestSpecApplyConfiguration { for i := range values { b.Usages = append(b.Usages, values[i]) } return b } // WithUsername sets the Username field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Username field is set to the value of the last call. func (b *CertificateSigningRequestSpecApplyConfiguration) WithUsername(value string) *CertificateSigningRequestSpecApplyConfiguration { b.Username = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CertificateSigningRequestSpecApplyConfiguration) WithUID(value string) *CertificateSigningRequestSpecApplyConfiguration { b.UID = &value return b } // WithGroups adds the given value to the Groups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Groups field. func (b *CertificateSigningRequestSpecApplyConfiguration) WithGroups(values ...string) *CertificateSigningRequestSpecApplyConfiguration { for i := range values { b.Groups = append(b.Groups, values[i]) } return b } // WithExtra puts the entries into the Extra field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Extra field, // overwriting an existing map entries in Extra field with the same key. func (b *CertificateSigningRequestSpecApplyConfiguration) WithExtra(entries map[string]v1.ExtraValue) *CertificateSigningRequestSpecApplyConfiguration { if b.Extra == nil && len(entries) > 0 { b.Extra = make(map[string]v1.ExtraValue, len(entries)) } for k, v := range entries { b.Extra[k] = v } return b } kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1/certificatesigningrequeststatus.go000066400000000000000000000050031472614177300345360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CertificateSigningRequestStatusApplyConfiguration represents a declarative configuration of the CertificateSigningRequestStatus type for use // with apply. type CertificateSigningRequestStatusApplyConfiguration struct { Conditions []CertificateSigningRequestConditionApplyConfiguration `json:"conditions,omitempty"` Certificate []byte `json:"certificate,omitempty"` } // CertificateSigningRequestStatusApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestStatus type for use with // apply. func CertificateSigningRequestStatus() *CertificateSigningRequestStatusApplyConfiguration { return &CertificateSigningRequestStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *CertificateSigningRequestStatusApplyConfiguration) WithConditions(values ...*CertificateSigningRequestConditionApplyConfiguration) *CertificateSigningRequestStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithCertificate adds the given value to the Certificate field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Certificate field. func (b *CertificateSigningRequestStatusApplyConfiguration) WithCertificate(values ...byte) *CertificateSigningRequestStatusApplyConfiguration { for i := range values { b.Certificate = append(b.Certificate, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1alpha1/000077500000000000000000000000001472614177300265625ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go000066400000000000000000000306771472614177300331030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ClusterTrustBundleApplyConfiguration represents a declarative configuration of the ClusterTrustBundle type for use // with apply. type ClusterTrustBundleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ClusterTrustBundleSpecApplyConfiguration `json:"spec,omitempty"` } // ClusterTrustBundle constructs a declarative configuration of the ClusterTrustBundle type for use with // apply. func ClusterTrustBundle(name string) *ClusterTrustBundleApplyConfiguration { b := &ClusterTrustBundleApplyConfiguration{} b.WithName(name) b.WithKind("ClusterTrustBundle") b.WithAPIVersion("certificates.k8s.io/v1alpha1") return b } // ExtractClusterTrustBundle extracts the applied configuration owned by fieldManager from // clusterTrustBundle. If no managedFields are found in clusterTrustBundle for fieldManager, a // ClusterTrustBundleApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // clusterTrustBundle must be a unmodified ClusterTrustBundle API object that was retrieved from the Kubernetes API. // ExtractClusterTrustBundle provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractClusterTrustBundle(clusterTrustBundle *certificatesv1alpha1.ClusterTrustBundle, fieldManager string) (*ClusterTrustBundleApplyConfiguration, error) { return extractClusterTrustBundle(clusterTrustBundle, fieldManager, "") } // ExtractClusterTrustBundleStatus is the same as ExtractClusterTrustBundle except // that it extracts the status subresource applied configuration. // Experimental! func ExtractClusterTrustBundleStatus(clusterTrustBundle *certificatesv1alpha1.ClusterTrustBundle, fieldManager string) (*ClusterTrustBundleApplyConfiguration, error) { return extractClusterTrustBundle(clusterTrustBundle, fieldManager, "status") } func extractClusterTrustBundle(clusterTrustBundle *certificatesv1alpha1.ClusterTrustBundle, fieldManager string, subresource string) (*ClusterTrustBundleApplyConfiguration, error) { b := &ClusterTrustBundleApplyConfiguration{} err := managedfields.ExtractInto(clusterTrustBundle, internal.Parser().Type("io.k8s.api.certificates.v1alpha1.ClusterTrustBundle"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(clusterTrustBundle.Name) b.WithKind("ClusterTrustBundle") b.WithAPIVersion("certificates.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithKind(value string) *ClusterTrustBundleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithAPIVersion(value string) *ClusterTrustBundleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithName(value string) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithGenerateName(value string) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithNamespace(value string) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithUID(value types.UID) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithResourceVersion(value string) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithGeneration(value int64) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ClusterTrustBundleApplyConfiguration) WithLabels(entries map[string]string) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterTrustBundleApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ClusterTrustBundleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ClusterTrustBundleApplyConfiguration) WithFinalizers(values ...string) *ClusterTrustBundleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ClusterTrustBundleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ClusterTrustBundleApplyConfiguration) WithSpec(value *ClusterTrustBundleSpecApplyConfiguration) *ClusterTrustBundleApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterTrustBundleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1alpha1/clustertrustbundlespec.go000066400000000000000000000040711472614177300337430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ClusterTrustBundleSpecApplyConfiguration represents a declarative configuration of the ClusterTrustBundleSpec type for use // with apply. type ClusterTrustBundleSpecApplyConfiguration struct { SignerName *string `json:"signerName,omitempty"` TrustBundle *string `json:"trustBundle,omitempty"` } // ClusterTrustBundleSpecApplyConfiguration constructs a declarative configuration of the ClusterTrustBundleSpec type for use with // apply. func ClusterTrustBundleSpec() *ClusterTrustBundleSpecApplyConfiguration { return &ClusterTrustBundleSpecApplyConfiguration{} } // WithSignerName sets the SignerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SignerName field is set to the value of the last call. func (b *ClusterTrustBundleSpecApplyConfiguration) WithSignerName(value string) *ClusterTrustBundleSpecApplyConfiguration { b.SignerName = &value return b } // WithTrustBundle sets the TrustBundle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TrustBundle field is set to the value of the last call. func (b *ClusterTrustBundleSpecApplyConfiguration) WithTrustBundle(value string) *ClusterTrustBundleSpecApplyConfiguration { b.TrustBundle = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1beta1/000077500000000000000000000000001472614177300264105ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go000066400000000000000000000330141472614177300342120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( certificatesv1beta1 "k8s.io/api/certificates/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CertificateSigningRequestApplyConfiguration represents a declarative configuration of the CertificateSigningRequest type for use // with apply. type CertificateSigningRequestApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CertificateSigningRequestSpecApplyConfiguration `json:"spec,omitempty"` Status *CertificateSigningRequestStatusApplyConfiguration `json:"status,omitempty"` } // CertificateSigningRequest constructs a declarative configuration of the CertificateSigningRequest type for use with // apply. func CertificateSigningRequest(name string) *CertificateSigningRequestApplyConfiguration { b := &CertificateSigningRequestApplyConfiguration{} b.WithName(name) b.WithKind("CertificateSigningRequest") b.WithAPIVersion("certificates.k8s.io/v1beta1") return b } // ExtractCertificateSigningRequest extracts the applied configuration owned by fieldManager from // certificateSigningRequest. If no managedFields are found in certificateSigningRequest for fieldManager, a // CertificateSigningRequestApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // certificateSigningRequest must be a unmodified CertificateSigningRequest API object that was retrieved from the Kubernetes API. // ExtractCertificateSigningRequest provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCertificateSigningRequest(certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, fieldManager string) (*CertificateSigningRequestApplyConfiguration, error) { return extractCertificateSigningRequest(certificateSigningRequest, fieldManager, "") } // ExtractCertificateSigningRequestStatus is the same as ExtractCertificateSigningRequest except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCertificateSigningRequestStatus(certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, fieldManager string) (*CertificateSigningRequestApplyConfiguration, error) { return extractCertificateSigningRequest(certificateSigningRequest, fieldManager, "status") } func extractCertificateSigningRequest(certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, fieldManager string, subresource string) (*CertificateSigningRequestApplyConfiguration, error) { b := &CertificateSigningRequestApplyConfiguration{} err := managedfields.ExtractInto(certificateSigningRequest, internal.Parser().Type("io.k8s.api.certificates.v1beta1.CertificateSigningRequest"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(certificateSigningRequest.Name) b.WithKind("CertificateSigningRequest") b.WithAPIVersion("certificates.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithKind(value string) *CertificateSigningRequestApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithAPIVersion(value string) *CertificateSigningRequestApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithName(value string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithGenerateName(value string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithNamespace(value string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithUID(value types.UID) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithResourceVersion(value string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithGeneration(value int64) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CertificateSigningRequestApplyConfiguration) WithLabels(entries map[string]string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CertificateSigningRequestApplyConfiguration) WithAnnotations(entries map[string]string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CertificateSigningRequestApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CertificateSigningRequestApplyConfiguration) WithFinalizers(values ...string) *CertificateSigningRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CertificateSigningRequestApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithSpec(value *CertificateSigningRequestSpecApplyConfiguration) *CertificateSigningRequestApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *CertificateSigningRequestApplyConfiguration) WithStatus(value *CertificateSigningRequestStatusApplyConfiguration) *CertificateSigningRequestApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CertificateSigningRequestApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } certificatesigningrequestcondition.go000066400000000000000000000110251472614177300360400ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // CertificateSigningRequestConditionApplyConfiguration represents a declarative configuration of the CertificateSigningRequestCondition type for use // with apply. type CertificateSigningRequestConditionApplyConfiguration struct { Type *v1beta1.RequestConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } // CertificateSigningRequestConditionApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestCondition type for use with // apply. func CertificateSigningRequestCondition() *CertificateSigningRequestConditionApplyConfiguration { return &CertificateSigningRequestConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithType(value v1beta1.RequestConditionType) *CertificateSigningRequestConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *CertificateSigningRequestConditionApplyConfiguration { b.Status = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithReason(value string) *CertificateSigningRequestConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithMessage(value string) *CertificateSigningRequestConditionApplyConfiguration { b.Message = &value return b } // WithLastUpdateTime sets the LastUpdateTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastUpdateTime field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *CertificateSigningRequestConditionApplyConfiguration { b.LastUpdateTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *CertificateSigningRequestConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *CertificateSigningRequestConditionApplyConfiguration { b.LastTransitionTime = &value return b } certificatesigningrequestspec.go000066400000000000000000000133341472614177300350110ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/certificates/v1beta1" ) // CertificateSigningRequestSpecApplyConfiguration represents a declarative configuration of the CertificateSigningRequestSpec type for use // with apply. type CertificateSigningRequestSpecApplyConfiguration struct { Request []byte `json:"request,omitempty"` SignerName *string `json:"signerName,omitempty"` ExpirationSeconds *int32 `json:"expirationSeconds,omitempty"` Usages []v1beta1.KeyUsage `json:"usages,omitempty"` Username *string `json:"username,omitempty"` UID *string `json:"uid,omitempty"` Groups []string `json:"groups,omitempty"` Extra map[string]v1beta1.ExtraValue `json:"extra,omitempty"` } // CertificateSigningRequestSpecApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestSpec type for use with // apply. func CertificateSigningRequestSpec() *CertificateSigningRequestSpecApplyConfiguration { return &CertificateSigningRequestSpecApplyConfiguration{} } // WithRequest adds the given value to the Request field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Request field. func (b *CertificateSigningRequestSpecApplyConfiguration) WithRequest(values ...byte) *CertificateSigningRequestSpecApplyConfiguration { for i := range values { b.Request = append(b.Request, values[i]) } return b } // WithSignerName sets the SignerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SignerName field is set to the value of the last call. func (b *CertificateSigningRequestSpecApplyConfiguration) WithSignerName(value string) *CertificateSigningRequestSpecApplyConfiguration { b.SignerName = &value return b } // WithExpirationSeconds sets the ExpirationSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExpirationSeconds field is set to the value of the last call. func (b *CertificateSigningRequestSpecApplyConfiguration) WithExpirationSeconds(value int32) *CertificateSigningRequestSpecApplyConfiguration { b.ExpirationSeconds = &value return b } // WithUsages adds the given value to the Usages field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Usages field. func (b *CertificateSigningRequestSpecApplyConfiguration) WithUsages(values ...v1beta1.KeyUsage) *CertificateSigningRequestSpecApplyConfiguration { for i := range values { b.Usages = append(b.Usages, values[i]) } return b } // WithUsername sets the Username field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Username field is set to the value of the last call. func (b *CertificateSigningRequestSpecApplyConfiguration) WithUsername(value string) *CertificateSigningRequestSpecApplyConfiguration { b.Username = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CertificateSigningRequestSpecApplyConfiguration) WithUID(value string) *CertificateSigningRequestSpecApplyConfiguration { b.UID = &value return b } // WithGroups adds the given value to the Groups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Groups field. func (b *CertificateSigningRequestSpecApplyConfiguration) WithGroups(values ...string) *CertificateSigningRequestSpecApplyConfiguration { for i := range values { b.Groups = append(b.Groups, values[i]) } return b } // WithExtra puts the entries into the Extra field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Extra field, // overwriting an existing map entries in Extra field with the same key. func (b *CertificateSigningRequestSpecApplyConfiguration) WithExtra(entries map[string]v1beta1.ExtraValue) *CertificateSigningRequestSpecApplyConfiguration { if b.Extra == nil && len(entries) > 0 { b.Extra = make(map[string]v1beta1.ExtraValue, len(entries)) } for k, v := range entries { b.Extra[k] = v } return b } certificatesigningrequeststatus.go000066400000000000000000000050101472614177300353720ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/certificates/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // CertificateSigningRequestStatusApplyConfiguration represents a declarative configuration of the CertificateSigningRequestStatus type for use // with apply. type CertificateSigningRequestStatusApplyConfiguration struct { Conditions []CertificateSigningRequestConditionApplyConfiguration `json:"conditions,omitempty"` Certificate []byte `json:"certificate,omitempty"` } // CertificateSigningRequestStatusApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestStatus type for use with // apply. func CertificateSigningRequestStatus() *CertificateSigningRequestStatusApplyConfiguration { return &CertificateSigningRequestStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *CertificateSigningRequestStatusApplyConfiguration) WithConditions(values ...*CertificateSigningRequestConditionApplyConfiguration) *CertificateSigningRequestStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithCertificate adds the given value to the Certificate field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Certificate field. func (b *CertificateSigningRequestStatusApplyConfiguration) WithCertificate(values ...byte) *CertificateSigningRequestStatusApplyConfiguration { for i := range values { b.Certificate = append(b.Certificate, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/coordination/000077500000000000000000000000001472614177300251705ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1/000077500000000000000000000000001472614177300255165ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1/lease.go000066400000000000000000000270171472614177300271450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicoordinationv1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // LeaseApplyConfiguration represents a declarative configuration of the Lease type for use // with apply. type LeaseApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *LeaseSpecApplyConfiguration `json:"spec,omitempty"` } // Lease constructs a declarative configuration of the Lease type for use with // apply. func Lease(name, namespace string) *LeaseApplyConfiguration { b := &LeaseApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Lease") b.WithAPIVersion("coordination.k8s.io/v1") return b } // ExtractLease extracts the applied configuration owned by fieldManager from // lease. If no managedFields are found in lease for fieldManager, a // LeaseApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // lease must be a unmodified Lease API object that was retrieved from the Kubernetes API. // ExtractLease provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractLease(lease *apicoordinationv1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { return extractLease(lease, fieldManager, "") } // ExtractLeaseStatus is the same as ExtractLease except // that it extracts the status subresource applied configuration. // Experimental! func ExtractLeaseStatus(lease *apicoordinationv1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { return extractLease(lease, fieldManager, "status") } func extractLease(lease *apicoordinationv1.Lease, fieldManager string, subresource string) (*LeaseApplyConfiguration, error) { b := &LeaseApplyConfiguration{} err := managedfields.ExtractInto(lease, internal.Parser().Type("io.k8s.api.coordination.v1.Lease"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(lease.Name) b.WithNamespace(lease.Namespace) b.WithKind("Lease") b.WithAPIVersion("coordination.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithKind(value string) *LeaseApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithAPIVersion(value string) *LeaseApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithName(value string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithGenerateName(value string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithNamespace(value string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithUID(value types.UID) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithResourceVersion(value string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithGeneration(value int64) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *LeaseApplyConfiguration) WithLabels(entries map[string]string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *LeaseApplyConfiguration) WithAnnotations(entries map[string]string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *LeaseApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *LeaseApplyConfiguration) WithFinalizers(values ...string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *LeaseApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithSpec(value *LeaseSpecApplyConfiguration) *LeaseApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *LeaseApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1/leasespec.go000066400000000000000000000113641472614177300300160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( coordinationv1 "k8s.io/api/coordination/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // LeaseSpecApplyConfiguration represents a declarative configuration of the LeaseSpec type for use // with apply. type LeaseSpecApplyConfiguration struct { HolderIdentity *string `json:"holderIdentity,omitempty"` LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"` AcquireTime *v1.MicroTime `json:"acquireTime,omitempty"` RenewTime *v1.MicroTime `json:"renewTime,omitempty"` LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"` PreferredHolder *string `json:"preferredHolder,omitempty"` } // LeaseSpecApplyConfiguration constructs a declarative configuration of the LeaseSpec type for use with // apply. func LeaseSpec() *LeaseSpecApplyConfiguration { return &LeaseSpecApplyConfiguration{} } // WithHolderIdentity sets the HolderIdentity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HolderIdentity field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithHolderIdentity(value string) *LeaseSpecApplyConfiguration { b.HolderIdentity = &value return b } // WithLeaseDurationSeconds sets the LeaseDurationSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LeaseDurationSeconds field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithLeaseDurationSeconds(value int32) *LeaseSpecApplyConfiguration { b.LeaseDurationSeconds = &value return b } // WithAcquireTime sets the AcquireTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AcquireTime field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithAcquireTime(value v1.MicroTime) *LeaseSpecApplyConfiguration { b.AcquireTime = &value return b } // WithRenewTime sets the RenewTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RenewTime field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseSpecApplyConfiguration { b.RenewTime = &value return b } // WithLeaseTransitions sets the LeaseTransitions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LeaseTransitions field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithLeaseTransitions(value int32) *LeaseSpecApplyConfiguration { b.LeaseTransitions = &value return b } // WithStrategy sets the Strategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Strategy field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithStrategy(value coordinationv1.CoordinatedLeaseStrategy) *LeaseSpecApplyConfiguration { b.Strategy = &value return b } // WithPreferredHolder sets the PreferredHolder field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PreferredHolder field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithPreferredHolder(value string) *LeaseSpecApplyConfiguration { b.PreferredHolder = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1alpha1/000077500000000000000000000000001472614177300266055ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1alpha1/leasecandidate.go000066400000000000000000000303451472614177300320670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // LeaseCandidateApplyConfiguration represents a declarative configuration of the LeaseCandidate type for use // with apply. type LeaseCandidateApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *LeaseCandidateSpecApplyConfiguration `json:"spec,omitempty"` } // LeaseCandidate constructs a declarative configuration of the LeaseCandidate type for use with // apply. func LeaseCandidate(name, namespace string) *LeaseCandidateApplyConfiguration { b := &LeaseCandidateApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("LeaseCandidate") b.WithAPIVersion("coordination.k8s.io/v1alpha1") return b } // ExtractLeaseCandidate extracts the applied configuration owned by fieldManager from // leaseCandidate. If no managedFields are found in leaseCandidate for fieldManager, a // LeaseCandidateApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // leaseCandidate must be a unmodified LeaseCandidate API object that was retrieved from the Kubernetes API. // ExtractLeaseCandidate provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractLeaseCandidate(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) { return extractLeaseCandidate(leaseCandidate, fieldManager, "") } // ExtractLeaseCandidateStatus is the same as ExtractLeaseCandidate except // that it extracts the status subresource applied configuration. // Experimental! func ExtractLeaseCandidateStatus(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) { return extractLeaseCandidate(leaseCandidate, fieldManager, "status") } func extractLeaseCandidate(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string, subresource string) (*LeaseCandidateApplyConfiguration, error) { b := &LeaseCandidateApplyConfiguration{} err := managedfields.ExtractInto(leaseCandidate, internal.Parser().Type("io.k8s.api.coordination.v1alpha1.LeaseCandidate"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(leaseCandidate.Name) b.WithNamespace(leaseCandidate.Namespace) b.WithKind("LeaseCandidate") b.WithAPIVersion("coordination.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithKind(value string) *LeaseCandidateApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithAPIVersion(value string) *LeaseCandidateApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithName(value string) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithGenerateName(value string) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithNamespace(value string) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithUID(value types.UID) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithResourceVersion(value string) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithGeneration(value int64) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *LeaseCandidateApplyConfiguration) WithLabels(entries map[string]string) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *LeaseCandidateApplyConfiguration) WithAnnotations(entries map[string]string) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *LeaseCandidateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *LeaseCandidateApplyConfiguration) WithFinalizers(values ...string) *LeaseCandidateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *LeaseCandidateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *LeaseCandidateApplyConfiguration) WithSpec(value *LeaseCandidateSpecApplyConfiguration) *LeaseCandidateApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *LeaseCandidateApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1alpha1/leasecandidatespec.go000066400000000000000000000107131472614177300327370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( coordinationv1 "k8s.io/api/coordination/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // LeaseCandidateSpecApplyConfiguration represents a declarative configuration of the LeaseCandidateSpec type for use // with apply. type LeaseCandidateSpecApplyConfiguration struct { LeaseName *string `json:"leaseName,omitempty"` PingTime *v1.MicroTime `json:"pingTime,omitempty"` RenewTime *v1.MicroTime `json:"renewTime,omitempty"` BinaryVersion *string `json:"binaryVersion,omitempty"` EmulationVersion *string `json:"emulationVersion,omitempty"` PreferredStrategies []coordinationv1.CoordinatedLeaseStrategy `json:"preferredStrategies,omitempty"` } // LeaseCandidateSpecApplyConfiguration constructs a declarative configuration of the LeaseCandidateSpec type for use with // apply. func LeaseCandidateSpec() *LeaseCandidateSpecApplyConfiguration { return &LeaseCandidateSpecApplyConfiguration{} } // WithLeaseName sets the LeaseName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LeaseName field is set to the value of the last call. func (b *LeaseCandidateSpecApplyConfiguration) WithLeaseName(value string) *LeaseCandidateSpecApplyConfiguration { b.LeaseName = &value return b } // WithPingTime sets the PingTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PingTime field is set to the value of the last call. func (b *LeaseCandidateSpecApplyConfiguration) WithPingTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration { b.PingTime = &value return b } // WithRenewTime sets the RenewTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RenewTime field is set to the value of the last call. func (b *LeaseCandidateSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration { b.RenewTime = &value return b } // WithBinaryVersion sets the BinaryVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BinaryVersion field is set to the value of the last call. func (b *LeaseCandidateSpecApplyConfiguration) WithBinaryVersion(value string) *LeaseCandidateSpecApplyConfiguration { b.BinaryVersion = &value return b } // WithEmulationVersion sets the EmulationVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EmulationVersion field is set to the value of the last call. func (b *LeaseCandidateSpecApplyConfiguration) WithEmulationVersion(value string) *LeaseCandidateSpecApplyConfiguration { b.EmulationVersion = &value return b } // WithPreferredStrategies adds the given value to the PreferredStrategies field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PreferredStrategies field. func (b *LeaseCandidateSpecApplyConfiguration) WithPreferredStrategies(values ...coordinationv1.CoordinatedLeaseStrategy) *LeaseCandidateSpecApplyConfiguration { for i := range values { b.PreferredStrategies = append(b.PreferredStrategies, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1beta1/000077500000000000000000000000001472614177300264335ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1beta1/lease.go000066400000000000000000000270601472614177300300600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( coordinationv1beta1 "k8s.io/api/coordination/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // LeaseApplyConfiguration represents a declarative configuration of the Lease type for use // with apply. type LeaseApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *LeaseSpecApplyConfiguration `json:"spec,omitempty"` } // Lease constructs a declarative configuration of the Lease type for use with // apply. func Lease(name, namespace string) *LeaseApplyConfiguration { b := &LeaseApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Lease") b.WithAPIVersion("coordination.k8s.io/v1beta1") return b } // ExtractLease extracts the applied configuration owned by fieldManager from // lease. If no managedFields are found in lease for fieldManager, a // LeaseApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // lease must be a unmodified Lease API object that was retrieved from the Kubernetes API. // ExtractLease provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractLease(lease *coordinationv1beta1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { return extractLease(lease, fieldManager, "") } // ExtractLeaseStatus is the same as ExtractLease except // that it extracts the status subresource applied configuration. // Experimental! func ExtractLeaseStatus(lease *coordinationv1beta1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { return extractLease(lease, fieldManager, "status") } func extractLease(lease *coordinationv1beta1.Lease, fieldManager string, subresource string) (*LeaseApplyConfiguration, error) { b := &LeaseApplyConfiguration{} err := managedfields.ExtractInto(lease, internal.Parser().Type("io.k8s.api.coordination.v1beta1.Lease"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(lease.Name) b.WithNamespace(lease.Namespace) b.WithKind("Lease") b.WithAPIVersion("coordination.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithKind(value string) *LeaseApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithAPIVersion(value string) *LeaseApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithName(value string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithGenerateName(value string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithNamespace(value string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithUID(value types.UID) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithResourceVersion(value string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithGeneration(value int64) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *LeaseApplyConfiguration) WithLabels(entries map[string]string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *LeaseApplyConfiguration) WithAnnotations(entries map[string]string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *LeaseApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *LeaseApplyConfiguration) WithFinalizers(values ...string) *LeaseApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *LeaseApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *LeaseApplyConfiguration) WithSpec(value *LeaseSpecApplyConfiguration) *LeaseApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *LeaseApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/coordination/v1beta1/leasespec.go000066400000000000000000000113711472614177300307310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( coordinationv1 "k8s.io/api/coordination/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // LeaseSpecApplyConfiguration represents a declarative configuration of the LeaseSpec type for use // with apply. type LeaseSpecApplyConfiguration struct { HolderIdentity *string `json:"holderIdentity,omitempty"` LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"` AcquireTime *v1.MicroTime `json:"acquireTime,omitempty"` RenewTime *v1.MicroTime `json:"renewTime,omitempty"` LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"` PreferredHolder *string `json:"preferredHolder,omitempty"` } // LeaseSpecApplyConfiguration constructs a declarative configuration of the LeaseSpec type for use with // apply. func LeaseSpec() *LeaseSpecApplyConfiguration { return &LeaseSpecApplyConfiguration{} } // WithHolderIdentity sets the HolderIdentity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HolderIdentity field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithHolderIdentity(value string) *LeaseSpecApplyConfiguration { b.HolderIdentity = &value return b } // WithLeaseDurationSeconds sets the LeaseDurationSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LeaseDurationSeconds field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithLeaseDurationSeconds(value int32) *LeaseSpecApplyConfiguration { b.LeaseDurationSeconds = &value return b } // WithAcquireTime sets the AcquireTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AcquireTime field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithAcquireTime(value v1.MicroTime) *LeaseSpecApplyConfiguration { b.AcquireTime = &value return b } // WithRenewTime sets the RenewTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RenewTime field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseSpecApplyConfiguration { b.RenewTime = &value return b } // WithLeaseTransitions sets the LeaseTransitions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LeaseTransitions field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithLeaseTransitions(value int32) *LeaseSpecApplyConfiguration { b.LeaseTransitions = &value return b } // WithStrategy sets the Strategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Strategy field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithStrategy(value coordinationv1.CoordinatedLeaseStrategy) *LeaseSpecApplyConfiguration { b.Strategy = &value return b } // WithPreferredHolder sets the PreferredHolder field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PreferredHolder field is set to the value of the last call. func (b *LeaseSpecApplyConfiguration) WithPreferredHolder(value string) *LeaseSpecApplyConfiguration { b.PreferredHolder = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/000077500000000000000000000000001472614177300234305ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/000077500000000000000000000000001472614177300237565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/affinity.go000066400000000000000000000050561472614177300261240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // AffinityApplyConfiguration represents a declarative configuration of the Affinity type for use // with apply. type AffinityApplyConfiguration struct { NodeAffinity *NodeAffinityApplyConfiguration `json:"nodeAffinity,omitempty"` PodAffinity *PodAffinityApplyConfiguration `json:"podAffinity,omitempty"` PodAntiAffinity *PodAntiAffinityApplyConfiguration `json:"podAntiAffinity,omitempty"` } // AffinityApplyConfiguration constructs a declarative configuration of the Affinity type for use with // apply. func Affinity() *AffinityApplyConfiguration { return &AffinityApplyConfiguration{} } // WithNodeAffinity sets the NodeAffinity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeAffinity field is set to the value of the last call. func (b *AffinityApplyConfiguration) WithNodeAffinity(value *NodeAffinityApplyConfiguration) *AffinityApplyConfiguration { b.NodeAffinity = value return b } // WithPodAffinity sets the PodAffinity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodAffinity field is set to the value of the last call. func (b *AffinityApplyConfiguration) WithPodAffinity(value *PodAffinityApplyConfiguration) *AffinityApplyConfiguration { b.PodAffinity = value return b } // WithPodAntiAffinity sets the PodAntiAffinity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodAntiAffinity field is set to the value of the last call. func (b *AffinityApplyConfiguration) WithPodAntiAffinity(value *PodAntiAffinityApplyConfiguration) *AffinityApplyConfiguration { b.PodAntiAffinity = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/apparmorprofile.go000066400000000000000000000040701472614177300275100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // AppArmorProfileApplyConfiguration represents a declarative configuration of the AppArmorProfile type for use // with apply. type AppArmorProfileApplyConfiguration struct { Type *v1.AppArmorProfileType `json:"type,omitempty"` LocalhostProfile *string `json:"localhostProfile,omitempty"` } // AppArmorProfileApplyConfiguration constructs a declarative configuration of the AppArmorProfile type for use with // apply. func AppArmorProfile() *AppArmorProfileApplyConfiguration { return &AppArmorProfileApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *AppArmorProfileApplyConfiguration) WithType(value v1.AppArmorProfileType) *AppArmorProfileApplyConfiguration { b.Type = &value return b } // WithLocalhostProfile sets the LocalhostProfile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LocalhostProfile field is set to the value of the last call. func (b *AppArmorProfileApplyConfiguration) WithLocalhostProfile(value string) *AppArmorProfileApplyConfiguration { b.LocalhostProfile = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/attachedvolume.go000066400000000000000000000037631472614177300273230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // AttachedVolumeApplyConfiguration represents a declarative configuration of the AttachedVolume type for use // with apply. type AttachedVolumeApplyConfiguration struct { Name *v1.UniqueVolumeName `json:"name,omitempty"` DevicePath *string `json:"devicePath,omitempty"` } // AttachedVolumeApplyConfiguration constructs a declarative configuration of the AttachedVolume type for use with // apply. func AttachedVolume() *AttachedVolumeApplyConfiguration { return &AttachedVolumeApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *AttachedVolumeApplyConfiguration) WithName(value v1.UniqueVolumeName) *AttachedVolumeApplyConfiguration { b.Name = &value return b } // WithDevicePath sets the DevicePath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DevicePath field is set to the value of the last call. func (b *AttachedVolumeApplyConfiguration) WithDevicePath(value string) *AttachedVolumeApplyConfiguration { b.DevicePath = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/awselasticblockstorevolumesource.go000066400000000000000000000061501472614177300332070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // AWSElasticBlockStoreVolumeSourceApplyConfiguration represents a declarative configuration of the AWSElasticBlockStoreVolumeSource type for use // with apply. type AWSElasticBlockStoreVolumeSourceApplyConfiguration struct { VolumeID *string `json:"volumeID,omitempty"` FSType *string `json:"fsType,omitempty"` Partition *int32 `json:"partition,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // AWSElasticBlockStoreVolumeSourceApplyConfiguration constructs a declarative configuration of the AWSElasticBlockStoreVolumeSource type for use with // apply. func AWSElasticBlockStoreVolumeSource() *AWSElasticBlockStoreVolumeSourceApplyConfiguration { return &AWSElasticBlockStoreVolumeSourceApplyConfiguration{} } // WithVolumeID sets the VolumeID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeID field is set to the value of the last call. func (b *AWSElasticBlockStoreVolumeSourceApplyConfiguration) WithVolumeID(value string) *AWSElasticBlockStoreVolumeSourceApplyConfiguration { b.VolumeID = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *AWSElasticBlockStoreVolumeSourceApplyConfiguration) WithFSType(value string) *AWSElasticBlockStoreVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithPartition sets the Partition field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Partition field is set to the value of the last call. func (b *AWSElasticBlockStoreVolumeSourceApplyConfiguration) WithPartition(value int32) *AWSElasticBlockStoreVolumeSourceApplyConfiguration { b.Partition = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *AWSElasticBlockStoreVolumeSourceApplyConfiguration) WithReadOnly(value bool) *AWSElasticBlockStoreVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/azurediskvolumesource.go000066400000000000000000000101111472614177300307510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // AzureDiskVolumeSourceApplyConfiguration represents a declarative configuration of the AzureDiskVolumeSource type for use // with apply. type AzureDiskVolumeSourceApplyConfiguration struct { DiskName *string `json:"diskName,omitempty"` DataDiskURI *string `json:"diskURI,omitempty"` CachingMode *v1.AzureDataDiskCachingMode `json:"cachingMode,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` Kind *v1.AzureDataDiskKind `json:"kind,omitempty"` } // AzureDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the AzureDiskVolumeSource type for use with // apply. func AzureDiskVolumeSource() *AzureDiskVolumeSourceApplyConfiguration { return &AzureDiskVolumeSourceApplyConfiguration{} } // WithDiskName sets the DiskName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DiskName field is set to the value of the last call. func (b *AzureDiskVolumeSourceApplyConfiguration) WithDiskName(value string) *AzureDiskVolumeSourceApplyConfiguration { b.DiskName = &value return b } // WithDataDiskURI sets the DataDiskURI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DataDiskURI field is set to the value of the last call. func (b *AzureDiskVolumeSourceApplyConfiguration) WithDataDiskURI(value string) *AzureDiskVolumeSourceApplyConfiguration { b.DataDiskURI = &value return b } // WithCachingMode sets the CachingMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CachingMode field is set to the value of the last call. func (b *AzureDiskVolumeSourceApplyConfiguration) WithCachingMode(value v1.AzureDataDiskCachingMode) *AzureDiskVolumeSourceApplyConfiguration { b.CachingMode = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *AzureDiskVolumeSourceApplyConfiguration) WithFSType(value string) *AzureDiskVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *AzureDiskVolumeSourceApplyConfiguration) WithReadOnly(value bool) *AzureDiskVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *AzureDiskVolumeSourceApplyConfiguration) WithKind(value v1.AzureDataDiskKind) *AzureDiskVolumeSourceApplyConfiguration { b.Kind = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/azurefilepersistentvolumesource.go000066400000000000000000000062631472614177300330740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // AzureFilePersistentVolumeSourceApplyConfiguration represents a declarative configuration of the AzureFilePersistentVolumeSource type for use // with apply. type AzureFilePersistentVolumeSourceApplyConfiguration struct { SecretName *string `json:"secretName,omitempty"` ShareName *string `json:"shareName,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` SecretNamespace *string `json:"secretNamespace,omitempty"` } // AzureFilePersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the AzureFilePersistentVolumeSource type for use with // apply. func AzureFilePersistentVolumeSource() *AzureFilePersistentVolumeSourceApplyConfiguration { return &AzureFilePersistentVolumeSourceApplyConfiguration{} } // WithSecretName sets the SecretName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretName field is set to the value of the last call. func (b *AzureFilePersistentVolumeSourceApplyConfiguration) WithSecretName(value string) *AzureFilePersistentVolumeSourceApplyConfiguration { b.SecretName = &value return b } // WithShareName sets the ShareName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ShareName field is set to the value of the last call. func (b *AzureFilePersistentVolumeSourceApplyConfiguration) WithShareName(value string) *AzureFilePersistentVolumeSourceApplyConfiguration { b.ShareName = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *AzureFilePersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *AzureFilePersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithSecretNamespace sets the SecretNamespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretNamespace field is set to the value of the last call. func (b *AzureFilePersistentVolumeSourceApplyConfiguration) WithSecretNamespace(value string) *AzureFilePersistentVolumeSourceApplyConfiguration { b.SecretNamespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/azurefilevolumesource.go000066400000000000000000000047661472614177300307610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // AzureFileVolumeSourceApplyConfiguration represents a declarative configuration of the AzureFileVolumeSource type for use // with apply. type AzureFileVolumeSourceApplyConfiguration struct { SecretName *string `json:"secretName,omitempty"` ShareName *string `json:"shareName,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // AzureFileVolumeSourceApplyConfiguration constructs a declarative configuration of the AzureFileVolumeSource type for use with // apply. func AzureFileVolumeSource() *AzureFileVolumeSourceApplyConfiguration { return &AzureFileVolumeSourceApplyConfiguration{} } // WithSecretName sets the SecretName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretName field is set to the value of the last call. func (b *AzureFileVolumeSourceApplyConfiguration) WithSecretName(value string) *AzureFileVolumeSourceApplyConfiguration { b.SecretName = &value return b } // WithShareName sets the ShareName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ShareName field is set to the value of the last call. func (b *AzureFileVolumeSourceApplyConfiguration) WithShareName(value string) *AzureFileVolumeSourceApplyConfiguration { b.ShareName = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *AzureFileVolumeSourceApplyConfiguration) WithReadOnly(value bool) *AzureFileVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/capabilities.go000066400000000000000000000040331472614177300267360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // CapabilitiesApplyConfiguration represents a declarative configuration of the Capabilities type for use // with apply. type CapabilitiesApplyConfiguration struct { Add []v1.Capability `json:"add,omitempty"` Drop []v1.Capability `json:"drop,omitempty"` } // CapabilitiesApplyConfiguration constructs a declarative configuration of the Capabilities type for use with // apply. func Capabilities() *CapabilitiesApplyConfiguration { return &CapabilitiesApplyConfiguration{} } // WithAdd adds the given value to the Add field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Add field. func (b *CapabilitiesApplyConfiguration) WithAdd(values ...v1.Capability) *CapabilitiesApplyConfiguration { for i := range values { b.Add = append(b.Add, values[i]) } return b } // WithDrop adds the given value to the Drop field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Drop field. func (b *CapabilitiesApplyConfiguration) WithDrop(values ...v1.Capability) *CapabilitiesApplyConfiguration { for i := range values { b.Drop = append(b.Drop, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/cephfspersistentvolumesource.go000066400000000000000000000103601472614177300323470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CephFSPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the CephFSPersistentVolumeSource type for use // with apply. type CephFSPersistentVolumeSourceApplyConfiguration struct { Monitors []string `json:"monitors,omitempty"` Path *string `json:"path,omitempty"` User *string `json:"user,omitempty"` SecretFile *string `json:"secretFile,omitempty"` SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // CephFSPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the CephFSPersistentVolumeSource type for use with // apply. func CephFSPersistentVolumeSource() *CephFSPersistentVolumeSourceApplyConfiguration { return &CephFSPersistentVolumeSourceApplyConfiguration{} } // WithMonitors adds the given value to the Monitors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Monitors field. func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithMonitors(values ...string) *CephFSPersistentVolumeSourceApplyConfiguration { for i := range values { b.Monitors = append(b.Monitors, values[i]) } return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithPath(value string) *CephFSPersistentVolumeSourceApplyConfiguration { b.Path = &value return b } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithUser(value string) *CephFSPersistentVolumeSourceApplyConfiguration { b.User = &value return b } // WithSecretFile sets the SecretFile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretFile field is set to the value of the last call. func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithSecretFile(value string) *CephFSPersistentVolumeSourceApplyConfiguration { b.SecretFile = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *CephFSPersistentVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CephFSPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/cephfsvolumesource.go000066400000000000000000000101131472614177300302220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CephFSVolumeSourceApplyConfiguration represents a declarative configuration of the CephFSVolumeSource type for use // with apply. type CephFSVolumeSourceApplyConfiguration struct { Monitors []string `json:"monitors,omitempty"` Path *string `json:"path,omitempty"` User *string `json:"user,omitempty"` SecretFile *string `json:"secretFile,omitempty"` SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // CephFSVolumeSourceApplyConfiguration constructs a declarative configuration of the CephFSVolumeSource type for use with // apply. func CephFSVolumeSource() *CephFSVolumeSourceApplyConfiguration { return &CephFSVolumeSourceApplyConfiguration{} } // WithMonitors adds the given value to the Monitors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Monitors field. func (b *CephFSVolumeSourceApplyConfiguration) WithMonitors(values ...string) *CephFSVolumeSourceApplyConfiguration { for i := range values { b.Monitors = append(b.Monitors, values[i]) } return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *CephFSVolumeSourceApplyConfiguration) WithPath(value string) *CephFSVolumeSourceApplyConfiguration { b.Path = &value return b } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *CephFSVolumeSourceApplyConfiguration) WithUser(value string) *CephFSVolumeSourceApplyConfiguration { b.User = &value return b } // WithSecretFile sets the SecretFile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretFile field is set to the value of the last call. func (b *CephFSVolumeSourceApplyConfiguration) WithSecretFile(value string) *CephFSVolumeSourceApplyConfiguration { b.SecretFile = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *CephFSVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *CephFSVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *CephFSVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CephFSVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/cinderpersistentvolumesource.go000066400000000000000000000062601472614177300323470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CinderPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the CinderPersistentVolumeSource type for use // with apply. type CinderPersistentVolumeSourceApplyConfiguration struct { VolumeID *string `json:"volumeID,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` } // CinderPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the CinderPersistentVolumeSource type for use with // apply. func CinderPersistentVolumeSource() *CinderPersistentVolumeSourceApplyConfiguration { return &CinderPersistentVolumeSourceApplyConfiguration{} } // WithVolumeID sets the VolumeID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeID field is set to the value of the last call. func (b *CinderPersistentVolumeSourceApplyConfiguration) WithVolumeID(value string) *CinderPersistentVolumeSourceApplyConfiguration { b.VolumeID = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *CinderPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *CinderPersistentVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *CinderPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CinderPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *CinderPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *CinderPersistentVolumeSourceApplyConfiguration { b.SecretRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/cindervolumesource.go000066400000000000000000000060511472614177300302240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CinderVolumeSourceApplyConfiguration represents a declarative configuration of the CinderVolumeSource type for use // with apply. type CinderVolumeSourceApplyConfiguration struct { VolumeID *string `json:"volumeID,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` } // CinderVolumeSourceApplyConfiguration constructs a declarative configuration of the CinderVolumeSource type for use with // apply. func CinderVolumeSource() *CinderVolumeSourceApplyConfiguration { return &CinderVolumeSourceApplyConfiguration{} } // WithVolumeID sets the VolumeID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeID field is set to the value of the last call. func (b *CinderVolumeSourceApplyConfiguration) WithVolumeID(value string) *CinderVolumeSourceApplyConfiguration { b.VolumeID = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *CinderVolumeSourceApplyConfiguration) WithFSType(value string) *CinderVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *CinderVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CinderVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *CinderVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *CinderVolumeSourceApplyConfiguration { b.SecretRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/clientipconfig.go000066400000000000000000000030101472614177300272740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ClientIPConfigApplyConfiguration represents a declarative configuration of the ClientIPConfig type for use // with apply. type ClientIPConfigApplyConfiguration struct { TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` } // ClientIPConfigApplyConfiguration constructs a declarative configuration of the ClientIPConfig type for use with // apply. func ClientIPConfig() *ClientIPConfigApplyConfiguration { return &ClientIPConfigApplyConfiguration{} } // WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeoutSeconds field is set to the value of the last call. func (b *ClientIPConfigApplyConfiguration) WithTimeoutSeconds(value int32) *ClientIPConfigApplyConfiguration { b.TimeoutSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/clustertrustbundleprojection.go000066400000000000000000000074201472614177300323620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ClusterTrustBundleProjectionApplyConfiguration represents a declarative configuration of the ClusterTrustBundleProjection type for use // with apply. type ClusterTrustBundleProjectionApplyConfiguration struct { Name *string `json:"name,omitempty"` SignerName *string `json:"signerName,omitempty"` LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` Optional *bool `json:"optional,omitempty"` Path *string `json:"path,omitempty"` } // ClusterTrustBundleProjectionApplyConfiguration constructs a declarative configuration of the ClusterTrustBundleProjection type for use with // apply. func ClusterTrustBundleProjection() *ClusterTrustBundleProjectionApplyConfiguration { return &ClusterTrustBundleProjectionApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterTrustBundleProjectionApplyConfiguration) WithName(value string) *ClusterTrustBundleProjectionApplyConfiguration { b.Name = &value return b } // WithSignerName sets the SignerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SignerName field is set to the value of the last call. func (b *ClusterTrustBundleProjectionApplyConfiguration) WithSignerName(value string) *ClusterTrustBundleProjectionApplyConfiguration { b.SignerName = &value return b } // WithLabelSelector sets the LabelSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LabelSelector field is set to the value of the last call. func (b *ClusterTrustBundleProjectionApplyConfiguration) WithLabelSelector(value *v1.LabelSelectorApplyConfiguration) *ClusterTrustBundleProjectionApplyConfiguration { b.LabelSelector = value return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *ClusterTrustBundleProjectionApplyConfiguration) WithOptional(value bool) *ClusterTrustBundleProjectionApplyConfiguration { b.Optional = &value return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *ClusterTrustBundleProjectionApplyConfiguration) WithPath(value string) *ClusterTrustBundleProjectionApplyConfiguration { b.Path = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/componentcondition.go000066400000000000000000000057351472614177300302300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ComponentConditionApplyConfiguration represents a declarative configuration of the ComponentCondition type for use // with apply. type ComponentConditionApplyConfiguration struct { Type *v1.ComponentConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` Message *string `json:"message,omitempty"` Error *string `json:"error,omitempty"` } // ComponentConditionApplyConfiguration constructs a declarative configuration of the ComponentCondition type for use with // apply. func ComponentCondition() *ComponentConditionApplyConfiguration { return &ComponentConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *ComponentConditionApplyConfiguration) WithType(value v1.ComponentConditionType) *ComponentConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ComponentConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ComponentConditionApplyConfiguration { b.Status = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ComponentConditionApplyConfiguration) WithMessage(value string) *ComponentConditionApplyConfiguration { b.Message = &value return b } // WithError sets the Error field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Error field is set to the value of the last call. func (b *ComponentConditionApplyConfiguration) WithError(value string) *ComponentConditionApplyConfiguration { b.Error = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/componentstatus.go000066400000000000000000000304221472614177300275540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ComponentStatusApplyConfiguration represents a declarative configuration of the ComponentStatus type for use // with apply. type ComponentStatusApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Conditions []ComponentConditionApplyConfiguration `json:"conditions,omitempty"` } // ComponentStatus constructs a declarative configuration of the ComponentStatus type for use with // apply. func ComponentStatus(name string) *ComponentStatusApplyConfiguration { b := &ComponentStatusApplyConfiguration{} b.WithName(name) b.WithKind("ComponentStatus") b.WithAPIVersion("v1") return b } // ExtractComponentStatus extracts the applied configuration owned by fieldManager from // componentStatus. If no managedFields are found in componentStatus for fieldManager, a // ComponentStatusApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // componentStatus must be a unmodified ComponentStatus API object that was retrieved from the Kubernetes API. // ExtractComponentStatus provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractComponentStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string) (*ComponentStatusApplyConfiguration, error) { return extractComponentStatus(componentStatus, fieldManager, "") } // ExtractComponentStatusStatus is the same as ExtractComponentStatus except // that it extracts the status subresource applied configuration. // Experimental! func ExtractComponentStatusStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string) (*ComponentStatusApplyConfiguration, error) { return extractComponentStatus(componentStatus, fieldManager, "status") } func extractComponentStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string, subresource string) (*ComponentStatusApplyConfiguration, error) { b := &ComponentStatusApplyConfiguration{} err := managedfields.ExtractInto(componentStatus, internal.Parser().Type("io.k8s.api.core.v1.ComponentStatus"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(componentStatus.Name) b.WithKind("ComponentStatus") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithKind(value string) *ComponentStatusApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithAPIVersion(value string) *ComponentStatusApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithName(value string) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithGenerateName(value string) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithNamespace(value string) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithUID(value types.UID) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithResourceVersion(value string) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithGeneration(value int64) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ComponentStatusApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ComponentStatusApplyConfiguration) WithLabels(entries map[string]string) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ComponentStatusApplyConfiguration) WithAnnotations(entries map[string]string) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ComponentStatusApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ComponentStatusApplyConfiguration) WithFinalizers(values ...string) *ComponentStatusApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ComponentStatusApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ComponentStatusApplyConfiguration) WithConditions(values ...*ComponentConditionApplyConfiguration) *ComponentStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ComponentStatusApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/configmap.go000066400000000000000000000321271472614177300262550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ConfigMapApplyConfiguration represents a declarative configuration of the ConfigMap type for use // with apply. type ConfigMapApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Immutable *bool `json:"immutable,omitempty"` Data map[string]string `json:"data,omitempty"` BinaryData map[string][]byte `json:"binaryData,omitempty"` } // ConfigMap constructs a declarative configuration of the ConfigMap type for use with // apply. func ConfigMap(name, namespace string) *ConfigMapApplyConfiguration { b := &ConfigMapApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ConfigMap") b.WithAPIVersion("v1") return b } // ExtractConfigMap extracts the applied configuration owned by fieldManager from // configMap. If no managedFields are found in configMap for fieldManager, a // ConfigMapApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // configMap must be a unmodified ConfigMap API object that was retrieved from the Kubernetes API. // ExtractConfigMap provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractConfigMap(configMap *corev1.ConfigMap, fieldManager string) (*ConfigMapApplyConfiguration, error) { return extractConfigMap(configMap, fieldManager, "") } // ExtractConfigMapStatus is the same as ExtractConfigMap except // that it extracts the status subresource applied configuration. // Experimental! func ExtractConfigMapStatus(configMap *corev1.ConfigMap, fieldManager string) (*ConfigMapApplyConfiguration, error) { return extractConfigMap(configMap, fieldManager, "status") } func extractConfigMap(configMap *corev1.ConfigMap, fieldManager string, subresource string) (*ConfigMapApplyConfiguration, error) { b := &ConfigMapApplyConfiguration{} err := managedfields.ExtractInto(configMap, internal.Parser().Type("io.k8s.api.core.v1.ConfigMap"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(configMap.Name) b.WithNamespace(configMap.Namespace) b.WithKind("ConfigMap") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithKind(value string) *ConfigMapApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithAPIVersion(value string) *ConfigMapApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithName(value string) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithGenerateName(value string) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithNamespace(value string) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithUID(value types.UID) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithResourceVersion(value string) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithGeneration(value int64) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ConfigMapApplyConfiguration) WithLabels(entries map[string]string) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ConfigMapApplyConfiguration) WithAnnotations(entries map[string]string) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ConfigMapApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ConfigMapApplyConfiguration) WithFinalizers(values ...string) *ConfigMapApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ConfigMapApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithImmutable sets the Immutable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Immutable field is set to the value of the last call. func (b *ConfigMapApplyConfiguration) WithImmutable(value bool) *ConfigMapApplyConfiguration { b.Immutable = &value return b } // WithData puts the entries into the Data field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Data field, // overwriting an existing map entries in Data field with the same key. func (b *ConfigMapApplyConfiguration) WithData(entries map[string]string) *ConfigMapApplyConfiguration { if b.Data == nil && len(entries) > 0 { b.Data = make(map[string]string, len(entries)) } for k, v := range entries { b.Data[k] = v } return b } // WithBinaryData puts the entries into the BinaryData field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the BinaryData field, // overwriting an existing map entries in BinaryData field with the same key. func (b *ConfigMapApplyConfiguration) WithBinaryData(entries map[string][]byte) *ConfigMapApplyConfiguration { if b.BinaryData == nil && len(entries) > 0 { b.BinaryData = make(map[string][]byte, len(entries)) } for k, v := range entries { b.BinaryData[k] = v } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ConfigMapApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/configmapenvsource.go000066400000000000000000000037601472614177300302100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ConfigMapEnvSourceApplyConfiguration represents a declarative configuration of the ConfigMapEnvSource type for use // with apply. type ConfigMapEnvSourceApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Optional *bool `json:"optional,omitempty"` } // ConfigMapEnvSourceApplyConfiguration constructs a declarative configuration of the ConfigMapEnvSource type for use with // apply. func ConfigMapEnvSource() *ConfigMapEnvSourceApplyConfiguration { return &ConfigMapEnvSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ConfigMapEnvSourceApplyConfiguration) WithName(value string) *ConfigMapEnvSourceApplyConfiguration { b.Name = &value return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *ConfigMapEnvSourceApplyConfiguration) WithOptional(value bool) *ConfigMapEnvSourceApplyConfiguration { b.Optional = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/configmapkeyselector.go000066400000000000000000000047451472614177300305340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ConfigMapKeySelectorApplyConfiguration represents a declarative configuration of the ConfigMapKeySelector type for use // with apply. type ConfigMapKeySelectorApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Key *string `json:"key,omitempty"` Optional *bool `json:"optional,omitempty"` } // ConfigMapKeySelectorApplyConfiguration constructs a declarative configuration of the ConfigMapKeySelector type for use with // apply. func ConfigMapKeySelector() *ConfigMapKeySelectorApplyConfiguration { return &ConfigMapKeySelectorApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ConfigMapKeySelectorApplyConfiguration) WithName(value string) *ConfigMapKeySelectorApplyConfiguration { b.Name = &value return b } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *ConfigMapKeySelectorApplyConfiguration) WithKey(value string) *ConfigMapKeySelectorApplyConfiguration { b.Key = &value return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *ConfigMapKeySelectorApplyConfiguration) WithOptional(value bool) *ConfigMapKeySelectorApplyConfiguration { b.Optional = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/configmapnodeconfigsource.go000066400000000000000000000071711472614177300315330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( types "k8s.io/apimachinery/pkg/types" ) // ConfigMapNodeConfigSourceApplyConfiguration represents a declarative configuration of the ConfigMapNodeConfigSource type for use // with apply. type ConfigMapNodeConfigSourceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` UID *types.UID `json:"uid,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` KubeletConfigKey *string `json:"kubeletConfigKey,omitempty"` } // ConfigMapNodeConfigSourceApplyConfiguration constructs a declarative configuration of the ConfigMapNodeConfigSource type for use with // apply. func ConfigMapNodeConfigSource() *ConfigMapNodeConfigSourceApplyConfiguration { return &ConfigMapNodeConfigSourceApplyConfiguration{} } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithNamespace(value string) *ConfigMapNodeConfigSourceApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithName(value string) *ConfigMapNodeConfigSourceApplyConfiguration { b.Name = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithUID(value types.UID) *ConfigMapNodeConfigSourceApplyConfiguration { b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithResourceVersion(value string) *ConfigMapNodeConfigSourceApplyConfiguration { b.ResourceVersion = &value return b } // WithKubeletConfigKey sets the KubeletConfigKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the KubeletConfigKey field is set to the value of the last call. func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithKubeletConfigKey(value string) *ConfigMapNodeConfigSourceApplyConfiguration { b.KubeletConfigKey = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/configmapprojection.go000066400000000000000000000052551472614177300303540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ConfigMapProjectionApplyConfiguration represents a declarative configuration of the ConfigMapProjection type for use // with apply. type ConfigMapProjectionApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Items []KeyToPathApplyConfiguration `json:"items,omitempty"` Optional *bool `json:"optional,omitempty"` } // ConfigMapProjectionApplyConfiguration constructs a declarative configuration of the ConfigMapProjection type for use with // apply. func ConfigMapProjection() *ConfigMapProjectionApplyConfiguration { return &ConfigMapProjectionApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ConfigMapProjectionApplyConfiguration) WithName(value string) *ConfigMapProjectionApplyConfiguration { b.Name = &value return b } // WithItems adds the given value to the Items field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Items field. func (b *ConfigMapProjectionApplyConfiguration) WithItems(values ...*KeyToPathApplyConfiguration) *ConfigMapProjectionApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithItems") } b.Items = append(b.Items, *values[i]) } return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *ConfigMapProjectionApplyConfiguration) WithOptional(value bool) *ConfigMapProjectionApplyConfiguration { b.Optional = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/configmapvolumesource.go000066400000000000000000000063531472614177300307300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ConfigMapVolumeSourceApplyConfiguration represents a declarative configuration of the ConfigMapVolumeSource type for use // with apply. type ConfigMapVolumeSourceApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Items []KeyToPathApplyConfiguration `json:"items,omitempty"` DefaultMode *int32 `json:"defaultMode,omitempty"` Optional *bool `json:"optional,omitempty"` } // ConfigMapVolumeSourceApplyConfiguration constructs a declarative configuration of the ConfigMapVolumeSource type for use with // apply. func ConfigMapVolumeSource() *ConfigMapVolumeSourceApplyConfiguration { return &ConfigMapVolumeSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ConfigMapVolumeSourceApplyConfiguration) WithName(value string) *ConfigMapVolumeSourceApplyConfiguration { b.Name = &value return b } // WithItems adds the given value to the Items field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Items field. func (b *ConfigMapVolumeSourceApplyConfiguration) WithItems(values ...*KeyToPathApplyConfiguration) *ConfigMapVolumeSourceApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithItems") } b.Items = append(b.Items, *values[i]) } return b } // WithDefaultMode sets the DefaultMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DefaultMode field is set to the value of the last call. func (b *ConfigMapVolumeSourceApplyConfiguration) WithDefaultMode(value int32) *ConfigMapVolumeSourceApplyConfiguration { b.DefaultMode = &value return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *ConfigMapVolumeSourceApplyConfiguration) WithOptional(value bool) *ConfigMapVolumeSourceApplyConfiguration { b.Optional = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/container.go000066400000000000000000000346511472614177300263000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" ) // ContainerApplyConfiguration represents a declarative configuration of the Container type for use // with apply. type ContainerApplyConfiguration struct { Name *string `json:"name,omitempty"` Image *string `json:"image,omitempty"` Command []string `json:"command,omitempty"` Args []string `json:"args,omitempty"` WorkingDir *string `json:"workingDir,omitempty"` Ports []ContainerPortApplyConfiguration `json:"ports,omitempty"` EnvFrom []EnvFromSourceApplyConfiguration `json:"envFrom,omitempty"` Env []EnvVarApplyConfiguration `json:"env,omitempty"` Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` ResizePolicy []ContainerResizePolicyApplyConfiguration `json:"resizePolicy,omitempty"` RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` VolumeMounts []VolumeMountApplyConfiguration `json:"volumeMounts,omitempty"` VolumeDevices []VolumeDeviceApplyConfiguration `json:"volumeDevices,omitempty"` LivenessProbe *ProbeApplyConfiguration `json:"livenessProbe,omitempty"` ReadinessProbe *ProbeApplyConfiguration `json:"readinessProbe,omitempty"` StartupProbe *ProbeApplyConfiguration `json:"startupProbe,omitempty"` Lifecycle *LifecycleApplyConfiguration `json:"lifecycle,omitempty"` TerminationMessagePath *string `json:"terminationMessagePath,omitempty"` TerminationMessagePolicy *corev1.TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty"` ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"` SecurityContext *SecurityContextApplyConfiguration `json:"securityContext,omitempty"` Stdin *bool `json:"stdin,omitempty"` StdinOnce *bool `json:"stdinOnce,omitempty"` TTY *bool `json:"tty,omitempty"` } // ContainerApplyConfiguration constructs a declarative configuration of the Container type for use with // apply. func Container() *ContainerApplyConfiguration { return &ContainerApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithName(value string) *ContainerApplyConfiguration { b.Name = &value return b } // WithImage sets the Image field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Image field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithImage(value string) *ContainerApplyConfiguration { b.Image = &value return b } // WithCommand adds the given value to the Command field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Command field. func (b *ContainerApplyConfiguration) WithCommand(values ...string) *ContainerApplyConfiguration { for i := range values { b.Command = append(b.Command, values[i]) } return b } // WithArgs adds the given value to the Args field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Args field. func (b *ContainerApplyConfiguration) WithArgs(values ...string) *ContainerApplyConfiguration { for i := range values { b.Args = append(b.Args, values[i]) } return b } // WithWorkingDir sets the WorkingDir field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WorkingDir field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithWorkingDir(value string) *ContainerApplyConfiguration { b.WorkingDir = &value return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *ContainerApplyConfiguration) WithPorts(values ...*ContainerPortApplyConfiguration) *ContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the EnvFrom field. func (b *ContainerApplyConfiguration) WithEnvFrom(values ...*EnvFromSourceApplyConfiguration) *ContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEnvFrom") } b.EnvFrom = append(b.EnvFrom, *values[i]) } return b } // WithEnv adds the given value to the Env field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Env field. func (b *ContainerApplyConfiguration) WithEnv(values ...*EnvVarApplyConfiguration) *ContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEnv") } b.Env = append(b.Env, *values[i]) } return b } // WithResources sets the Resources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resources field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *ContainerApplyConfiguration { b.Resources = value return b } // WithResizePolicy adds the given value to the ResizePolicy field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResizePolicy field. func (b *ContainerApplyConfiguration) WithResizePolicy(values ...*ContainerResizePolicyApplyConfiguration) *ContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResizePolicy") } b.ResizePolicy = append(b.ResizePolicy, *values[i]) } return b } // WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RestartPolicy field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithRestartPolicy(value corev1.ContainerRestartPolicy) *ContainerApplyConfiguration { b.RestartPolicy = &value return b } // WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeMounts field. func (b *ContainerApplyConfiguration) WithVolumeMounts(values ...*VolumeMountApplyConfiguration) *ContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeMounts") } b.VolumeMounts = append(b.VolumeMounts, *values[i]) } return b } // WithVolumeDevices adds the given value to the VolumeDevices field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeDevices field. func (b *ContainerApplyConfiguration) WithVolumeDevices(values ...*VolumeDeviceApplyConfiguration) *ContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeDevices") } b.VolumeDevices = append(b.VolumeDevices, *values[i]) } return b } // WithLivenessProbe sets the LivenessProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LivenessProbe field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithLivenessProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { b.LivenessProbe = value return b } // WithReadinessProbe sets the ReadinessProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadinessProbe field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { b.ReadinessProbe = value return b } // WithStartupProbe sets the StartupProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartupProbe field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithStartupProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { b.StartupProbe = value return b } // WithLifecycle sets the Lifecycle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Lifecycle field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithLifecycle(value *LifecycleApplyConfiguration) *ContainerApplyConfiguration { b.Lifecycle = value return b } // WithTerminationMessagePath sets the TerminationMessagePath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TerminationMessagePath field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithTerminationMessagePath(value string) *ContainerApplyConfiguration { b.TerminationMessagePath = &value return b } // WithTerminationMessagePolicy sets the TerminationMessagePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TerminationMessagePolicy field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithTerminationMessagePolicy(value corev1.TerminationMessagePolicy) *ContainerApplyConfiguration { b.TerminationMessagePolicy = &value return b } // WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ImagePullPolicy field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *ContainerApplyConfiguration { b.ImagePullPolicy = &value return b } // WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecurityContext field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithSecurityContext(value *SecurityContextApplyConfiguration) *ContainerApplyConfiguration { b.SecurityContext = value return b } // WithStdin sets the Stdin field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Stdin field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithStdin(value bool) *ContainerApplyConfiguration { b.Stdin = &value return b } // WithStdinOnce sets the StdinOnce field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StdinOnce field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithStdinOnce(value bool) *ContainerApplyConfiguration { b.StdinOnce = &value return b } // WithTTY sets the TTY field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TTY field is set to the value of the last call. func (b *ContainerApplyConfiguration) WithTTY(value bool) *ContainerApplyConfiguration { b.TTY = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containerimage.go000066400000000000000000000037471472614177300273050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ContainerImageApplyConfiguration represents a declarative configuration of the ContainerImage type for use // with apply. type ContainerImageApplyConfiguration struct { Names []string `json:"names,omitempty"` SizeBytes *int64 `json:"sizeBytes,omitempty"` } // ContainerImageApplyConfiguration constructs a declarative configuration of the ContainerImage type for use with // apply. func ContainerImage() *ContainerImageApplyConfiguration { return &ContainerImageApplyConfiguration{} } // WithNames adds the given value to the Names field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Names field. func (b *ContainerImageApplyConfiguration) WithNames(values ...string) *ContainerImageApplyConfiguration { for i := range values { b.Names = append(b.Names, values[i]) } return b } // WithSizeBytes sets the SizeBytes field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SizeBytes field is set to the value of the last call. func (b *ContainerImageApplyConfiguration) WithSizeBytes(value int64) *ContainerImageApplyConfiguration { b.SizeBytes = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containerport.go000066400000000000000000000065361472614177300272060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ContainerPortApplyConfiguration represents a declarative configuration of the ContainerPort type for use // with apply. type ContainerPortApplyConfiguration struct { Name *string `json:"name,omitempty"` HostPort *int32 `json:"hostPort,omitempty"` ContainerPort *int32 `json:"containerPort,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` HostIP *string `json:"hostIP,omitempty"` } // ContainerPortApplyConfiguration constructs a declarative configuration of the ContainerPort type for use with // apply. func ContainerPort() *ContainerPortApplyConfiguration { return &ContainerPortApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerPortApplyConfiguration) WithName(value string) *ContainerPortApplyConfiguration { b.Name = &value return b } // WithHostPort sets the HostPort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostPort field is set to the value of the last call. func (b *ContainerPortApplyConfiguration) WithHostPort(value int32) *ContainerPortApplyConfiguration { b.HostPort = &value return b } // WithContainerPort sets the ContainerPort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerPort field is set to the value of the last call. func (b *ContainerPortApplyConfiguration) WithContainerPort(value int32) *ContainerPortApplyConfiguration { b.ContainerPort = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *ContainerPortApplyConfiguration) WithProtocol(value v1.Protocol) *ContainerPortApplyConfiguration { b.Protocol = &value return b } // WithHostIP sets the HostIP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostIP field is set to the value of the last call. func (b *ContainerPortApplyConfiguration) WithHostIP(value string) *ContainerPortApplyConfiguration { b.HostIP = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containerresizepolicy.go000066400000000000000000000042711472614177300307350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ContainerResizePolicyApplyConfiguration represents a declarative configuration of the ContainerResizePolicy type for use // with apply. type ContainerResizePolicyApplyConfiguration struct { ResourceName *v1.ResourceName `json:"resourceName,omitempty"` RestartPolicy *v1.ResourceResizeRestartPolicy `json:"restartPolicy,omitempty"` } // ContainerResizePolicyApplyConfiguration constructs a declarative configuration of the ContainerResizePolicy type for use with // apply. func ContainerResizePolicy() *ContainerResizePolicyApplyConfiguration { return &ContainerResizePolicyApplyConfiguration{} } // WithResourceName sets the ResourceName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceName field is set to the value of the last call. func (b *ContainerResizePolicyApplyConfiguration) WithResourceName(value v1.ResourceName) *ContainerResizePolicyApplyConfiguration { b.ResourceName = &value return b } // WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RestartPolicy field is set to the value of the last call. func (b *ContainerResizePolicyApplyConfiguration) WithRestartPolicy(value v1.ResourceResizeRestartPolicy) *ContainerResizePolicyApplyConfiguration { b.RestartPolicy = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containerstate.go000066400000000000000000000051261472614177300273340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ContainerStateApplyConfiguration represents a declarative configuration of the ContainerState type for use // with apply. type ContainerStateApplyConfiguration struct { Waiting *ContainerStateWaitingApplyConfiguration `json:"waiting,omitempty"` Running *ContainerStateRunningApplyConfiguration `json:"running,omitempty"` Terminated *ContainerStateTerminatedApplyConfiguration `json:"terminated,omitempty"` } // ContainerStateApplyConfiguration constructs a declarative configuration of the ContainerState type for use with // apply. func ContainerState() *ContainerStateApplyConfiguration { return &ContainerStateApplyConfiguration{} } // WithWaiting sets the Waiting field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Waiting field is set to the value of the last call. func (b *ContainerStateApplyConfiguration) WithWaiting(value *ContainerStateWaitingApplyConfiguration) *ContainerStateApplyConfiguration { b.Waiting = value return b } // WithRunning sets the Running field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Running field is set to the value of the last call. func (b *ContainerStateApplyConfiguration) WithRunning(value *ContainerStateRunningApplyConfiguration) *ContainerStateApplyConfiguration { b.Running = value return b } // WithTerminated sets the Terminated field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Terminated field is set to the value of the last call. func (b *ContainerStateApplyConfiguration) WithTerminated(value *ContainerStateTerminatedApplyConfiguration) *ContainerStateApplyConfiguration { b.Terminated = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containerstaterunning.go000066400000000000000000000031461472614177300307350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ContainerStateRunningApplyConfiguration represents a declarative configuration of the ContainerStateRunning type for use // with apply. type ContainerStateRunningApplyConfiguration struct { StartedAt *v1.Time `json:"startedAt,omitempty"` } // ContainerStateRunningApplyConfiguration constructs a declarative configuration of the ContainerStateRunning type for use with // apply. func ContainerStateRunning() *ContainerStateRunningApplyConfiguration { return &ContainerStateRunningApplyConfiguration{} } // WithStartedAt sets the StartedAt field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartedAt field is set to the value of the last call. func (b *ContainerStateRunningApplyConfiguration) WithStartedAt(value v1.Time) *ContainerStateRunningApplyConfiguration { b.StartedAt = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containerstateterminated.go000066400000000000000000000107571472614177300314170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ContainerStateTerminatedApplyConfiguration represents a declarative configuration of the ContainerStateTerminated type for use // with apply. type ContainerStateTerminatedApplyConfiguration struct { ExitCode *int32 `json:"exitCode,omitempty"` Signal *int32 `json:"signal,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` StartedAt *v1.Time `json:"startedAt,omitempty"` FinishedAt *v1.Time `json:"finishedAt,omitempty"` ContainerID *string `json:"containerID,omitempty"` } // ContainerStateTerminatedApplyConfiguration constructs a declarative configuration of the ContainerStateTerminated type for use with // apply. func ContainerStateTerminated() *ContainerStateTerminatedApplyConfiguration { return &ContainerStateTerminatedApplyConfiguration{} } // WithExitCode sets the ExitCode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExitCode field is set to the value of the last call. func (b *ContainerStateTerminatedApplyConfiguration) WithExitCode(value int32) *ContainerStateTerminatedApplyConfiguration { b.ExitCode = &value return b } // WithSignal sets the Signal field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Signal field is set to the value of the last call. func (b *ContainerStateTerminatedApplyConfiguration) WithSignal(value int32) *ContainerStateTerminatedApplyConfiguration { b.Signal = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ContainerStateTerminatedApplyConfiguration) WithReason(value string) *ContainerStateTerminatedApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ContainerStateTerminatedApplyConfiguration) WithMessage(value string) *ContainerStateTerminatedApplyConfiguration { b.Message = &value return b } // WithStartedAt sets the StartedAt field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartedAt field is set to the value of the last call. func (b *ContainerStateTerminatedApplyConfiguration) WithStartedAt(value v1.Time) *ContainerStateTerminatedApplyConfiguration { b.StartedAt = &value return b } // WithFinishedAt sets the FinishedAt field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FinishedAt field is set to the value of the last call. func (b *ContainerStateTerminatedApplyConfiguration) WithFinishedAt(value v1.Time) *ContainerStateTerminatedApplyConfiguration { b.FinishedAt = &value return b } // WithContainerID sets the ContainerID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerID field is set to the value of the last call. func (b *ContainerStateTerminatedApplyConfiguration) WithContainerID(value string) *ContainerStateTerminatedApplyConfiguration { b.ContainerID = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containerstatewaiting.go000066400000000000000000000037571472614177300307270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ContainerStateWaitingApplyConfiguration represents a declarative configuration of the ContainerStateWaiting type for use // with apply. type ContainerStateWaitingApplyConfiguration struct { Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // ContainerStateWaitingApplyConfiguration constructs a declarative configuration of the ContainerStateWaiting type for use with // apply. func ContainerStateWaiting() *ContainerStateWaitingApplyConfiguration { return &ContainerStateWaitingApplyConfiguration{} } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ContainerStateWaitingApplyConfiguration) WithReason(value string) *ContainerStateWaitingApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ContainerStateWaitingApplyConfiguration) WithMessage(value string) *ContainerStateWaitingApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containerstatus.go000066400000000000000000000213611472614177300275360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" ) // ContainerStatusApplyConfiguration represents a declarative configuration of the ContainerStatus type for use // with apply. type ContainerStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` State *ContainerStateApplyConfiguration `json:"state,omitempty"` LastTerminationState *ContainerStateApplyConfiguration `json:"lastState,omitempty"` Ready *bool `json:"ready,omitempty"` RestartCount *int32 `json:"restartCount,omitempty"` Image *string `json:"image,omitempty"` ImageID *string `json:"imageID,omitempty"` ContainerID *string `json:"containerID,omitempty"` Started *bool `json:"started,omitempty"` AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"` Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` User *ContainerUserApplyConfiguration `json:"user,omitempty"` AllocatedResourcesStatus []ResourceStatusApplyConfiguration `json:"allocatedResourcesStatus,omitempty"` } // ContainerStatusApplyConfiguration constructs a declarative configuration of the ContainerStatus type for use with // apply. func ContainerStatus() *ContainerStatusApplyConfiguration { return &ContainerStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithName(value string) *ContainerStatusApplyConfiguration { b.Name = &value return b } // WithState sets the State field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the State field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithState(value *ContainerStateApplyConfiguration) *ContainerStatusApplyConfiguration { b.State = value return b } // WithLastTerminationState sets the LastTerminationState field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTerminationState field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithLastTerminationState(value *ContainerStateApplyConfiguration) *ContainerStatusApplyConfiguration { b.LastTerminationState = value return b } // WithReady sets the Ready field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ready field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithReady(value bool) *ContainerStatusApplyConfiguration { b.Ready = &value return b } // WithRestartCount sets the RestartCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RestartCount field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithRestartCount(value int32) *ContainerStatusApplyConfiguration { b.RestartCount = &value return b } // WithImage sets the Image field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Image field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithImage(value string) *ContainerStatusApplyConfiguration { b.Image = &value return b } // WithImageID sets the ImageID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ImageID field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithImageID(value string) *ContainerStatusApplyConfiguration { b.ImageID = &value return b } // WithContainerID sets the ContainerID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerID field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithContainerID(value string) *ContainerStatusApplyConfiguration { b.ContainerID = &value return b } // WithStarted sets the Started field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Started field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithStarted(value bool) *ContainerStatusApplyConfiguration { b.Started = &value return b } // WithAllocatedResources sets the AllocatedResources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllocatedResources field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithAllocatedResources(value corev1.ResourceList) *ContainerStatusApplyConfiguration { b.AllocatedResources = &value return b } // WithResources sets the Resources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resources field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *ContainerStatusApplyConfiguration { b.Resources = value return b } // WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeMounts field. func (b *ContainerStatusApplyConfiguration) WithVolumeMounts(values ...*VolumeMountStatusApplyConfiguration) *ContainerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeMounts") } b.VolumeMounts = append(b.VolumeMounts, *values[i]) } return b } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *ContainerStatusApplyConfiguration) WithUser(value *ContainerUserApplyConfiguration) *ContainerStatusApplyConfiguration { b.User = value return b } // WithAllocatedResourcesStatus adds the given value to the AllocatedResourcesStatus field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AllocatedResourcesStatus field. func (b *ContainerStatusApplyConfiguration) WithAllocatedResourcesStatus(values ...*ResourceStatusApplyConfiguration) *ContainerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithAllocatedResourcesStatus") } b.AllocatedResourcesStatus = append(b.AllocatedResourcesStatus, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/containeruser.go000066400000000000000000000027751472614177300272010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ContainerUserApplyConfiguration represents a declarative configuration of the ContainerUser type for use // with apply. type ContainerUserApplyConfiguration struct { Linux *LinuxContainerUserApplyConfiguration `json:"linux,omitempty"` } // ContainerUserApplyConfiguration constructs a declarative configuration of the ContainerUser type for use with // apply. func ContainerUser() *ContainerUserApplyConfiguration { return &ContainerUserApplyConfiguration{} } // WithLinux sets the Linux field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Linux field is set to the value of the last call. func (b *ContainerUserApplyConfiguration) WithLinux(value *LinuxContainerUserApplyConfiguration) *ContainerUserApplyConfiguration { b.Linux = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/csipersistentvolumesource.go000066400000000000000000000161501472614177300316600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CSIPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the CSIPersistentVolumeSource type for use // with apply. type CSIPersistentVolumeSourceApplyConfiguration struct { Driver *string `json:"driver,omitempty"` VolumeHandle *string `json:"volumeHandle,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` FSType *string `json:"fsType,omitempty"` VolumeAttributes map[string]string `json:"volumeAttributes,omitempty"` ControllerPublishSecretRef *SecretReferenceApplyConfiguration `json:"controllerPublishSecretRef,omitempty"` NodeStageSecretRef *SecretReferenceApplyConfiguration `json:"nodeStageSecretRef,omitempty"` NodePublishSecretRef *SecretReferenceApplyConfiguration `json:"nodePublishSecretRef,omitempty"` ControllerExpandSecretRef *SecretReferenceApplyConfiguration `json:"controllerExpandSecretRef,omitempty"` NodeExpandSecretRef *SecretReferenceApplyConfiguration `json:"nodeExpandSecretRef,omitempty"` } // CSIPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the CSIPersistentVolumeSource type for use with // apply. func CSIPersistentVolumeSource() *CSIPersistentVolumeSourceApplyConfiguration { return &CSIPersistentVolumeSourceApplyConfiguration{} } // WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Driver field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithDriver(value string) *CSIPersistentVolumeSourceApplyConfiguration { b.Driver = &value return b } // WithVolumeHandle sets the VolumeHandle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeHandle field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithVolumeHandle(value string) *CSIPersistentVolumeSourceApplyConfiguration { b.VolumeHandle = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CSIPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *CSIPersistentVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithVolumeAttributes puts the entries into the VolumeAttributes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the VolumeAttributes field, // overwriting an existing map entries in VolumeAttributes field with the same key. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithVolumeAttributes(entries map[string]string) *CSIPersistentVolumeSourceApplyConfiguration { if b.VolumeAttributes == nil && len(entries) > 0 { b.VolumeAttributes = make(map[string]string, len(entries)) } for k, v := range entries { b.VolumeAttributes[k] = v } return b } // WithControllerPublishSecretRef sets the ControllerPublishSecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ControllerPublishSecretRef field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithControllerPublishSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { b.ControllerPublishSecretRef = value return b } // WithNodeStageSecretRef sets the NodeStageSecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeStageSecretRef field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodeStageSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { b.NodeStageSecretRef = value return b } // WithNodePublishSecretRef sets the NodePublishSecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodePublishSecretRef field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodePublishSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { b.NodePublishSecretRef = value return b } // WithControllerExpandSecretRef sets the ControllerExpandSecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ControllerExpandSecretRef field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithControllerExpandSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { b.ControllerExpandSecretRef = value return b } // WithNodeExpandSecretRef sets the NodeExpandSecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeExpandSecretRef field is set to the value of the last call. func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodeExpandSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { b.NodeExpandSecretRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/csivolumesource.go000066400000000000000000000076061472614177300275450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CSIVolumeSourceApplyConfiguration represents a declarative configuration of the CSIVolumeSource type for use // with apply. type CSIVolumeSourceApplyConfiguration struct { Driver *string `json:"driver,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` FSType *string `json:"fsType,omitempty"` VolumeAttributes map[string]string `json:"volumeAttributes,omitempty"` NodePublishSecretRef *LocalObjectReferenceApplyConfiguration `json:"nodePublishSecretRef,omitempty"` } // CSIVolumeSourceApplyConfiguration constructs a declarative configuration of the CSIVolumeSource type for use with // apply. func CSIVolumeSource() *CSIVolumeSourceApplyConfiguration { return &CSIVolumeSourceApplyConfiguration{} } // WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Driver field is set to the value of the last call. func (b *CSIVolumeSourceApplyConfiguration) WithDriver(value string) *CSIVolumeSourceApplyConfiguration { b.Driver = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *CSIVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CSIVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *CSIVolumeSourceApplyConfiguration) WithFSType(value string) *CSIVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithVolumeAttributes puts the entries into the VolumeAttributes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the VolumeAttributes field, // overwriting an existing map entries in VolumeAttributes field with the same key. func (b *CSIVolumeSourceApplyConfiguration) WithVolumeAttributes(entries map[string]string) *CSIVolumeSourceApplyConfiguration { if b.VolumeAttributes == nil && len(entries) > 0 { b.VolumeAttributes = make(map[string]string, len(entries)) } for k, v := range entries { b.VolumeAttributes[k] = v } return b } // WithNodePublishSecretRef sets the NodePublishSecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodePublishSecretRef field is set to the value of the last call. func (b *CSIVolumeSourceApplyConfiguration) WithNodePublishSecretRef(value *LocalObjectReferenceApplyConfiguration) *CSIVolumeSourceApplyConfiguration { b.NodePublishSecretRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/daemonendpoint.go000066400000000000000000000027021472614177300273120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // DaemonEndpointApplyConfiguration represents a declarative configuration of the DaemonEndpoint type for use // with apply. type DaemonEndpointApplyConfiguration struct { Port *int32 `json:"Port,omitempty"` } // DaemonEndpointApplyConfiguration constructs a declarative configuration of the DaemonEndpoint type for use with // apply. func DaemonEndpoint() *DaemonEndpointApplyConfiguration { return &DaemonEndpointApplyConfiguration{} } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *DaemonEndpointApplyConfiguration) WithPort(value int32) *DaemonEndpointApplyConfiguration { b.Port = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/downwardapiprojection.go000066400000000000000000000033351472614177300307250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // DownwardAPIProjectionApplyConfiguration represents a declarative configuration of the DownwardAPIProjection type for use // with apply. type DownwardAPIProjectionApplyConfiguration struct { Items []DownwardAPIVolumeFileApplyConfiguration `json:"items,omitempty"` } // DownwardAPIProjectionApplyConfiguration constructs a declarative configuration of the DownwardAPIProjection type for use with // apply. func DownwardAPIProjection() *DownwardAPIProjectionApplyConfiguration { return &DownwardAPIProjectionApplyConfiguration{} } // WithItems adds the given value to the Items field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Items field. func (b *DownwardAPIProjectionApplyConfiguration) WithItems(values ...*DownwardAPIVolumeFileApplyConfiguration) *DownwardAPIProjectionApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithItems") } b.Items = append(b.Items, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/downwardapivolumefile.go000066400000000000000000000062401472614177300307160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // DownwardAPIVolumeFileApplyConfiguration represents a declarative configuration of the DownwardAPIVolumeFile type for use // with apply. type DownwardAPIVolumeFileApplyConfiguration struct { Path *string `json:"path,omitempty"` FieldRef *ObjectFieldSelectorApplyConfiguration `json:"fieldRef,omitempty"` ResourceFieldRef *ResourceFieldSelectorApplyConfiguration `json:"resourceFieldRef,omitempty"` Mode *int32 `json:"mode,omitempty"` } // DownwardAPIVolumeFileApplyConfiguration constructs a declarative configuration of the DownwardAPIVolumeFile type for use with // apply. func DownwardAPIVolumeFile() *DownwardAPIVolumeFileApplyConfiguration { return &DownwardAPIVolumeFileApplyConfiguration{} } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *DownwardAPIVolumeFileApplyConfiguration) WithPath(value string) *DownwardAPIVolumeFileApplyConfiguration { b.Path = &value return b } // WithFieldRef sets the FieldRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldRef field is set to the value of the last call. func (b *DownwardAPIVolumeFileApplyConfiguration) WithFieldRef(value *ObjectFieldSelectorApplyConfiguration) *DownwardAPIVolumeFileApplyConfiguration { b.FieldRef = value return b } // WithResourceFieldRef sets the ResourceFieldRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceFieldRef field is set to the value of the last call. func (b *DownwardAPIVolumeFileApplyConfiguration) WithResourceFieldRef(value *ResourceFieldSelectorApplyConfiguration) *DownwardAPIVolumeFileApplyConfiguration { b.ResourceFieldRef = value return b } // WithMode sets the Mode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Mode field is set to the value of the last call. func (b *DownwardAPIVolumeFileApplyConfiguration) WithMode(value int32) *DownwardAPIVolumeFileApplyConfiguration { b.Mode = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/downwardapivolumesource.go000066400000000000000000000044161472614177300313020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // DownwardAPIVolumeSourceApplyConfiguration represents a declarative configuration of the DownwardAPIVolumeSource type for use // with apply. type DownwardAPIVolumeSourceApplyConfiguration struct { Items []DownwardAPIVolumeFileApplyConfiguration `json:"items,omitempty"` DefaultMode *int32 `json:"defaultMode,omitempty"` } // DownwardAPIVolumeSourceApplyConfiguration constructs a declarative configuration of the DownwardAPIVolumeSource type for use with // apply. func DownwardAPIVolumeSource() *DownwardAPIVolumeSourceApplyConfiguration { return &DownwardAPIVolumeSourceApplyConfiguration{} } // WithItems adds the given value to the Items field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Items field. func (b *DownwardAPIVolumeSourceApplyConfiguration) WithItems(values ...*DownwardAPIVolumeFileApplyConfiguration) *DownwardAPIVolumeSourceApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithItems") } b.Items = append(b.Items, *values[i]) } return b } // WithDefaultMode sets the DefaultMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DefaultMode field is set to the value of the last call. func (b *DownwardAPIVolumeSourceApplyConfiguration) WithDefaultMode(value int32) *DownwardAPIVolumeSourceApplyConfiguration { b.DefaultMode = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/emptydirvolumesource.go000066400000000000000000000041641472614177300306200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" ) // EmptyDirVolumeSourceApplyConfiguration represents a declarative configuration of the EmptyDirVolumeSource type for use // with apply. type EmptyDirVolumeSourceApplyConfiguration struct { Medium *v1.StorageMedium `json:"medium,omitempty"` SizeLimit *resource.Quantity `json:"sizeLimit,omitempty"` } // EmptyDirVolumeSourceApplyConfiguration constructs a declarative configuration of the EmptyDirVolumeSource type for use with // apply. func EmptyDirVolumeSource() *EmptyDirVolumeSourceApplyConfiguration { return &EmptyDirVolumeSourceApplyConfiguration{} } // WithMedium sets the Medium field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Medium field is set to the value of the last call. func (b *EmptyDirVolumeSourceApplyConfiguration) WithMedium(value v1.StorageMedium) *EmptyDirVolumeSourceApplyConfiguration { b.Medium = &value return b } // WithSizeLimit sets the SizeLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SizeLimit field is set to the value of the last call. func (b *EmptyDirVolumeSourceApplyConfiguration) WithSizeLimit(value resource.Quantity) *EmptyDirVolumeSourceApplyConfiguration { b.SizeLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/endpointaddress.go000066400000000000000000000057121472614177300275000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EndpointAddressApplyConfiguration represents a declarative configuration of the EndpointAddress type for use // with apply. type EndpointAddressApplyConfiguration struct { IP *string `json:"ip,omitempty"` Hostname *string `json:"hostname,omitempty"` NodeName *string `json:"nodeName,omitempty"` TargetRef *ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"` } // EndpointAddressApplyConfiguration constructs a declarative configuration of the EndpointAddress type for use with // apply. func EndpointAddress() *EndpointAddressApplyConfiguration { return &EndpointAddressApplyConfiguration{} } // WithIP sets the IP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IP field is set to the value of the last call. func (b *EndpointAddressApplyConfiguration) WithIP(value string) *EndpointAddressApplyConfiguration { b.IP = &value return b } // WithHostname sets the Hostname field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hostname field is set to the value of the last call. func (b *EndpointAddressApplyConfiguration) WithHostname(value string) *EndpointAddressApplyConfiguration { b.Hostname = &value return b } // WithNodeName sets the NodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeName field is set to the value of the last call. func (b *EndpointAddressApplyConfiguration) WithNodeName(value string) *EndpointAddressApplyConfiguration { b.NodeName = &value return b } // WithTargetRef sets the TargetRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetRef field is set to the value of the last call. func (b *EndpointAddressApplyConfiguration) WithTargetRef(value *ObjectReferenceApplyConfiguration) *EndpointAddressApplyConfiguration { b.TargetRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/endpointport.go000066400000000000000000000055301472614177300270350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // EndpointPortApplyConfiguration represents a declarative configuration of the EndpointPort type for use // with apply. type EndpointPortApplyConfiguration struct { Name *string `json:"name,omitempty"` Port *int32 `json:"port,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` AppProtocol *string `json:"appProtocol,omitempty"` } // EndpointPortApplyConfiguration constructs a declarative configuration of the EndpointPort type for use with // apply. func EndpointPort() *EndpointPortApplyConfiguration { return &EndpointPortApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithName(value string) *EndpointPortApplyConfiguration { b.Name = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithPort(value int32) *EndpointPortApplyConfiguration { b.Port = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithProtocol(value v1.Protocol) *EndpointPortApplyConfiguration { b.Protocol = &value return b } // WithAppProtocol sets the AppProtocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AppProtocol field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithAppProtocol(value string) *EndpointPortApplyConfiguration { b.AppProtocol = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/endpoints.go000066400000000000000000000276111472614177300263170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // EndpointsApplyConfiguration represents a declarative configuration of the Endpoints type for use // with apply. type EndpointsApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Subsets []EndpointSubsetApplyConfiguration `json:"subsets,omitempty"` } // Endpoints constructs a declarative configuration of the Endpoints type for use with // apply. func Endpoints(name, namespace string) *EndpointsApplyConfiguration { b := &EndpointsApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Endpoints") b.WithAPIVersion("v1") return b } // ExtractEndpoints extracts the applied configuration owned by fieldManager from // endpoints. If no managedFields are found in endpoints for fieldManager, a // EndpointsApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // endpoints must be a unmodified Endpoints API object that was retrieved from the Kubernetes API. // ExtractEndpoints provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractEndpoints(endpoints *apicorev1.Endpoints, fieldManager string) (*EndpointsApplyConfiguration, error) { return extractEndpoints(endpoints, fieldManager, "") } // ExtractEndpointsStatus is the same as ExtractEndpoints except // that it extracts the status subresource applied configuration. // Experimental! func ExtractEndpointsStatus(endpoints *apicorev1.Endpoints, fieldManager string) (*EndpointsApplyConfiguration, error) { return extractEndpoints(endpoints, fieldManager, "status") } func extractEndpoints(endpoints *apicorev1.Endpoints, fieldManager string, subresource string) (*EndpointsApplyConfiguration, error) { b := &EndpointsApplyConfiguration{} err := managedfields.ExtractInto(endpoints, internal.Parser().Type("io.k8s.api.core.v1.Endpoints"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(endpoints.Name) b.WithNamespace(endpoints.Namespace) b.WithKind("Endpoints") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithKind(value string) *EndpointsApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithAPIVersion(value string) *EndpointsApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithName(value string) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithGenerateName(value string) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithNamespace(value string) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithUID(value types.UID) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithResourceVersion(value string) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithGeneration(value int64) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *EndpointsApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *EndpointsApplyConfiguration) WithLabels(entries map[string]string) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *EndpointsApplyConfiguration) WithAnnotations(entries map[string]string) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *EndpointsApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *EndpointsApplyConfiguration) WithFinalizers(values ...string) *EndpointsApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *EndpointsApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSubsets adds the given value to the Subsets field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subsets field. func (b *EndpointsApplyConfiguration) WithSubsets(values ...*EndpointSubsetApplyConfiguration) *EndpointsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubsets") } b.Subsets = append(b.Subsets, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *EndpointsApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/endpointsubset.go000066400000000000000000000060401472614177300273530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EndpointSubsetApplyConfiguration represents a declarative configuration of the EndpointSubset type for use // with apply. type EndpointSubsetApplyConfiguration struct { Addresses []EndpointAddressApplyConfiguration `json:"addresses,omitempty"` NotReadyAddresses []EndpointAddressApplyConfiguration `json:"notReadyAddresses,omitempty"` Ports []EndpointPortApplyConfiguration `json:"ports,omitempty"` } // EndpointSubsetApplyConfiguration constructs a declarative configuration of the EndpointSubset type for use with // apply. func EndpointSubset() *EndpointSubsetApplyConfiguration { return &EndpointSubsetApplyConfiguration{} } // WithAddresses adds the given value to the Addresses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Addresses field. func (b *EndpointSubsetApplyConfiguration) WithAddresses(values ...*EndpointAddressApplyConfiguration) *EndpointSubsetApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithAddresses") } b.Addresses = append(b.Addresses, *values[i]) } return b } // WithNotReadyAddresses adds the given value to the NotReadyAddresses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NotReadyAddresses field. func (b *EndpointSubsetApplyConfiguration) WithNotReadyAddresses(values ...*EndpointAddressApplyConfiguration) *EndpointSubsetApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithNotReadyAddresses") } b.NotReadyAddresses = append(b.NotReadyAddresses, *values[i]) } return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *EndpointSubsetApplyConfiguration) WithPorts(values ...*EndpointPortApplyConfiguration) *EndpointSubsetApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/envfromsource.go000066400000000000000000000050411472614177300272020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EnvFromSourceApplyConfiguration represents a declarative configuration of the EnvFromSource type for use // with apply. type EnvFromSourceApplyConfiguration struct { Prefix *string `json:"prefix,omitempty"` ConfigMapRef *ConfigMapEnvSourceApplyConfiguration `json:"configMapRef,omitempty"` SecretRef *SecretEnvSourceApplyConfiguration `json:"secretRef,omitempty"` } // EnvFromSourceApplyConfiguration constructs a declarative configuration of the EnvFromSource type for use with // apply. func EnvFromSource() *EnvFromSourceApplyConfiguration { return &EnvFromSourceApplyConfiguration{} } // WithPrefix sets the Prefix field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Prefix field is set to the value of the last call. func (b *EnvFromSourceApplyConfiguration) WithPrefix(value string) *EnvFromSourceApplyConfiguration { b.Prefix = &value return b } // WithConfigMapRef sets the ConfigMapRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConfigMapRef field is set to the value of the last call. func (b *EnvFromSourceApplyConfiguration) WithConfigMapRef(value *ConfigMapEnvSourceApplyConfiguration) *EnvFromSourceApplyConfiguration { b.ConfigMapRef = value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *EnvFromSourceApplyConfiguration) WithSecretRef(value *SecretEnvSourceApplyConfiguration) *EnvFromSourceApplyConfiguration { b.SecretRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/envvar.go000066400000000000000000000045151472614177300256130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EnvVarApplyConfiguration represents a declarative configuration of the EnvVar type for use // with apply. type EnvVarApplyConfiguration struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` ValueFrom *EnvVarSourceApplyConfiguration `json:"valueFrom,omitempty"` } // EnvVarApplyConfiguration constructs a declarative configuration of the EnvVar type for use with // apply. func EnvVar() *EnvVarApplyConfiguration { return &EnvVarApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EnvVarApplyConfiguration) WithName(value string) *EnvVarApplyConfiguration { b.Name = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *EnvVarApplyConfiguration) WithValue(value string) *EnvVarApplyConfiguration { b.Value = &value return b } // WithValueFrom sets the ValueFrom field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ValueFrom field is set to the value of the last call. func (b *EnvVarApplyConfiguration) WithValueFrom(value *EnvVarSourceApplyConfiguration) *EnvVarApplyConfiguration { b.ValueFrom = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/envvarsource.go000066400000000000000000000063001472614177300270260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EnvVarSourceApplyConfiguration represents a declarative configuration of the EnvVarSource type for use // with apply. type EnvVarSourceApplyConfiguration struct { FieldRef *ObjectFieldSelectorApplyConfiguration `json:"fieldRef,omitempty"` ResourceFieldRef *ResourceFieldSelectorApplyConfiguration `json:"resourceFieldRef,omitempty"` ConfigMapKeyRef *ConfigMapKeySelectorApplyConfiguration `json:"configMapKeyRef,omitempty"` SecretKeyRef *SecretKeySelectorApplyConfiguration `json:"secretKeyRef,omitempty"` } // EnvVarSourceApplyConfiguration constructs a declarative configuration of the EnvVarSource type for use with // apply. func EnvVarSource() *EnvVarSourceApplyConfiguration { return &EnvVarSourceApplyConfiguration{} } // WithFieldRef sets the FieldRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldRef field is set to the value of the last call. func (b *EnvVarSourceApplyConfiguration) WithFieldRef(value *ObjectFieldSelectorApplyConfiguration) *EnvVarSourceApplyConfiguration { b.FieldRef = value return b } // WithResourceFieldRef sets the ResourceFieldRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceFieldRef field is set to the value of the last call. func (b *EnvVarSourceApplyConfiguration) WithResourceFieldRef(value *ResourceFieldSelectorApplyConfiguration) *EnvVarSourceApplyConfiguration { b.ResourceFieldRef = value return b } // WithConfigMapKeyRef sets the ConfigMapKeyRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConfigMapKeyRef field is set to the value of the last call. func (b *EnvVarSourceApplyConfiguration) WithConfigMapKeyRef(value *ConfigMapKeySelectorApplyConfiguration) *EnvVarSourceApplyConfiguration { b.ConfigMapKeyRef = value return b } // WithSecretKeyRef sets the SecretKeyRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretKeyRef field is set to the value of the last call. func (b *EnvVarSourceApplyConfiguration) WithSecretKeyRef(value *SecretKeySelectorApplyConfiguration) *EnvVarSourceApplyConfiguration { b.SecretKeyRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/ephemeralcontainer.go000066400000000000000000000323441472614177300301600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" ) // EphemeralContainerApplyConfiguration represents a declarative configuration of the EphemeralContainer type for use // with apply. type EphemeralContainerApplyConfiguration struct { EphemeralContainerCommonApplyConfiguration `json:",inline"` TargetContainerName *string `json:"targetContainerName,omitempty"` } // EphemeralContainerApplyConfiguration constructs a declarative configuration of the EphemeralContainer type for use with // apply. func EphemeralContainer() *EphemeralContainerApplyConfiguration { return &EphemeralContainerApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithName(value string) *EphemeralContainerApplyConfiguration { b.Name = &value return b } // WithImage sets the Image field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Image field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithImage(value string) *EphemeralContainerApplyConfiguration { b.Image = &value return b } // WithCommand adds the given value to the Command field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Command field. func (b *EphemeralContainerApplyConfiguration) WithCommand(values ...string) *EphemeralContainerApplyConfiguration { for i := range values { b.Command = append(b.Command, values[i]) } return b } // WithArgs adds the given value to the Args field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Args field. func (b *EphemeralContainerApplyConfiguration) WithArgs(values ...string) *EphemeralContainerApplyConfiguration { for i := range values { b.Args = append(b.Args, values[i]) } return b } // WithWorkingDir sets the WorkingDir field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WorkingDir field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithWorkingDir(value string) *EphemeralContainerApplyConfiguration { b.WorkingDir = &value return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *EphemeralContainerApplyConfiguration) WithPorts(values ...*ContainerPortApplyConfiguration) *EphemeralContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the EnvFrom field. func (b *EphemeralContainerApplyConfiguration) WithEnvFrom(values ...*EnvFromSourceApplyConfiguration) *EphemeralContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEnvFrom") } b.EnvFrom = append(b.EnvFrom, *values[i]) } return b } // WithEnv adds the given value to the Env field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Env field. func (b *EphemeralContainerApplyConfiguration) WithEnv(values ...*EnvVarApplyConfiguration) *EphemeralContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEnv") } b.Env = append(b.Env, *values[i]) } return b } // WithResources sets the Resources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resources field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *EphemeralContainerApplyConfiguration { b.Resources = value return b } // WithResizePolicy adds the given value to the ResizePolicy field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResizePolicy field. func (b *EphemeralContainerApplyConfiguration) WithResizePolicy(values ...*ContainerResizePolicyApplyConfiguration) *EphemeralContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResizePolicy") } b.ResizePolicy = append(b.ResizePolicy, *values[i]) } return b } // WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RestartPolicy field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithRestartPolicy(value corev1.ContainerRestartPolicy) *EphemeralContainerApplyConfiguration { b.RestartPolicy = &value return b } // WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeMounts field. func (b *EphemeralContainerApplyConfiguration) WithVolumeMounts(values ...*VolumeMountApplyConfiguration) *EphemeralContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeMounts") } b.VolumeMounts = append(b.VolumeMounts, *values[i]) } return b } // WithVolumeDevices adds the given value to the VolumeDevices field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeDevices field. func (b *EphemeralContainerApplyConfiguration) WithVolumeDevices(values ...*VolumeDeviceApplyConfiguration) *EphemeralContainerApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeDevices") } b.VolumeDevices = append(b.VolumeDevices, *values[i]) } return b } // WithLivenessProbe sets the LivenessProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LivenessProbe field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithLivenessProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration { b.LivenessProbe = value return b } // WithReadinessProbe sets the ReadinessProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadinessProbe field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration { b.ReadinessProbe = value return b } // WithStartupProbe sets the StartupProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartupProbe field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithStartupProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration { b.StartupProbe = value return b } // WithLifecycle sets the Lifecycle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Lifecycle field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithLifecycle(value *LifecycleApplyConfiguration) *EphemeralContainerApplyConfiguration { b.Lifecycle = value return b } // WithTerminationMessagePath sets the TerminationMessagePath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TerminationMessagePath field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithTerminationMessagePath(value string) *EphemeralContainerApplyConfiguration { b.TerminationMessagePath = &value return b } // WithTerminationMessagePolicy sets the TerminationMessagePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TerminationMessagePolicy field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithTerminationMessagePolicy(value corev1.TerminationMessagePolicy) *EphemeralContainerApplyConfiguration { b.TerminationMessagePolicy = &value return b } // WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ImagePullPolicy field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *EphemeralContainerApplyConfiguration { b.ImagePullPolicy = &value return b } // WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecurityContext field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithSecurityContext(value *SecurityContextApplyConfiguration) *EphemeralContainerApplyConfiguration { b.SecurityContext = value return b } // WithStdin sets the Stdin field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Stdin field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithStdin(value bool) *EphemeralContainerApplyConfiguration { b.Stdin = &value return b } // WithStdinOnce sets the StdinOnce field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StdinOnce field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithStdinOnce(value bool) *EphemeralContainerApplyConfiguration { b.StdinOnce = &value return b } // WithTTY sets the TTY field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TTY field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithTTY(value bool) *EphemeralContainerApplyConfiguration { b.TTY = &value return b } // WithTargetContainerName sets the TargetContainerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetContainerName field is set to the value of the last call. func (b *EphemeralContainerApplyConfiguration) WithTargetContainerName(value string) *EphemeralContainerApplyConfiguration { b.TargetContainerName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/ephemeralcontainercommon.go000066400000000000000000000363611472614177300313740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" ) // EphemeralContainerCommonApplyConfiguration represents a declarative configuration of the EphemeralContainerCommon type for use // with apply. type EphemeralContainerCommonApplyConfiguration struct { Name *string `json:"name,omitempty"` Image *string `json:"image,omitempty"` Command []string `json:"command,omitempty"` Args []string `json:"args,omitempty"` WorkingDir *string `json:"workingDir,omitempty"` Ports []ContainerPortApplyConfiguration `json:"ports,omitempty"` EnvFrom []EnvFromSourceApplyConfiguration `json:"envFrom,omitempty"` Env []EnvVarApplyConfiguration `json:"env,omitempty"` Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` ResizePolicy []ContainerResizePolicyApplyConfiguration `json:"resizePolicy,omitempty"` RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` VolumeMounts []VolumeMountApplyConfiguration `json:"volumeMounts,omitempty"` VolumeDevices []VolumeDeviceApplyConfiguration `json:"volumeDevices,omitempty"` LivenessProbe *ProbeApplyConfiguration `json:"livenessProbe,omitempty"` ReadinessProbe *ProbeApplyConfiguration `json:"readinessProbe,omitempty"` StartupProbe *ProbeApplyConfiguration `json:"startupProbe,omitempty"` Lifecycle *LifecycleApplyConfiguration `json:"lifecycle,omitempty"` TerminationMessagePath *string `json:"terminationMessagePath,omitempty"` TerminationMessagePolicy *corev1.TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty"` ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"` SecurityContext *SecurityContextApplyConfiguration `json:"securityContext,omitempty"` Stdin *bool `json:"stdin,omitempty"` StdinOnce *bool `json:"stdinOnce,omitempty"` TTY *bool `json:"tty,omitempty"` } // EphemeralContainerCommonApplyConfiguration constructs a declarative configuration of the EphemeralContainerCommon type for use with // apply. func EphemeralContainerCommon() *EphemeralContainerCommonApplyConfiguration { return &EphemeralContainerCommonApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithName(value string) *EphemeralContainerCommonApplyConfiguration { b.Name = &value return b } // WithImage sets the Image field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Image field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithImage(value string) *EphemeralContainerCommonApplyConfiguration { b.Image = &value return b } // WithCommand adds the given value to the Command field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Command field. func (b *EphemeralContainerCommonApplyConfiguration) WithCommand(values ...string) *EphemeralContainerCommonApplyConfiguration { for i := range values { b.Command = append(b.Command, values[i]) } return b } // WithArgs adds the given value to the Args field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Args field. func (b *EphemeralContainerCommonApplyConfiguration) WithArgs(values ...string) *EphemeralContainerCommonApplyConfiguration { for i := range values { b.Args = append(b.Args, values[i]) } return b } // WithWorkingDir sets the WorkingDir field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WorkingDir field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithWorkingDir(value string) *EphemeralContainerCommonApplyConfiguration { b.WorkingDir = &value return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *EphemeralContainerCommonApplyConfiguration) WithPorts(values ...*ContainerPortApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the EnvFrom field. func (b *EphemeralContainerCommonApplyConfiguration) WithEnvFrom(values ...*EnvFromSourceApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEnvFrom") } b.EnvFrom = append(b.EnvFrom, *values[i]) } return b } // WithEnv adds the given value to the Env field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Env field. func (b *EphemeralContainerCommonApplyConfiguration) WithEnv(values ...*EnvVarApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEnv") } b.Env = append(b.Env, *values[i]) } return b } // WithResources sets the Resources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resources field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { b.Resources = value return b } // WithResizePolicy adds the given value to the ResizePolicy field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResizePolicy field. func (b *EphemeralContainerCommonApplyConfiguration) WithResizePolicy(values ...*ContainerResizePolicyApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResizePolicy") } b.ResizePolicy = append(b.ResizePolicy, *values[i]) } return b } // WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RestartPolicy field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithRestartPolicy(value corev1.ContainerRestartPolicy) *EphemeralContainerCommonApplyConfiguration { b.RestartPolicy = &value return b } // WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeMounts field. func (b *EphemeralContainerCommonApplyConfiguration) WithVolumeMounts(values ...*VolumeMountApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeMounts") } b.VolumeMounts = append(b.VolumeMounts, *values[i]) } return b } // WithVolumeDevices adds the given value to the VolumeDevices field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeDevices field. func (b *EphemeralContainerCommonApplyConfiguration) WithVolumeDevices(values ...*VolumeDeviceApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumeDevices") } b.VolumeDevices = append(b.VolumeDevices, *values[i]) } return b } // WithLivenessProbe sets the LivenessProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LivenessProbe field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithLivenessProbe(value *ProbeApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { b.LivenessProbe = value return b } // WithReadinessProbe sets the ReadinessProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadinessProbe field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { b.ReadinessProbe = value return b } // WithStartupProbe sets the StartupProbe field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartupProbe field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithStartupProbe(value *ProbeApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { b.StartupProbe = value return b } // WithLifecycle sets the Lifecycle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Lifecycle field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithLifecycle(value *LifecycleApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { b.Lifecycle = value return b } // WithTerminationMessagePath sets the TerminationMessagePath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TerminationMessagePath field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithTerminationMessagePath(value string) *EphemeralContainerCommonApplyConfiguration { b.TerminationMessagePath = &value return b } // WithTerminationMessagePolicy sets the TerminationMessagePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TerminationMessagePolicy field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithTerminationMessagePolicy(value corev1.TerminationMessagePolicy) *EphemeralContainerCommonApplyConfiguration { b.TerminationMessagePolicy = &value return b } // WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ImagePullPolicy field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *EphemeralContainerCommonApplyConfiguration { b.ImagePullPolicy = &value return b } // WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecurityContext field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithSecurityContext(value *SecurityContextApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { b.SecurityContext = value return b } // WithStdin sets the Stdin field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Stdin field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithStdin(value bool) *EphemeralContainerCommonApplyConfiguration { b.Stdin = &value return b } // WithStdinOnce sets the StdinOnce field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StdinOnce field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithStdinOnce(value bool) *EphemeralContainerCommonApplyConfiguration { b.StdinOnce = &value return b } // WithTTY sets the TTY field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TTY field is set to the value of the last call. func (b *EphemeralContainerCommonApplyConfiguration) WithTTY(value bool) *EphemeralContainerCommonApplyConfiguration { b.TTY = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/ephemeralvolumesource.go000066400000000000000000000033051472614177300307210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EphemeralVolumeSourceApplyConfiguration represents a declarative configuration of the EphemeralVolumeSource type for use // with apply. type EphemeralVolumeSourceApplyConfiguration struct { VolumeClaimTemplate *PersistentVolumeClaimTemplateApplyConfiguration `json:"volumeClaimTemplate,omitempty"` } // EphemeralVolumeSourceApplyConfiguration constructs a declarative configuration of the EphemeralVolumeSource type for use with // apply. func EphemeralVolumeSource() *EphemeralVolumeSourceApplyConfiguration { return &EphemeralVolumeSourceApplyConfiguration{} } // WithVolumeClaimTemplate sets the VolumeClaimTemplate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeClaimTemplate field is set to the value of the last call. func (b *EphemeralVolumeSourceApplyConfiguration) WithVolumeClaimTemplate(value *PersistentVolumeClaimTemplateApplyConfiguration) *EphemeralVolumeSourceApplyConfiguration { b.VolumeClaimTemplate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/event.go000066400000000000000000000437441472614177300254420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // EventApplyConfiguration represents a declarative configuration of the Event type for use // with apply. type EventApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` InvolvedObject *ObjectReferenceApplyConfiguration `json:"involvedObject,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` Source *EventSourceApplyConfiguration `json:"source,omitempty"` FirstTimestamp *metav1.Time `json:"firstTimestamp,omitempty"` LastTimestamp *metav1.Time `json:"lastTimestamp,omitempty"` Count *int32 `json:"count,omitempty"` Type *string `json:"type,omitempty"` EventTime *metav1.MicroTime `json:"eventTime,omitempty"` Series *EventSeriesApplyConfiguration `json:"series,omitempty"` Action *string `json:"action,omitempty"` Related *ObjectReferenceApplyConfiguration `json:"related,omitempty"` ReportingController *string `json:"reportingComponent,omitempty"` ReportingInstance *string `json:"reportingInstance,omitempty"` } // Event constructs a declarative configuration of the Event type for use with // apply. func Event(name, namespace string) *EventApplyConfiguration { b := &EventApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Event") b.WithAPIVersion("v1") return b } // ExtractEvent extracts the applied configuration owned by fieldManager from // event. If no managedFields are found in event for fieldManager, a // EventApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // event must be a unmodified Event API object that was retrieved from the Kubernetes API. // ExtractEvent provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractEvent(event *apicorev1.Event, fieldManager string) (*EventApplyConfiguration, error) { return extractEvent(event, fieldManager, "") } // ExtractEventStatus is the same as ExtractEvent except // that it extracts the status subresource applied configuration. // Experimental! func ExtractEventStatus(event *apicorev1.Event, fieldManager string) (*EventApplyConfiguration, error) { return extractEvent(event, fieldManager, "status") } func extractEvent(event *apicorev1.Event, fieldManager string, subresource string) (*EventApplyConfiguration, error) { b := &EventApplyConfiguration{} err := managedfields.ExtractInto(event, internal.Parser().Type("io.k8s.api.core.v1.Event"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(event.Name) b.WithNamespace(event.Namespace) b.WithKind("Event") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *EventApplyConfiguration) WithKind(value string) *EventApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *EventApplyConfiguration) WithAPIVersion(value string) *EventApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EventApplyConfiguration) WithName(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *EventApplyConfiguration) WithGenerateName(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *EventApplyConfiguration) WithNamespace(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *EventApplyConfiguration) WithUID(value types.UID) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *EventApplyConfiguration) WithResourceVersion(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *EventApplyConfiguration) WithGeneration(value int64) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *EventApplyConfiguration) WithLabels(entries map[string]string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *EventApplyConfiguration) WithAnnotations(entries map[string]string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *EventApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *EventApplyConfiguration) WithFinalizers(values ...string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *EventApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithInvolvedObject sets the InvolvedObject field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InvolvedObject field is set to the value of the last call. func (b *EventApplyConfiguration) WithInvolvedObject(value *ObjectReferenceApplyConfiguration) *EventApplyConfiguration { b.InvolvedObject = value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *EventApplyConfiguration) WithReason(value string) *EventApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *EventApplyConfiguration) WithMessage(value string) *EventApplyConfiguration { b.Message = &value return b } // WithSource sets the Source field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Source field is set to the value of the last call. func (b *EventApplyConfiguration) WithSource(value *EventSourceApplyConfiguration) *EventApplyConfiguration { b.Source = value return b } // WithFirstTimestamp sets the FirstTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FirstTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithFirstTimestamp(value metav1.Time) *EventApplyConfiguration { b.FirstTimestamp = &value return b } // WithLastTimestamp sets the LastTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithLastTimestamp(value metav1.Time) *EventApplyConfiguration { b.LastTimestamp = &value return b } // WithCount sets the Count field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Count field is set to the value of the last call. func (b *EventApplyConfiguration) WithCount(value int32) *EventApplyConfiguration { b.Count = &value return b } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *EventApplyConfiguration) WithType(value string) *EventApplyConfiguration { b.Type = &value return b } // WithEventTime sets the EventTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EventTime field is set to the value of the last call. func (b *EventApplyConfiguration) WithEventTime(value metav1.MicroTime) *EventApplyConfiguration { b.EventTime = &value return b } // WithSeries sets the Series field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Series field is set to the value of the last call. func (b *EventApplyConfiguration) WithSeries(value *EventSeriesApplyConfiguration) *EventApplyConfiguration { b.Series = value return b } // WithAction sets the Action field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Action field is set to the value of the last call. func (b *EventApplyConfiguration) WithAction(value string) *EventApplyConfiguration { b.Action = &value return b } // WithRelated sets the Related field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Related field is set to the value of the last call. func (b *EventApplyConfiguration) WithRelated(value *ObjectReferenceApplyConfiguration) *EventApplyConfiguration { b.Related = value return b } // WithReportingController sets the ReportingController field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReportingController field is set to the value of the last call. func (b *EventApplyConfiguration) WithReportingController(value string) *EventApplyConfiguration { b.ReportingController = &value return b } // WithReportingInstance sets the ReportingInstance field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReportingInstance field is set to the value of the last call. func (b *EventApplyConfiguration) WithReportingInstance(value string) *EventApplyConfiguration { b.ReportingInstance = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *EventApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/eventseries.go000066400000000000000000000040011472614177300266340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // EventSeriesApplyConfiguration represents a declarative configuration of the EventSeries type for use // with apply. type EventSeriesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` LastObservedTime *v1.MicroTime `json:"lastObservedTime,omitempty"` } // EventSeriesApplyConfiguration constructs a declarative configuration of the EventSeries type for use with // apply. func EventSeries() *EventSeriesApplyConfiguration { return &EventSeriesApplyConfiguration{} } // WithCount sets the Count field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Count field is set to the value of the last call. func (b *EventSeriesApplyConfiguration) WithCount(value int32) *EventSeriesApplyConfiguration { b.Count = &value return b } // WithLastObservedTime sets the LastObservedTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastObservedTime field is set to the value of the last call. func (b *EventSeriesApplyConfiguration) WithLastObservedTime(value v1.MicroTime) *EventSeriesApplyConfiguration { b.LastObservedTime = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/eventsource.go000066400000000000000000000035731472614177300266570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EventSourceApplyConfiguration represents a declarative configuration of the EventSource type for use // with apply. type EventSourceApplyConfiguration struct { Component *string `json:"component,omitempty"` Host *string `json:"host,omitempty"` } // EventSourceApplyConfiguration constructs a declarative configuration of the EventSource type for use with // apply. func EventSource() *EventSourceApplyConfiguration { return &EventSourceApplyConfiguration{} } // WithComponent sets the Component field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Component field is set to the value of the last call. func (b *EventSourceApplyConfiguration) WithComponent(value string) *EventSourceApplyConfiguration { b.Component = &value return b } // WithHost sets the Host field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Host field is set to the value of the last call. func (b *EventSourceApplyConfiguration) WithHost(value string) *EventSourceApplyConfiguration { b.Host = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/execaction.go000066400000000000000000000027651472614177300264410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ExecActionApplyConfiguration represents a declarative configuration of the ExecAction type for use // with apply. type ExecActionApplyConfiguration struct { Command []string `json:"command,omitempty"` } // ExecActionApplyConfiguration constructs a declarative configuration of the ExecAction type for use with // apply. func ExecAction() *ExecActionApplyConfiguration { return &ExecActionApplyConfiguration{} } // WithCommand adds the given value to the Command field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Command field. func (b *ExecActionApplyConfiguration) WithCommand(values ...string) *ExecActionApplyConfiguration { for i := range values { b.Command = append(b.Command, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/fcvolumesource.go000066400000000000000000000065771472614177300273650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // FCVolumeSourceApplyConfiguration represents a declarative configuration of the FCVolumeSource type for use // with apply. type FCVolumeSourceApplyConfiguration struct { TargetWWNs []string `json:"targetWWNs,omitempty"` Lun *int32 `json:"lun,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` WWIDs []string `json:"wwids,omitempty"` } // FCVolumeSourceApplyConfiguration constructs a declarative configuration of the FCVolumeSource type for use with // apply. func FCVolumeSource() *FCVolumeSourceApplyConfiguration { return &FCVolumeSourceApplyConfiguration{} } // WithTargetWWNs adds the given value to the TargetWWNs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TargetWWNs field. func (b *FCVolumeSourceApplyConfiguration) WithTargetWWNs(values ...string) *FCVolumeSourceApplyConfiguration { for i := range values { b.TargetWWNs = append(b.TargetWWNs, values[i]) } return b } // WithLun sets the Lun field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Lun field is set to the value of the last call. func (b *FCVolumeSourceApplyConfiguration) WithLun(value int32) *FCVolumeSourceApplyConfiguration { b.Lun = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *FCVolumeSourceApplyConfiguration) WithFSType(value string) *FCVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *FCVolumeSourceApplyConfiguration) WithReadOnly(value bool) *FCVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithWWIDs adds the given value to the WWIDs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the WWIDs field. func (b *FCVolumeSourceApplyConfiguration) WithWWIDs(values ...string) *FCVolumeSourceApplyConfiguration { for i := range values { b.WWIDs = append(b.WWIDs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/flexpersistentvolumesource.go000066400000000000000000000075441472614177300320470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // FlexPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the FlexPersistentVolumeSource type for use // with apply. type FlexPersistentVolumeSourceApplyConfiguration struct { Driver *string `json:"driver,omitempty"` FSType *string `json:"fsType,omitempty"` SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` Options map[string]string `json:"options,omitempty"` } // FlexPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the FlexPersistentVolumeSource type for use with // apply. func FlexPersistentVolumeSource() *FlexPersistentVolumeSourceApplyConfiguration { return &FlexPersistentVolumeSourceApplyConfiguration{} } // WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Driver field is set to the value of the last call. func (b *FlexPersistentVolumeSourceApplyConfiguration) WithDriver(value string) *FlexPersistentVolumeSourceApplyConfiguration { b.Driver = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *FlexPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *FlexPersistentVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *FlexPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *FlexPersistentVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *FlexPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *FlexPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithOptions puts the entries into the Options field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Options field, // overwriting an existing map entries in Options field with the same key. func (b *FlexPersistentVolumeSourceApplyConfiguration) WithOptions(entries map[string]string) *FlexPersistentVolumeSourceApplyConfiguration { if b.Options == nil && len(entries) > 0 { b.Options = make(map[string]string, len(entries)) } for k, v := range entries { b.Options[k] = v } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/flexvolumesource.go000066400000000000000000000073161472614177300277230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // FlexVolumeSourceApplyConfiguration represents a declarative configuration of the FlexVolumeSource type for use // with apply. type FlexVolumeSourceApplyConfiguration struct { Driver *string `json:"driver,omitempty"` FSType *string `json:"fsType,omitempty"` SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` Options map[string]string `json:"options,omitempty"` } // FlexVolumeSourceApplyConfiguration constructs a declarative configuration of the FlexVolumeSource type for use with // apply. func FlexVolumeSource() *FlexVolumeSourceApplyConfiguration { return &FlexVolumeSourceApplyConfiguration{} } // WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Driver field is set to the value of the last call. func (b *FlexVolumeSourceApplyConfiguration) WithDriver(value string) *FlexVolumeSourceApplyConfiguration { b.Driver = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *FlexVolumeSourceApplyConfiguration) WithFSType(value string) *FlexVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *FlexVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *FlexVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *FlexVolumeSourceApplyConfiguration) WithReadOnly(value bool) *FlexVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithOptions puts the entries into the Options field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Options field, // overwriting an existing map entries in Options field with the same key. func (b *FlexVolumeSourceApplyConfiguration) WithOptions(entries map[string]string) *FlexVolumeSourceApplyConfiguration { if b.Options == nil && len(entries) > 0 { b.Options = make(map[string]string, len(entries)) } for k, v := range entries { b.Options[k] = v } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/flockervolumesource.go000066400000000000000000000040251472614177300304040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // FlockerVolumeSourceApplyConfiguration represents a declarative configuration of the FlockerVolumeSource type for use // with apply. type FlockerVolumeSourceApplyConfiguration struct { DatasetName *string `json:"datasetName,omitempty"` DatasetUUID *string `json:"datasetUUID,omitempty"` } // FlockerVolumeSourceApplyConfiguration constructs a declarative configuration of the FlockerVolumeSource type for use with // apply. func FlockerVolumeSource() *FlockerVolumeSourceApplyConfiguration { return &FlockerVolumeSourceApplyConfiguration{} } // WithDatasetName sets the DatasetName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DatasetName field is set to the value of the last call. func (b *FlockerVolumeSourceApplyConfiguration) WithDatasetName(value string) *FlockerVolumeSourceApplyConfiguration { b.DatasetName = &value return b } // WithDatasetUUID sets the DatasetUUID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DatasetUUID field is set to the value of the last call. func (b *FlockerVolumeSourceApplyConfiguration) WithDatasetUUID(value string) *FlockerVolumeSourceApplyConfiguration { b.DatasetUUID = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/gcepersistentdiskvolumesource.go000066400000000000000000000060541472614177300325150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // GCEPersistentDiskVolumeSourceApplyConfiguration represents a declarative configuration of the GCEPersistentDiskVolumeSource type for use // with apply. type GCEPersistentDiskVolumeSourceApplyConfiguration struct { PDName *string `json:"pdName,omitempty"` FSType *string `json:"fsType,omitempty"` Partition *int32 `json:"partition,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // GCEPersistentDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the GCEPersistentDiskVolumeSource type for use with // apply. func GCEPersistentDiskVolumeSource() *GCEPersistentDiskVolumeSourceApplyConfiguration { return &GCEPersistentDiskVolumeSourceApplyConfiguration{} } // WithPDName sets the PDName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PDName field is set to the value of the last call. func (b *GCEPersistentDiskVolumeSourceApplyConfiguration) WithPDName(value string) *GCEPersistentDiskVolumeSourceApplyConfiguration { b.PDName = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *GCEPersistentDiskVolumeSourceApplyConfiguration) WithFSType(value string) *GCEPersistentDiskVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithPartition sets the Partition field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Partition field is set to the value of the last call. func (b *GCEPersistentDiskVolumeSourceApplyConfiguration) WithPartition(value int32) *GCEPersistentDiskVolumeSourceApplyConfiguration { b.Partition = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *GCEPersistentDiskVolumeSourceApplyConfiguration) WithReadOnly(value bool) *GCEPersistentDiskVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/gitrepovolumesource.go000066400000000000000000000047341472614177300304370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // GitRepoVolumeSourceApplyConfiguration represents a declarative configuration of the GitRepoVolumeSource type for use // with apply. type GitRepoVolumeSourceApplyConfiguration struct { Repository *string `json:"repository,omitempty"` Revision *string `json:"revision,omitempty"` Directory *string `json:"directory,omitempty"` } // GitRepoVolumeSourceApplyConfiguration constructs a declarative configuration of the GitRepoVolumeSource type for use with // apply. func GitRepoVolumeSource() *GitRepoVolumeSourceApplyConfiguration { return &GitRepoVolumeSourceApplyConfiguration{} } // WithRepository sets the Repository field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Repository field is set to the value of the last call. func (b *GitRepoVolumeSourceApplyConfiguration) WithRepository(value string) *GitRepoVolumeSourceApplyConfiguration { b.Repository = &value return b } // WithRevision sets the Revision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Revision field is set to the value of the last call. func (b *GitRepoVolumeSourceApplyConfiguration) WithRevision(value string) *GitRepoVolumeSourceApplyConfiguration { b.Revision = &value return b } // WithDirectory sets the Directory field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Directory field is set to the value of the last call. func (b *GitRepoVolumeSourceApplyConfiguration) WithDirectory(value string) *GitRepoVolumeSourceApplyConfiguration { b.Directory = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/glusterfspersistentvolumesource.go000066400000000000000000000063011472614177300331150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // GlusterfsPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the GlusterfsPersistentVolumeSource type for use // with apply. type GlusterfsPersistentVolumeSourceApplyConfiguration struct { EndpointsName *string `json:"endpoints,omitempty"` Path *string `json:"path,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` EndpointsNamespace *string `json:"endpointsNamespace,omitempty"` } // GlusterfsPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the GlusterfsPersistentVolumeSource type for use with // apply. func GlusterfsPersistentVolumeSource() *GlusterfsPersistentVolumeSourceApplyConfiguration { return &GlusterfsPersistentVolumeSourceApplyConfiguration{} } // WithEndpointsName sets the EndpointsName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EndpointsName field is set to the value of the last call. func (b *GlusterfsPersistentVolumeSourceApplyConfiguration) WithEndpointsName(value string) *GlusterfsPersistentVolumeSourceApplyConfiguration { b.EndpointsName = &value return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *GlusterfsPersistentVolumeSourceApplyConfiguration) WithPath(value string) *GlusterfsPersistentVolumeSourceApplyConfiguration { b.Path = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *GlusterfsPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *GlusterfsPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithEndpointsNamespace sets the EndpointsNamespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EndpointsNamespace field is set to the value of the last call. func (b *GlusterfsPersistentVolumeSourceApplyConfiguration) WithEndpointsNamespace(value string) *GlusterfsPersistentVolumeSourceApplyConfiguration { b.EndpointsNamespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/glusterfsvolumesource.go000066400000000000000000000047571472614177300310110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // GlusterfsVolumeSourceApplyConfiguration represents a declarative configuration of the GlusterfsVolumeSource type for use // with apply. type GlusterfsVolumeSourceApplyConfiguration struct { EndpointsName *string `json:"endpoints,omitempty"` Path *string `json:"path,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // GlusterfsVolumeSourceApplyConfiguration constructs a declarative configuration of the GlusterfsVolumeSource type for use with // apply. func GlusterfsVolumeSource() *GlusterfsVolumeSourceApplyConfiguration { return &GlusterfsVolumeSourceApplyConfiguration{} } // WithEndpointsName sets the EndpointsName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EndpointsName field is set to the value of the last call. func (b *GlusterfsVolumeSourceApplyConfiguration) WithEndpointsName(value string) *GlusterfsVolumeSourceApplyConfiguration { b.EndpointsName = &value return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *GlusterfsVolumeSourceApplyConfiguration) WithPath(value string) *GlusterfsVolumeSourceApplyConfiguration { b.Path = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *GlusterfsVolumeSourceApplyConfiguration) WithReadOnly(value bool) *GlusterfsVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/grpcaction.go000066400000000000000000000035361472614177300264450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // GRPCActionApplyConfiguration represents a declarative configuration of the GRPCAction type for use // with apply. type GRPCActionApplyConfiguration struct { Port *int32 `json:"port,omitempty"` Service *string `json:"service,omitempty"` } // GRPCActionApplyConfiguration constructs a declarative configuration of the GRPCAction type for use with // apply. func GRPCAction() *GRPCActionApplyConfiguration { return &GRPCActionApplyConfiguration{} } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *GRPCActionApplyConfiguration) WithPort(value int32) *GRPCActionApplyConfiguration { b.Port = &value return b } // WithService sets the Service field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Service field is set to the value of the last call. func (b *GRPCActionApplyConfiguration) WithService(value string) *GRPCActionApplyConfiguration { b.Service = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/hostalias.go000066400000000000000000000036361472614177300263040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // HostAliasApplyConfiguration represents a declarative configuration of the HostAlias type for use // with apply. type HostAliasApplyConfiguration struct { IP *string `json:"ip,omitempty"` Hostnames []string `json:"hostnames,omitempty"` } // HostAliasApplyConfiguration constructs a declarative configuration of the HostAlias type for use with // apply. func HostAlias() *HostAliasApplyConfiguration { return &HostAliasApplyConfiguration{} } // WithIP sets the IP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IP field is set to the value of the last call. func (b *HostAliasApplyConfiguration) WithIP(value string) *HostAliasApplyConfiguration { b.IP = &value return b } // WithHostnames adds the given value to the Hostnames field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Hostnames field. func (b *HostAliasApplyConfiguration) WithHostnames(values ...string) *HostAliasApplyConfiguration { for i := range values { b.Hostnames = append(b.Hostnames, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/hostip.go000066400000000000000000000025461472614177300256220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // HostIPApplyConfiguration represents a declarative configuration of the HostIP type for use // with apply. type HostIPApplyConfiguration struct { IP *string `json:"ip,omitempty"` } // HostIPApplyConfiguration constructs a declarative configuration of the HostIP type for use with // apply. func HostIP() *HostIPApplyConfiguration { return &HostIPApplyConfiguration{} } // WithIP sets the IP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IP field is set to the value of the last call. func (b *HostIPApplyConfiguration) WithIP(value string) *HostIPApplyConfiguration { b.IP = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/hostpathvolumesource.go000066400000000000000000000037771472614177300306260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // HostPathVolumeSourceApplyConfiguration represents a declarative configuration of the HostPathVolumeSource type for use // with apply. type HostPathVolumeSourceApplyConfiguration struct { Path *string `json:"path,omitempty"` Type *v1.HostPathType `json:"type,omitempty"` } // HostPathVolumeSourceApplyConfiguration constructs a declarative configuration of the HostPathVolumeSource type for use with // apply. func HostPathVolumeSource() *HostPathVolumeSourceApplyConfiguration { return &HostPathVolumeSourceApplyConfiguration{} } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *HostPathVolumeSourceApplyConfiguration) WithPath(value string) *HostPathVolumeSourceApplyConfiguration { b.Path = &value return b } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *HostPathVolumeSourceApplyConfiguration) WithType(value v1.HostPathType) *HostPathVolumeSourceApplyConfiguration { b.Type = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/httpgetaction.go000066400000000000000000000071321472614177300271650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" intstr "k8s.io/apimachinery/pkg/util/intstr" ) // HTTPGetActionApplyConfiguration represents a declarative configuration of the HTTPGetAction type for use // with apply. type HTTPGetActionApplyConfiguration struct { Path *string `json:"path,omitempty"` Port *intstr.IntOrString `json:"port,omitempty"` Host *string `json:"host,omitempty"` Scheme *v1.URIScheme `json:"scheme,omitempty"` HTTPHeaders []HTTPHeaderApplyConfiguration `json:"httpHeaders,omitempty"` } // HTTPGetActionApplyConfiguration constructs a declarative configuration of the HTTPGetAction type for use with // apply. func HTTPGetAction() *HTTPGetActionApplyConfiguration { return &HTTPGetActionApplyConfiguration{} } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *HTTPGetActionApplyConfiguration) WithPath(value string) *HTTPGetActionApplyConfiguration { b.Path = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *HTTPGetActionApplyConfiguration) WithPort(value intstr.IntOrString) *HTTPGetActionApplyConfiguration { b.Port = &value return b } // WithHost sets the Host field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Host field is set to the value of the last call. func (b *HTTPGetActionApplyConfiguration) WithHost(value string) *HTTPGetActionApplyConfiguration { b.Host = &value return b } // WithScheme sets the Scheme field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scheme field is set to the value of the last call. func (b *HTTPGetActionApplyConfiguration) WithScheme(value v1.URIScheme) *HTTPGetActionApplyConfiguration { b.Scheme = &value return b } // WithHTTPHeaders adds the given value to the HTTPHeaders field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the HTTPHeaders field. func (b *HTTPGetActionApplyConfiguration) WithHTTPHeaders(values ...*HTTPHeaderApplyConfiguration) *HTTPGetActionApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithHTTPHeaders") } b.HTTPHeaders = append(b.HTTPHeaders, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/httpheader.go000066400000000000000000000035171472614177300264430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // HTTPHeaderApplyConfiguration represents a declarative configuration of the HTTPHeader type for use // with apply. type HTTPHeaderApplyConfiguration struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } // HTTPHeaderApplyConfiguration constructs a declarative configuration of the HTTPHeader type for use with // apply. func HTTPHeader() *HTTPHeaderApplyConfiguration { return &HTTPHeaderApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *HTTPHeaderApplyConfiguration) WithName(value string) *HTTPHeaderApplyConfiguration { b.Name = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *HTTPHeaderApplyConfiguration) WithValue(value string) *HTTPHeaderApplyConfiguration { b.Value = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/imagevolumesource.go000066400000000000000000000040431472614177300300410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ImageVolumeSourceApplyConfiguration represents a declarative configuration of the ImageVolumeSource type for use // with apply. type ImageVolumeSourceApplyConfiguration struct { Reference *string `json:"reference,omitempty"` PullPolicy *v1.PullPolicy `json:"pullPolicy,omitempty"` } // ImageVolumeSourceApplyConfiguration constructs a declarative configuration of the ImageVolumeSource type for use with // apply. func ImageVolumeSource() *ImageVolumeSourceApplyConfiguration { return &ImageVolumeSourceApplyConfiguration{} } // WithReference sets the Reference field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reference field is set to the value of the last call. func (b *ImageVolumeSourceApplyConfiguration) WithReference(value string) *ImageVolumeSourceApplyConfiguration { b.Reference = &value return b } // WithPullPolicy sets the PullPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PullPolicy field is set to the value of the last call. func (b *ImageVolumeSourceApplyConfiguration) WithPullPolicy(value v1.PullPolicy) *ImageVolumeSourceApplyConfiguration { b.PullPolicy = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/iscsipersistentvolumesource.go000066400000000000000000000157211472614177300322170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ISCSIPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the ISCSIPersistentVolumeSource type for use // with apply. type ISCSIPersistentVolumeSourceApplyConfiguration struct { TargetPortal *string `json:"targetPortal,omitempty"` IQN *string `json:"iqn,omitempty"` Lun *int32 `json:"lun,omitempty"` ISCSIInterface *string `json:"iscsiInterface,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` Portals []string `json:"portals,omitempty"` DiscoveryCHAPAuth *bool `json:"chapAuthDiscovery,omitempty"` SessionCHAPAuth *bool `json:"chapAuthSession,omitempty"` SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` InitiatorName *string `json:"initiatorName,omitempty"` } // ISCSIPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the ISCSIPersistentVolumeSource type for use with // apply. func ISCSIPersistentVolumeSource() *ISCSIPersistentVolumeSourceApplyConfiguration { return &ISCSIPersistentVolumeSourceApplyConfiguration{} } // WithTargetPortal sets the TargetPortal field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetPortal field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithTargetPortal(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { b.TargetPortal = &value return b } // WithIQN sets the IQN field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IQN field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithIQN(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { b.IQN = &value return b } // WithLun sets the Lun field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Lun field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithLun(value int32) *ISCSIPersistentVolumeSourceApplyConfiguration { b.Lun = &value return b } // WithISCSIInterface sets the ISCSIInterface field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ISCSIInterface field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithISCSIInterface(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { b.ISCSIInterface = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *ISCSIPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithPortals adds the given value to the Portals field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Portals field. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithPortals(values ...string) *ISCSIPersistentVolumeSourceApplyConfiguration { for i := range values { b.Portals = append(b.Portals, values[i]) } return b } // WithDiscoveryCHAPAuth sets the DiscoveryCHAPAuth field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DiscoveryCHAPAuth field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithDiscoveryCHAPAuth(value bool) *ISCSIPersistentVolumeSourceApplyConfiguration { b.DiscoveryCHAPAuth = &value return b } // WithSessionCHAPAuth sets the SessionCHAPAuth field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SessionCHAPAuth field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithSessionCHAPAuth(value bool) *ISCSIPersistentVolumeSourceApplyConfiguration { b.SessionCHAPAuth = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *ISCSIPersistentVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithInitiatorName sets the InitiatorName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InitiatorName field is set to the value of the last call. func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithInitiatorName(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { b.InitiatorName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/iscsivolumesource.go000066400000000000000000000153411472614177300300740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ISCSIVolumeSourceApplyConfiguration represents a declarative configuration of the ISCSIVolumeSource type for use // with apply. type ISCSIVolumeSourceApplyConfiguration struct { TargetPortal *string `json:"targetPortal,omitempty"` IQN *string `json:"iqn,omitempty"` Lun *int32 `json:"lun,omitempty"` ISCSIInterface *string `json:"iscsiInterface,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` Portals []string `json:"portals,omitempty"` DiscoveryCHAPAuth *bool `json:"chapAuthDiscovery,omitempty"` SessionCHAPAuth *bool `json:"chapAuthSession,omitempty"` SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` InitiatorName *string `json:"initiatorName,omitempty"` } // ISCSIVolumeSourceApplyConfiguration constructs a declarative configuration of the ISCSIVolumeSource type for use with // apply. func ISCSIVolumeSource() *ISCSIVolumeSourceApplyConfiguration { return &ISCSIVolumeSourceApplyConfiguration{} } // WithTargetPortal sets the TargetPortal field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetPortal field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithTargetPortal(value string) *ISCSIVolumeSourceApplyConfiguration { b.TargetPortal = &value return b } // WithIQN sets the IQN field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IQN field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithIQN(value string) *ISCSIVolumeSourceApplyConfiguration { b.IQN = &value return b } // WithLun sets the Lun field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Lun field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithLun(value int32) *ISCSIVolumeSourceApplyConfiguration { b.Lun = &value return b } // WithISCSIInterface sets the ISCSIInterface field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ISCSIInterface field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithISCSIInterface(value string) *ISCSIVolumeSourceApplyConfiguration { b.ISCSIInterface = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithFSType(value string) *ISCSIVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithReadOnly(value bool) *ISCSIVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithPortals adds the given value to the Portals field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Portals field. func (b *ISCSIVolumeSourceApplyConfiguration) WithPortals(values ...string) *ISCSIVolumeSourceApplyConfiguration { for i := range values { b.Portals = append(b.Portals, values[i]) } return b } // WithDiscoveryCHAPAuth sets the DiscoveryCHAPAuth field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DiscoveryCHAPAuth field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithDiscoveryCHAPAuth(value bool) *ISCSIVolumeSourceApplyConfiguration { b.DiscoveryCHAPAuth = &value return b } // WithSessionCHAPAuth sets the SessionCHAPAuth field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SessionCHAPAuth field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithSessionCHAPAuth(value bool) *ISCSIVolumeSourceApplyConfiguration { b.SessionCHAPAuth = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *ISCSIVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithInitiatorName sets the InitiatorName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InitiatorName field is set to the value of the last call. func (b *ISCSIVolumeSourceApplyConfiguration) WithInitiatorName(value string) *ISCSIVolumeSourceApplyConfiguration { b.InitiatorName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/keytopath.go000066400000000000000000000043351472614177300263220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // KeyToPathApplyConfiguration represents a declarative configuration of the KeyToPath type for use // with apply. type KeyToPathApplyConfiguration struct { Key *string `json:"key,omitempty"` Path *string `json:"path,omitempty"` Mode *int32 `json:"mode,omitempty"` } // KeyToPathApplyConfiguration constructs a declarative configuration of the KeyToPath type for use with // apply. func KeyToPath() *KeyToPathApplyConfiguration { return &KeyToPathApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *KeyToPathApplyConfiguration) WithKey(value string) *KeyToPathApplyConfiguration { b.Key = &value return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *KeyToPathApplyConfiguration) WithPath(value string) *KeyToPathApplyConfiguration { b.Path = &value return b } // WithMode sets the Mode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Mode field is set to the value of the last call. func (b *KeyToPathApplyConfiguration) WithMode(value int32) *KeyToPathApplyConfiguration { b.Mode = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/lifecycle.go000066400000000000000000000037451472614177300262550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LifecycleApplyConfiguration represents a declarative configuration of the Lifecycle type for use // with apply. type LifecycleApplyConfiguration struct { PostStart *LifecycleHandlerApplyConfiguration `json:"postStart,omitempty"` PreStop *LifecycleHandlerApplyConfiguration `json:"preStop,omitempty"` } // LifecycleApplyConfiguration constructs a declarative configuration of the Lifecycle type for use with // apply. func Lifecycle() *LifecycleApplyConfiguration { return &LifecycleApplyConfiguration{} } // WithPostStart sets the PostStart field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PostStart field is set to the value of the last call. func (b *LifecycleApplyConfiguration) WithPostStart(value *LifecycleHandlerApplyConfiguration) *LifecycleApplyConfiguration { b.PostStart = value return b } // WithPreStop sets the PreStop field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PreStop field is set to the value of the last call. func (b *LifecycleApplyConfiguration) WithPreStop(value *LifecycleHandlerApplyConfiguration) *LifecycleApplyConfiguration { b.PreStop = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/lifecyclehandler.go000066400000000000000000000060241472614177300276040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LifecycleHandlerApplyConfiguration represents a declarative configuration of the LifecycleHandler type for use // with apply. type LifecycleHandlerApplyConfiguration struct { Exec *ExecActionApplyConfiguration `json:"exec,omitempty"` HTTPGet *HTTPGetActionApplyConfiguration `json:"httpGet,omitempty"` TCPSocket *TCPSocketActionApplyConfiguration `json:"tcpSocket,omitempty"` Sleep *SleepActionApplyConfiguration `json:"sleep,omitempty"` } // LifecycleHandlerApplyConfiguration constructs a declarative configuration of the LifecycleHandler type for use with // apply. func LifecycleHandler() *LifecycleHandlerApplyConfiguration { return &LifecycleHandlerApplyConfiguration{} } // WithExec sets the Exec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Exec field is set to the value of the last call. func (b *LifecycleHandlerApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { b.Exec = value return b } // WithHTTPGet sets the HTTPGet field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTPGet field is set to the value of the last call. func (b *LifecycleHandlerApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { b.HTTPGet = value return b } // WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TCPSocket field is set to the value of the last call. func (b *LifecycleHandlerApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { b.TCPSocket = value return b } // WithSleep sets the Sleep field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Sleep field is set to the value of the last call. func (b *LifecycleHandlerApplyConfiguration) WithSleep(value *SleepActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { b.Sleep = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/limitrange.go000066400000000000000000000274631472614177300264540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // LimitRangeApplyConfiguration represents a declarative configuration of the LimitRange type for use // with apply. type LimitRangeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *LimitRangeSpecApplyConfiguration `json:"spec,omitempty"` } // LimitRange constructs a declarative configuration of the LimitRange type for use with // apply. func LimitRange(name, namespace string) *LimitRangeApplyConfiguration { b := &LimitRangeApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("LimitRange") b.WithAPIVersion("v1") return b } // ExtractLimitRange extracts the applied configuration owned by fieldManager from // limitRange. If no managedFields are found in limitRange for fieldManager, a // LimitRangeApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // limitRange must be a unmodified LimitRange API object that was retrieved from the Kubernetes API. // ExtractLimitRange provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractLimitRange(limitRange *apicorev1.LimitRange, fieldManager string) (*LimitRangeApplyConfiguration, error) { return extractLimitRange(limitRange, fieldManager, "") } // ExtractLimitRangeStatus is the same as ExtractLimitRange except // that it extracts the status subresource applied configuration. // Experimental! func ExtractLimitRangeStatus(limitRange *apicorev1.LimitRange, fieldManager string) (*LimitRangeApplyConfiguration, error) { return extractLimitRange(limitRange, fieldManager, "status") } func extractLimitRange(limitRange *apicorev1.LimitRange, fieldManager string, subresource string) (*LimitRangeApplyConfiguration, error) { b := &LimitRangeApplyConfiguration{} err := managedfields.ExtractInto(limitRange, internal.Parser().Type("io.k8s.api.core.v1.LimitRange"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(limitRange.Name) b.WithNamespace(limitRange.Namespace) b.WithKind("LimitRange") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithKind(value string) *LimitRangeApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithAPIVersion(value string) *LimitRangeApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithName(value string) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithGenerateName(value string) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithNamespace(value string) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithUID(value types.UID) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithResourceVersion(value string) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithGeneration(value int64) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *LimitRangeApplyConfiguration) WithLabels(entries map[string]string) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *LimitRangeApplyConfiguration) WithAnnotations(entries map[string]string) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *LimitRangeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *LimitRangeApplyConfiguration) WithFinalizers(values ...string) *LimitRangeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *LimitRangeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *LimitRangeApplyConfiguration) WithSpec(value *LimitRangeSpecApplyConfiguration) *LimitRangeApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *LimitRangeApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/limitrangeitem.go000066400000000000000000000077231472614177300273300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // LimitRangeItemApplyConfiguration represents a declarative configuration of the LimitRangeItem type for use // with apply. type LimitRangeItemApplyConfiguration struct { Type *v1.LimitType `json:"type,omitempty"` Max *v1.ResourceList `json:"max,omitempty"` Min *v1.ResourceList `json:"min,omitempty"` Default *v1.ResourceList `json:"default,omitempty"` DefaultRequest *v1.ResourceList `json:"defaultRequest,omitempty"` MaxLimitRequestRatio *v1.ResourceList `json:"maxLimitRequestRatio,omitempty"` } // LimitRangeItemApplyConfiguration constructs a declarative configuration of the LimitRangeItem type for use with // apply. func LimitRangeItem() *LimitRangeItemApplyConfiguration { return &LimitRangeItemApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *LimitRangeItemApplyConfiguration) WithType(value v1.LimitType) *LimitRangeItemApplyConfiguration { b.Type = &value return b } // WithMax sets the Max field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Max field is set to the value of the last call. func (b *LimitRangeItemApplyConfiguration) WithMax(value v1.ResourceList) *LimitRangeItemApplyConfiguration { b.Max = &value return b } // WithMin sets the Min field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Min field is set to the value of the last call. func (b *LimitRangeItemApplyConfiguration) WithMin(value v1.ResourceList) *LimitRangeItemApplyConfiguration { b.Min = &value return b } // WithDefault sets the Default field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Default field is set to the value of the last call. func (b *LimitRangeItemApplyConfiguration) WithDefault(value v1.ResourceList) *LimitRangeItemApplyConfiguration { b.Default = &value return b } // WithDefaultRequest sets the DefaultRequest field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DefaultRequest field is set to the value of the last call. func (b *LimitRangeItemApplyConfiguration) WithDefaultRequest(value v1.ResourceList) *LimitRangeItemApplyConfiguration { b.DefaultRequest = &value return b } // WithMaxLimitRequestRatio sets the MaxLimitRequestRatio field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxLimitRequestRatio field is set to the value of the last call. func (b *LimitRangeItemApplyConfiguration) WithMaxLimitRequestRatio(value v1.ResourceList) *LimitRangeItemApplyConfiguration { b.MaxLimitRequestRatio = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/limitrangespec.go000066400000000000000000000032221472614177300273120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LimitRangeSpecApplyConfiguration represents a declarative configuration of the LimitRangeSpec type for use // with apply. type LimitRangeSpecApplyConfiguration struct { Limits []LimitRangeItemApplyConfiguration `json:"limits,omitempty"` } // LimitRangeSpecApplyConfiguration constructs a declarative configuration of the LimitRangeSpec type for use with // apply. func LimitRangeSpec() *LimitRangeSpecApplyConfiguration { return &LimitRangeSpecApplyConfiguration{} } // WithLimits adds the given value to the Limits field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Limits field. func (b *LimitRangeSpecApplyConfiguration) WithLimits(values ...*LimitRangeItemApplyConfiguration) *LimitRangeSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithLimits") } b.Limits = append(b.Limits, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/linuxcontaineruser.go000066400000000000000000000050371472614177300302530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LinuxContainerUserApplyConfiguration represents a declarative configuration of the LinuxContainerUser type for use // with apply. type LinuxContainerUserApplyConfiguration struct { UID *int64 `json:"uid,omitempty"` GID *int64 `json:"gid,omitempty"` SupplementalGroups []int64 `json:"supplementalGroups,omitempty"` } // LinuxContainerUserApplyConfiguration constructs a declarative configuration of the LinuxContainerUser type for use with // apply. func LinuxContainerUser() *LinuxContainerUserApplyConfiguration { return &LinuxContainerUserApplyConfiguration{} } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *LinuxContainerUserApplyConfiguration) WithUID(value int64) *LinuxContainerUserApplyConfiguration { b.UID = &value return b } // WithGID sets the GID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GID field is set to the value of the last call. func (b *LinuxContainerUserApplyConfiguration) WithGID(value int64) *LinuxContainerUserApplyConfiguration { b.GID = &value return b } // WithSupplementalGroups adds the given value to the SupplementalGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the SupplementalGroups field. func (b *LinuxContainerUserApplyConfiguration) WithSupplementalGroups(values ...int64) *LinuxContainerUserApplyConfiguration { for i := range values { b.SupplementalGroups = append(b.SupplementalGroups, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/loadbalanceringress.go000066400000000000000000000062121472614177300303100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // LoadBalancerIngressApplyConfiguration represents a declarative configuration of the LoadBalancerIngress type for use // with apply. type LoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` Hostname *string `json:"hostname,omitempty"` IPMode *v1.LoadBalancerIPMode `json:"ipMode,omitempty"` Ports []PortStatusApplyConfiguration `json:"ports,omitempty"` } // LoadBalancerIngressApplyConfiguration constructs a declarative configuration of the LoadBalancerIngress type for use with // apply. func LoadBalancerIngress() *LoadBalancerIngressApplyConfiguration { return &LoadBalancerIngressApplyConfiguration{} } // WithIP sets the IP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IP field is set to the value of the last call. func (b *LoadBalancerIngressApplyConfiguration) WithIP(value string) *LoadBalancerIngressApplyConfiguration { b.IP = &value return b } // WithHostname sets the Hostname field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hostname field is set to the value of the last call. func (b *LoadBalancerIngressApplyConfiguration) WithHostname(value string) *LoadBalancerIngressApplyConfiguration { b.Hostname = &value return b } // WithIPMode sets the IPMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IPMode field is set to the value of the last call. func (b *LoadBalancerIngressApplyConfiguration) WithIPMode(value v1.LoadBalancerIPMode) *LoadBalancerIngressApplyConfiguration { b.IPMode = &value return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *LoadBalancerIngressApplyConfiguration) WithPorts(values ...*PortStatusApplyConfiguration) *LoadBalancerIngressApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/loadbalancerstatus.go000066400000000000000000000033151472614177300301620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LoadBalancerStatusApplyConfiguration represents a declarative configuration of the LoadBalancerStatus type for use // with apply. type LoadBalancerStatusApplyConfiguration struct { Ingress []LoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` } // LoadBalancerStatusApplyConfiguration constructs a declarative configuration of the LoadBalancerStatus type for use with // apply. func LoadBalancerStatus() *LoadBalancerStatusApplyConfiguration { return &LoadBalancerStatusApplyConfiguration{} } // WithIngress adds the given value to the Ingress field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ingress field. func (b *LoadBalancerStatusApplyConfiguration) WithIngress(values ...*LoadBalancerIngressApplyConfiguration) *LoadBalancerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithIngress") } b.Ingress = append(b.Ingress, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/localobjectreference.go000066400000000000000000000030001472614177300304360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LocalObjectReferenceApplyConfiguration represents a declarative configuration of the LocalObjectReference type for use // with apply. type LocalObjectReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } // LocalObjectReferenceApplyConfiguration constructs a declarative configuration of the LocalObjectReference type for use with // apply. func LocalObjectReference() *LocalObjectReferenceApplyConfiguration { return &LocalObjectReferenceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *LocalObjectReferenceApplyConfiguration) WithName(value string) *LocalObjectReferenceApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/localvolumesource.go000066400000000000000000000036531472614177300300570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LocalVolumeSourceApplyConfiguration represents a declarative configuration of the LocalVolumeSource type for use // with apply. type LocalVolumeSourceApplyConfiguration struct { Path *string `json:"path,omitempty"` FSType *string `json:"fsType,omitempty"` } // LocalVolumeSourceApplyConfiguration constructs a declarative configuration of the LocalVolumeSource type for use with // apply. func LocalVolumeSource() *LocalVolumeSourceApplyConfiguration { return &LocalVolumeSourceApplyConfiguration{} } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *LocalVolumeSourceApplyConfiguration) WithPath(value string) *LocalVolumeSourceApplyConfiguration { b.Path = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *LocalVolumeSourceApplyConfiguration) WithFSType(value string) *LocalVolumeSourceApplyConfiguration { b.FSType = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/modifyvolumestatus.go000066400000000000000000000044341472614177300302750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ModifyVolumeStatusApplyConfiguration represents a declarative configuration of the ModifyVolumeStatus type for use // with apply. type ModifyVolumeStatusApplyConfiguration struct { TargetVolumeAttributesClassName *string `json:"targetVolumeAttributesClassName,omitempty"` Status *v1.PersistentVolumeClaimModifyVolumeStatus `json:"status,omitempty"` } // ModifyVolumeStatusApplyConfiguration constructs a declarative configuration of the ModifyVolumeStatus type for use with // apply. func ModifyVolumeStatus() *ModifyVolumeStatusApplyConfiguration { return &ModifyVolumeStatusApplyConfiguration{} } // WithTargetVolumeAttributesClassName sets the TargetVolumeAttributesClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetVolumeAttributesClassName field is set to the value of the last call. func (b *ModifyVolumeStatusApplyConfiguration) WithTargetVolumeAttributesClassName(value string) *ModifyVolumeStatusApplyConfiguration { b.TargetVolumeAttributesClassName = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ModifyVolumeStatusApplyConfiguration) WithStatus(value v1.PersistentVolumeClaimModifyVolumeStatus) *ModifyVolumeStatusApplyConfiguration { b.Status = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/namespace.go000066400000000000000000000302431472614177300262430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NamespaceApplyConfiguration represents a declarative configuration of the Namespace type for use // with apply. type NamespaceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *NamespaceSpecApplyConfiguration `json:"spec,omitempty"` Status *NamespaceStatusApplyConfiguration `json:"status,omitempty"` } // Namespace constructs a declarative configuration of the Namespace type for use with // apply. func Namespace(name string) *NamespaceApplyConfiguration { b := &NamespaceApplyConfiguration{} b.WithName(name) b.WithKind("Namespace") b.WithAPIVersion("v1") return b } // ExtractNamespace extracts the applied configuration owned by fieldManager from // namespace. If no managedFields are found in namespace for fieldManager, a // NamespaceApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // namespace must be a unmodified Namespace API object that was retrieved from the Kubernetes API. // ExtractNamespace provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractNamespace(namespace *apicorev1.Namespace, fieldManager string) (*NamespaceApplyConfiguration, error) { return extractNamespace(namespace, fieldManager, "") } // ExtractNamespaceStatus is the same as ExtractNamespace except // that it extracts the status subresource applied configuration. // Experimental! func ExtractNamespaceStatus(namespace *apicorev1.Namespace, fieldManager string) (*NamespaceApplyConfiguration, error) { return extractNamespace(namespace, fieldManager, "status") } func extractNamespace(namespace *apicorev1.Namespace, fieldManager string, subresource string) (*NamespaceApplyConfiguration, error) { b := &NamespaceApplyConfiguration{} err := managedfields.ExtractInto(namespace, internal.Parser().Type("io.k8s.api.core.v1.Namespace"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(namespace.Name) b.WithKind("Namespace") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithKind(value string) *NamespaceApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithAPIVersion(value string) *NamespaceApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithName(value string) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithGenerateName(value string) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithNamespace(value string) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithUID(value types.UID) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithResourceVersion(value string) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithGeneration(value int64) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *NamespaceApplyConfiguration) WithLabels(entries map[string]string) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *NamespaceApplyConfiguration) WithAnnotations(entries map[string]string) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *NamespaceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *NamespaceApplyConfiguration) WithFinalizers(values ...string) *NamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *NamespaceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithSpec(value *NamespaceSpecApplyConfiguration) *NamespaceApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *NamespaceApplyConfiguration) WithStatus(value *NamespaceStatusApplyConfiguration) *NamespaceApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *NamespaceApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/namespacecondition.go000066400000000000000000000071631472614177300301570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // NamespaceConditionApplyConfiguration represents a declarative configuration of the NamespaceCondition type for use // with apply. type NamespaceConditionApplyConfiguration struct { Type *v1.NamespaceConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // NamespaceConditionApplyConfiguration constructs a declarative configuration of the NamespaceCondition type for use with // apply. func NamespaceCondition() *NamespaceConditionApplyConfiguration { return &NamespaceConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *NamespaceConditionApplyConfiguration) WithType(value v1.NamespaceConditionType) *NamespaceConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *NamespaceConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *NamespaceConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *NamespaceConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *NamespaceConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *NamespaceConditionApplyConfiguration) WithReason(value string) *NamespaceConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *NamespaceConditionApplyConfiguration) WithMessage(value string) *NamespaceConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/namespacespec.go000066400000000000000000000031441472614177300271160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // NamespaceSpecApplyConfiguration represents a declarative configuration of the NamespaceSpec type for use // with apply. type NamespaceSpecApplyConfiguration struct { Finalizers []v1.FinalizerName `json:"finalizers,omitempty"` } // NamespaceSpecApplyConfiguration constructs a declarative configuration of the NamespaceSpec type for use with // apply. func NamespaceSpec() *NamespaceSpecApplyConfiguration { return &NamespaceSpecApplyConfiguration{} } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *NamespaceSpecApplyConfiguration) WithFinalizers(values ...v1.FinalizerName) *NamespaceSpecApplyConfiguration { for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/namespacestatus.go000066400000000000000000000043301472614177300275050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // NamespaceStatusApplyConfiguration represents a declarative configuration of the NamespaceStatus type for use // with apply. type NamespaceStatusApplyConfiguration struct { Phase *v1.NamespacePhase `json:"phase,omitempty"` Conditions []NamespaceConditionApplyConfiguration `json:"conditions,omitempty"` } // NamespaceStatusApplyConfiguration constructs a declarative configuration of the NamespaceStatus type for use with // apply. func NamespaceStatus() *NamespaceStatusApplyConfiguration { return &NamespaceStatusApplyConfiguration{} } // WithPhase sets the Phase field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Phase field is set to the value of the last call. func (b *NamespaceStatusApplyConfiguration) WithPhase(value v1.NamespacePhase) *NamespaceStatusApplyConfiguration { b.Phase = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *NamespaceStatusApplyConfiguration) WithConditions(values ...*NamespaceConditionApplyConfiguration) *NamespaceStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nfsvolumesource.go000066400000000000000000000045461472614177300275550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NFSVolumeSourceApplyConfiguration represents a declarative configuration of the NFSVolumeSource type for use // with apply. type NFSVolumeSourceApplyConfiguration struct { Server *string `json:"server,omitempty"` Path *string `json:"path,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // NFSVolumeSourceApplyConfiguration constructs a declarative configuration of the NFSVolumeSource type for use with // apply. func NFSVolumeSource() *NFSVolumeSourceApplyConfiguration { return &NFSVolumeSourceApplyConfiguration{} } // WithServer sets the Server field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Server field is set to the value of the last call. func (b *NFSVolumeSourceApplyConfiguration) WithServer(value string) *NFSVolumeSourceApplyConfiguration { b.Server = &value return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *NFSVolumeSourceApplyConfiguration) WithPath(value string) *NFSVolumeSourceApplyConfiguration { b.Path = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *NFSVolumeSourceApplyConfiguration) WithReadOnly(value bool) *NFSVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/node.go000066400000000000000000000274301472614177300252400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NodeApplyConfiguration represents a declarative configuration of the Node type for use // with apply. type NodeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *NodeSpecApplyConfiguration `json:"spec,omitempty"` Status *NodeStatusApplyConfiguration `json:"status,omitempty"` } // Node constructs a declarative configuration of the Node type for use with // apply. func Node(name string) *NodeApplyConfiguration { b := &NodeApplyConfiguration{} b.WithName(name) b.WithKind("Node") b.WithAPIVersion("v1") return b } // ExtractNode extracts the applied configuration owned by fieldManager from // node. If no managedFields are found in node for fieldManager, a // NodeApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // node must be a unmodified Node API object that was retrieved from the Kubernetes API. // ExtractNode provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractNode(node *apicorev1.Node, fieldManager string) (*NodeApplyConfiguration, error) { return extractNode(node, fieldManager, "") } // ExtractNodeStatus is the same as ExtractNode except // that it extracts the status subresource applied configuration. // Experimental! func ExtractNodeStatus(node *apicorev1.Node, fieldManager string) (*NodeApplyConfiguration, error) { return extractNode(node, fieldManager, "status") } func extractNode(node *apicorev1.Node, fieldManager string, subresource string) (*NodeApplyConfiguration, error) { b := &NodeApplyConfiguration{} err := managedfields.ExtractInto(node, internal.Parser().Type("io.k8s.api.core.v1.Node"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(node.Name) b.WithKind("Node") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *NodeApplyConfiguration) WithKind(value string) *NodeApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *NodeApplyConfiguration) WithAPIVersion(value string) *NodeApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *NodeApplyConfiguration) WithName(value string) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *NodeApplyConfiguration) WithGenerateName(value string) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *NodeApplyConfiguration) WithNamespace(value string) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *NodeApplyConfiguration) WithUID(value types.UID) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *NodeApplyConfiguration) WithResourceVersion(value string) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *NodeApplyConfiguration) WithGeneration(value int64) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *NodeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *NodeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *NodeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *NodeApplyConfiguration) WithLabels(entries map[string]string) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *NodeApplyConfiguration) WithAnnotations(entries map[string]string) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *NodeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *NodeApplyConfiguration) WithFinalizers(values ...string) *NodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *NodeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *NodeApplyConfiguration) WithSpec(value *NodeSpecApplyConfiguration) *NodeApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *NodeApplyConfiguration) WithStatus(value *NodeStatusApplyConfiguration) *NodeApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *NodeApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodeaddress.go000066400000000000000000000036641472614177300266110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // NodeAddressApplyConfiguration represents a declarative configuration of the NodeAddress type for use // with apply. type NodeAddressApplyConfiguration struct { Type *v1.NodeAddressType `json:"type,omitempty"` Address *string `json:"address,omitempty"` } // NodeAddressApplyConfiguration constructs a declarative configuration of the NodeAddress type for use with // apply. func NodeAddress() *NodeAddressApplyConfiguration { return &NodeAddressApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *NodeAddressApplyConfiguration) WithType(value v1.NodeAddressType) *NodeAddressApplyConfiguration { b.Type = &value return b } // WithAddress sets the Address field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Address field is set to the value of the last call. func (b *NodeAddressApplyConfiguration) WithAddress(value string) *NodeAddressApplyConfiguration { b.Address = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodeaffinity.go000066400000000000000000000054231472614177300267700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeAffinityApplyConfiguration represents a declarative configuration of the NodeAffinity type for use // with apply. type NodeAffinityApplyConfiguration struct { RequiredDuringSchedulingIgnoredDuringExecution *NodeSelectorApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` } // NodeAffinityApplyConfiguration constructs a declarative configuration of the NodeAffinity type for use with // apply. func NodeAffinity() *NodeAffinityApplyConfiguration { return &NodeAffinityApplyConfiguration{} } // WithRequiredDuringSchedulingIgnoredDuringExecution sets the RequiredDuringSchedulingIgnoredDuringExecution field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RequiredDuringSchedulingIgnoredDuringExecution field is set to the value of the last call. func (b *NodeAffinityApplyConfiguration) WithRequiredDuringSchedulingIgnoredDuringExecution(value *NodeSelectorApplyConfiguration) *NodeAffinityApplyConfiguration { b.RequiredDuringSchedulingIgnoredDuringExecution = value return b } // WithPreferredDuringSchedulingIgnoredDuringExecution adds the given value to the PreferredDuringSchedulingIgnoredDuringExecution field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PreferredDuringSchedulingIgnoredDuringExecution field. func (b *NodeAffinityApplyConfiguration) WithPreferredDuringSchedulingIgnoredDuringExecution(values ...*PreferredSchedulingTermApplyConfiguration) *NodeAffinityApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPreferredDuringSchedulingIgnoredDuringExecution") } b.PreferredDuringSchedulingIgnoredDuringExecution = append(b.PreferredDuringSchedulingIgnoredDuringExecution, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodecondition.go000066400000000000000000000100331472614177300271360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // NodeConditionApplyConfiguration represents a declarative configuration of the NodeCondition type for use // with apply. type NodeConditionApplyConfiguration struct { Type *v1.NodeConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastHeartbeatTime *metav1.Time `json:"lastHeartbeatTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // NodeConditionApplyConfiguration constructs a declarative configuration of the NodeCondition type for use with // apply. func NodeCondition() *NodeConditionApplyConfiguration { return &NodeConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *NodeConditionApplyConfiguration) WithType(value v1.NodeConditionType) *NodeConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *NodeConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *NodeConditionApplyConfiguration { b.Status = &value return b } // WithLastHeartbeatTime sets the LastHeartbeatTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastHeartbeatTime field is set to the value of the last call. func (b *NodeConditionApplyConfiguration) WithLastHeartbeatTime(value metav1.Time) *NodeConditionApplyConfiguration { b.LastHeartbeatTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *NodeConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *NodeConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *NodeConditionApplyConfiguration) WithReason(value string) *NodeConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *NodeConditionApplyConfiguration) WithMessage(value string) *NodeConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodeconfigsource.go000066400000000000000000000031051472614177300276400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeConfigSourceApplyConfiguration represents a declarative configuration of the NodeConfigSource type for use // with apply. type NodeConfigSourceApplyConfiguration struct { ConfigMap *ConfigMapNodeConfigSourceApplyConfiguration `json:"configMap,omitempty"` } // NodeConfigSourceApplyConfiguration constructs a declarative configuration of the NodeConfigSource type for use with // apply. func NodeConfigSource() *NodeConfigSourceApplyConfiguration { return &NodeConfigSourceApplyConfiguration{} } // WithConfigMap sets the ConfigMap field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConfigMap field is set to the value of the last call. func (b *NodeConfigSourceApplyConfiguration) WithConfigMap(value *ConfigMapNodeConfigSourceApplyConfiguration) *NodeConfigSourceApplyConfiguration { b.ConfigMap = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodeconfigstatus.go000066400000000000000000000061051472614177300276660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeConfigStatusApplyConfiguration represents a declarative configuration of the NodeConfigStatus type for use // with apply. type NodeConfigStatusApplyConfiguration struct { Assigned *NodeConfigSourceApplyConfiguration `json:"assigned,omitempty"` Active *NodeConfigSourceApplyConfiguration `json:"active,omitempty"` LastKnownGood *NodeConfigSourceApplyConfiguration `json:"lastKnownGood,omitempty"` Error *string `json:"error,omitempty"` } // NodeConfigStatusApplyConfiguration constructs a declarative configuration of the NodeConfigStatus type for use with // apply. func NodeConfigStatus() *NodeConfigStatusApplyConfiguration { return &NodeConfigStatusApplyConfiguration{} } // WithAssigned sets the Assigned field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Assigned field is set to the value of the last call. func (b *NodeConfigStatusApplyConfiguration) WithAssigned(value *NodeConfigSourceApplyConfiguration) *NodeConfigStatusApplyConfiguration { b.Assigned = value return b } // WithActive sets the Active field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Active field is set to the value of the last call. func (b *NodeConfigStatusApplyConfiguration) WithActive(value *NodeConfigSourceApplyConfiguration) *NodeConfigStatusApplyConfiguration { b.Active = value return b } // WithLastKnownGood sets the LastKnownGood field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastKnownGood field is set to the value of the last call. func (b *NodeConfigStatusApplyConfiguration) WithLastKnownGood(value *NodeConfigSourceApplyConfiguration) *NodeConfigStatusApplyConfiguration { b.LastKnownGood = value return b } // WithError sets the Error field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Error field is set to the value of the last call. func (b *NodeConfigStatusApplyConfiguration) WithError(value string) *NodeConfigStatusApplyConfiguration { b.Error = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodedaemonendpoints.go000066400000000000000000000031671472614177300303510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeDaemonEndpointsApplyConfiguration represents a declarative configuration of the NodeDaemonEndpoints type for use // with apply. type NodeDaemonEndpointsApplyConfiguration struct { KubeletEndpoint *DaemonEndpointApplyConfiguration `json:"kubeletEndpoint,omitempty"` } // NodeDaemonEndpointsApplyConfiguration constructs a declarative configuration of the NodeDaemonEndpoints type for use with // apply. func NodeDaemonEndpoints() *NodeDaemonEndpointsApplyConfiguration { return &NodeDaemonEndpointsApplyConfiguration{} } // WithKubeletEndpoint sets the KubeletEndpoint field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the KubeletEndpoint field is set to the value of the last call. func (b *NodeDaemonEndpointsApplyConfiguration) WithKubeletEndpoint(value *DaemonEndpointApplyConfiguration) *NodeDaemonEndpointsApplyConfiguration { b.KubeletEndpoint = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodefeatures.go000066400000000000000000000030701472614177300267710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeFeaturesApplyConfiguration represents a declarative configuration of the NodeFeatures type for use // with apply. type NodeFeaturesApplyConfiguration struct { SupplementalGroupsPolicy *bool `json:"supplementalGroupsPolicy,omitempty"` } // NodeFeaturesApplyConfiguration constructs a declarative configuration of the NodeFeatures type for use with // apply. func NodeFeatures() *NodeFeaturesApplyConfiguration { return &NodeFeaturesApplyConfiguration{} } // WithSupplementalGroupsPolicy sets the SupplementalGroupsPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SupplementalGroupsPolicy field is set to the value of the last call. func (b *NodeFeaturesApplyConfiguration) WithSupplementalGroupsPolicy(value bool) *NodeFeaturesApplyConfiguration { b.SupplementalGroupsPolicy = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/noderuntimehandler.go000066400000000000000000000040711472614177300301760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeRuntimeHandlerApplyConfiguration represents a declarative configuration of the NodeRuntimeHandler type for use // with apply. type NodeRuntimeHandlerApplyConfiguration struct { Name *string `json:"name,omitempty"` Features *NodeRuntimeHandlerFeaturesApplyConfiguration `json:"features,omitempty"` } // NodeRuntimeHandlerApplyConfiguration constructs a declarative configuration of the NodeRuntimeHandler type for use with // apply. func NodeRuntimeHandler() *NodeRuntimeHandlerApplyConfiguration { return &NodeRuntimeHandlerApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *NodeRuntimeHandlerApplyConfiguration) WithName(value string) *NodeRuntimeHandlerApplyConfiguration { b.Name = &value return b } // WithFeatures sets the Features field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Features field is set to the value of the last call. func (b *NodeRuntimeHandlerApplyConfiguration) WithFeatures(value *NodeRuntimeHandlerFeaturesApplyConfiguration) *NodeRuntimeHandlerApplyConfiguration { b.Features = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/noderuntimehandlerfeatures.go000066400000000000000000000043231472614177300317350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeRuntimeHandlerFeaturesApplyConfiguration represents a declarative configuration of the NodeRuntimeHandlerFeatures type for use // with apply. type NodeRuntimeHandlerFeaturesApplyConfiguration struct { RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty"` UserNamespaces *bool `json:"userNamespaces,omitempty"` } // NodeRuntimeHandlerFeaturesApplyConfiguration constructs a declarative configuration of the NodeRuntimeHandlerFeatures type for use with // apply. func NodeRuntimeHandlerFeatures() *NodeRuntimeHandlerFeaturesApplyConfiguration { return &NodeRuntimeHandlerFeaturesApplyConfiguration{} } // WithRecursiveReadOnlyMounts sets the RecursiveReadOnlyMounts field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RecursiveReadOnlyMounts field is set to the value of the last call. func (b *NodeRuntimeHandlerFeaturesApplyConfiguration) WithRecursiveReadOnlyMounts(value bool) *NodeRuntimeHandlerFeaturesApplyConfiguration { b.RecursiveReadOnlyMounts = &value return b } // WithUserNamespaces sets the UserNamespaces field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UserNamespaces field is set to the value of the last call. func (b *NodeRuntimeHandlerFeaturesApplyConfiguration) WithUserNamespaces(value bool) *NodeRuntimeHandlerFeaturesApplyConfiguration { b.UserNamespaces = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodeselector.go000066400000000000000000000033451472614177300270000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeSelectorApplyConfiguration represents a declarative configuration of the NodeSelector type for use // with apply. type NodeSelectorApplyConfiguration struct { NodeSelectorTerms []NodeSelectorTermApplyConfiguration `json:"nodeSelectorTerms,omitempty"` } // NodeSelectorApplyConfiguration constructs a declarative configuration of the NodeSelector type for use with // apply. func NodeSelector() *NodeSelectorApplyConfiguration { return &NodeSelectorApplyConfiguration{} } // WithNodeSelectorTerms adds the given value to the NodeSelectorTerms field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NodeSelectorTerms field. func (b *NodeSelectorApplyConfiguration) WithNodeSelectorTerms(values ...*NodeSelectorTermApplyConfiguration) *NodeSelectorApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithNodeSelectorTerms") } b.NodeSelectorTerms = append(b.NodeSelectorTerms, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodeselectorrequirement.go000066400000000000000000000051751472614177300312640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // NodeSelectorRequirementApplyConfiguration represents a declarative configuration of the NodeSelectorRequirement type for use // with apply. type NodeSelectorRequirementApplyConfiguration struct { Key *string `json:"key,omitempty"` Operator *v1.NodeSelectorOperator `json:"operator,omitempty"` Values []string `json:"values,omitempty"` } // NodeSelectorRequirementApplyConfiguration constructs a declarative configuration of the NodeSelectorRequirement type for use with // apply. func NodeSelectorRequirement() *NodeSelectorRequirementApplyConfiguration { return &NodeSelectorRequirementApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *NodeSelectorRequirementApplyConfiguration) WithKey(value string) *NodeSelectorRequirementApplyConfiguration { b.Key = &value return b } // WithOperator sets the Operator field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Operator field is set to the value of the last call. func (b *NodeSelectorRequirementApplyConfiguration) WithOperator(value v1.NodeSelectorOperator) *NodeSelectorRequirementApplyConfiguration { b.Operator = &value return b } // WithValues adds the given value to the Values field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Values field. func (b *NodeSelectorRequirementApplyConfiguration) WithValues(values ...string) *NodeSelectorRequirementApplyConfiguration { for i := range values { b.Values = append(b.Values, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodeselectorterm.go000066400000000000000000000047331472614177300276720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeSelectorTermApplyConfiguration represents a declarative configuration of the NodeSelectorTerm type for use // with apply. type NodeSelectorTermApplyConfiguration struct { MatchExpressions []NodeSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` MatchFields []NodeSelectorRequirementApplyConfiguration `json:"matchFields,omitempty"` } // NodeSelectorTermApplyConfiguration constructs a declarative configuration of the NodeSelectorTerm type for use with // apply. func NodeSelectorTerm() *NodeSelectorTermApplyConfiguration { return &NodeSelectorTermApplyConfiguration{} } // WithMatchExpressions adds the given value to the MatchExpressions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchExpressions field. func (b *NodeSelectorTermApplyConfiguration) WithMatchExpressions(values ...*NodeSelectorRequirementApplyConfiguration) *NodeSelectorTermApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchExpressions") } b.MatchExpressions = append(b.MatchExpressions, *values[i]) } return b } // WithMatchFields adds the given value to the MatchFields field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchFields field. func (b *NodeSelectorTermApplyConfiguration) WithMatchFields(values ...*NodeSelectorRequirementApplyConfiguration) *NodeSelectorTermApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchFields") } b.MatchFields = append(b.MatchFields, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodespec.go000066400000000000000000000112361472614177300261100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeSpecApplyConfiguration represents a declarative configuration of the NodeSpec type for use // with apply. type NodeSpecApplyConfiguration struct { PodCIDR *string `json:"podCIDR,omitempty"` PodCIDRs []string `json:"podCIDRs,omitempty"` ProviderID *string `json:"providerID,omitempty"` Unschedulable *bool `json:"unschedulable,omitempty"` Taints []TaintApplyConfiguration `json:"taints,omitempty"` ConfigSource *NodeConfigSourceApplyConfiguration `json:"configSource,omitempty"` DoNotUseExternalID *string `json:"externalID,omitempty"` } // NodeSpecApplyConfiguration constructs a declarative configuration of the NodeSpec type for use with // apply. func NodeSpec() *NodeSpecApplyConfiguration { return &NodeSpecApplyConfiguration{} } // WithPodCIDR sets the PodCIDR field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodCIDR field is set to the value of the last call. func (b *NodeSpecApplyConfiguration) WithPodCIDR(value string) *NodeSpecApplyConfiguration { b.PodCIDR = &value return b } // WithPodCIDRs adds the given value to the PodCIDRs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PodCIDRs field. func (b *NodeSpecApplyConfiguration) WithPodCIDRs(values ...string) *NodeSpecApplyConfiguration { for i := range values { b.PodCIDRs = append(b.PodCIDRs, values[i]) } return b } // WithProviderID sets the ProviderID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProviderID field is set to the value of the last call. func (b *NodeSpecApplyConfiguration) WithProviderID(value string) *NodeSpecApplyConfiguration { b.ProviderID = &value return b } // WithUnschedulable sets the Unschedulable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Unschedulable field is set to the value of the last call. func (b *NodeSpecApplyConfiguration) WithUnschedulable(value bool) *NodeSpecApplyConfiguration { b.Unschedulable = &value return b } // WithTaints adds the given value to the Taints field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Taints field. func (b *NodeSpecApplyConfiguration) WithTaints(values ...*TaintApplyConfiguration) *NodeSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTaints") } b.Taints = append(b.Taints, *values[i]) } return b } // WithConfigSource sets the ConfigSource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConfigSource field is set to the value of the last call. func (b *NodeSpecApplyConfiguration) WithConfigSource(value *NodeConfigSourceApplyConfiguration) *NodeSpecApplyConfiguration { b.ConfigSource = value return b } // WithDoNotUseExternalID sets the DoNotUseExternalID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DoNotUseExternalID field is set to the value of the last call. func (b *NodeSpecApplyConfiguration) WithDoNotUseExternalID(value string) *NodeSpecApplyConfiguration { b.DoNotUseExternalID = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodestatus.go000066400000000000000000000207641472614177300265070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // NodeStatusApplyConfiguration represents a declarative configuration of the NodeStatus type for use // with apply. type NodeStatusApplyConfiguration struct { Capacity *v1.ResourceList `json:"capacity,omitempty"` Allocatable *v1.ResourceList `json:"allocatable,omitempty"` Phase *v1.NodePhase `json:"phase,omitempty"` Conditions []NodeConditionApplyConfiguration `json:"conditions,omitempty"` Addresses []NodeAddressApplyConfiguration `json:"addresses,omitempty"` DaemonEndpoints *NodeDaemonEndpointsApplyConfiguration `json:"daemonEndpoints,omitempty"` NodeInfo *NodeSystemInfoApplyConfiguration `json:"nodeInfo,omitempty"` Images []ContainerImageApplyConfiguration `json:"images,omitempty"` VolumesInUse []v1.UniqueVolumeName `json:"volumesInUse,omitempty"` VolumesAttached []AttachedVolumeApplyConfiguration `json:"volumesAttached,omitempty"` Config *NodeConfigStatusApplyConfiguration `json:"config,omitempty"` RuntimeHandlers []NodeRuntimeHandlerApplyConfiguration `json:"runtimeHandlers,omitempty"` Features *NodeFeaturesApplyConfiguration `json:"features,omitempty"` } // NodeStatusApplyConfiguration constructs a declarative configuration of the NodeStatus type for use with // apply. func NodeStatus() *NodeStatusApplyConfiguration { return &NodeStatusApplyConfiguration{} } // WithCapacity sets the Capacity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Capacity field is set to the value of the last call. func (b *NodeStatusApplyConfiguration) WithCapacity(value v1.ResourceList) *NodeStatusApplyConfiguration { b.Capacity = &value return b } // WithAllocatable sets the Allocatable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Allocatable field is set to the value of the last call. func (b *NodeStatusApplyConfiguration) WithAllocatable(value v1.ResourceList) *NodeStatusApplyConfiguration { b.Allocatable = &value return b } // WithPhase sets the Phase field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Phase field is set to the value of the last call. func (b *NodeStatusApplyConfiguration) WithPhase(value v1.NodePhase) *NodeStatusApplyConfiguration { b.Phase = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *NodeStatusApplyConfiguration) WithConditions(values ...*NodeConditionApplyConfiguration) *NodeStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithAddresses adds the given value to the Addresses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Addresses field. func (b *NodeStatusApplyConfiguration) WithAddresses(values ...*NodeAddressApplyConfiguration) *NodeStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithAddresses") } b.Addresses = append(b.Addresses, *values[i]) } return b } // WithDaemonEndpoints sets the DaemonEndpoints field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DaemonEndpoints field is set to the value of the last call. func (b *NodeStatusApplyConfiguration) WithDaemonEndpoints(value *NodeDaemonEndpointsApplyConfiguration) *NodeStatusApplyConfiguration { b.DaemonEndpoints = value return b } // WithNodeInfo sets the NodeInfo field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeInfo field is set to the value of the last call. func (b *NodeStatusApplyConfiguration) WithNodeInfo(value *NodeSystemInfoApplyConfiguration) *NodeStatusApplyConfiguration { b.NodeInfo = value return b } // WithImages adds the given value to the Images field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Images field. func (b *NodeStatusApplyConfiguration) WithImages(values ...*ContainerImageApplyConfiguration) *NodeStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithImages") } b.Images = append(b.Images, *values[i]) } return b } // WithVolumesInUse adds the given value to the VolumesInUse field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumesInUse field. func (b *NodeStatusApplyConfiguration) WithVolumesInUse(values ...v1.UniqueVolumeName) *NodeStatusApplyConfiguration { for i := range values { b.VolumesInUse = append(b.VolumesInUse, values[i]) } return b } // WithVolumesAttached adds the given value to the VolumesAttached field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumesAttached field. func (b *NodeStatusApplyConfiguration) WithVolumesAttached(values ...*AttachedVolumeApplyConfiguration) *NodeStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumesAttached") } b.VolumesAttached = append(b.VolumesAttached, *values[i]) } return b } // WithConfig sets the Config field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Config field is set to the value of the last call. func (b *NodeStatusApplyConfiguration) WithConfig(value *NodeConfigStatusApplyConfiguration) *NodeStatusApplyConfiguration { b.Config = value return b } // WithRuntimeHandlers adds the given value to the RuntimeHandlers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the RuntimeHandlers field. func (b *NodeStatusApplyConfiguration) WithRuntimeHandlers(values ...*NodeRuntimeHandlerApplyConfiguration) *NodeStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRuntimeHandlers") } b.RuntimeHandlers = append(b.RuntimeHandlers, *values[i]) } return b } // WithFeatures sets the Features field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Features field is set to the value of the last call. func (b *NodeStatusApplyConfiguration) WithFeatures(value *NodeFeaturesApplyConfiguration) *NodeStatusApplyConfiguration { b.Features = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/nodesysteminfo.go000066400000000000000000000137131472614177300273600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NodeSystemInfoApplyConfiguration represents a declarative configuration of the NodeSystemInfo type for use // with apply. type NodeSystemInfoApplyConfiguration struct { MachineID *string `json:"machineID,omitempty"` SystemUUID *string `json:"systemUUID,omitempty"` BootID *string `json:"bootID,omitempty"` KernelVersion *string `json:"kernelVersion,omitempty"` OSImage *string `json:"osImage,omitempty"` ContainerRuntimeVersion *string `json:"containerRuntimeVersion,omitempty"` KubeletVersion *string `json:"kubeletVersion,omitempty"` KubeProxyVersion *string `json:"kubeProxyVersion,omitempty"` OperatingSystem *string `json:"operatingSystem,omitempty"` Architecture *string `json:"architecture,omitempty"` } // NodeSystemInfoApplyConfiguration constructs a declarative configuration of the NodeSystemInfo type for use with // apply. func NodeSystemInfo() *NodeSystemInfoApplyConfiguration { return &NodeSystemInfoApplyConfiguration{} } // WithMachineID sets the MachineID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MachineID field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithMachineID(value string) *NodeSystemInfoApplyConfiguration { b.MachineID = &value return b } // WithSystemUUID sets the SystemUUID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SystemUUID field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithSystemUUID(value string) *NodeSystemInfoApplyConfiguration { b.SystemUUID = &value return b } // WithBootID sets the BootID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BootID field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithBootID(value string) *NodeSystemInfoApplyConfiguration { b.BootID = &value return b } // WithKernelVersion sets the KernelVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the KernelVersion field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithKernelVersion(value string) *NodeSystemInfoApplyConfiguration { b.KernelVersion = &value return b } // WithOSImage sets the OSImage field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the OSImage field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithOSImage(value string) *NodeSystemInfoApplyConfiguration { b.OSImage = &value return b } // WithContainerRuntimeVersion sets the ContainerRuntimeVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerRuntimeVersion field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithContainerRuntimeVersion(value string) *NodeSystemInfoApplyConfiguration { b.ContainerRuntimeVersion = &value return b } // WithKubeletVersion sets the KubeletVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the KubeletVersion field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithKubeletVersion(value string) *NodeSystemInfoApplyConfiguration { b.KubeletVersion = &value return b } // WithKubeProxyVersion sets the KubeProxyVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the KubeProxyVersion field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithKubeProxyVersion(value string) *NodeSystemInfoApplyConfiguration { b.KubeProxyVersion = &value return b } // WithOperatingSystem sets the OperatingSystem field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the OperatingSystem field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithOperatingSystem(value string) *NodeSystemInfoApplyConfiguration { b.OperatingSystem = &value return b } // WithArchitecture sets the Architecture field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Architecture field is set to the value of the last call. func (b *NodeSystemInfoApplyConfiguration) WithArchitecture(value string) *NodeSystemInfoApplyConfiguration { b.Architecture = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/objectfieldselector.go000066400000000000000000000040011472614177300303130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ObjectFieldSelectorApplyConfiguration represents a declarative configuration of the ObjectFieldSelector type for use // with apply. type ObjectFieldSelectorApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` FieldPath *string `json:"fieldPath,omitempty"` } // ObjectFieldSelectorApplyConfiguration constructs a declarative configuration of the ObjectFieldSelector type for use with // apply. func ObjectFieldSelector() *ObjectFieldSelectorApplyConfiguration { return &ObjectFieldSelectorApplyConfiguration{} } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ObjectFieldSelectorApplyConfiguration) WithAPIVersion(value string) *ObjectFieldSelectorApplyConfiguration { b.APIVersion = &value return b } // WithFieldPath sets the FieldPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldPath field is set to the value of the last call. func (b *ObjectFieldSelectorApplyConfiguration) WithFieldPath(value string) *ObjectFieldSelectorApplyConfiguration { b.FieldPath = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/objectreference.go000066400000000000000000000105001472614177300274260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( types "k8s.io/apimachinery/pkg/types" ) // ObjectReferenceApplyConfiguration represents a declarative configuration of the ObjectReference type for use // with apply. type ObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` UID *types.UID `json:"uid,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` FieldPath *string `json:"fieldPath,omitempty"` } // ObjectReferenceApplyConfiguration constructs a declarative configuration of the ObjectReference type for use with // apply. func ObjectReference() *ObjectReferenceApplyConfiguration { return &ObjectReferenceApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ObjectReferenceApplyConfiguration) WithKind(value string) *ObjectReferenceApplyConfiguration { b.Kind = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ObjectReferenceApplyConfiguration) WithNamespace(value string) *ObjectReferenceApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ObjectReferenceApplyConfiguration) WithName(value string) *ObjectReferenceApplyConfiguration { b.Name = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ObjectReferenceApplyConfiguration) WithUID(value types.UID) *ObjectReferenceApplyConfiguration { b.UID = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ObjectReferenceApplyConfiguration) WithAPIVersion(value string) *ObjectReferenceApplyConfiguration { b.APIVersion = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ObjectReferenceApplyConfiguration) WithResourceVersion(value string) *ObjectReferenceApplyConfiguration { b.ResourceVersion = &value return b } // WithFieldPath sets the FieldPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldPath field is set to the value of the last call. func (b *ObjectReferenceApplyConfiguration) WithFieldPath(value string) *ObjectReferenceApplyConfiguration { b.FieldPath = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolume.go000066400000000000000000000313141472614177300277370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PersistentVolumeApplyConfiguration represents a declarative configuration of the PersistentVolume type for use // with apply. type PersistentVolumeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PersistentVolumeSpecApplyConfiguration `json:"spec,omitempty"` Status *PersistentVolumeStatusApplyConfiguration `json:"status,omitempty"` } // PersistentVolume constructs a declarative configuration of the PersistentVolume type for use with // apply. func PersistentVolume(name string) *PersistentVolumeApplyConfiguration { b := &PersistentVolumeApplyConfiguration{} b.WithName(name) b.WithKind("PersistentVolume") b.WithAPIVersion("v1") return b } // ExtractPersistentVolume extracts the applied configuration owned by fieldManager from // persistentVolume. If no managedFields are found in persistentVolume for fieldManager, a // PersistentVolumeApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // persistentVolume must be a unmodified PersistentVolume API object that was retrieved from the Kubernetes API. // ExtractPersistentVolume provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPersistentVolume(persistentVolume *apicorev1.PersistentVolume, fieldManager string) (*PersistentVolumeApplyConfiguration, error) { return extractPersistentVolume(persistentVolume, fieldManager, "") } // ExtractPersistentVolumeStatus is the same as ExtractPersistentVolume except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPersistentVolumeStatus(persistentVolume *apicorev1.PersistentVolume, fieldManager string) (*PersistentVolumeApplyConfiguration, error) { return extractPersistentVolume(persistentVolume, fieldManager, "status") } func extractPersistentVolume(persistentVolume *apicorev1.PersistentVolume, fieldManager string, subresource string) (*PersistentVolumeApplyConfiguration, error) { b := &PersistentVolumeApplyConfiguration{} err := managedfields.ExtractInto(persistentVolume, internal.Parser().Type("io.k8s.api.core.v1.PersistentVolume"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(persistentVolume.Name) b.WithKind("PersistentVolume") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithKind(value string) *PersistentVolumeApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithAPIVersion(value string) *PersistentVolumeApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithName(value string) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithGenerateName(value string) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithNamespace(value string) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithUID(value types.UID) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithResourceVersion(value string) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithGeneration(value int64) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PersistentVolumeApplyConfiguration) WithLabels(entries map[string]string) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PersistentVolumeApplyConfiguration) WithAnnotations(entries map[string]string) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PersistentVolumeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PersistentVolumeApplyConfiguration) WithFinalizers(values ...string) *PersistentVolumeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PersistentVolumeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithSpec(value *PersistentVolumeSpecApplyConfiguration) *PersistentVolumeApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PersistentVolumeApplyConfiguration) WithStatus(value *PersistentVolumeStatusApplyConfiguration) *PersistentVolumeApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PersistentVolumeApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumeclaim.go000066400000000000000000000322601472614177300307460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PersistentVolumeClaimApplyConfiguration represents a declarative configuration of the PersistentVolumeClaim type for use // with apply. type PersistentVolumeClaimApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PersistentVolumeClaimSpecApplyConfiguration `json:"spec,omitempty"` Status *PersistentVolumeClaimStatusApplyConfiguration `json:"status,omitempty"` } // PersistentVolumeClaim constructs a declarative configuration of the PersistentVolumeClaim type for use with // apply. func PersistentVolumeClaim(name, namespace string) *PersistentVolumeClaimApplyConfiguration { b := &PersistentVolumeClaimApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("PersistentVolumeClaim") b.WithAPIVersion("v1") return b } // ExtractPersistentVolumeClaim extracts the applied configuration owned by fieldManager from // persistentVolumeClaim. If no managedFields are found in persistentVolumeClaim for fieldManager, a // PersistentVolumeClaimApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // persistentVolumeClaim must be a unmodified PersistentVolumeClaim API object that was retrieved from the Kubernetes API. // ExtractPersistentVolumeClaim provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPersistentVolumeClaim(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string) (*PersistentVolumeClaimApplyConfiguration, error) { return extractPersistentVolumeClaim(persistentVolumeClaim, fieldManager, "") } // ExtractPersistentVolumeClaimStatus is the same as ExtractPersistentVolumeClaim except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPersistentVolumeClaimStatus(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string) (*PersistentVolumeClaimApplyConfiguration, error) { return extractPersistentVolumeClaim(persistentVolumeClaim, fieldManager, "status") } func extractPersistentVolumeClaim(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string, subresource string) (*PersistentVolumeClaimApplyConfiguration, error) { b := &PersistentVolumeClaimApplyConfiguration{} err := managedfields.ExtractInto(persistentVolumeClaim, internal.Parser().Type("io.k8s.api.core.v1.PersistentVolumeClaim"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(persistentVolumeClaim.Name) b.WithNamespace(persistentVolumeClaim.Namespace) b.WithKind("PersistentVolumeClaim") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithKind(value string) *PersistentVolumeClaimApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithAPIVersion(value string) *PersistentVolumeClaimApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithName(value string) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithGenerateName(value string) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithNamespace(value string) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithUID(value types.UID) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithResourceVersion(value string) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithGeneration(value int64) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PersistentVolumeClaimApplyConfiguration) WithLabels(entries map[string]string) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PersistentVolumeClaimApplyConfiguration) WithAnnotations(entries map[string]string) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PersistentVolumeClaimApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PersistentVolumeClaimApplyConfiguration) WithFinalizers(values ...string) *PersistentVolumeClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PersistentVolumeClaimApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithSpec(value *PersistentVolumeClaimSpecApplyConfiguration) *PersistentVolumeClaimApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PersistentVolumeClaimApplyConfiguration) WithStatus(value *PersistentVolumeClaimStatusApplyConfiguration) *PersistentVolumeClaimApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PersistentVolumeClaimApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumeclaimcondition.go000066400000000000000000000107161472614177300326570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PersistentVolumeClaimConditionApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimCondition type for use // with apply. type PersistentVolumeClaimConditionApplyConfiguration struct { Type *v1.PersistentVolumeClaimConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastProbeTime *metav1.Time `json:"lastProbeTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // PersistentVolumeClaimConditionApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimCondition type for use with // apply. func PersistentVolumeClaimCondition() *PersistentVolumeClaimConditionApplyConfiguration { return &PersistentVolumeClaimConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PersistentVolumeClaimConditionApplyConfiguration) WithType(value v1.PersistentVolumeClaimConditionType) *PersistentVolumeClaimConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PersistentVolumeClaimConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PersistentVolumeClaimConditionApplyConfiguration { b.Status = &value return b } // WithLastProbeTime sets the LastProbeTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastProbeTime field is set to the value of the last call. func (b *PersistentVolumeClaimConditionApplyConfiguration) WithLastProbeTime(value metav1.Time) *PersistentVolumeClaimConditionApplyConfiguration { b.LastProbeTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *PersistentVolumeClaimConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PersistentVolumeClaimConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *PersistentVolumeClaimConditionApplyConfiguration) WithReason(value string) *PersistentVolumeClaimConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *PersistentVolumeClaimConditionApplyConfiguration) WithMessage(value string) *PersistentVolumeClaimConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumeclaimspec.go000066400000000000000000000146531472614177300316270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PersistentVolumeClaimSpecApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimSpec type for use // with apply. type PersistentVolumeClaimSpecApplyConfiguration struct { AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Resources *VolumeResourceRequirementsApplyConfiguration `json:"resources,omitempty"` VolumeName *string `json:"volumeName,omitempty"` StorageClassName *string `json:"storageClassName,omitempty"` VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"` DataSource *TypedLocalObjectReferenceApplyConfiguration `json:"dataSource,omitempty"` DataSourceRef *TypedObjectReferenceApplyConfiguration `json:"dataSourceRef,omitempty"` VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` } // PersistentVolumeClaimSpecApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimSpec type for use with // apply. func PersistentVolumeClaimSpec() *PersistentVolumeClaimSpecApplyConfiguration { return &PersistentVolumeClaimSpecApplyConfiguration{} } // WithAccessModes adds the given value to the AccessModes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AccessModes field. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeClaimSpecApplyConfiguration { for i := range values { b.AccessModes = append(b.AccessModes, values[i]) } return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { b.Selector = value return b } // WithResources sets the Resources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resources field is set to the value of the last call. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithResources(value *VolumeResourceRequirementsApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { b.Resources = value return b } // WithVolumeName sets the VolumeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeName field is set to the value of the last call. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeName(value string) *PersistentVolumeClaimSpecApplyConfiguration { b.VolumeName = &value return b } // WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageClassName field is set to the value of the last call. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithStorageClassName(value string) *PersistentVolumeClaimSpecApplyConfiguration { b.StorageClassName = &value return b } // WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeMode field is set to the value of the last call. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeMode(value v1.PersistentVolumeMode) *PersistentVolumeClaimSpecApplyConfiguration { b.VolumeMode = &value return b } // WithDataSource sets the DataSource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DataSource field is set to the value of the last call. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSource(value *TypedLocalObjectReferenceApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { b.DataSource = value return b } // WithDataSourceRef sets the DataSourceRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DataSourceRef field is set to the value of the last call. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSourceRef(value *TypedObjectReferenceApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { b.DataSourceRef = value return b } // WithVolumeAttributesClassName sets the VolumeAttributesClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeAttributesClassName field is set to the value of the last call. func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeAttributesClassName(value string) *PersistentVolumeClaimSpecApplyConfiguration { b.VolumeAttributesClassName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumeclaimstatus.go000066400000000000000000000150451472614177300322140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // PersistentVolumeClaimStatusApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimStatus type for use // with apply. type PersistentVolumeClaimStatusApplyConfiguration struct { Phase *v1.PersistentVolumeClaimPhase `json:"phase,omitempty"` AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` Capacity *v1.ResourceList `json:"capacity,omitempty"` Conditions []PersistentVolumeClaimConditionApplyConfiguration `json:"conditions,omitempty"` AllocatedResources *v1.ResourceList `json:"allocatedResources,omitempty"` AllocatedResourceStatuses map[v1.ResourceName]v1.ClaimResourceStatus `json:"allocatedResourceStatuses,omitempty"` CurrentVolumeAttributesClassName *string `json:"currentVolumeAttributesClassName,omitempty"` ModifyVolumeStatus *ModifyVolumeStatusApplyConfiguration `json:"modifyVolumeStatus,omitempty"` } // PersistentVolumeClaimStatusApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimStatus type for use with // apply. func PersistentVolumeClaimStatus() *PersistentVolumeClaimStatusApplyConfiguration { return &PersistentVolumeClaimStatusApplyConfiguration{} } // WithPhase sets the Phase field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Phase field is set to the value of the last call. func (b *PersistentVolumeClaimStatusApplyConfiguration) WithPhase(value v1.PersistentVolumeClaimPhase) *PersistentVolumeClaimStatusApplyConfiguration { b.Phase = &value return b } // WithAccessModes adds the given value to the AccessModes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AccessModes field. func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeClaimStatusApplyConfiguration { for i := range values { b.AccessModes = append(b.AccessModes, values[i]) } return b } // WithCapacity sets the Capacity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Capacity field is set to the value of the last call. func (b *PersistentVolumeClaimStatusApplyConfiguration) WithCapacity(value v1.ResourceList) *PersistentVolumeClaimStatusApplyConfiguration { b.Capacity = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *PersistentVolumeClaimStatusApplyConfiguration) WithConditions(values ...*PersistentVolumeClaimConditionApplyConfiguration) *PersistentVolumeClaimStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithAllocatedResources sets the AllocatedResources field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllocatedResources field is set to the value of the last call. func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAllocatedResources(value v1.ResourceList) *PersistentVolumeClaimStatusApplyConfiguration { b.AllocatedResources = &value return b } // WithAllocatedResourceStatuses puts the entries into the AllocatedResourceStatuses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the AllocatedResourceStatuses field, // overwriting an existing map entries in AllocatedResourceStatuses field with the same key. func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAllocatedResourceStatuses(entries map[v1.ResourceName]v1.ClaimResourceStatus) *PersistentVolumeClaimStatusApplyConfiguration { if b.AllocatedResourceStatuses == nil && len(entries) > 0 { b.AllocatedResourceStatuses = make(map[v1.ResourceName]v1.ClaimResourceStatus, len(entries)) } for k, v := range entries { b.AllocatedResourceStatuses[k] = v } return b } // WithCurrentVolumeAttributesClassName sets the CurrentVolumeAttributesClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentVolumeAttributesClassName field is set to the value of the last call. func (b *PersistentVolumeClaimStatusApplyConfiguration) WithCurrentVolumeAttributesClassName(value string) *PersistentVolumeClaimStatusApplyConfiguration { b.CurrentVolumeAttributesClassName = &value return b } // WithModifyVolumeStatus sets the ModifyVolumeStatus field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ModifyVolumeStatus field is set to the value of the last call. func (b *PersistentVolumeClaimStatusApplyConfiguration) WithModifyVolumeStatus(value *ModifyVolumeStatusApplyConfiguration) *PersistentVolumeClaimStatusApplyConfiguration { b.ModifyVolumeStatus = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go000066400000000000000000000230651472614177300325050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PersistentVolumeClaimTemplateApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimTemplate type for use // with apply. type PersistentVolumeClaimTemplateApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PersistentVolumeClaimSpecApplyConfiguration `json:"spec,omitempty"` } // PersistentVolumeClaimTemplateApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimTemplate type for use with // apply. func PersistentVolumeClaimTemplate() *PersistentVolumeClaimTemplateApplyConfiguration { return &PersistentVolumeClaimTemplateApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithName(value string) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithGenerateName(value string) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithNamespace(value string) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithUID(value types.UID) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithResourceVersion(value string) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithGeneration(value int64) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithLabels(entries map[string]string) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithAnnotations(entries map[string]string) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithFinalizers(values ...string) *PersistentVolumeClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PersistentVolumeClaimTemplateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithSpec(value *PersistentVolumeClaimSpecApplyConfiguration) *PersistentVolumeClaimTemplateApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PersistentVolumeClaimTemplateApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumeclaimvolumesource.go000066400000000000000000000042311472614177300334140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PersistentVolumeClaimVolumeSourceApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimVolumeSource type for use // with apply. type PersistentVolumeClaimVolumeSourceApplyConfiguration struct { ClaimName *string `json:"claimName,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // PersistentVolumeClaimVolumeSourceApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimVolumeSource type for use with // apply. func PersistentVolumeClaimVolumeSource() *PersistentVolumeClaimVolumeSourceApplyConfiguration { return &PersistentVolumeClaimVolumeSourceApplyConfiguration{} } // WithClaimName sets the ClaimName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClaimName field is set to the value of the last call. func (b *PersistentVolumeClaimVolumeSourceApplyConfiguration) WithClaimName(value string) *PersistentVolumeClaimVolumeSourceApplyConfiguration { b.ClaimName = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *PersistentVolumeClaimVolumeSourceApplyConfiguration) WithReadOnly(value bool) *PersistentVolumeClaimVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumesource.go000066400000000000000000000327301472614177300311630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PersistentVolumeSourceApplyConfiguration represents a declarative configuration of the PersistentVolumeSource type for use // with apply. type PersistentVolumeSourceApplyConfiguration struct { GCEPersistentDisk *GCEPersistentDiskVolumeSourceApplyConfiguration `json:"gcePersistentDisk,omitempty"` AWSElasticBlockStore *AWSElasticBlockStoreVolumeSourceApplyConfiguration `json:"awsElasticBlockStore,omitempty"` HostPath *HostPathVolumeSourceApplyConfiguration `json:"hostPath,omitempty"` Glusterfs *GlusterfsPersistentVolumeSourceApplyConfiguration `json:"glusterfs,omitempty"` NFS *NFSVolumeSourceApplyConfiguration `json:"nfs,omitempty"` RBD *RBDPersistentVolumeSourceApplyConfiguration `json:"rbd,omitempty"` ISCSI *ISCSIPersistentVolumeSourceApplyConfiguration `json:"iscsi,omitempty"` Cinder *CinderPersistentVolumeSourceApplyConfiguration `json:"cinder,omitempty"` CephFS *CephFSPersistentVolumeSourceApplyConfiguration `json:"cephfs,omitempty"` FC *FCVolumeSourceApplyConfiguration `json:"fc,omitempty"` Flocker *FlockerVolumeSourceApplyConfiguration `json:"flocker,omitempty"` FlexVolume *FlexPersistentVolumeSourceApplyConfiguration `json:"flexVolume,omitempty"` AzureFile *AzureFilePersistentVolumeSourceApplyConfiguration `json:"azureFile,omitempty"` VsphereVolume *VsphereVirtualDiskVolumeSourceApplyConfiguration `json:"vsphereVolume,omitempty"` Quobyte *QuobyteVolumeSourceApplyConfiguration `json:"quobyte,omitempty"` AzureDisk *AzureDiskVolumeSourceApplyConfiguration `json:"azureDisk,omitempty"` PhotonPersistentDisk *PhotonPersistentDiskVolumeSourceApplyConfiguration `json:"photonPersistentDisk,omitempty"` PortworxVolume *PortworxVolumeSourceApplyConfiguration `json:"portworxVolume,omitempty"` ScaleIO *ScaleIOPersistentVolumeSourceApplyConfiguration `json:"scaleIO,omitempty"` Local *LocalVolumeSourceApplyConfiguration `json:"local,omitempty"` StorageOS *StorageOSPersistentVolumeSourceApplyConfiguration `json:"storageos,omitempty"` CSI *CSIPersistentVolumeSourceApplyConfiguration `json:"csi,omitempty"` } // PersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the PersistentVolumeSource type for use with // apply. func PersistentVolumeSource() *PersistentVolumeSourceApplyConfiguration { return &PersistentVolumeSourceApplyConfiguration{} } // WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GCEPersistentDisk field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.GCEPersistentDisk = value return b } // WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.AWSElasticBlockStore = value return b } // WithHostPath sets the HostPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostPath field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.HostPath = value return b } // WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Glusterfs field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithGlusterfs(value *GlusterfsPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.Glusterfs = value return b } // WithNFS sets the NFS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NFS field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.NFS = value return b } // WithRBD sets the RBD field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RBD field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithRBD(value *RBDPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.RBD = value return b } // WithISCSI sets the ISCSI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ISCSI field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithISCSI(value *ISCSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.ISCSI = value return b } // WithCinder sets the Cinder field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Cinder field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithCinder(value *CinderPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.Cinder = value return b } // WithCephFS sets the CephFS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CephFS field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithCephFS(value *CephFSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.CephFS = value return b } // WithFC sets the FC field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FC field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.FC = value return b } // WithFlocker sets the Flocker field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Flocker field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.Flocker = value return b } // WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FlexVolume field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithFlexVolume(value *FlexPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.FlexVolume = value return b } // WithAzureFile sets the AzureFile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AzureFile field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithAzureFile(value *AzureFilePersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.AzureFile = value return b } // WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VsphereVolume field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.VsphereVolume = value return b } // WithQuobyte sets the Quobyte field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Quobyte field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.Quobyte = value return b } // WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AzureDisk field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.AzureDisk = value return b } // WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.PhotonPersistentDisk = value return b } // WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PortworxVolume field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.PortworxVolume = value return b } // WithScaleIO sets the ScaleIO field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleIO field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithScaleIO(value *ScaleIOPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.ScaleIO = value return b } // WithLocal sets the Local field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Local field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithLocal(value *LocalVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.Local = value return b } // WithStorageOS sets the StorageOS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageOS field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithStorageOS(value *StorageOSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.StorageOS = value return b } // WithCSI sets the CSI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CSI field is set to the value of the last call. func (b *PersistentVolumeSourceApplyConfiguration) WithCSI(value *CSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { b.CSI = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumespec.go000066400000000000000000000410751472614177300306170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // PersistentVolumeSpecApplyConfiguration represents a declarative configuration of the PersistentVolumeSpec type for use // with apply. type PersistentVolumeSpecApplyConfiguration struct { Capacity *v1.ResourceList `json:"capacity,omitempty"` PersistentVolumeSourceApplyConfiguration `json:",inline"` AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` ClaimRef *ObjectReferenceApplyConfiguration `json:"claimRef,omitempty"` PersistentVolumeReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty"` StorageClassName *string `json:"storageClassName,omitempty"` MountOptions []string `json:"mountOptions,omitempty"` VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"` NodeAffinity *VolumeNodeAffinityApplyConfiguration `json:"nodeAffinity,omitempty"` VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` } // PersistentVolumeSpecApplyConfiguration constructs a declarative configuration of the PersistentVolumeSpec type for use with // apply. func PersistentVolumeSpec() *PersistentVolumeSpecApplyConfiguration { return &PersistentVolumeSpecApplyConfiguration{} } // WithCapacity sets the Capacity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Capacity field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithCapacity(value v1.ResourceList) *PersistentVolumeSpecApplyConfiguration { b.Capacity = &value return b } // WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GCEPersistentDisk field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.GCEPersistentDisk = value return b } // WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.AWSElasticBlockStore = value return b } // WithHostPath sets the HostPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostPath field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.HostPath = value return b } // WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Glusterfs field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithGlusterfs(value *GlusterfsPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.Glusterfs = value return b } // WithNFS sets the NFS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NFS field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.NFS = value return b } // WithRBD sets the RBD field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RBD field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithRBD(value *RBDPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.RBD = value return b } // WithISCSI sets the ISCSI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ISCSI field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithISCSI(value *ISCSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.ISCSI = value return b } // WithCinder sets the Cinder field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Cinder field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithCinder(value *CinderPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.Cinder = value return b } // WithCephFS sets the CephFS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CephFS field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithCephFS(value *CephFSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.CephFS = value return b } // WithFC sets the FC field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FC field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.FC = value return b } // WithFlocker sets the Flocker field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Flocker field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.Flocker = value return b } // WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FlexVolume field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithFlexVolume(value *FlexPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.FlexVolume = value return b } // WithAzureFile sets the AzureFile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AzureFile field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithAzureFile(value *AzureFilePersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.AzureFile = value return b } // WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VsphereVolume field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.VsphereVolume = value return b } // WithQuobyte sets the Quobyte field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Quobyte field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.Quobyte = value return b } // WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AzureDisk field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.AzureDisk = value return b } // WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.PhotonPersistentDisk = value return b } // WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PortworxVolume field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.PortworxVolume = value return b } // WithScaleIO sets the ScaleIO field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleIO field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithScaleIO(value *ScaleIOPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.ScaleIO = value return b } // WithLocal sets the Local field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Local field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithLocal(value *LocalVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.Local = value return b } // WithStorageOS sets the StorageOS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageOS field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithStorageOS(value *StorageOSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.StorageOS = value return b } // WithCSI sets the CSI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CSI field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithCSI(value *CSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.CSI = value return b } // WithAccessModes adds the given value to the AccessModes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AccessModes field. func (b *PersistentVolumeSpecApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeSpecApplyConfiguration { for i := range values { b.AccessModes = append(b.AccessModes, values[i]) } return b } // WithClaimRef sets the ClaimRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClaimRef field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithClaimRef(value *ObjectReferenceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.ClaimRef = value return b } // WithPersistentVolumeReclaimPolicy sets the PersistentVolumeReclaimPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeReclaimPolicy field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithPersistentVolumeReclaimPolicy(value v1.PersistentVolumeReclaimPolicy) *PersistentVolumeSpecApplyConfiguration { b.PersistentVolumeReclaimPolicy = &value return b } // WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageClassName field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithStorageClassName(value string) *PersistentVolumeSpecApplyConfiguration { b.StorageClassName = &value return b } // WithMountOptions adds the given value to the MountOptions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MountOptions field. func (b *PersistentVolumeSpecApplyConfiguration) WithMountOptions(values ...string) *PersistentVolumeSpecApplyConfiguration { for i := range values { b.MountOptions = append(b.MountOptions, values[i]) } return b } // WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeMode field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithVolumeMode(value v1.PersistentVolumeMode) *PersistentVolumeSpecApplyConfiguration { b.VolumeMode = &value return b } // WithNodeAffinity sets the NodeAffinity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeAffinity field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithNodeAffinity(value *VolumeNodeAffinityApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { b.NodeAffinity = value return b } // WithVolumeAttributesClassName sets the VolumeAttributesClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeAttributesClassName field is set to the value of the last call. func (b *PersistentVolumeSpecApplyConfiguration) WithVolumeAttributesClassName(value string) *PersistentVolumeSpecApplyConfiguration { b.VolumeAttributesClassName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/persistentvolumestatus.go000066400000000000000000000063621472614177300312100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PersistentVolumeStatusApplyConfiguration represents a declarative configuration of the PersistentVolumeStatus type for use // with apply. type PersistentVolumeStatusApplyConfiguration struct { Phase *v1.PersistentVolumePhase `json:"phase,omitempty"` Message *string `json:"message,omitempty"` Reason *string `json:"reason,omitempty"` LastPhaseTransitionTime *metav1.Time `json:"lastPhaseTransitionTime,omitempty"` } // PersistentVolumeStatusApplyConfiguration constructs a declarative configuration of the PersistentVolumeStatus type for use with // apply. func PersistentVolumeStatus() *PersistentVolumeStatusApplyConfiguration { return &PersistentVolumeStatusApplyConfiguration{} } // WithPhase sets the Phase field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Phase field is set to the value of the last call. func (b *PersistentVolumeStatusApplyConfiguration) WithPhase(value v1.PersistentVolumePhase) *PersistentVolumeStatusApplyConfiguration { b.Phase = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *PersistentVolumeStatusApplyConfiguration) WithMessage(value string) *PersistentVolumeStatusApplyConfiguration { b.Message = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *PersistentVolumeStatusApplyConfiguration) WithReason(value string) *PersistentVolumeStatusApplyConfiguration { b.Reason = &value return b } // WithLastPhaseTransitionTime sets the LastPhaseTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastPhaseTransitionTime field is set to the value of the last call. func (b *PersistentVolumeStatusApplyConfiguration) WithLastPhaseTransitionTime(value metav1.Time) *PersistentVolumeStatusApplyConfiguration { b.LastPhaseTransitionTime = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/photonpersistentdiskvolumesource.go000066400000000000000000000041371472614177300332660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PhotonPersistentDiskVolumeSourceApplyConfiguration represents a declarative configuration of the PhotonPersistentDiskVolumeSource type for use // with apply. type PhotonPersistentDiskVolumeSourceApplyConfiguration struct { PdID *string `json:"pdID,omitempty"` FSType *string `json:"fsType,omitempty"` } // PhotonPersistentDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the PhotonPersistentDiskVolumeSource type for use with // apply. func PhotonPersistentDiskVolumeSource() *PhotonPersistentDiskVolumeSourceApplyConfiguration { return &PhotonPersistentDiskVolumeSourceApplyConfiguration{} } // WithPdID sets the PdID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PdID field is set to the value of the last call. func (b *PhotonPersistentDiskVolumeSourceApplyConfiguration) WithPdID(value string) *PhotonPersistentDiskVolumeSourceApplyConfiguration { b.PdID = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *PhotonPersistentDiskVolumeSourceApplyConfiguration) WithFSType(value string) *PhotonPersistentDiskVolumeSourceApplyConfiguration { b.FSType = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/pod.go000066400000000000000000000274201472614177300250740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodApplyConfiguration represents a declarative configuration of the Pod type for use // with apply. type PodApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PodSpecApplyConfiguration `json:"spec,omitempty"` Status *PodStatusApplyConfiguration `json:"status,omitempty"` } // Pod constructs a declarative configuration of the Pod type for use with // apply. func Pod(name, namespace string) *PodApplyConfiguration { b := &PodApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Pod") b.WithAPIVersion("v1") return b } // ExtractPod extracts the applied configuration owned by fieldManager from // pod. If no managedFields are found in pod for fieldManager, a // PodApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // pod must be a unmodified Pod API object that was retrieved from the Kubernetes API. // ExtractPod provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPod(pod *apicorev1.Pod, fieldManager string) (*PodApplyConfiguration, error) { return extractPod(pod, fieldManager, "") } // ExtractPodStatus is the same as ExtractPod except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPodStatus(pod *apicorev1.Pod, fieldManager string) (*PodApplyConfiguration, error) { return extractPod(pod, fieldManager, "status") } func extractPod(pod *apicorev1.Pod, fieldManager string, subresource string) (*PodApplyConfiguration, error) { b := &PodApplyConfiguration{} err := managedfields.ExtractInto(pod, internal.Parser().Type("io.k8s.api.core.v1.Pod"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(pod.Name) b.WithNamespace(pod.Namespace) b.WithKind("Pod") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PodApplyConfiguration) WithKind(value string) *PodApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PodApplyConfiguration) WithAPIVersion(value string) *PodApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodApplyConfiguration) WithName(value string) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PodApplyConfiguration) WithGenerateName(value string) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PodApplyConfiguration) WithNamespace(value string) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PodApplyConfiguration) WithUID(value types.UID) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PodApplyConfiguration) WithResourceVersion(value string) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PodApplyConfiguration) WithGeneration(value int64) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PodApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PodApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PodApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PodApplyConfiguration) WithLabels(entries map[string]string) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PodApplyConfiguration) WithAnnotations(entries map[string]string) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PodApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PodApplyConfiguration) WithFinalizers(values ...string) *PodApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PodApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PodApplyConfiguration) WithSpec(value *PodSpecApplyConfiguration) *PodApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PodApplyConfiguration) WithStatus(value *PodStatusApplyConfiguration) *PodApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PodApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podaffinity.go000066400000000000000000000057451472614177300266340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodAffinityApplyConfiguration represents a declarative configuration of the PodAffinity type for use // with apply. type PodAffinityApplyConfiguration struct { RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTermApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` } // PodAffinityApplyConfiguration constructs a declarative configuration of the PodAffinity type for use with // apply. func PodAffinity() *PodAffinityApplyConfiguration { return &PodAffinityApplyConfiguration{} } // WithRequiredDuringSchedulingIgnoredDuringExecution adds the given value to the RequiredDuringSchedulingIgnoredDuringExecution field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the RequiredDuringSchedulingIgnoredDuringExecution field. func (b *PodAffinityApplyConfiguration) WithRequiredDuringSchedulingIgnoredDuringExecution(values ...*PodAffinityTermApplyConfiguration) *PodAffinityApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRequiredDuringSchedulingIgnoredDuringExecution") } b.RequiredDuringSchedulingIgnoredDuringExecution = append(b.RequiredDuringSchedulingIgnoredDuringExecution, *values[i]) } return b } // WithPreferredDuringSchedulingIgnoredDuringExecution adds the given value to the PreferredDuringSchedulingIgnoredDuringExecution field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PreferredDuringSchedulingIgnoredDuringExecution field. func (b *PodAffinityApplyConfiguration) WithPreferredDuringSchedulingIgnoredDuringExecution(values ...*WeightedPodAffinityTermApplyConfiguration) *PodAffinityApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPreferredDuringSchedulingIgnoredDuringExecution") } b.PreferredDuringSchedulingIgnoredDuringExecution = append(b.PreferredDuringSchedulingIgnoredDuringExecution, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podaffinityterm.go000066400000000000000000000107751472614177300275230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodAffinityTermApplyConfiguration represents a declarative configuration of the PodAffinityTerm type for use // with apply. type PodAffinityTermApplyConfiguration struct { LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` Namespaces []string `json:"namespaces,omitempty"` TopologyKey *string `json:"topologyKey,omitempty"` NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` MatchLabelKeys []string `json:"matchLabelKeys,omitempty"` MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty"` } // PodAffinityTermApplyConfiguration constructs a declarative configuration of the PodAffinityTerm type for use with // apply. func PodAffinityTerm() *PodAffinityTermApplyConfiguration { return &PodAffinityTermApplyConfiguration{} } // WithLabelSelector sets the LabelSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LabelSelector field is set to the value of the last call. func (b *PodAffinityTermApplyConfiguration) WithLabelSelector(value *v1.LabelSelectorApplyConfiguration) *PodAffinityTermApplyConfiguration { b.LabelSelector = value return b } // WithNamespaces adds the given value to the Namespaces field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Namespaces field. func (b *PodAffinityTermApplyConfiguration) WithNamespaces(values ...string) *PodAffinityTermApplyConfiguration { for i := range values { b.Namespaces = append(b.Namespaces, values[i]) } return b } // WithTopologyKey sets the TopologyKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TopologyKey field is set to the value of the last call. func (b *PodAffinityTermApplyConfiguration) WithTopologyKey(value string) *PodAffinityTermApplyConfiguration { b.TopologyKey = &value return b } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *PodAffinityTermApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *PodAffinityTermApplyConfiguration { b.NamespaceSelector = value return b } // WithMatchLabelKeys adds the given value to the MatchLabelKeys field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchLabelKeys field. func (b *PodAffinityTermApplyConfiguration) WithMatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration { for i := range values { b.MatchLabelKeys = append(b.MatchLabelKeys, values[i]) } return b } // WithMismatchLabelKeys adds the given value to the MismatchLabelKeys field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MismatchLabelKeys field. func (b *PodAffinityTermApplyConfiguration) WithMismatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration { for i := range values { b.MismatchLabelKeys = append(b.MismatchLabelKeys, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podantiaffinity.go000066400000000000000000000060251472614177300275000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodAntiAffinityApplyConfiguration represents a declarative configuration of the PodAntiAffinity type for use // with apply. type PodAntiAffinityApplyConfiguration struct { RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTermApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` } // PodAntiAffinityApplyConfiguration constructs a declarative configuration of the PodAntiAffinity type for use with // apply. func PodAntiAffinity() *PodAntiAffinityApplyConfiguration { return &PodAntiAffinityApplyConfiguration{} } // WithRequiredDuringSchedulingIgnoredDuringExecution adds the given value to the RequiredDuringSchedulingIgnoredDuringExecution field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the RequiredDuringSchedulingIgnoredDuringExecution field. func (b *PodAntiAffinityApplyConfiguration) WithRequiredDuringSchedulingIgnoredDuringExecution(values ...*PodAffinityTermApplyConfiguration) *PodAntiAffinityApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRequiredDuringSchedulingIgnoredDuringExecution") } b.RequiredDuringSchedulingIgnoredDuringExecution = append(b.RequiredDuringSchedulingIgnoredDuringExecution, *values[i]) } return b } // WithPreferredDuringSchedulingIgnoredDuringExecution adds the given value to the PreferredDuringSchedulingIgnoredDuringExecution field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PreferredDuringSchedulingIgnoredDuringExecution field. func (b *PodAntiAffinityApplyConfiguration) WithPreferredDuringSchedulingIgnoredDuringExecution(values ...*WeightedPodAffinityTermApplyConfiguration) *PodAntiAffinityApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPreferredDuringSchedulingIgnoredDuringExecution") } b.PreferredDuringSchedulingIgnoredDuringExecution = append(b.PreferredDuringSchedulingIgnoredDuringExecution, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podcondition.go000066400000000000000000000077501472614177300270070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PodConditionApplyConfiguration represents a declarative configuration of the PodCondition type for use // with apply. type PodConditionApplyConfiguration struct { Type *v1.PodConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastProbeTime *metav1.Time `json:"lastProbeTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // PodConditionApplyConfiguration constructs a declarative configuration of the PodCondition type for use with // apply. func PodCondition() *PodConditionApplyConfiguration { return &PodConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PodConditionApplyConfiguration) WithType(value v1.PodConditionType) *PodConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PodConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PodConditionApplyConfiguration { b.Status = &value return b } // WithLastProbeTime sets the LastProbeTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastProbeTime field is set to the value of the last call. func (b *PodConditionApplyConfiguration) WithLastProbeTime(value metav1.Time) *PodConditionApplyConfiguration { b.LastProbeTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *PodConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PodConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *PodConditionApplyConfiguration) WithReason(value string) *PodConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *PodConditionApplyConfiguration) WithMessage(value string) *PodConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/poddnsconfig.go000066400000000000000000000054121472614177300267640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodDNSConfigApplyConfiguration represents a declarative configuration of the PodDNSConfig type for use // with apply. type PodDNSConfigApplyConfiguration struct { Nameservers []string `json:"nameservers,omitempty"` Searches []string `json:"searches,omitempty"` Options []PodDNSConfigOptionApplyConfiguration `json:"options,omitempty"` } // PodDNSConfigApplyConfiguration constructs a declarative configuration of the PodDNSConfig type for use with // apply. func PodDNSConfig() *PodDNSConfigApplyConfiguration { return &PodDNSConfigApplyConfiguration{} } // WithNameservers adds the given value to the Nameservers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Nameservers field. func (b *PodDNSConfigApplyConfiguration) WithNameservers(values ...string) *PodDNSConfigApplyConfiguration { for i := range values { b.Nameservers = append(b.Nameservers, values[i]) } return b } // WithSearches adds the given value to the Searches field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Searches field. func (b *PodDNSConfigApplyConfiguration) WithSearches(values ...string) *PodDNSConfigApplyConfiguration { for i := range values { b.Searches = append(b.Searches, values[i]) } return b } // WithOptions adds the given value to the Options field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Options field. func (b *PodDNSConfigApplyConfiguration) WithOptions(values ...*PodDNSConfigOptionApplyConfiguration) *PodDNSConfigApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithOptions") } b.Options = append(b.Options, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/poddnsconfigoption.go000066400000000000000000000036571472614177300302260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodDNSConfigOptionApplyConfiguration represents a declarative configuration of the PodDNSConfigOption type for use // with apply. type PodDNSConfigOptionApplyConfiguration struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } // PodDNSConfigOptionApplyConfiguration constructs a declarative configuration of the PodDNSConfigOption type for use with // apply. func PodDNSConfigOption() *PodDNSConfigOptionApplyConfiguration { return &PodDNSConfigOptionApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodDNSConfigOptionApplyConfiguration) WithName(value string) *PodDNSConfigOptionApplyConfiguration { b.Name = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *PodDNSConfigOptionApplyConfiguration) WithValue(value string) *PodDNSConfigOptionApplyConfiguration { b.Value = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podip.go000066400000000000000000000025341472614177300254240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodIPApplyConfiguration represents a declarative configuration of the PodIP type for use // with apply. type PodIPApplyConfiguration struct { IP *string `json:"ip,omitempty"` } // PodIPApplyConfiguration constructs a declarative configuration of the PodIP type for use with // apply. func PodIP() *PodIPApplyConfiguration { return &PodIPApplyConfiguration{} } // WithIP sets the IP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IP field is set to the value of the last call. func (b *PodIPApplyConfiguration) WithIP(value string) *PodIPApplyConfiguration { b.IP = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podos.go000066400000000000000000000026251472614177300254360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // PodOSApplyConfiguration represents a declarative configuration of the PodOS type for use // with apply. type PodOSApplyConfiguration struct { Name *v1.OSName `json:"name,omitempty"` } // PodOSApplyConfiguration constructs a declarative configuration of the PodOS type for use with // apply. func PodOS() *PodOSApplyConfiguration { return &PodOSApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodOSApplyConfiguration) WithName(value v1.OSName) *PodOSApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podreadinessgate.go000066400000000000000000000031261472614177300276300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // PodReadinessGateApplyConfiguration represents a declarative configuration of the PodReadinessGate type for use // with apply. type PodReadinessGateApplyConfiguration struct { ConditionType *v1.PodConditionType `json:"conditionType,omitempty"` } // PodReadinessGateApplyConfiguration constructs a declarative configuration of the PodReadinessGate type for use with // apply. func PodReadinessGate() *PodReadinessGateApplyConfiguration { return &PodReadinessGateApplyConfiguration{} } // WithConditionType sets the ConditionType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConditionType field is set to the value of the last call. func (b *PodReadinessGateApplyConfiguration) WithConditionType(value v1.PodConditionType) *PodReadinessGateApplyConfiguration { b.ConditionType = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podresourceclaim.go000066400000000000000000000051211472614177300276440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodResourceClaimApplyConfiguration represents a declarative configuration of the PodResourceClaim type for use // with apply. type PodResourceClaimApplyConfiguration struct { Name *string `json:"name,omitempty"` ResourceClaimName *string `json:"resourceClaimName,omitempty"` ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"` } // PodResourceClaimApplyConfiguration constructs a declarative configuration of the PodResourceClaim type for use with // apply. func PodResourceClaim() *PodResourceClaimApplyConfiguration { return &PodResourceClaimApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodResourceClaimApplyConfiguration) WithName(value string) *PodResourceClaimApplyConfiguration { b.Name = &value return b } // WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceClaimName field is set to the value of the last call. func (b *PodResourceClaimApplyConfiguration) WithResourceClaimName(value string) *PodResourceClaimApplyConfiguration { b.ResourceClaimName = &value return b } // WithResourceClaimTemplateName sets the ResourceClaimTemplateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceClaimTemplateName field is set to the value of the last call. func (b *PodResourceClaimApplyConfiguration) WithResourceClaimTemplateName(value string) *PodResourceClaimApplyConfiguration { b.ResourceClaimTemplateName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podresourceclaimstatus.go000066400000000000000000000040771472614177300311210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodResourceClaimStatusApplyConfiguration represents a declarative configuration of the PodResourceClaimStatus type for use // with apply. type PodResourceClaimStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` ResourceClaimName *string `json:"resourceClaimName,omitempty"` } // PodResourceClaimStatusApplyConfiguration constructs a declarative configuration of the PodResourceClaimStatus type for use with // apply. func PodResourceClaimStatus() *PodResourceClaimStatusApplyConfiguration { return &PodResourceClaimStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodResourceClaimStatusApplyConfiguration) WithName(value string) *PodResourceClaimStatusApplyConfiguration { b.Name = &value return b } // WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceClaimName field is set to the value of the last call. func (b *PodResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *PodResourceClaimStatusApplyConfiguration { b.ResourceClaimName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podschedulinggate.go000066400000000000000000000027421472614177300300030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PodSchedulingGateApplyConfiguration represents a declarative configuration of the PodSchedulingGate type for use // with apply. type PodSchedulingGateApplyConfiguration struct { Name *string `json:"name,omitempty"` } // PodSchedulingGateApplyConfiguration constructs a declarative configuration of the PodSchedulingGate type for use with // apply. func PodSchedulingGate() *PodSchedulingGateApplyConfiguration { return &PodSchedulingGateApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodSchedulingGateApplyConfiguration) WithName(value string) *PodSchedulingGateApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podsecuritycontext.go000066400000000000000000000200731472614177300302660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" ) // PodSecurityContextApplyConfiguration represents a declarative configuration of the PodSecurityContext type for use // with apply. type PodSecurityContextApplyConfiguration struct { SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"` RunAsUser *int64 `json:"runAsUser,omitempty"` RunAsGroup *int64 `json:"runAsGroup,omitempty"` RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` SupplementalGroups []int64 `json:"supplementalGroups,omitempty"` SupplementalGroupsPolicy *corev1.SupplementalGroupsPolicy `json:"supplementalGroupsPolicy,omitempty"` FSGroup *int64 `json:"fsGroup,omitempty"` Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"` FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"` SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` } // PodSecurityContextApplyConfiguration constructs a declarative configuration of the PodSecurityContext type for use with // apply. func PodSecurityContext() *PodSecurityContextApplyConfiguration { return &PodSecurityContextApplyConfiguration{} } // WithSELinuxOptions sets the SELinuxOptions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SELinuxOptions field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithSELinuxOptions(value *SELinuxOptionsApplyConfiguration) *PodSecurityContextApplyConfiguration { b.SELinuxOptions = value return b } // WithWindowsOptions sets the WindowsOptions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WindowsOptions field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithWindowsOptions(value *WindowsSecurityContextOptionsApplyConfiguration) *PodSecurityContextApplyConfiguration { b.WindowsOptions = value return b } // WithRunAsUser sets the RunAsUser field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RunAsUser field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithRunAsUser(value int64) *PodSecurityContextApplyConfiguration { b.RunAsUser = &value return b } // WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RunAsGroup field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithRunAsGroup(value int64) *PodSecurityContextApplyConfiguration { b.RunAsGroup = &value return b } // WithRunAsNonRoot sets the RunAsNonRoot field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RunAsNonRoot field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithRunAsNonRoot(value bool) *PodSecurityContextApplyConfiguration { b.RunAsNonRoot = &value return b } // WithSupplementalGroups adds the given value to the SupplementalGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the SupplementalGroups field. func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroups(values ...int64) *PodSecurityContextApplyConfiguration { for i := range values { b.SupplementalGroups = append(b.SupplementalGroups, values[i]) } return b } // WithSupplementalGroupsPolicy sets the SupplementalGroupsPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SupplementalGroupsPolicy field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroupsPolicy(value corev1.SupplementalGroupsPolicy) *PodSecurityContextApplyConfiguration { b.SupplementalGroupsPolicy = &value return b } // WithFSGroup sets the FSGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSGroup field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithFSGroup(value int64) *PodSecurityContextApplyConfiguration { b.FSGroup = &value return b } // WithSysctls adds the given value to the Sysctls field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Sysctls field. func (b *PodSecurityContextApplyConfiguration) WithSysctls(values ...*SysctlApplyConfiguration) *PodSecurityContextApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSysctls") } b.Sysctls = append(b.Sysctls, *values[i]) } return b } // WithFSGroupChangePolicy sets the FSGroupChangePolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSGroupChangePolicy field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithFSGroupChangePolicy(value corev1.PodFSGroupChangePolicy) *PodSecurityContextApplyConfiguration { b.FSGroupChangePolicy = &value return b } // WithSeccompProfile sets the SeccompProfile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SeccompProfile field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { b.SeccompProfile = value return b } // WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AppArmorProfile field is set to the value of the last call. func (b *PodSecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { b.AppArmorProfile = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podspec.go000066400000000000000000000576661472614177300257660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" ) // PodSpecApplyConfiguration represents a declarative configuration of the PodSpec type for use // with apply. type PodSpecApplyConfiguration struct { Volumes []VolumeApplyConfiguration `json:"volumes,omitempty"` InitContainers []ContainerApplyConfiguration `json:"initContainers,omitempty"` Containers []ContainerApplyConfiguration `json:"containers,omitempty"` EphemeralContainers []EphemeralContainerApplyConfiguration `json:"ephemeralContainers,omitempty"` RestartPolicy *corev1.RestartPolicy `json:"restartPolicy,omitempty"` TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` DNSPolicy *corev1.DNSPolicy `json:"dnsPolicy,omitempty"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` ServiceAccountName *string `json:"serviceAccountName,omitempty"` DeprecatedServiceAccount *string `json:"serviceAccount,omitempty"` AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"` NodeName *string `json:"nodeName,omitempty"` HostNetwork *bool `json:"hostNetwork,omitempty"` HostPID *bool `json:"hostPID,omitempty"` HostIPC *bool `json:"hostIPC,omitempty"` ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty"` SecurityContext *PodSecurityContextApplyConfiguration `json:"securityContext,omitempty"` ImagePullSecrets []LocalObjectReferenceApplyConfiguration `json:"imagePullSecrets,omitempty"` Hostname *string `json:"hostname,omitempty"` Subdomain *string `json:"subdomain,omitempty"` Affinity *AffinityApplyConfiguration `json:"affinity,omitempty"` SchedulerName *string `json:"schedulerName,omitempty"` Tolerations []TolerationApplyConfiguration `json:"tolerations,omitempty"` HostAliases []HostAliasApplyConfiguration `json:"hostAliases,omitempty"` PriorityClassName *string `json:"priorityClassName,omitempty"` Priority *int32 `json:"priority,omitempty"` DNSConfig *PodDNSConfigApplyConfiguration `json:"dnsConfig,omitempty"` ReadinessGates []PodReadinessGateApplyConfiguration `json:"readinessGates,omitempty"` RuntimeClassName *string `json:"runtimeClassName,omitempty"` EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"` PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` Overhead *corev1.ResourceList `json:"overhead,omitempty"` TopologySpreadConstraints []TopologySpreadConstraintApplyConfiguration `json:"topologySpreadConstraints,omitempty"` SetHostnameAsFQDN *bool `json:"setHostnameAsFQDN,omitempty"` OS *PodOSApplyConfiguration `json:"os,omitempty"` HostUsers *bool `json:"hostUsers,omitempty"` SchedulingGates []PodSchedulingGateApplyConfiguration `json:"schedulingGates,omitempty"` ResourceClaims []PodResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"` } // PodSpecApplyConfiguration constructs a declarative configuration of the PodSpec type for use with // apply. func PodSpec() *PodSpecApplyConfiguration { return &PodSpecApplyConfiguration{} } // WithVolumes adds the given value to the Volumes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Volumes field. func (b *PodSpecApplyConfiguration) WithVolumes(values ...*VolumeApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithVolumes") } b.Volumes = append(b.Volumes, *values[i]) } return b } // WithInitContainers adds the given value to the InitContainers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the InitContainers field. func (b *PodSpecApplyConfiguration) WithInitContainers(values ...*ContainerApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithInitContainers") } b.InitContainers = append(b.InitContainers, *values[i]) } return b } // WithContainers adds the given value to the Containers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Containers field. func (b *PodSpecApplyConfiguration) WithContainers(values ...*ContainerApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithContainers") } b.Containers = append(b.Containers, *values[i]) } return b } // WithEphemeralContainers adds the given value to the EphemeralContainers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the EphemeralContainers field. func (b *PodSpecApplyConfiguration) WithEphemeralContainers(values ...*EphemeralContainerApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEphemeralContainers") } b.EphemeralContainers = append(b.EphemeralContainers, *values[i]) } return b } // WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RestartPolicy field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithRestartPolicy(value corev1.RestartPolicy) *PodSpecApplyConfiguration { b.RestartPolicy = &value return b } // WithTerminationGracePeriodSeconds sets the TerminationGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TerminationGracePeriodSeconds field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithTerminationGracePeriodSeconds(value int64) *PodSpecApplyConfiguration { b.TerminationGracePeriodSeconds = &value return b } // WithActiveDeadlineSeconds sets the ActiveDeadlineSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ActiveDeadlineSeconds field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithActiveDeadlineSeconds(value int64) *PodSpecApplyConfiguration { b.ActiveDeadlineSeconds = &value return b } // WithDNSPolicy sets the DNSPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DNSPolicy field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithDNSPolicy(value corev1.DNSPolicy) *PodSpecApplyConfiguration { b.DNSPolicy = &value return b } // WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the NodeSelector field, // overwriting an existing map entries in NodeSelector field with the same key. func (b *PodSpecApplyConfiguration) WithNodeSelector(entries map[string]string) *PodSpecApplyConfiguration { if b.NodeSelector == nil && len(entries) > 0 { b.NodeSelector = make(map[string]string, len(entries)) } for k, v := range entries { b.NodeSelector[k] = v } return b } // WithServiceAccountName sets the ServiceAccountName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccountName field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithServiceAccountName(value string) *PodSpecApplyConfiguration { b.ServiceAccountName = &value return b } // WithDeprecatedServiceAccount sets the DeprecatedServiceAccount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedServiceAccount field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithDeprecatedServiceAccount(value string) *PodSpecApplyConfiguration { b.DeprecatedServiceAccount = &value return b } // WithAutomountServiceAccountToken sets the AutomountServiceAccountToken field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AutomountServiceAccountToken field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithAutomountServiceAccountToken(value bool) *PodSpecApplyConfiguration { b.AutomountServiceAccountToken = &value return b } // WithNodeName sets the NodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeName field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithNodeName(value string) *PodSpecApplyConfiguration { b.NodeName = &value return b } // WithHostNetwork sets the HostNetwork field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostNetwork field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithHostNetwork(value bool) *PodSpecApplyConfiguration { b.HostNetwork = &value return b } // WithHostPID sets the HostPID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostPID field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithHostPID(value bool) *PodSpecApplyConfiguration { b.HostPID = &value return b } // WithHostIPC sets the HostIPC field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostIPC field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithHostIPC(value bool) *PodSpecApplyConfiguration { b.HostIPC = &value return b } // WithShareProcessNamespace sets the ShareProcessNamespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ShareProcessNamespace field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithShareProcessNamespace(value bool) *PodSpecApplyConfiguration { b.ShareProcessNamespace = &value return b } // WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecurityContext field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithSecurityContext(value *PodSecurityContextApplyConfiguration) *PodSpecApplyConfiguration { b.SecurityContext = value return b } // WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ImagePullSecrets field. func (b *PodSpecApplyConfiguration) WithImagePullSecrets(values ...*LocalObjectReferenceApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithImagePullSecrets") } b.ImagePullSecrets = append(b.ImagePullSecrets, *values[i]) } return b } // WithHostname sets the Hostname field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hostname field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithHostname(value string) *PodSpecApplyConfiguration { b.Hostname = &value return b } // WithSubdomain sets the Subdomain field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Subdomain field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithSubdomain(value string) *PodSpecApplyConfiguration { b.Subdomain = &value return b } // WithAffinity sets the Affinity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Affinity field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithAffinity(value *AffinityApplyConfiguration) *PodSpecApplyConfiguration { b.Affinity = value return b } // WithSchedulerName sets the SchedulerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SchedulerName field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithSchedulerName(value string) *PodSpecApplyConfiguration { b.SchedulerName = &value return b } // WithTolerations adds the given value to the Tolerations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Tolerations field. func (b *PodSpecApplyConfiguration) WithTolerations(values ...*TolerationApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTolerations") } b.Tolerations = append(b.Tolerations, *values[i]) } return b } // WithHostAliases adds the given value to the HostAliases field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the HostAliases field. func (b *PodSpecApplyConfiguration) WithHostAliases(values ...*HostAliasApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithHostAliases") } b.HostAliases = append(b.HostAliases, *values[i]) } return b } // WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PriorityClassName field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithPriorityClassName(value string) *PodSpecApplyConfiguration { b.PriorityClassName = &value return b } // WithPriority sets the Priority field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Priority field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithPriority(value int32) *PodSpecApplyConfiguration { b.Priority = &value return b } // WithDNSConfig sets the DNSConfig field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DNSConfig field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithDNSConfig(value *PodDNSConfigApplyConfiguration) *PodSpecApplyConfiguration { b.DNSConfig = value return b } // WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ReadinessGates field. func (b *PodSpecApplyConfiguration) WithReadinessGates(values ...*PodReadinessGateApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithReadinessGates") } b.ReadinessGates = append(b.ReadinessGates, *values[i]) } return b } // WithRuntimeClassName sets the RuntimeClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RuntimeClassName field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithRuntimeClassName(value string) *PodSpecApplyConfiguration { b.RuntimeClassName = &value return b } // WithEnableServiceLinks sets the EnableServiceLinks field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EnableServiceLinks field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithEnableServiceLinks(value bool) *PodSpecApplyConfiguration { b.EnableServiceLinks = &value return b } // WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PreemptionPolicy field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithPreemptionPolicy(value corev1.PreemptionPolicy) *PodSpecApplyConfiguration { b.PreemptionPolicy = &value return b } // WithOverhead sets the Overhead field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Overhead field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithOverhead(value corev1.ResourceList) *PodSpecApplyConfiguration { b.Overhead = &value return b } // WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. func (b *PodSpecApplyConfiguration) WithTopologySpreadConstraints(values ...*TopologySpreadConstraintApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTopologySpreadConstraints") } b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, *values[i]) } return b } // WithSetHostnameAsFQDN sets the SetHostnameAsFQDN field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SetHostnameAsFQDN field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithSetHostnameAsFQDN(value bool) *PodSpecApplyConfiguration { b.SetHostnameAsFQDN = &value return b } // WithOS sets the OS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the OS field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithOS(value *PodOSApplyConfiguration) *PodSpecApplyConfiguration { b.OS = value return b } // WithHostUsers sets the HostUsers field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostUsers field is set to the value of the last call. func (b *PodSpecApplyConfiguration) WithHostUsers(value bool) *PodSpecApplyConfiguration { b.HostUsers = &value return b } // WithSchedulingGates adds the given value to the SchedulingGates field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the SchedulingGates field. func (b *PodSpecApplyConfiguration) WithSchedulingGates(values ...*PodSchedulingGateApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSchedulingGates") } b.SchedulingGates = append(b.SchedulingGates, *values[i]) } return b } // WithResourceClaims adds the given value to the ResourceClaims field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceClaims field. func (b *PodSpecApplyConfiguration) WithResourceClaims(values ...*PodResourceClaimApplyConfiguration) *PodSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceClaims") } b.ResourceClaims = append(b.ResourceClaims, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podstatus.go000066400000000000000000000250401472614177300263340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PodStatusApplyConfiguration represents a declarative configuration of the PodStatus type for use // with apply. type PodStatusApplyConfiguration struct { Phase *v1.PodPhase `json:"phase,omitempty"` Conditions []PodConditionApplyConfiguration `json:"conditions,omitempty"` Message *string `json:"message,omitempty"` Reason *string `json:"reason,omitempty"` NominatedNodeName *string `json:"nominatedNodeName,omitempty"` HostIP *string `json:"hostIP,omitempty"` HostIPs []HostIPApplyConfiguration `json:"hostIPs,omitempty"` PodIP *string `json:"podIP,omitempty"` PodIPs []PodIPApplyConfiguration `json:"podIPs,omitempty"` StartTime *metav1.Time `json:"startTime,omitempty"` InitContainerStatuses []ContainerStatusApplyConfiguration `json:"initContainerStatuses,omitempty"` ContainerStatuses []ContainerStatusApplyConfiguration `json:"containerStatuses,omitempty"` QOSClass *v1.PodQOSClass `json:"qosClass,omitempty"` EphemeralContainerStatuses []ContainerStatusApplyConfiguration `json:"ephemeralContainerStatuses,omitempty"` Resize *v1.PodResizeStatus `json:"resize,omitempty"` ResourceClaimStatuses []PodResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"` } // PodStatusApplyConfiguration constructs a declarative configuration of the PodStatus type for use with // apply. func PodStatus() *PodStatusApplyConfiguration { return &PodStatusApplyConfiguration{} } // WithPhase sets the Phase field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Phase field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithPhase(value v1.PodPhase) *PodStatusApplyConfiguration { b.Phase = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *PodStatusApplyConfiguration) WithConditions(values ...*PodConditionApplyConfiguration) *PodStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithMessage(value string) *PodStatusApplyConfiguration { b.Message = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithReason(value string) *PodStatusApplyConfiguration { b.Reason = &value return b } // WithNominatedNodeName sets the NominatedNodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NominatedNodeName field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithNominatedNodeName(value string) *PodStatusApplyConfiguration { b.NominatedNodeName = &value return b } // WithHostIP sets the HostIP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostIP field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithHostIP(value string) *PodStatusApplyConfiguration { b.HostIP = &value return b } // WithHostIPs adds the given value to the HostIPs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the HostIPs field. func (b *PodStatusApplyConfiguration) WithHostIPs(values ...*HostIPApplyConfiguration) *PodStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithHostIPs") } b.HostIPs = append(b.HostIPs, *values[i]) } return b } // WithPodIP sets the PodIP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodIP field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithPodIP(value string) *PodStatusApplyConfiguration { b.PodIP = &value return b } // WithPodIPs adds the given value to the PodIPs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PodIPs field. func (b *PodStatusApplyConfiguration) WithPodIPs(values ...*PodIPApplyConfiguration) *PodStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPodIPs") } b.PodIPs = append(b.PodIPs, *values[i]) } return b } // WithStartTime sets the StartTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StartTime field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithStartTime(value metav1.Time) *PodStatusApplyConfiguration { b.StartTime = &value return b } // WithInitContainerStatuses adds the given value to the InitContainerStatuses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the InitContainerStatuses field. func (b *PodStatusApplyConfiguration) WithInitContainerStatuses(values ...*ContainerStatusApplyConfiguration) *PodStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithInitContainerStatuses") } b.InitContainerStatuses = append(b.InitContainerStatuses, *values[i]) } return b } // WithContainerStatuses adds the given value to the ContainerStatuses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ContainerStatuses field. func (b *PodStatusApplyConfiguration) WithContainerStatuses(values ...*ContainerStatusApplyConfiguration) *PodStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithContainerStatuses") } b.ContainerStatuses = append(b.ContainerStatuses, *values[i]) } return b } // WithQOSClass sets the QOSClass field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the QOSClass field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithQOSClass(value v1.PodQOSClass) *PodStatusApplyConfiguration { b.QOSClass = &value return b } // WithEphemeralContainerStatuses adds the given value to the EphemeralContainerStatuses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the EphemeralContainerStatuses field. func (b *PodStatusApplyConfiguration) WithEphemeralContainerStatuses(values ...*ContainerStatusApplyConfiguration) *PodStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEphemeralContainerStatuses") } b.EphemeralContainerStatuses = append(b.EphemeralContainerStatuses, *values[i]) } return b } // WithResize sets the Resize field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resize field is set to the value of the last call. func (b *PodStatusApplyConfiguration) WithResize(value v1.PodResizeStatus) *PodStatusApplyConfiguration { b.Resize = &value return b } // WithResourceClaimStatuses adds the given value to the ResourceClaimStatuses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceClaimStatuses field. func (b *PodStatusApplyConfiguration) WithResourceClaimStatuses(values ...*PodResourceClaimStatusApplyConfiguration) *PodStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceClaimStatuses") } b.ResourceClaimStatuses = append(b.ResourceClaimStatuses, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podtemplate.go000066400000000000000000000276271472614177300266410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodTemplateApplyConfiguration represents a declarative configuration of the PodTemplate type for use // with apply. type PodTemplateApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Template *PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } // PodTemplate constructs a declarative configuration of the PodTemplate type for use with // apply. func PodTemplate(name, namespace string) *PodTemplateApplyConfiguration { b := &PodTemplateApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("PodTemplate") b.WithAPIVersion("v1") return b } // ExtractPodTemplate extracts the applied configuration owned by fieldManager from // podTemplate. If no managedFields are found in podTemplate for fieldManager, a // PodTemplateApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // podTemplate must be a unmodified PodTemplate API object that was retrieved from the Kubernetes API. // ExtractPodTemplate provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPodTemplate(podTemplate *apicorev1.PodTemplate, fieldManager string) (*PodTemplateApplyConfiguration, error) { return extractPodTemplate(podTemplate, fieldManager, "") } // ExtractPodTemplateStatus is the same as ExtractPodTemplate except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPodTemplateStatus(podTemplate *apicorev1.PodTemplate, fieldManager string) (*PodTemplateApplyConfiguration, error) { return extractPodTemplate(podTemplate, fieldManager, "status") } func extractPodTemplate(podTemplate *apicorev1.PodTemplate, fieldManager string, subresource string) (*PodTemplateApplyConfiguration, error) { b := &PodTemplateApplyConfiguration{} err := managedfields.ExtractInto(podTemplate, internal.Parser().Type("io.k8s.api.core.v1.PodTemplate"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(podTemplate.Name) b.WithNamespace(podTemplate.Namespace) b.WithKind("PodTemplate") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithKind(value string) *PodTemplateApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithAPIVersion(value string) *PodTemplateApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithName(value string) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithGenerateName(value string) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithNamespace(value string) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithUID(value types.UID) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithResourceVersion(value string) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithGeneration(value int64) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PodTemplateApplyConfiguration) WithLabels(entries map[string]string) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PodTemplateApplyConfiguration) WithAnnotations(entries map[string]string) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PodTemplateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PodTemplateApplyConfiguration) WithFinalizers(values ...string) *PodTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PodTemplateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *PodTemplateApplyConfiguration) WithTemplate(value *PodTemplateSpecApplyConfiguration) *PodTemplateApplyConfiguration { b.Template = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PodTemplateApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/podtemplatespec.go000066400000000000000000000217751472614177300275120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodTemplateSpecApplyConfiguration represents a declarative configuration of the PodTemplateSpec type for use // with apply. type PodTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PodSpecApplyConfiguration `json:"spec,omitempty"` } // PodTemplateSpecApplyConfiguration constructs a declarative configuration of the PodTemplateSpec type for use with // apply. func PodTemplateSpec() *PodTemplateSpecApplyConfiguration { return &PodTemplateSpecApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithName(value string) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithGenerateName(value string) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithNamespace(value string) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithUID(value types.UID) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithResourceVersion(value string) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithGeneration(value int64) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PodTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PodTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PodTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PodTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *PodTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PodTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PodTemplateSpecApplyConfiguration) WithSpec(value *PodSpecApplyConfiguration) *PodTemplateSpecApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PodTemplateSpecApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/portstatus.go000066400000000000000000000045241472614177300265420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // PortStatusApplyConfiguration represents a declarative configuration of the PortStatus type for use // with apply. type PortStatusApplyConfiguration struct { Port *int32 `json:"port,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` Error *string `json:"error,omitempty"` } // PortStatusApplyConfiguration constructs a declarative configuration of the PortStatus type for use with // apply. func PortStatus() *PortStatusApplyConfiguration { return &PortStatusApplyConfiguration{} } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *PortStatusApplyConfiguration) WithPort(value int32) *PortStatusApplyConfiguration { b.Port = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *PortStatusApplyConfiguration) WithProtocol(value v1.Protocol) *PortStatusApplyConfiguration { b.Protocol = &value return b } // WithError sets the Error field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Error field is set to the value of the last call. func (b *PortStatusApplyConfiguration) WithError(value string) *PortStatusApplyConfiguration { b.Error = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/portworxvolumesource.go000066400000000000000000000047041472614177300306670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PortworxVolumeSourceApplyConfiguration represents a declarative configuration of the PortworxVolumeSource type for use // with apply. type PortworxVolumeSourceApplyConfiguration struct { VolumeID *string `json:"volumeID,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // PortworxVolumeSourceApplyConfiguration constructs a declarative configuration of the PortworxVolumeSource type for use with // apply. func PortworxVolumeSource() *PortworxVolumeSourceApplyConfiguration { return &PortworxVolumeSourceApplyConfiguration{} } // WithVolumeID sets the VolumeID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeID field is set to the value of the last call. func (b *PortworxVolumeSourceApplyConfiguration) WithVolumeID(value string) *PortworxVolumeSourceApplyConfiguration { b.VolumeID = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *PortworxVolumeSourceApplyConfiguration) WithFSType(value string) *PortworxVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *PortworxVolumeSourceApplyConfiguration) WithReadOnly(value bool) *PortworxVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/preferredschedulingterm.go000066400000000000000000000041621472614177300312240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PreferredSchedulingTermApplyConfiguration represents a declarative configuration of the PreferredSchedulingTerm type for use // with apply. type PreferredSchedulingTermApplyConfiguration struct { Weight *int32 `json:"weight,omitempty"` Preference *NodeSelectorTermApplyConfiguration `json:"preference,omitempty"` } // PreferredSchedulingTermApplyConfiguration constructs a declarative configuration of the PreferredSchedulingTerm type for use with // apply. func PreferredSchedulingTerm() *PreferredSchedulingTermApplyConfiguration { return &PreferredSchedulingTermApplyConfiguration{} } // WithWeight sets the Weight field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Weight field is set to the value of the last call. func (b *PreferredSchedulingTermApplyConfiguration) WithWeight(value int32) *PreferredSchedulingTermApplyConfiguration { b.Weight = &value return b } // WithPreference sets the Preference field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Preference field is set to the value of the last call. func (b *PreferredSchedulingTermApplyConfiguration) WithPreference(value *NodeSelectorTermApplyConfiguration) *PreferredSchedulingTermApplyConfiguration { b.Preference = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/probe.go000066400000000000000000000132661472614177300254240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ProbeApplyConfiguration represents a declarative configuration of the Probe type for use // with apply. type ProbeApplyConfiguration struct { ProbeHandlerApplyConfiguration `json:",inline"` InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` PeriodSeconds *int32 `json:"periodSeconds,omitempty"` SuccessThreshold *int32 `json:"successThreshold,omitempty"` FailureThreshold *int32 `json:"failureThreshold,omitempty"` TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` } // ProbeApplyConfiguration constructs a declarative configuration of the Probe type for use with // apply. func Probe() *ProbeApplyConfiguration { return &ProbeApplyConfiguration{} } // WithExec sets the Exec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Exec field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *ProbeApplyConfiguration { b.Exec = value return b } // WithHTTPGet sets the HTTPGet field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTPGet field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *ProbeApplyConfiguration { b.HTTPGet = value return b } // WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TCPSocket field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *ProbeApplyConfiguration { b.TCPSocket = value return b } // WithGRPC sets the GRPC field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GRPC field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithGRPC(value *GRPCActionApplyConfiguration) *ProbeApplyConfiguration { b.GRPC = value return b } // WithInitialDelaySeconds sets the InitialDelaySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InitialDelaySeconds field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithInitialDelaySeconds(value int32) *ProbeApplyConfiguration { b.InitialDelaySeconds = &value return b } // WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeoutSeconds field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithTimeoutSeconds(value int32) *ProbeApplyConfiguration { b.TimeoutSeconds = &value return b } // WithPeriodSeconds sets the PeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PeriodSeconds field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithPeriodSeconds(value int32) *ProbeApplyConfiguration { b.PeriodSeconds = &value return b } // WithSuccessThreshold sets the SuccessThreshold field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SuccessThreshold field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithSuccessThreshold(value int32) *ProbeApplyConfiguration { b.SuccessThreshold = &value return b } // WithFailureThreshold sets the FailureThreshold field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FailureThreshold field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithFailureThreshold(value int32) *ProbeApplyConfiguration { b.FailureThreshold = &value return b } // WithTerminationGracePeriodSeconds sets the TerminationGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TerminationGracePeriodSeconds field is set to the value of the last call. func (b *ProbeApplyConfiguration) WithTerminationGracePeriodSeconds(value int64) *ProbeApplyConfiguration { b.TerminationGracePeriodSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/probehandler.go000066400000000000000000000057151472614177300267620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ProbeHandlerApplyConfiguration represents a declarative configuration of the ProbeHandler type for use // with apply. type ProbeHandlerApplyConfiguration struct { Exec *ExecActionApplyConfiguration `json:"exec,omitempty"` HTTPGet *HTTPGetActionApplyConfiguration `json:"httpGet,omitempty"` TCPSocket *TCPSocketActionApplyConfiguration `json:"tcpSocket,omitempty"` GRPC *GRPCActionApplyConfiguration `json:"grpc,omitempty"` } // ProbeHandlerApplyConfiguration constructs a declarative configuration of the ProbeHandler type for use with // apply. func ProbeHandler() *ProbeHandlerApplyConfiguration { return &ProbeHandlerApplyConfiguration{} } // WithExec sets the Exec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Exec field is set to the value of the last call. func (b *ProbeHandlerApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *ProbeHandlerApplyConfiguration { b.Exec = value return b } // WithHTTPGet sets the HTTPGet field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTPGet field is set to the value of the last call. func (b *ProbeHandlerApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *ProbeHandlerApplyConfiguration { b.HTTPGet = value return b } // WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TCPSocket field is set to the value of the last call. func (b *ProbeHandlerApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *ProbeHandlerApplyConfiguration { b.TCPSocket = value return b } // WithGRPC sets the GRPC field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GRPC field is set to the value of the last call. func (b *ProbeHandlerApplyConfiguration) WithGRPC(value *GRPCActionApplyConfiguration) *ProbeHandlerApplyConfiguration { b.GRPC = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/projectedvolumesource.go000066400000000000000000000043671472614177300307470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ProjectedVolumeSourceApplyConfiguration represents a declarative configuration of the ProjectedVolumeSource type for use // with apply. type ProjectedVolumeSourceApplyConfiguration struct { Sources []VolumeProjectionApplyConfiguration `json:"sources,omitempty"` DefaultMode *int32 `json:"defaultMode,omitempty"` } // ProjectedVolumeSourceApplyConfiguration constructs a declarative configuration of the ProjectedVolumeSource type for use with // apply. func ProjectedVolumeSource() *ProjectedVolumeSourceApplyConfiguration { return &ProjectedVolumeSourceApplyConfiguration{} } // WithSources adds the given value to the Sources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Sources field. func (b *ProjectedVolumeSourceApplyConfiguration) WithSources(values ...*VolumeProjectionApplyConfiguration) *ProjectedVolumeSourceApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSources") } b.Sources = append(b.Sources, *values[i]) } return b } // WithDefaultMode sets the DefaultMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DefaultMode field is set to the value of the last call. func (b *ProjectedVolumeSourceApplyConfiguration) WithDefaultMode(value int32) *ProjectedVolumeSourceApplyConfiguration { b.DefaultMode = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/quobytevolumesource.go000066400000000000000000000074131472614177300304530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // QuobyteVolumeSourceApplyConfiguration represents a declarative configuration of the QuobyteVolumeSource type for use // with apply. type QuobyteVolumeSourceApplyConfiguration struct { Registry *string `json:"registry,omitempty"` Volume *string `json:"volume,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` User *string `json:"user,omitempty"` Group *string `json:"group,omitempty"` Tenant *string `json:"tenant,omitempty"` } // QuobyteVolumeSourceApplyConfiguration constructs a declarative configuration of the QuobyteVolumeSource type for use with // apply. func QuobyteVolumeSource() *QuobyteVolumeSourceApplyConfiguration { return &QuobyteVolumeSourceApplyConfiguration{} } // WithRegistry sets the Registry field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Registry field is set to the value of the last call. func (b *QuobyteVolumeSourceApplyConfiguration) WithRegistry(value string) *QuobyteVolumeSourceApplyConfiguration { b.Registry = &value return b } // WithVolume sets the Volume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Volume field is set to the value of the last call. func (b *QuobyteVolumeSourceApplyConfiguration) WithVolume(value string) *QuobyteVolumeSourceApplyConfiguration { b.Volume = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *QuobyteVolumeSourceApplyConfiguration) WithReadOnly(value bool) *QuobyteVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *QuobyteVolumeSourceApplyConfiguration) WithUser(value string) *QuobyteVolumeSourceApplyConfiguration { b.User = &value return b } // WithGroup sets the Group field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *QuobyteVolumeSourceApplyConfiguration) WithGroup(value string) *QuobyteVolumeSourceApplyConfiguration { b.Group = &value return b } // WithTenant sets the Tenant field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Tenant field is set to the value of the last call. func (b *QuobyteVolumeSourceApplyConfiguration) WithTenant(value string) *QuobyteVolumeSourceApplyConfiguration { b.Tenant = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/rbdpersistentvolumesource.go000066400000000000000000000123471472614177300316550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // RBDPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the RBDPersistentVolumeSource type for use // with apply. type RBDPersistentVolumeSourceApplyConfiguration struct { CephMonitors []string `json:"monitors,omitempty"` RBDImage *string `json:"image,omitempty"` FSType *string `json:"fsType,omitempty"` RBDPool *string `json:"pool,omitempty"` RadosUser *string `json:"user,omitempty"` Keyring *string `json:"keyring,omitempty"` SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // RBDPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the RBDPersistentVolumeSource type for use with // apply. func RBDPersistentVolumeSource() *RBDPersistentVolumeSourceApplyConfiguration { return &RBDPersistentVolumeSourceApplyConfiguration{} } // WithCephMonitors adds the given value to the CephMonitors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CephMonitors field. func (b *RBDPersistentVolumeSourceApplyConfiguration) WithCephMonitors(values ...string) *RBDPersistentVolumeSourceApplyConfiguration { for i := range values { b.CephMonitors = append(b.CephMonitors, values[i]) } return b } // WithRBDImage sets the RBDImage field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RBDImage field is set to the value of the last call. func (b *RBDPersistentVolumeSourceApplyConfiguration) WithRBDImage(value string) *RBDPersistentVolumeSourceApplyConfiguration { b.RBDImage = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *RBDPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *RBDPersistentVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithRBDPool sets the RBDPool field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RBDPool field is set to the value of the last call. func (b *RBDPersistentVolumeSourceApplyConfiguration) WithRBDPool(value string) *RBDPersistentVolumeSourceApplyConfiguration { b.RBDPool = &value return b } // WithRadosUser sets the RadosUser field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RadosUser field is set to the value of the last call. func (b *RBDPersistentVolumeSourceApplyConfiguration) WithRadosUser(value string) *RBDPersistentVolumeSourceApplyConfiguration { b.RadosUser = &value return b } // WithKeyring sets the Keyring field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Keyring field is set to the value of the last call. func (b *RBDPersistentVolumeSourceApplyConfiguration) WithKeyring(value string) *RBDPersistentVolumeSourceApplyConfiguration { b.Keyring = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *RBDPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *RBDPersistentVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *RBDPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *RBDPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/rbdvolumesource.go000066400000000000000000000120441472614177300275260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // RBDVolumeSourceApplyConfiguration represents a declarative configuration of the RBDVolumeSource type for use // with apply. type RBDVolumeSourceApplyConfiguration struct { CephMonitors []string `json:"monitors,omitempty"` RBDImage *string `json:"image,omitempty"` FSType *string `json:"fsType,omitempty"` RBDPool *string `json:"pool,omitempty"` RadosUser *string `json:"user,omitempty"` Keyring *string `json:"keyring,omitempty"` SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // RBDVolumeSourceApplyConfiguration constructs a declarative configuration of the RBDVolumeSource type for use with // apply. func RBDVolumeSource() *RBDVolumeSourceApplyConfiguration { return &RBDVolumeSourceApplyConfiguration{} } // WithCephMonitors adds the given value to the CephMonitors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CephMonitors field. func (b *RBDVolumeSourceApplyConfiguration) WithCephMonitors(values ...string) *RBDVolumeSourceApplyConfiguration { for i := range values { b.CephMonitors = append(b.CephMonitors, values[i]) } return b } // WithRBDImage sets the RBDImage field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RBDImage field is set to the value of the last call. func (b *RBDVolumeSourceApplyConfiguration) WithRBDImage(value string) *RBDVolumeSourceApplyConfiguration { b.RBDImage = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *RBDVolumeSourceApplyConfiguration) WithFSType(value string) *RBDVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithRBDPool sets the RBDPool field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RBDPool field is set to the value of the last call. func (b *RBDVolumeSourceApplyConfiguration) WithRBDPool(value string) *RBDVolumeSourceApplyConfiguration { b.RBDPool = &value return b } // WithRadosUser sets the RadosUser field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RadosUser field is set to the value of the last call. func (b *RBDVolumeSourceApplyConfiguration) WithRadosUser(value string) *RBDVolumeSourceApplyConfiguration { b.RadosUser = &value return b } // WithKeyring sets the Keyring field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Keyring field is set to the value of the last call. func (b *RBDVolumeSourceApplyConfiguration) WithKeyring(value string) *RBDVolumeSourceApplyConfiguration { b.Keyring = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *RBDVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *RBDVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *RBDVolumeSourceApplyConfiguration) WithReadOnly(value bool) *RBDVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/replicationcontroller.go000066400000000000000000000322601472614177300307250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ReplicationControllerApplyConfiguration represents a declarative configuration of the ReplicationController type for use // with apply. type ReplicationControllerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ReplicationControllerSpecApplyConfiguration `json:"spec,omitempty"` Status *ReplicationControllerStatusApplyConfiguration `json:"status,omitempty"` } // ReplicationController constructs a declarative configuration of the ReplicationController type for use with // apply. func ReplicationController(name, namespace string) *ReplicationControllerApplyConfiguration { b := &ReplicationControllerApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ReplicationController") b.WithAPIVersion("v1") return b } // ExtractReplicationController extracts the applied configuration owned by fieldManager from // replicationController. If no managedFields are found in replicationController for fieldManager, a // ReplicationControllerApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // replicationController must be a unmodified ReplicationController API object that was retrieved from the Kubernetes API. // ExtractReplicationController provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractReplicationController(replicationController *apicorev1.ReplicationController, fieldManager string) (*ReplicationControllerApplyConfiguration, error) { return extractReplicationController(replicationController, fieldManager, "") } // ExtractReplicationControllerStatus is the same as ExtractReplicationController except // that it extracts the status subresource applied configuration. // Experimental! func ExtractReplicationControllerStatus(replicationController *apicorev1.ReplicationController, fieldManager string) (*ReplicationControllerApplyConfiguration, error) { return extractReplicationController(replicationController, fieldManager, "status") } func extractReplicationController(replicationController *apicorev1.ReplicationController, fieldManager string, subresource string) (*ReplicationControllerApplyConfiguration, error) { b := &ReplicationControllerApplyConfiguration{} err := managedfields.ExtractInto(replicationController, internal.Parser().Type("io.k8s.api.core.v1.ReplicationController"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(replicationController.Name) b.WithNamespace(replicationController.Namespace) b.WithKind("ReplicationController") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithKind(value string) *ReplicationControllerApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithAPIVersion(value string) *ReplicationControllerApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithName(value string) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithGenerateName(value string) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithNamespace(value string) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithUID(value types.UID) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithResourceVersion(value string) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithGeneration(value int64) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ReplicationControllerApplyConfiguration) WithLabels(entries map[string]string) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ReplicationControllerApplyConfiguration) WithAnnotations(entries map[string]string) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ReplicationControllerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ReplicationControllerApplyConfiguration) WithFinalizers(values ...string) *ReplicationControllerApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ReplicationControllerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithSpec(value *ReplicationControllerSpecApplyConfiguration) *ReplicationControllerApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ReplicationControllerApplyConfiguration) WithStatus(value *ReplicationControllerStatusApplyConfiguration) *ReplicationControllerApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ReplicationControllerApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/replicationcontrollercondition.go000066400000000000000000000076231472614177300326410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ReplicationControllerConditionApplyConfiguration represents a declarative configuration of the ReplicationControllerCondition type for use // with apply. type ReplicationControllerConditionApplyConfiguration struct { Type *v1.ReplicationControllerConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // ReplicationControllerConditionApplyConfiguration constructs a declarative configuration of the ReplicationControllerCondition type for use with // apply. func ReplicationControllerCondition() *ReplicationControllerConditionApplyConfiguration { return &ReplicationControllerConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *ReplicationControllerConditionApplyConfiguration) WithType(value v1.ReplicationControllerConditionType) *ReplicationControllerConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ReplicationControllerConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ReplicationControllerConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *ReplicationControllerConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ReplicationControllerConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ReplicationControllerConditionApplyConfiguration) WithReason(value string) *ReplicationControllerConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ReplicationControllerConditionApplyConfiguration) WithMessage(value string) *ReplicationControllerConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/replicationcontrollerspec.go000066400000000000000000000066561472614177300316120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ReplicationControllerSpecApplyConfiguration represents a declarative configuration of the ReplicationControllerSpec type for use // with apply. type ReplicationControllerSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` Selector map[string]string `json:"selector,omitempty"` Template *PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } // ReplicationControllerSpecApplyConfiguration constructs a declarative configuration of the ReplicationControllerSpec type for use with // apply. func ReplicationControllerSpec() *ReplicationControllerSpecApplyConfiguration { return &ReplicationControllerSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ReplicationControllerSpecApplyConfiguration) WithReplicas(value int32) *ReplicationControllerSpecApplyConfiguration { b.Replicas = &value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *ReplicationControllerSpecApplyConfiguration) WithMinReadySeconds(value int32) *ReplicationControllerSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithSelector puts the entries into the Selector field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Selector field, // overwriting an existing map entries in Selector field with the same key. func (b *ReplicationControllerSpecApplyConfiguration) WithSelector(entries map[string]string) *ReplicationControllerSpecApplyConfiguration { if b.Selector == nil && len(entries) > 0 { b.Selector = make(map[string]string, len(entries)) } for k, v := range entries { b.Selector[k] = v } return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *ReplicationControllerSpecApplyConfiguration) WithTemplate(value *PodTemplateSpecApplyConfiguration) *ReplicationControllerSpecApplyConfiguration { b.Template = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/replicationcontrollerstatus.go000066400000000000000000000113251472614177300321700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ReplicationControllerStatusApplyConfiguration represents a declarative configuration of the ReplicationControllerStatus type for use // with apply. type ReplicationControllerStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Conditions []ReplicationControllerConditionApplyConfiguration `json:"conditions,omitempty"` } // ReplicationControllerStatusApplyConfiguration constructs a declarative configuration of the ReplicationControllerStatus type for use with // apply. func ReplicationControllerStatus() *ReplicationControllerStatusApplyConfiguration { return &ReplicationControllerStatusApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ReplicationControllerStatusApplyConfiguration) WithReplicas(value int32) *ReplicationControllerStatusApplyConfiguration { b.Replicas = &value return b } // WithFullyLabeledReplicas sets the FullyLabeledReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FullyLabeledReplicas field is set to the value of the last call. func (b *ReplicationControllerStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *ReplicationControllerStatusApplyConfiguration { b.FullyLabeledReplicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *ReplicationControllerStatusApplyConfiguration) WithReadyReplicas(value int32) *ReplicationControllerStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *ReplicationControllerStatusApplyConfiguration) WithAvailableReplicas(value int32) *ReplicationControllerStatusApplyConfiguration { b.AvailableReplicas = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *ReplicationControllerStatusApplyConfiguration) WithObservedGeneration(value int64) *ReplicationControllerStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ReplicationControllerStatusApplyConfiguration) WithConditions(values ...*ReplicationControllerConditionApplyConfiguration) *ReplicationControllerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/resourceclaim.go000066400000000000000000000036031472614177300271440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ResourceClaimApplyConfiguration represents a declarative configuration of the ResourceClaim type for use // with apply. type ResourceClaimApplyConfiguration struct { Name *string `json:"name,omitempty"` Request *string `json:"request,omitempty"` } // ResourceClaimApplyConfiguration constructs a declarative configuration of the ResourceClaim type for use with // apply. func ResourceClaim() *ResourceClaimApplyConfiguration { return &ResourceClaimApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithName(value string) *ResourceClaimApplyConfiguration { b.Name = &value return b } // WithRequest sets the Request field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Request field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithRequest(value string) *ResourceClaimApplyConfiguration { b.Request = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/resourcefieldselector.go000066400000000000000000000051601472614177300307030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( resource "k8s.io/apimachinery/pkg/api/resource" ) // ResourceFieldSelectorApplyConfiguration represents a declarative configuration of the ResourceFieldSelector type for use // with apply. type ResourceFieldSelectorApplyConfiguration struct { ContainerName *string `json:"containerName,omitempty"` Resource *string `json:"resource,omitempty"` Divisor *resource.Quantity `json:"divisor,omitempty"` } // ResourceFieldSelectorApplyConfiguration constructs a declarative configuration of the ResourceFieldSelector type for use with // apply. func ResourceFieldSelector() *ResourceFieldSelectorApplyConfiguration { return &ResourceFieldSelectorApplyConfiguration{} } // WithContainerName sets the ContainerName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContainerName field is set to the value of the last call. func (b *ResourceFieldSelectorApplyConfiguration) WithContainerName(value string) *ResourceFieldSelectorApplyConfiguration { b.ContainerName = &value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *ResourceFieldSelectorApplyConfiguration) WithResource(value string) *ResourceFieldSelectorApplyConfiguration { b.Resource = &value return b } // WithDivisor sets the Divisor field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Divisor field is set to the value of the last call. func (b *ResourceFieldSelectorApplyConfiguration) WithDivisor(value resource.Quantity) *ResourceFieldSelectorApplyConfiguration { b.Divisor = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/resourcehealth.go000066400000000000000000000040221472614177300273200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ResourceHealthApplyConfiguration represents a declarative configuration of the ResourceHealth type for use // with apply. type ResourceHealthApplyConfiguration struct { ResourceID *v1.ResourceID `json:"resourceID,omitempty"` Health *v1.ResourceHealthStatus `json:"health,omitempty"` } // ResourceHealthApplyConfiguration constructs a declarative configuration of the ResourceHealth type for use with // apply. func ResourceHealth() *ResourceHealthApplyConfiguration { return &ResourceHealthApplyConfiguration{} } // WithResourceID sets the ResourceID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceID field is set to the value of the last call. func (b *ResourceHealthApplyConfiguration) WithResourceID(value v1.ResourceID) *ResourceHealthApplyConfiguration { b.ResourceID = &value return b } // WithHealth sets the Health field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Health field is set to the value of the last call. func (b *ResourceHealthApplyConfiguration) WithHealth(value v1.ResourceHealthStatus) *ResourceHealthApplyConfiguration { b.Health = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/resourcequota.go000066400000000000000000000310601472614177300272060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ResourceQuotaApplyConfiguration represents a declarative configuration of the ResourceQuota type for use // with apply. type ResourceQuotaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ResourceQuotaSpecApplyConfiguration `json:"spec,omitempty"` Status *ResourceQuotaStatusApplyConfiguration `json:"status,omitempty"` } // ResourceQuota constructs a declarative configuration of the ResourceQuota type for use with // apply. func ResourceQuota(name, namespace string) *ResourceQuotaApplyConfiguration { b := &ResourceQuotaApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceQuota") b.WithAPIVersion("v1") return b } // ExtractResourceQuota extracts the applied configuration owned by fieldManager from // resourceQuota. If no managedFields are found in resourceQuota for fieldManager, a // ResourceQuotaApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // resourceQuota must be a unmodified ResourceQuota API object that was retrieved from the Kubernetes API. // ExtractResourceQuota provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractResourceQuota(resourceQuota *apicorev1.ResourceQuota, fieldManager string) (*ResourceQuotaApplyConfiguration, error) { return extractResourceQuota(resourceQuota, fieldManager, "") } // ExtractResourceQuotaStatus is the same as ExtractResourceQuota except // that it extracts the status subresource applied configuration. // Experimental! func ExtractResourceQuotaStatus(resourceQuota *apicorev1.ResourceQuota, fieldManager string) (*ResourceQuotaApplyConfiguration, error) { return extractResourceQuota(resourceQuota, fieldManager, "status") } func extractResourceQuota(resourceQuota *apicorev1.ResourceQuota, fieldManager string, subresource string) (*ResourceQuotaApplyConfiguration, error) { b := &ResourceQuotaApplyConfiguration{} err := managedfields.ExtractInto(resourceQuota, internal.Parser().Type("io.k8s.api.core.v1.ResourceQuota"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(resourceQuota.Name) b.WithNamespace(resourceQuota.Namespace) b.WithKind("ResourceQuota") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithKind(value string) *ResourceQuotaApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithAPIVersion(value string) *ResourceQuotaApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithName(value string) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithGenerateName(value string) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithNamespace(value string) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithUID(value types.UID) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithResourceVersion(value string) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithGeneration(value int64) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ResourceQuotaApplyConfiguration) WithLabels(entries map[string]string) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ResourceQuotaApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ResourceQuotaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ResourceQuotaApplyConfiguration) WithFinalizers(values ...string) *ResourceQuotaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ResourceQuotaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithSpec(value *ResourceQuotaSpecApplyConfiguration) *ResourceQuotaApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ResourceQuotaApplyConfiguration) WithStatus(value *ResourceQuotaStatusApplyConfiguration) *ResourceQuotaApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ResourceQuotaApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/resourcequotaspec.go000066400000000000000000000052241472614177300300640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ResourceQuotaSpecApplyConfiguration represents a declarative configuration of the ResourceQuotaSpec type for use // with apply. type ResourceQuotaSpecApplyConfiguration struct { Hard *v1.ResourceList `json:"hard,omitempty"` Scopes []v1.ResourceQuotaScope `json:"scopes,omitempty"` ScopeSelector *ScopeSelectorApplyConfiguration `json:"scopeSelector,omitempty"` } // ResourceQuotaSpecApplyConfiguration constructs a declarative configuration of the ResourceQuotaSpec type for use with // apply. func ResourceQuotaSpec() *ResourceQuotaSpecApplyConfiguration { return &ResourceQuotaSpecApplyConfiguration{} } // WithHard sets the Hard field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hard field is set to the value of the last call. func (b *ResourceQuotaSpecApplyConfiguration) WithHard(value v1.ResourceList) *ResourceQuotaSpecApplyConfiguration { b.Hard = &value return b } // WithScopes adds the given value to the Scopes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Scopes field. func (b *ResourceQuotaSpecApplyConfiguration) WithScopes(values ...v1.ResourceQuotaScope) *ResourceQuotaSpecApplyConfiguration { for i := range values { b.Scopes = append(b.Scopes, values[i]) } return b } // WithScopeSelector sets the ScopeSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScopeSelector field is set to the value of the last call. func (b *ResourceQuotaSpecApplyConfiguration) WithScopeSelector(value *ScopeSelectorApplyConfiguration) *ResourceQuotaSpecApplyConfiguration { b.ScopeSelector = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/resourcequotastatus.go000066400000000000000000000037741472614177300304650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ResourceQuotaStatusApplyConfiguration represents a declarative configuration of the ResourceQuotaStatus type for use // with apply. type ResourceQuotaStatusApplyConfiguration struct { Hard *v1.ResourceList `json:"hard,omitempty"` Used *v1.ResourceList `json:"used,omitempty"` } // ResourceQuotaStatusApplyConfiguration constructs a declarative configuration of the ResourceQuotaStatus type for use with // apply. func ResourceQuotaStatus() *ResourceQuotaStatusApplyConfiguration { return &ResourceQuotaStatusApplyConfiguration{} } // WithHard sets the Hard field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hard field is set to the value of the last call. func (b *ResourceQuotaStatusApplyConfiguration) WithHard(value v1.ResourceList) *ResourceQuotaStatusApplyConfiguration { b.Hard = &value return b } // WithUsed sets the Used field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Used field is set to the value of the last call. func (b *ResourceQuotaStatusApplyConfiguration) WithUsed(value v1.ResourceList) *ResourceQuotaStatusApplyConfiguration { b.Used = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/resourcerequirements.go000066400000000000000000000053431472614177300306050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ResourceRequirementsApplyConfiguration represents a declarative configuration of the ResourceRequirements type for use // with apply. type ResourceRequirementsApplyConfiguration struct { Limits *v1.ResourceList `json:"limits,omitempty"` Requests *v1.ResourceList `json:"requests,omitempty"` Claims []ResourceClaimApplyConfiguration `json:"claims,omitempty"` } // ResourceRequirementsApplyConfiguration constructs a declarative configuration of the ResourceRequirements type for use with // apply. func ResourceRequirements() *ResourceRequirementsApplyConfiguration { return &ResourceRequirementsApplyConfiguration{} } // WithLimits sets the Limits field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Limits field is set to the value of the last call. func (b *ResourceRequirementsApplyConfiguration) WithLimits(value v1.ResourceList) *ResourceRequirementsApplyConfiguration { b.Limits = &value return b } // WithRequests sets the Requests field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Requests field is set to the value of the last call. func (b *ResourceRequirementsApplyConfiguration) WithRequests(value v1.ResourceList) *ResourceRequirementsApplyConfiguration { b.Requests = &value return b } // WithClaims adds the given value to the Claims field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Claims field. func (b *ResourceRequirementsApplyConfiguration) WithClaims(values ...*ResourceClaimApplyConfiguration) *ResourceRequirementsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithClaims") } b.Claims = append(b.Claims, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/resourcestatus.go000066400000000000000000000042561472614177300274070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ResourceStatusApplyConfiguration represents a declarative configuration of the ResourceStatus type for use // with apply. type ResourceStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Resources []ResourceHealthApplyConfiguration `json:"resources,omitempty"` } // ResourceStatusApplyConfiguration constructs a declarative configuration of the ResourceStatus type for use with // apply. func ResourceStatus() *ResourceStatusApplyConfiguration { return &ResourceStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceStatusApplyConfiguration) WithName(value v1.ResourceName) *ResourceStatusApplyConfiguration { b.Name = &value return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *ResourceStatusApplyConfiguration) WithResources(values ...*ResourceHealthApplyConfiguration) *ResourceStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResources") } b.Resources = append(b.Resources, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/scaleiopersistentvolumesource.go000066400000000000000000000146241472614177300325250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ScaleIOPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the ScaleIOPersistentVolumeSource type for use // with apply. type ScaleIOPersistentVolumeSourceApplyConfiguration struct { Gateway *string `json:"gateway,omitempty"` System *string `json:"system,omitempty"` SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` SSLEnabled *bool `json:"sslEnabled,omitempty"` ProtectionDomain *string `json:"protectionDomain,omitempty"` StoragePool *string `json:"storagePool,omitempty"` StorageMode *string `json:"storageMode,omitempty"` VolumeName *string `json:"volumeName,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // ScaleIOPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the ScaleIOPersistentVolumeSource type for use with // apply. func ScaleIOPersistentVolumeSource() *ScaleIOPersistentVolumeSourceApplyConfiguration { return &ScaleIOPersistentVolumeSourceApplyConfiguration{} } // WithGateway sets the Gateway field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Gateway field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithGateway(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.Gateway = &value return b } // WithSystem sets the System field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the System field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithSystem(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.System = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithSSLEnabled sets the SSLEnabled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SSLEnabled field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithSSLEnabled(value bool) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.SSLEnabled = &value return b } // WithProtectionDomain sets the ProtectionDomain field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProtectionDomain field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithProtectionDomain(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.ProtectionDomain = &value return b } // WithStoragePool sets the StoragePool field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StoragePool field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithStoragePool(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.StoragePool = &value return b } // WithStorageMode sets the StorageMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageMode field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithStorageMode(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.StorageMode = &value return b } // WithVolumeName sets the VolumeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeName field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithVolumeName(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.VolumeName = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *ScaleIOPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/scaleiovolumesource.go000066400000000000000000000142631472614177300304030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ScaleIOVolumeSourceApplyConfiguration represents a declarative configuration of the ScaleIOVolumeSource type for use // with apply. type ScaleIOVolumeSourceApplyConfiguration struct { Gateway *string `json:"gateway,omitempty"` System *string `json:"system,omitempty"` SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` SSLEnabled *bool `json:"sslEnabled,omitempty"` ProtectionDomain *string `json:"protectionDomain,omitempty"` StoragePool *string `json:"storagePool,omitempty"` StorageMode *string `json:"storageMode,omitempty"` VolumeName *string `json:"volumeName,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } // ScaleIOVolumeSourceApplyConfiguration constructs a declarative configuration of the ScaleIOVolumeSource type for use with // apply. func ScaleIOVolumeSource() *ScaleIOVolumeSourceApplyConfiguration { return &ScaleIOVolumeSourceApplyConfiguration{} } // WithGateway sets the Gateway field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Gateway field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithGateway(value string) *ScaleIOVolumeSourceApplyConfiguration { b.Gateway = &value return b } // WithSystem sets the System field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the System field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithSystem(value string) *ScaleIOVolumeSourceApplyConfiguration { b.System = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *ScaleIOVolumeSourceApplyConfiguration { b.SecretRef = value return b } // WithSSLEnabled sets the SSLEnabled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SSLEnabled field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithSSLEnabled(value bool) *ScaleIOVolumeSourceApplyConfiguration { b.SSLEnabled = &value return b } // WithProtectionDomain sets the ProtectionDomain field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProtectionDomain field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithProtectionDomain(value string) *ScaleIOVolumeSourceApplyConfiguration { b.ProtectionDomain = &value return b } // WithStoragePool sets the StoragePool field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StoragePool field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithStoragePool(value string) *ScaleIOVolumeSourceApplyConfiguration { b.StoragePool = &value return b } // WithStorageMode sets the StorageMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageMode field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithStorageMode(value string) *ScaleIOVolumeSourceApplyConfiguration { b.StorageMode = &value return b } // WithVolumeName sets the VolumeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeName field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithVolumeName(value string) *ScaleIOVolumeSourceApplyConfiguration { b.VolumeName = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithFSType(value string) *ScaleIOVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *ScaleIOVolumeSourceApplyConfiguration) WithReadOnly(value bool) *ScaleIOVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/scopedresourceselectorrequirement.go000066400000000000000000000055031472614177300333570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // ScopedResourceSelectorRequirementApplyConfiguration represents a declarative configuration of the ScopedResourceSelectorRequirement type for use // with apply. type ScopedResourceSelectorRequirementApplyConfiguration struct { ScopeName *v1.ResourceQuotaScope `json:"scopeName,omitempty"` Operator *v1.ScopeSelectorOperator `json:"operator,omitempty"` Values []string `json:"values,omitempty"` } // ScopedResourceSelectorRequirementApplyConfiguration constructs a declarative configuration of the ScopedResourceSelectorRequirement type for use with // apply. func ScopedResourceSelectorRequirement() *ScopedResourceSelectorRequirementApplyConfiguration { return &ScopedResourceSelectorRequirementApplyConfiguration{} } // WithScopeName sets the ScopeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScopeName field is set to the value of the last call. func (b *ScopedResourceSelectorRequirementApplyConfiguration) WithScopeName(value v1.ResourceQuotaScope) *ScopedResourceSelectorRequirementApplyConfiguration { b.ScopeName = &value return b } // WithOperator sets the Operator field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Operator field is set to the value of the last call. func (b *ScopedResourceSelectorRequirementApplyConfiguration) WithOperator(value v1.ScopeSelectorOperator) *ScopedResourceSelectorRequirementApplyConfiguration { b.Operator = &value return b } // WithValues adds the given value to the Values field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Values field. func (b *ScopedResourceSelectorRequirementApplyConfiguration) WithValues(values ...string) *ScopedResourceSelectorRequirementApplyConfiguration { for i := range values { b.Values = append(b.Values, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/scopeselector.go000066400000000000000000000034101472614177300271550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ScopeSelectorApplyConfiguration represents a declarative configuration of the ScopeSelector type for use // with apply. type ScopeSelectorApplyConfiguration struct { MatchExpressions []ScopedResourceSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` } // ScopeSelectorApplyConfiguration constructs a declarative configuration of the ScopeSelector type for use with // apply. func ScopeSelector() *ScopeSelectorApplyConfiguration { return &ScopeSelectorApplyConfiguration{} } // WithMatchExpressions adds the given value to the MatchExpressions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchExpressions field. func (b *ScopeSelectorApplyConfiguration) WithMatchExpressions(values ...*ScopedResourceSelectorRequirementApplyConfiguration) *ScopeSelectorApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchExpressions") } b.MatchExpressions = append(b.MatchExpressions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/seccompprofile.go000066400000000000000000000040511472614177300273170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // SeccompProfileApplyConfiguration represents a declarative configuration of the SeccompProfile type for use // with apply. type SeccompProfileApplyConfiguration struct { Type *v1.SeccompProfileType `json:"type,omitempty"` LocalhostProfile *string `json:"localhostProfile,omitempty"` } // SeccompProfileApplyConfiguration constructs a declarative configuration of the SeccompProfile type for use with // apply. func SeccompProfile() *SeccompProfileApplyConfiguration { return &SeccompProfileApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *SeccompProfileApplyConfiguration) WithType(value v1.SeccompProfileType) *SeccompProfileApplyConfiguration { b.Type = &value return b } // WithLocalhostProfile sets the LocalhostProfile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LocalhostProfile field is set to the value of the last call. func (b *SeccompProfileApplyConfiguration) WithLocalhostProfile(value string) *SeccompProfileApplyConfiguration { b.LocalhostProfile = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/secret.go000066400000000000000000000325051472614177300255770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // SecretApplyConfiguration represents a declarative configuration of the Secret type for use // with apply. type SecretApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Immutable *bool `json:"immutable,omitempty"` Data map[string][]byte `json:"data,omitempty"` StringData map[string]string `json:"stringData,omitempty"` Type *corev1.SecretType `json:"type,omitempty"` } // Secret constructs a declarative configuration of the Secret type for use with // apply. func Secret(name, namespace string) *SecretApplyConfiguration { b := &SecretApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Secret") b.WithAPIVersion("v1") return b } // ExtractSecret extracts the applied configuration owned by fieldManager from // secret. If no managedFields are found in secret for fieldManager, a // SecretApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // secret must be a unmodified Secret API object that was retrieved from the Kubernetes API. // ExtractSecret provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractSecret(secret *corev1.Secret, fieldManager string) (*SecretApplyConfiguration, error) { return extractSecret(secret, fieldManager, "") } // ExtractSecretStatus is the same as ExtractSecret except // that it extracts the status subresource applied configuration. // Experimental! func ExtractSecretStatus(secret *corev1.Secret, fieldManager string) (*SecretApplyConfiguration, error) { return extractSecret(secret, fieldManager, "status") } func extractSecret(secret *corev1.Secret, fieldManager string, subresource string) (*SecretApplyConfiguration, error) { b := &SecretApplyConfiguration{} err := managedfields.ExtractInto(secret, internal.Parser().Type("io.k8s.api.core.v1.Secret"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(secret.Name) b.WithNamespace(secret.Namespace) b.WithKind("Secret") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SecretApplyConfiguration) WithKind(value string) *SecretApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *SecretApplyConfiguration) WithAPIVersion(value string) *SecretApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SecretApplyConfiguration) WithName(value string) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *SecretApplyConfiguration) WithGenerateName(value string) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *SecretApplyConfiguration) WithNamespace(value string) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *SecretApplyConfiguration) WithUID(value types.UID) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *SecretApplyConfiguration) WithResourceVersion(value string) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *SecretApplyConfiguration) WithGeneration(value int64) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *SecretApplyConfiguration) WithCreationTimestamp(value metav1.Time) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *SecretApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *SecretApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *SecretApplyConfiguration) WithLabels(entries map[string]string) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *SecretApplyConfiguration) WithAnnotations(entries map[string]string) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *SecretApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *SecretApplyConfiguration) WithFinalizers(values ...string) *SecretApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *SecretApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithImmutable sets the Immutable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Immutable field is set to the value of the last call. func (b *SecretApplyConfiguration) WithImmutable(value bool) *SecretApplyConfiguration { b.Immutable = &value return b } // WithData puts the entries into the Data field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Data field, // overwriting an existing map entries in Data field with the same key. func (b *SecretApplyConfiguration) WithData(entries map[string][]byte) *SecretApplyConfiguration { if b.Data == nil && len(entries) > 0 { b.Data = make(map[string][]byte, len(entries)) } for k, v := range entries { b.Data[k] = v } return b } // WithStringData puts the entries into the StringData field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the StringData field, // overwriting an existing map entries in StringData field with the same key. func (b *SecretApplyConfiguration) WithStringData(entries map[string]string) *SecretApplyConfiguration { if b.StringData == nil && len(entries) > 0 { b.StringData = make(map[string]string, len(entries)) } for k, v := range entries { b.StringData[k] = v } return b } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *SecretApplyConfiguration) WithType(value corev1.SecretType) *SecretApplyConfiguration { b.Type = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *SecretApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/secretenvsource.go000066400000000000000000000037141472614177300275310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SecretEnvSourceApplyConfiguration represents a declarative configuration of the SecretEnvSource type for use // with apply. type SecretEnvSourceApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Optional *bool `json:"optional,omitempty"` } // SecretEnvSourceApplyConfiguration constructs a declarative configuration of the SecretEnvSource type for use with // apply. func SecretEnvSource() *SecretEnvSourceApplyConfiguration { return &SecretEnvSourceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SecretEnvSourceApplyConfiguration) WithName(value string) *SecretEnvSourceApplyConfiguration { b.Name = &value return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *SecretEnvSourceApplyConfiguration) WithOptional(value bool) *SecretEnvSourceApplyConfiguration { b.Optional = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/secretkeyselector.go000066400000000000000000000046731472614177300300560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SecretKeySelectorApplyConfiguration represents a declarative configuration of the SecretKeySelector type for use // with apply. type SecretKeySelectorApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Key *string `json:"key,omitempty"` Optional *bool `json:"optional,omitempty"` } // SecretKeySelectorApplyConfiguration constructs a declarative configuration of the SecretKeySelector type for use with // apply. func SecretKeySelector() *SecretKeySelectorApplyConfiguration { return &SecretKeySelectorApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SecretKeySelectorApplyConfiguration) WithName(value string) *SecretKeySelectorApplyConfiguration { b.Name = &value return b } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *SecretKeySelectorApplyConfiguration) WithKey(value string) *SecretKeySelectorApplyConfiguration { b.Key = &value return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *SecretKeySelectorApplyConfiguration) WithOptional(value bool) *SecretKeySelectorApplyConfiguration { b.Optional = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/secretprojection.go000066400000000000000000000052031472614177300276670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SecretProjectionApplyConfiguration represents a declarative configuration of the SecretProjection type for use // with apply. type SecretProjectionApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Items []KeyToPathApplyConfiguration `json:"items,omitempty"` Optional *bool `json:"optional,omitempty"` } // SecretProjectionApplyConfiguration constructs a declarative configuration of the SecretProjection type for use with // apply. func SecretProjection() *SecretProjectionApplyConfiguration { return &SecretProjectionApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SecretProjectionApplyConfiguration) WithName(value string) *SecretProjectionApplyConfiguration { b.Name = &value return b } // WithItems adds the given value to the Items field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Items field. func (b *SecretProjectionApplyConfiguration) WithItems(values ...*KeyToPathApplyConfiguration) *SecretProjectionApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithItems") } b.Items = append(b.Items, *values[i]) } return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *SecretProjectionApplyConfiguration) WithOptional(value bool) *SecretProjectionApplyConfiguration { b.Optional = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/secretreference.go000066400000000000000000000036531472614177300274600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SecretReferenceApplyConfiguration represents a declarative configuration of the SecretReference type for use // with apply. type SecretReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` } // SecretReferenceApplyConfiguration constructs a declarative configuration of the SecretReference type for use with // apply. func SecretReference() *SecretReferenceApplyConfiguration { return &SecretReferenceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SecretReferenceApplyConfiguration) WithName(value string) *SecretReferenceApplyConfiguration { b.Name = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *SecretReferenceApplyConfiguration) WithNamespace(value string) *SecretReferenceApplyConfiguration { b.Namespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/secretvolumesource.go000066400000000000000000000062301472614177300302440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SecretVolumeSourceApplyConfiguration represents a declarative configuration of the SecretVolumeSource type for use // with apply. type SecretVolumeSourceApplyConfiguration struct { SecretName *string `json:"secretName,omitempty"` Items []KeyToPathApplyConfiguration `json:"items,omitempty"` DefaultMode *int32 `json:"defaultMode,omitempty"` Optional *bool `json:"optional,omitempty"` } // SecretVolumeSourceApplyConfiguration constructs a declarative configuration of the SecretVolumeSource type for use with // apply. func SecretVolumeSource() *SecretVolumeSourceApplyConfiguration { return &SecretVolumeSourceApplyConfiguration{} } // WithSecretName sets the SecretName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretName field is set to the value of the last call. func (b *SecretVolumeSourceApplyConfiguration) WithSecretName(value string) *SecretVolumeSourceApplyConfiguration { b.SecretName = &value return b } // WithItems adds the given value to the Items field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Items field. func (b *SecretVolumeSourceApplyConfiguration) WithItems(values ...*KeyToPathApplyConfiguration) *SecretVolumeSourceApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithItems") } b.Items = append(b.Items, *values[i]) } return b } // WithDefaultMode sets the DefaultMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DefaultMode field is set to the value of the last call. func (b *SecretVolumeSourceApplyConfiguration) WithDefaultMode(value int32) *SecretVolumeSourceApplyConfiguration { b.DefaultMode = &value return b } // WithOptional sets the Optional field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Optional field is set to the value of the last call. func (b *SecretVolumeSourceApplyConfiguration) WithOptional(value bool) *SecretVolumeSourceApplyConfiguration { b.Optional = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/securitycontext.go000066400000000000000000000173541472614177300275730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" ) // SecurityContextApplyConfiguration represents a declarative configuration of the SecurityContext type for use // with apply. type SecurityContextApplyConfiguration struct { Capabilities *CapabilitiesApplyConfiguration `json:"capabilities,omitempty"` Privileged *bool `json:"privileged,omitempty"` SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"` RunAsUser *int64 `json:"runAsUser,omitempty"` RunAsGroup *int64 `json:"runAsGroup,omitempty"` RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"` AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"` ProcMount *corev1.ProcMountType `json:"procMount,omitempty"` SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` } // SecurityContextApplyConfiguration constructs a declarative configuration of the SecurityContext type for use with // apply. func SecurityContext() *SecurityContextApplyConfiguration { return &SecurityContextApplyConfiguration{} } // WithCapabilities sets the Capabilities field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Capabilities field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithCapabilities(value *CapabilitiesApplyConfiguration) *SecurityContextApplyConfiguration { b.Capabilities = value return b } // WithPrivileged sets the Privileged field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Privileged field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithPrivileged(value bool) *SecurityContextApplyConfiguration { b.Privileged = &value return b } // WithSELinuxOptions sets the SELinuxOptions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SELinuxOptions field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithSELinuxOptions(value *SELinuxOptionsApplyConfiguration) *SecurityContextApplyConfiguration { b.SELinuxOptions = value return b } // WithWindowsOptions sets the WindowsOptions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WindowsOptions field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithWindowsOptions(value *WindowsSecurityContextOptionsApplyConfiguration) *SecurityContextApplyConfiguration { b.WindowsOptions = value return b } // WithRunAsUser sets the RunAsUser field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RunAsUser field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithRunAsUser(value int64) *SecurityContextApplyConfiguration { b.RunAsUser = &value return b } // WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RunAsGroup field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithRunAsGroup(value int64) *SecurityContextApplyConfiguration { b.RunAsGroup = &value return b } // WithRunAsNonRoot sets the RunAsNonRoot field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RunAsNonRoot field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithRunAsNonRoot(value bool) *SecurityContextApplyConfiguration { b.RunAsNonRoot = &value return b } // WithReadOnlyRootFilesystem sets the ReadOnlyRootFilesystem field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnlyRootFilesystem field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithReadOnlyRootFilesystem(value bool) *SecurityContextApplyConfiguration { b.ReadOnlyRootFilesystem = &value return b } // WithAllowPrivilegeEscalation sets the AllowPrivilegeEscalation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllowPrivilegeEscalation field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithAllowPrivilegeEscalation(value bool) *SecurityContextApplyConfiguration { b.AllowPrivilegeEscalation = &value return b } // WithProcMount sets the ProcMount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProcMount field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithProcMount(value corev1.ProcMountType) *SecurityContextApplyConfiguration { b.ProcMount = &value return b } // WithSeccompProfile sets the SeccompProfile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SeccompProfile field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompProfileApplyConfiguration) *SecurityContextApplyConfiguration { b.SeccompProfile = value return b } // WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AppArmorProfile field is set to the value of the last call. func (b *SecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *SecurityContextApplyConfiguration { b.AppArmorProfile = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/selinuxoptions.go000066400000000000000000000053471472614177300274210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SELinuxOptionsApplyConfiguration represents a declarative configuration of the SELinuxOptions type for use // with apply. type SELinuxOptionsApplyConfiguration struct { User *string `json:"user,omitempty"` Role *string `json:"role,omitempty"` Type *string `json:"type,omitempty"` Level *string `json:"level,omitempty"` } // SELinuxOptionsApplyConfiguration constructs a declarative configuration of the SELinuxOptions type for use with // apply. func SELinuxOptions() *SELinuxOptionsApplyConfiguration { return &SELinuxOptionsApplyConfiguration{} } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *SELinuxOptionsApplyConfiguration) WithUser(value string) *SELinuxOptionsApplyConfiguration { b.User = &value return b } // WithRole sets the Role field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Role field is set to the value of the last call. func (b *SELinuxOptionsApplyConfiguration) WithRole(value string) *SELinuxOptionsApplyConfiguration { b.Role = &value return b } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *SELinuxOptionsApplyConfiguration) WithType(value string) *SELinuxOptionsApplyConfiguration { b.Type = &value return b } // WithLevel sets the Level field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Level field is set to the value of the last call. func (b *SELinuxOptionsApplyConfiguration) WithLevel(value string) *SELinuxOptionsApplyConfiguration { b.Level = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/service.go000066400000000000000000000301201472614177300257410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ServiceApplyConfiguration represents a declarative configuration of the Service type for use // with apply. type ServiceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ServiceSpecApplyConfiguration `json:"spec,omitempty"` Status *ServiceStatusApplyConfiguration `json:"status,omitempty"` } // Service constructs a declarative configuration of the Service type for use with // apply. func Service(name, namespace string) *ServiceApplyConfiguration { b := &ServiceApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Service") b.WithAPIVersion("v1") return b } // ExtractService extracts the applied configuration owned by fieldManager from // service. If no managedFields are found in service for fieldManager, a // ServiceApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // service must be a unmodified Service API object that was retrieved from the Kubernetes API. // ExtractService provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractService(service *apicorev1.Service, fieldManager string) (*ServiceApplyConfiguration, error) { return extractService(service, fieldManager, "") } // ExtractServiceStatus is the same as ExtractService except // that it extracts the status subresource applied configuration. // Experimental! func ExtractServiceStatus(service *apicorev1.Service, fieldManager string) (*ServiceApplyConfiguration, error) { return extractService(service, fieldManager, "status") } func extractService(service *apicorev1.Service, fieldManager string, subresource string) (*ServiceApplyConfiguration, error) { b := &ServiceApplyConfiguration{} err := managedfields.ExtractInto(service, internal.Parser().Type("io.k8s.api.core.v1.Service"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(service.Name) b.WithNamespace(service.Namespace) b.WithKind("Service") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithKind(value string) *ServiceApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithAPIVersion(value string) *ServiceApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithName(value string) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithGenerateName(value string) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithNamespace(value string) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithUID(value types.UID) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithResourceVersion(value string) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithGeneration(value int64) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ServiceApplyConfiguration) WithLabels(entries map[string]string) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ServiceApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ServiceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ServiceApplyConfiguration) WithFinalizers(values ...string) *ServiceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ServiceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithSpec(value *ServiceSpecApplyConfiguration) *ServiceApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ServiceApplyConfiguration) WithStatus(value *ServiceStatusApplyConfiguration) *ServiceApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ServiceApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/serviceaccount.go000066400000000000000000000331671472614177300273340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apicorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ServiceAccountApplyConfiguration represents a declarative configuration of the ServiceAccount type for use // with apply. type ServiceAccountApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Secrets []ObjectReferenceApplyConfiguration `json:"secrets,omitempty"` ImagePullSecrets []LocalObjectReferenceApplyConfiguration `json:"imagePullSecrets,omitempty"` AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"` } // ServiceAccount constructs a declarative configuration of the ServiceAccount type for use with // apply. func ServiceAccount(name, namespace string) *ServiceAccountApplyConfiguration { b := &ServiceAccountApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ServiceAccount") b.WithAPIVersion("v1") return b } // ExtractServiceAccount extracts the applied configuration owned by fieldManager from // serviceAccount. If no managedFields are found in serviceAccount for fieldManager, a // ServiceAccountApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // serviceAccount must be a unmodified ServiceAccount API object that was retrieved from the Kubernetes API. // ExtractServiceAccount provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractServiceAccount(serviceAccount *apicorev1.ServiceAccount, fieldManager string) (*ServiceAccountApplyConfiguration, error) { return extractServiceAccount(serviceAccount, fieldManager, "") } // ExtractServiceAccountStatus is the same as ExtractServiceAccount except // that it extracts the status subresource applied configuration. // Experimental! func ExtractServiceAccountStatus(serviceAccount *apicorev1.ServiceAccount, fieldManager string) (*ServiceAccountApplyConfiguration, error) { return extractServiceAccount(serviceAccount, fieldManager, "status") } func extractServiceAccount(serviceAccount *apicorev1.ServiceAccount, fieldManager string, subresource string) (*ServiceAccountApplyConfiguration, error) { b := &ServiceAccountApplyConfiguration{} err := managedfields.ExtractInto(serviceAccount, internal.Parser().Type("io.k8s.api.core.v1.ServiceAccount"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(serviceAccount.Name) b.WithNamespace(serviceAccount.Namespace) b.WithKind("ServiceAccount") b.WithAPIVersion("v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithKind(value string) *ServiceAccountApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithAPIVersion(value string) *ServiceAccountApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithName(value string) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithGenerateName(value string) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithNamespace(value string) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithUID(value types.UID) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithResourceVersion(value string) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithGeneration(value int64) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ServiceAccountApplyConfiguration) WithLabels(entries map[string]string) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ServiceAccountApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ServiceAccountApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ServiceAccountApplyConfiguration) WithFinalizers(values ...string) *ServiceAccountApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ServiceAccountApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSecrets adds the given value to the Secrets field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Secrets field. func (b *ServiceAccountApplyConfiguration) WithSecrets(values ...*ObjectReferenceApplyConfiguration) *ServiceAccountApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSecrets") } b.Secrets = append(b.Secrets, *values[i]) } return b } // WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ImagePullSecrets field. func (b *ServiceAccountApplyConfiguration) WithImagePullSecrets(values ...*LocalObjectReferenceApplyConfiguration) *ServiceAccountApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithImagePullSecrets") } b.ImagePullSecrets = append(b.ImagePullSecrets, *values[i]) } return b } // WithAutomountServiceAccountToken sets the AutomountServiceAccountToken field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AutomountServiceAccountToken field is set to the value of the last call. func (b *ServiceAccountApplyConfiguration) WithAutomountServiceAccountToken(value bool) *ServiceAccountApplyConfiguration { b.AutomountServiceAccountToken = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ServiceAccountApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/serviceaccounttokenprojection.go000066400000000000000000000052101472614177300324560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ServiceAccountTokenProjectionApplyConfiguration represents a declarative configuration of the ServiceAccountTokenProjection type for use // with apply. type ServiceAccountTokenProjectionApplyConfiguration struct { Audience *string `json:"audience,omitempty"` ExpirationSeconds *int64 `json:"expirationSeconds,omitempty"` Path *string `json:"path,omitempty"` } // ServiceAccountTokenProjectionApplyConfiguration constructs a declarative configuration of the ServiceAccountTokenProjection type for use with // apply. func ServiceAccountTokenProjection() *ServiceAccountTokenProjectionApplyConfiguration { return &ServiceAccountTokenProjectionApplyConfiguration{} } // WithAudience sets the Audience field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Audience field is set to the value of the last call. func (b *ServiceAccountTokenProjectionApplyConfiguration) WithAudience(value string) *ServiceAccountTokenProjectionApplyConfiguration { b.Audience = &value return b } // WithExpirationSeconds sets the ExpirationSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExpirationSeconds field is set to the value of the last call. func (b *ServiceAccountTokenProjectionApplyConfiguration) WithExpirationSeconds(value int64) *ServiceAccountTokenProjectionApplyConfiguration { b.ExpirationSeconds = &value return b } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *ServiceAccountTokenProjectionApplyConfiguration) WithPath(value string) *ServiceAccountTokenProjectionApplyConfiguration { b.Path = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/serviceport.go000066400000000000000000000075311472614177300266600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" intstr "k8s.io/apimachinery/pkg/util/intstr" ) // ServicePortApplyConfiguration represents a declarative configuration of the ServicePort type for use // with apply. type ServicePortApplyConfiguration struct { Name *string `json:"name,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` AppProtocol *string `json:"appProtocol,omitempty"` Port *int32 `json:"port,omitempty"` TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` NodePort *int32 `json:"nodePort,omitempty"` } // ServicePortApplyConfiguration constructs a declarative configuration of the ServicePort type for use with // apply. func ServicePort() *ServicePortApplyConfiguration { return &ServicePortApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServicePortApplyConfiguration) WithName(value string) *ServicePortApplyConfiguration { b.Name = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *ServicePortApplyConfiguration) WithProtocol(value v1.Protocol) *ServicePortApplyConfiguration { b.Protocol = &value return b } // WithAppProtocol sets the AppProtocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AppProtocol field is set to the value of the last call. func (b *ServicePortApplyConfiguration) WithAppProtocol(value string) *ServicePortApplyConfiguration { b.AppProtocol = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *ServicePortApplyConfiguration) WithPort(value int32) *ServicePortApplyConfiguration { b.Port = &value return b } // WithTargetPort sets the TargetPort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetPort field is set to the value of the last call. func (b *ServicePortApplyConfiguration) WithTargetPort(value intstr.IntOrString) *ServicePortApplyConfiguration { b.TargetPort = &value return b } // WithNodePort sets the NodePort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodePort field is set to the value of the last call. func (b *ServicePortApplyConfiguration) WithNodePort(value int32) *ServicePortApplyConfiguration { b.NodePort = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/servicespec.go000066400000000000000000000312671472614177300266310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" ) // ServiceSpecApplyConfiguration represents a declarative configuration of the ServiceSpec type for use // with apply. type ServiceSpecApplyConfiguration struct { Ports []ServicePortApplyConfiguration `json:"ports,omitempty"` Selector map[string]string `json:"selector,omitempty"` ClusterIP *string `json:"clusterIP,omitempty"` ClusterIPs []string `json:"clusterIPs,omitempty"` Type *corev1.ServiceType `json:"type,omitempty"` ExternalIPs []string `json:"externalIPs,omitempty"` SessionAffinity *corev1.ServiceAffinity `json:"sessionAffinity,omitempty"` LoadBalancerIP *string `json:"loadBalancerIP,omitempty"` LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"` ExternalName *string `json:"externalName,omitempty"` ExternalTrafficPolicy *corev1.ServiceExternalTrafficPolicy `json:"externalTrafficPolicy,omitempty"` HealthCheckNodePort *int32 `json:"healthCheckNodePort,omitempty"` PublishNotReadyAddresses *bool `json:"publishNotReadyAddresses,omitempty"` SessionAffinityConfig *SessionAffinityConfigApplyConfiguration `json:"sessionAffinityConfig,omitempty"` IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"` IPFamilyPolicy *corev1.IPFamilyPolicy `json:"ipFamilyPolicy,omitempty"` AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty"` LoadBalancerClass *string `json:"loadBalancerClass,omitempty"` InternalTrafficPolicy *corev1.ServiceInternalTrafficPolicy `json:"internalTrafficPolicy,omitempty"` TrafficDistribution *string `json:"trafficDistribution,omitempty"` } // ServiceSpecApplyConfiguration constructs a declarative configuration of the ServiceSpec type for use with // apply. func ServiceSpec() *ServiceSpecApplyConfiguration { return &ServiceSpecApplyConfiguration{} } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *ServiceSpecApplyConfiguration) WithPorts(values ...*ServicePortApplyConfiguration) *ServiceSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // WithSelector puts the entries into the Selector field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Selector field, // overwriting an existing map entries in Selector field with the same key. func (b *ServiceSpecApplyConfiguration) WithSelector(entries map[string]string) *ServiceSpecApplyConfiguration { if b.Selector == nil && len(entries) > 0 { b.Selector = make(map[string]string, len(entries)) } for k, v := range entries { b.Selector[k] = v } return b } // WithClusterIP sets the ClusterIP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClusterIP field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithClusterIP(value string) *ServiceSpecApplyConfiguration { b.ClusterIP = &value return b } // WithClusterIPs adds the given value to the ClusterIPs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ClusterIPs field. func (b *ServiceSpecApplyConfiguration) WithClusterIPs(values ...string) *ServiceSpecApplyConfiguration { for i := range values { b.ClusterIPs = append(b.ClusterIPs, values[i]) } return b } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithType(value corev1.ServiceType) *ServiceSpecApplyConfiguration { b.Type = &value return b } // WithExternalIPs adds the given value to the ExternalIPs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ExternalIPs field. func (b *ServiceSpecApplyConfiguration) WithExternalIPs(values ...string) *ServiceSpecApplyConfiguration { for i := range values { b.ExternalIPs = append(b.ExternalIPs, values[i]) } return b } // WithSessionAffinity sets the SessionAffinity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SessionAffinity field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithSessionAffinity(value corev1.ServiceAffinity) *ServiceSpecApplyConfiguration { b.SessionAffinity = &value return b } // WithLoadBalancerIP sets the LoadBalancerIP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LoadBalancerIP field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithLoadBalancerIP(value string) *ServiceSpecApplyConfiguration { b.LoadBalancerIP = &value return b } // WithLoadBalancerSourceRanges adds the given value to the LoadBalancerSourceRanges field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the LoadBalancerSourceRanges field. func (b *ServiceSpecApplyConfiguration) WithLoadBalancerSourceRanges(values ...string) *ServiceSpecApplyConfiguration { for i := range values { b.LoadBalancerSourceRanges = append(b.LoadBalancerSourceRanges, values[i]) } return b } // WithExternalName sets the ExternalName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExternalName field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithExternalName(value string) *ServiceSpecApplyConfiguration { b.ExternalName = &value return b } // WithExternalTrafficPolicy sets the ExternalTrafficPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExternalTrafficPolicy field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithExternalTrafficPolicy(value corev1.ServiceExternalTrafficPolicy) *ServiceSpecApplyConfiguration { b.ExternalTrafficPolicy = &value return b } // WithHealthCheckNodePort sets the HealthCheckNodePort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HealthCheckNodePort field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithHealthCheckNodePort(value int32) *ServiceSpecApplyConfiguration { b.HealthCheckNodePort = &value return b } // WithPublishNotReadyAddresses sets the PublishNotReadyAddresses field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PublishNotReadyAddresses field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithPublishNotReadyAddresses(value bool) *ServiceSpecApplyConfiguration { b.PublishNotReadyAddresses = &value return b } // WithSessionAffinityConfig sets the SessionAffinityConfig field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SessionAffinityConfig field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithSessionAffinityConfig(value *SessionAffinityConfigApplyConfiguration) *ServiceSpecApplyConfiguration { b.SessionAffinityConfig = value return b } // WithIPFamilies adds the given value to the IPFamilies field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the IPFamilies field. func (b *ServiceSpecApplyConfiguration) WithIPFamilies(values ...corev1.IPFamily) *ServiceSpecApplyConfiguration { for i := range values { b.IPFamilies = append(b.IPFamilies, values[i]) } return b } // WithIPFamilyPolicy sets the IPFamilyPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IPFamilyPolicy field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithIPFamilyPolicy(value corev1.IPFamilyPolicy) *ServiceSpecApplyConfiguration { b.IPFamilyPolicy = &value return b } // WithAllocateLoadBalancerNodePorts sets the AllocateLoadBalancerNodePorts field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllocateLoadBalancerNodePorts field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithAllocateLoadBalancerNodePorts(value bool) *ServiceSpecApplyConfiguration { b.AllocateLoadBalancerNodePorts = &value return b } // WithLoadBalancerClass sets the LoadBalancerClass field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LoadBalancerClass field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithLoadBalancerClass(value string) *ServiceSpecApplyConfiguration { b.LoadBalancerClass = &value return b } // WithInternalTrafficPolicy sets the InternalTrafficPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InternalTrafficPolicy field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithInternalTrafficPolicy(value corev1.ServiceInternalTrafficPolicy) *ServiceSpecApplyConfiguration { b.InternalTrafficPolicy = &value return b } // WithTrafficDistribution sets the TrafficDistribution field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TrafficDistribution field is set to the value of the last call. func (b *ServiceSpecApplyConfiguration) WithTrafficDistribution(value string) *ServiceSpecApplyConfiguration { b.TrafficDistribution = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/servicestatus.go000066400000000000000000000044331472614177300272150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ServiceStatusApplyConfiguration represents a declarative configuration of the ServiceStatus type for use // with apply. type ServiceStatusApplyConfiguration struct { LoadBalancer *LoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } // ServiceStatusApplyConfiguration constructs a declarative configuration of the ServiceStatus type for use with // apply. func ServiceStatus() *ServiceStatusApplyConfiguration { return &ServiceStatusApplyConfiguration{} } // WithLoadBalancer sets the LoadBalancer field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LoadBalancer field is set to the value of the last call. func (b *ServiceStatusApplyConfiguration) WithLoadBalancer(value *LoadBalancerStatusApplyConfiguration) *ServiceStatusApplyConfiguration { b.LoadBalancer = value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ServiceStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ServiceStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/sessionaffinityconfig.go000066400000000000000000000031321472614177300307070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SessionAffinityConfigApplyConfiguration represents a declarative configuration of the SessionAffinityConfig type for use // with apply. type SessionAffinityConfigApplyConfiguration struct { ClientIP *ClientIPConfigApplyConfiguration `json:"clientIP,omitempty"` } // SessionAffinityConfigApplyConfiguration constructs a declarative configuration of the SessionAffinityConfig type for use with // apply. func SessionAffinityConfig() *SessionAffinityConfigApplyConfiguration { return &SessionAffinityConfigApplyConfiguration{} } // WithClientIP sets the ClientIP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClientIP field is set to the value of the last call. func (b *SessionAffinityConfigApplyConfiguration) WithClientIP(value *ClientIPConfigApplyConfiguration) *SessionAffinityConfigApplyConfiguration { b.ClientIP = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/sleepaction.go000066400000000000000000000026711472614177300266210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SleepActionApplyConfiguration represents a declarative configuration of the SleepAction type for use // with apply. type SleepActionApplyConfiguration struct { Seconds *int64 `json:"seconds,omitempty"` } // SleepActionApplyConfiguration constructs a declarative configuration of the SleepAction type for use with // apply. func SleepAction() *SleepActionApplyConfiguration { return &SleepActionApplyConfiguration{} } // WithSeconds sets the Seconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Seconds field is set to the value of the last call. func (b *SleepActionApplyConfiguration) WithSeconds(value int64) *SleepActionApplyConfiguration { b.Seconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/storageospersistentvolumesource.go000066400000000000000000000075011472614177300331100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // StorageOSPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the StorageOSPersistentVolumeSource type for use // with apply. type StorageOSPersistentVolumeSourceApplyConfiguration struct { VolumeName *string `json:"volumeName,omitempty"` VolumeNamespace *string `json:"volumeNamespace,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` SecretRef *ObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` } // StorageOSPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the StorageOSPersistentVolumeSource type for use with // apply. func StorageOSPersistentVolumeSource() *StorageOSPersistentVolumeSourceApplyConfiguration { return &StorageOSPersistentVolumeSourceApplyConfiguration{} } // WithVolumeName sets the VolumeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeName field is set to the value of the last call. func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithVolumeName(value string) *StorageOSPersistentVolumeSourceApplyConfiguration { b.VolumeName = &value return b } // WithVolumeNamespace sets the VolumeNamespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeNamespace field is set to the value of the last call. func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithVolumeNamespace(value string) *StorageOSPersistentVolumeSourceApplyConfiguration { b.VolumeNamespace = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *StorageOSPersistentVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *StorageOSPersistentVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *ObjectReferenceApplyConfiguration) *StorageOSPersistentVolumeSourceApplyConfiguration { b.SecretRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/storageosvolumesource.go000066400000000000000000000072531472614177300307730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // StorageOSVolumeSourceApplyConfiguration represents a declarative configuration of the StorageOSVolumeSource type for use // with apply. type StorageOSVolumeSourceApplyConfiguration struct { VolumeName *string `json:"volumeName,omitempty"` VolumeNamespace *string `json:"volumeNamespace,omitempty"` FSType *string `json:"fsType,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` } // StorageOSVolumeSourceApplyConfiguration constructs a declarative configuration of the StorageOSVolumeSource type for use with // apply. func StorageOSVolumeSource() *StorageOSVolumeSourceApplyConfiguration { return &StorageOSVolumeSourceApplyConfiguration{} } // WithVolumeName sets the VolumeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeName field is set to the value of the last call. func (b *StorageOSVolumeSourceApplyConfiguration) WithVolumeName(value string) *StorageOSVolumeSourceApplyConfiguration { b.VolumeName = &value return b } // WithVolumeNamespace sets the VolumeNamespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeNamespace field is set to the value of the last call. func (b *StorageOSVolumeSourceApplyConfiguration) WithVolumeNamespace(value string) *StorageOSVolumeSourceApplyConfiguration { b.VolumeNamespace = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *StorageOSVolumeSourceApplyConfiguration) WithFSType(value string) *StorageOSVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *StorageOSVolumeSourceApplyConfiguration) WithReadOnly(value bool) *StorageOSVolumeSourceApplyConfiguration { b.ReadOnly = &value return b } // WithSecretRef sets the SecretRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretRef field is set to the value of the last call. func (b *StorageOSVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *StorageOSVolumeSourceApplyConfiguration { b.SecretRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/sysctl.go000066400000000000000000000034371472614177300256350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SysctlApplyConfiguration represents a declarative configuration of the Sysctl type for use // with apply. type SysctlApplyConfiguration struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } // SysctlApplyConfiguration constructs a declarative configuration of the Sysctl type for use with // apply. func Sysctl() *SysctlApplyConfiguration { return &SysctlApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SysctlApplyConfiguration) WithName(value string) *SysctlApplyConfiguration { b.Name = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *SysctlApplyConfiguration) WithValue(value string) *SysctlApplyConfiguration { b.Value = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/taint.go000066400000000000000000000054141472614177300254300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // TaintApplyConfiguration represents a declarative configuration of the Taint type for use // with apply. type TaintApplyConfiguration struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` Effect *v1.TaintEffect `json:"effect,omitempty"` TimeAdded *metav1.Time `json:"timeAdded,omitempty"` } // TaintApplyConfiguration constructs a declarative configuration of the Taint type for use with // apply. func Taint() *TaintApplyConfiguration { return &TaintApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *TaintApplyConfiguration) WithKey(value string) *TaintApplyConfiguration { b.Key = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *TaintApplyConfiguration) WithValue(value string) *TaintApplyConfiguration { b.Value = &value return b } // WithEffect sets the Effect field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Effect field is set to the value of the last call. func (b *TaintApplyConfiguration) WithEffect(value v1.TaintEffect) *TaintApplyConfiguration { b.Effect = &value return b } // WithTimeAdded sets the TimeAdded field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TimeAdded field is set to the value of the last call. func (b *TaintApplyConfiguration) WithTimeAdded(value metav1.Time) *TaintApplyConfiguration { b.TimeAdded = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/tcpsocketaction.go000066400000000000000000000037411472614177300275070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // TCPSocketActionApplyConfiguration represents a declarative configuration of the TCPSocketAction type for use // with apply. type TCPSocketActionApplyConfiguration struct { Port *intstr.IntOrString `json:"port,omitempty"` Host *string `json:"host,omitempty"` } // TCPSocketActionApplyConfiguration constructs a declarative configuration of the TCPSocketAction type for use with // apply. func TCPSocketAction() *TCPSocketActionApplyConfiguration { return &TCPSocketActionApplyConfiguration{} } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *TCPSocketActionApplyConfiguration) WithPort(value intstr.IntOrString) *TCPSocketActionApplyConfiguration { b.Port = &value return b } // WithHost sets the Host field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Host field is set to the value of the last call. func (b *TCPSocketActionApplyConfiguration) WithHost(value string) *TCPSocketActionApplyConfiguration { b.Host = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/toleration.go000066400000000000000000000066011472614177300264700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // TolerationApplyConfiguration represents a declarative configuration of the Toleration type for use // with apply. type TolerationApplyConfiguration struct { Key *string `json:"key,omitempty"` Operator *v1.TolerationOperator `json:"operator,omitempty"` Value *string `json:"value,omitempty"` Effect *v1.TaintEffect `json:"effect,omitempty"` TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"` } // TolerationApplyConfiguration constructs a declarative configuration of the Toleration type for use with // apply. func Toleration() *TolerationApplyConfiguration { return &TolerationApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *TolerationApplyConfiguration) WithKey(value string) *TolerationApplyConfiguration { b.Key = &value return b } // WithOperator sets the Operator field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Operator field is set to the value of the last call. func (b *TolerationApplyConfiguration) WithOperator(value v1.TolerationOperator) *TolerationApplyConfiguration { b.Operator = &value return b } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *TolerationApplyConfiguration) WithValue(value string) *TolerationApplyConfiguration { b.Value = &value return b } // WithEffect sets the Effect field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Effect field is set to the value of the last call. func (b *TolerationApplyConfiguration) WithEffect(value v1.TaintEffect) *TolerationApplyConfiguration { b.Effect = &value return b } // WithTolerationSeconds sets the TolerationSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TolerationSeconds field is set to the value of the last call. func (b *TolerationApplyConfiguration) WithTolerationSeconds(value int64) *TolerationApplyConfiguration { b.TolerationSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/topologyselectorlabelrequirement.go000066400000000000000000000042351472614177300332070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // TopologySelectorLabelRequirementApplyConfiguration represents a declarative configuration of the TopologySelectorLabelRequirement type for use // with apply. type TopologySelectorLabelRequirementApplyConfiguration struct { Key *string `json:"key,omitempty"` Values []string `json:"values,omitempty"` } // TopologySelectorLabelRequirementApplyConfiguration constructs a declarative configuration of the TopologySelectorLabelRequirement type for use with // apply. func TopologySelectorLabelRequirement() *TopologySelectorLabelRequirementApplyConfiguration { return &TopologySelectorLabelRequirementApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *TopologySelectorLabelRequirementApplyConfiguration) WithKey(value string) *TopologySelectorLabelRequirementApplyConfiguration { b.Key = &value return b } // WithValues adds the given value to the Values field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Values field. func (b *TopologySelectorLabelRequirementApplyConfiguration) WithValues(values ...string) *TopologySelectorLabelRequirementApplyConfiguration { for i := range values { b.Values = append(b.Values, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/topologyselectorterm.go000066400000000000000000000035711472614177300306200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // TopologySelectorTermApplyConfiguration represents a declarative configuration of the TopologySelectorTerm type for use // with apply. type TopologySelectorTermApplyConfiguration struct { MatchLabelExpressions []TopologySelectorLabelRequirementApplyConfiguration `json:"matchLabelExpressions,omitempty"` } // TopologySelectorTermApplyConfiguration constructs a declarative configuration of the TopologySelectorTerm type for use with // apply. func TopologySelectorTerm() *TopologySelectorTermApplyConfiguration { return &TopologySelectorTermApplyConfiguration{} } // WithMatchLabelExpressions adds the given value to the MatchLabelExpressions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchLabelExpressions field. func (b *TopologySelectorTermApplyConfiguration) WithMatchLabelExpressions(values ...*TopologySelectorLabelRequirementApplyConfiguration) *TopologySelectorTermApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchLabelExpressions") } b.MatchLabelExpressions = append(b.MatchLabelExpressions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/topologyspreadconstraint.go000066400000000000000000000133031472614177300314650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // TopologySpreadConstraintApplyConfiguration represents a declarative configuration of the TopologySpreadConstraint type for use // with apply. type TopologySpreadConstraintApplyConfiguration struct { MaxSkew *int32 `json:"maxSkew,omitempty"` TopologyKey *string `json:"topologyKey,omitempty"` WhenUnsatisfiable *v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable,omitempty"` LabelSelector *metav1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` MinDomains *int32 `json:"minDomains,omitempty"` NodeAffinityPolicy *v1.NodeInclusionPolicy `json:"nodeAffinityPolicy,omitempty"` NodeTaintsPolicy *v1.NodeInclusionPolicy `json:"nodeTaintsPolicy,omitempty"` MatchLabelKeys []string `json:"matchLabelKeys,omitempty"` } // TopologySpreadConstraintApplyConfiguration constructs a declarative configuration of the TopologySpreadConstraint type for use with // apply. func TopologySpreadConstraint() *TopologySpreadConstraintApplyConfiguration { return &TopologySpreadConstraintApplyConfiguration{} } // WithMaxSkew sets the MaxSkew field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxSkew field is set to the value of the last call. func (b *TopologySpreadConstraintApplyConfiguration) WithMaxSkew(value int32) *TopologySpreadConstraintApplyConfiguration { b.MaxSkew = &value return b } // WithTopologyKey sets the TopologyKey field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TopologyKey field is set to the value of the last call. func (b *TopologySpreadConstraintApplyConfiguration) WithTopologyKey(value string) *TopologySpreadConstraintApplyConfiguration { b.TopologyKey = &value return b } // WithWhenUnsatisfiable sets the WhenUnsatisfiable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the WhenUnsatisfiable field is set to the value of the last call. func (b *TopologySpreadConstraintApplyConfiguration) WithWhenUnsatisfiable(value v1.UnsatisfiableConstraintAction) *TopologySpreadConstraintApplyConfiguration { b.WhenUnsatisfiable = &value return b } // WithLabelSelector sets the LabelSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LabelSelector field is set to the value of the last call. func (b *TopologySpreadConstraintApplyConfiguration) WithLabelSelector(value *metav1.LabelSelectorApplyConfiguration) *TopologySpreadConstraintApplyConfiguration { b.LabelSelector = value return b } // WithMinDomains sets the MinDomains field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinDomains field is set to the value of the last call. func (b *TopologySpreadConstraintApplyConfiguration) WithMinDomains(value int32) *TopologySpreadConstraintApplyConfiguration { b.MinDomains = &value return b } // WithNodeAffinityPolicy sets the NodeAffinityPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeAffinityPolicy field is set to the value of the last call. func (b *TopologySpreadConstraintApplyConfiguration) WithNodeAffinityPolicy(value v1.NodeInclusionPolicy) *TopologySpreadConstraintApplyConfiguration { b.NodeAffinityPolicy = &value return b } // WithNodeTaintsPolicy sets the NodeTaintsPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeTaintsPolicy field is set to the value of the last call. func (b *TopologySpreadConstraintApplyConfiguration) WithNodeTaintsPolicy(value v1.NodeInclusionPolicy) *TopologySpreadConstraintApplyConfiguration { b.NodeTaintsPolicy = &value return b } // WithMatchLabelKeys adds the given value to the MatchLabelKeys field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchLabelKeys field. func (b *TopologySpreadConstraintApplyConfiguration) WithMatchLabelKeys(values ...string) *TopologySpreadConstraintApplyConfiguration { for i := range values { b.MatchLabelKeys = append(b.MatchLabelKeys, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/typedlocalobjectreference.go000066400000000000000000000047501472614177300315210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // TypedLocalObjectReferenceApplyConfiguration represents a declarative configuration of the TypedLocalObjectReference type for use // with apply. type TypedLocalObjectReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` } // TypedLocalObjectReferenceApplyConfiguration constructs a declarative configuration of the TypedLocalObjectReference type for use with // apply. func TypedLocalObjectReference() *TypedLocalObjectReferenceApplyConfiguration { return &TypedLocalObjectReferenceApplyConfiguration{} } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *TypedLocalObjectReferenceApplyConfiguration) WithAPIGroup(value string) *TypedLocalObjectReferenceApplyConfiguration { b.APIGroup = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *TypedLocalObjectReferenceApplyConfiguration) WithKind(value string) *TypedLocalObjectReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *TypedLocalObjectReferenceApplyConfiguration) WithName(value string) *TypedLocalObjectReferenceApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/typedobjectreference.go000066400000000000000000000056071472614177300305100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // TypedObjectReferenceApplyConfiguration represents a declarative configuration of the TypedObjectReference type for use // with apply. type TypedObjectReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` } // TypedObjectReferenceApplyConfiguration constructs a declarative configuration of the TypedObjectReference type for use with // apply. func TypedObjectReference() *TypedObjectReferenceApplyConfiguration { return &TypedObjectReferenceApplyConfiguration{} } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *TypedObjectReferenceApplyConfiguration) WithAPIGroup(value string) *TypedObjectReferenceApplyConfiguration { b.APIGroup = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *TypedObjectReferenceApplyConfiguration) WithKind(value string) *TypedObjectReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *TypedObjectReferenceApplyConfiguration) WithName(value string) *TypedObjectReferenceApplyConfiguration { b.Name = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *TypedObjectReferenceApplyConfiguration) WithNamespace(value string) *TypedObjectReferenceApplyConfiguration { b.Namespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/volume.go000066400000000000000000000344661472614177300256310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VolumeApplyConfiguration represents a declarative configuration of the Volume type for use // with apply. type VolumeApplyConfiguration struct { Name *string `json:"name,omitempty"` VolumeSourceApplyConfiguration `json:",inline"` } // VolumeApplyConfiguration constructs a declarative configuration of the Volume type for use with // apply. func Volume() *VolumeApplyConfiguration { return &VolumeApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithName(value string) *VolumeApplyConfiguration { b.Name = &value return b } // WithHostPath sets the HostPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostPath field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.HostPath = value return b } // WithEmptyDir sets the EmptyDir field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EmptyDir field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithEmptyDir(value *EmptyDirVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.EmptyDir = value return b } // WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GCEPersistentDisk field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.GCEPersistentDisk = value return b } // WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.AWSElasticBlockStore = value return b } // WithGitRepo sets the GitRepo field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GitRepo field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithGitRepo(value *GitRepoVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.GitRepo = value return b } // WithSecret sets the Secret field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Secret field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithSecret(value *SecretVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.Secret = value return b } // WithNFS sets the NFS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NFS field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.NFS = value return b } // WithISCSI sets the ISCSI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ISCSI field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithISCSI(value *ISCSIVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.ISCSI = value return b } // WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Glusterfs field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithGlusterfs(value *GlusterfsVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.Glusterfs = value return b } // WithPersistentVolumeClaim sets the PersistentVolumeClaim field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeClaim field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithPersistentVolumeClaim(value *PersistentVolumeClaimVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.PersistentVolumeClaim = value return b } // WithRBD sets the RBD field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RBD field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithRBD(value *RBDVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.RBD = value return b } // WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FlexVolume field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithFlexVolume(value *FlexVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.FlexVolume = value return b } // WithCinder sets the Cinder field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Cinder field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithCinder(value *CinderVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.Cinder = value return b } // WithCephFS sets the CephFS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CephFS field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithCephFS(value *CephFSVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.CephFS = value return b } // WithFlocker sets the Flocker field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Flocker field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.Flocker = value return b } // WithDownwardAPI sets the DownwardAPI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DownwardAPI field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithDownwardAPI(value *DownwardAPIVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.DownwardAPI = value return b } // WithFC sets the FC field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FC field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.FC = value return b } // WithAzureFile sets the AzureFile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AzureFile field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithAzureFile(value *AzureFileVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.AzureFile = value return b } // WithConfigMap sets the ConfigMap field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConfigMap field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithConfigMap(value *ConfigMapVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.ConfigMap = value return b } // WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VsphereVolume field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.VsphereVolume = value return b } // WithQuobyte sets the Quobyte field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Quobyte field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.Quobyte = value return b } // WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AzureDisk field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.AzureDisk = value return b } // WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.PhotonPersistentDisk = value return b } // WithProjected sets the Projected field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Projected field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithProjected(value *ProjectedVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.Projected = value return b } // WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PortworxVolume field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.PortworxVolume = value return b } // WithScaleIO sets the ScaleIO field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleIO field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithScaleIO(value *ScaleIOVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.ScaleIO = value return b } // WithStorageOS sets the StorageOS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageOS field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithStorageOS(value *StorageOSVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.StorageOS = value return b } // WithCSI sets the CSI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CSI field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithCSI(value *CSIVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.CSI = value return b } // WithEphemeral sets the Ephemeral field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ephemeral field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithEphemeral(value *EphemeralVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.Ephemeral = value return b } // WithImage sets the Image field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Image field is set to the value of the last call. func (b *VolumeApplyConfiguration) WithImage(value *ImageVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { b.Image = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/volumedevice.go000066400000000000000000000036171472614177300270030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VolumeDeviceApplyConfiguration represents a declarative configuration of the VolumeDevice type for use // with apply. type VolumeDeviceApplyConfiguration struct { Name *string `json:"name,omitempty"` DevicePath *string `json:"devicePath,omitempty"` } // VolumeDeviceApplyConfiguration constructs a declarative configuration of the VolumeDevice type for use with // apply. func VolumeDevice() *VolumeDeviceApplyConfiguration { return &VolumeDeviceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeDeviceApplyConfiguration) WithName(value string) *VolumeDeviceApplyConfiguration { b.Name = &value return b } // WithDevicePath sets the DevicePath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DevicePath field is set to the value of the last call. func (b *VolumeDeviceApplyConfiguration) WithDevicePath(value string) *VolumeDeviceApplyConfiguration { b.DevicePath = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/volumemount.go000066400000000000000000000107331472614177300267030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // VolumeMountApplyConfiguration represents a declarative configuration of the VolumeMount type for use // with apply. type VolumeMountApplyConfiguration struct { Name *string `json:"name,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"` MountPath *string `json:"mountPath,omitempty"` SubPath *string `json:"subPath,omitempty"` MountPropagation *v1.MountPropagationMode `json:"mountPropagation,omitempty"` SubPathExpr *string `json:"subPathExpr,omitempty"` } // VolumeMountApplyConfiguration constructs a declarative configuration of the VolumeMount type for use with // apply. func VolumeMount() *VolumeMountApplyConfiguration { return &VolumeMountApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeMountApplyConfiguration) WithName(value string) *VolumeMountApplyConfiguration { b.Name = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *VolumeMountApplyConfiguration) WithReadOnly(value bool) *VolumeMountApplyConfiguration { b.ReadOnly = &value return b } // WithRecursiveReadOnly sets the RecursiveReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RecursiveReadOnly field is set to the value of the last call. func (b *VolumeMountApplyConfiguration) WithRecursiveReadOnly(value v1.RecursiveReadOnlyMode) *VolumeMountApplyConfiguration { b.RecursiveReadOnly = &value return b } // WithMountPath sets the MountPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MountPath field is set to the value of the last call. func (b *VolumeMountApplyConfiguration) WithMountPath(value string) *VolumeMountApplyConfiguration { b.MountPath = &value return b } // WithSubPath sets the SubPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SubPath field is set to the value of the last call. func (b *VolumeMountApplyConfiguration) WithSubPath(value string) *VolumeMountApplyConfiguration { b.SubPath = &value return b } // WithMountPropagation sets the MountPropagation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MountPropagation field is set to the value of the last call. func (b *VolumeMountApplyConfiguration) WithMountPropagation(value v1.MountPropagationMode) *VolumeMountApplyConfiguration { b.MountPropagation = &value return b } // WithSubPathExpr sets the SubPathExpr field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SubPathExpr field is set to the value of the last call. func (b *VolumeMountApplyConfiguration) WithSubPathExpr(value string) *VolumeMountApplyConfiguration { b.SubPathExpr = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/volumemountstatus.go000066400000000000000000000061021472614177300301420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // VolumeMountStatusApplyConfiguration represents a declarative configuration of the VolumeMountStatus type for use // with apply. type VolumeMountStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` MountPath *string `json:"mountPath,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"` } // VolumeMountStatusApplyConfiguration constructs a declarative configuration of the VolumeMountStatus type for use with // apply. func VolumeMountStatus() *VolumeMountStatusApplyConfiguration { return &VolumeMountStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeMountStatusApplyConfiguration) WithName(value string) *VolumeMountStatusApplyConfiguration { b.Name = &value return b } // WithMountPath sets the MountPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MountPath field is set to the value of the last call. func (b *VolumeMountStatusApplyConfiguration) WithMountPath(value string) *VolumeMountStatusApplyConfiguration { b.MountPath = &value return b } // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadOnly field is set to the value of the last call. func (b *VolumeMountStatusApplyConfiguration) WithReadOnly(value bool) *VolumeMountStatusApplyConfiguration { b.ReadOnly = &value return b } // WithRecursiveReadOnly sets the RecursiveReadOnly field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RecursiveReadOnly field is set to the value of the last call. func (b *VolumeMountStatusApplyConfiguration) WithRecursiveReadOnly(value v1.RecursiveReadOnlyMode) *VolumeMountStatusApplyConfiguration { b.RecursiveReadOnly = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/volumenodeaffinity.go000066400000000000000000000030701472614177300302140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VolumeNodeAffinityApplyConfiguration represents a declarative configuration of the VolumeNodeAffinity type for use // with apply. type VolumeNodeAffinityApplyConfiguration struct { Required *NodeSelectorApplyConfiguration `json:"required,omitempty"` } // VolumeNodeAffinityApplyConfiguration constructs a declarative configuration of the VolumeNodeAffinity type for use with // apply. func VolumeNodeAffinity() *VolumeNodeAffinityApplyConfiguration { return &VolumeNodeAffinityApplyConfiguration{} } // WithRequired sets the Required field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Required field is set to the value of the last call. func (b *VolumeNodeAffinityApplyConfiguration) WithRequired(value *NodeSelectorApplyConfiguration) *VolumeNodeAffinityApplyConfiguration { b.Required = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/volumeprojection.go000066400000000000000000000075731472614177300277250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VolumeProjectionApplyConfiguration represents a declarative configuration of the VolumeProjection type for use // with apply. type VolumeProjectionApplyConfiguration struct { Secret *SecretProjectionApplyConfiguration `json:"secret,omitempty"` DownwardAPI *DownwardAPIProjectionApplyConfiguration `json:"downwardAPI,omitempty"` ConfigMap *ConfigMapProjectionApplyConfiguration `json:"configMap,omitempty"` ServiceAccountToken *ServiceAccountTokenProjectionApplyConfiguration `json:"serviceAccountToken,omitempty"` ClusterTrustBundle *ClusterTrustBundleProjectionApplyConfiguration `json:"clusterTrustBundle,omitempty"` } // VolumeProjectionApplyConfiguration constructs a declarative configuration of the VolumeProjection type for use with // apply. func VolumeProjection() *VolumeProjectionApplyConfiguration { return &VolumeProjectionApplyConfiguration{} } // WithSecret sets the Secret field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Secret field is set to the value of the last call. func (b *VolumeProjectionApplyConfiguration) WithSecret(value *SecretProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { b.Secret = value return b } // WithDownwardAPI sets the DownwardAPI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DownwardAPI field is set to the value of the last call. func (b *VolumeProjectionApplyConfiguration) WithDownwardAPI(value *DownwardAPIProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { b.DownwardAPI = value return b } // WithConfigMap sets the ConfigMap field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConfigMap field is set to the value of the last call. func (b *VolumeProjectionApplyConfiguration) WithConfigMap(value *ConfigMapProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { b.ConfigMap = value return b } // WithServiceAccountToken sets the ServiceAccountToken field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccountToken field is set to the value of the last call. func (b *VolumeProjectionApplyConfiguration) WithServiceAccountToken(value *ServiceAccountTokenProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { b.ServiceAccountToken = value return b } // WithClusterTrustBundle sets the ClusterTrustBundle field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClusterTrustBundle field is set to the value of the last call. func (b *VolumeProjectionApplyConfiguration) WithClusterTrustBundle(value *ClusterTrustBundleProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { b.ClusterTrustBundle = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/volumeresourcerequirements.go000066400000000000000000000041741472614177300320360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // VolumeResourceRequirementsApplyConfiguration represents a declarative configuration of the VolumeResourceRequirements type for use // with apply. type VolumeResourceRequirementsApplyConfiguration struct { Limits *v1.ResourceList `json:"limits,omitempty"` Requests *v1.ResourceList `json:"requests,omitempty"` } // VolumeResourceRequirementsApplyConfiguration constructs a declarative configuration of the VolumeResourceRequirements type for use with // apply. func VolumeResourceRequirements() *VolumeResourceRequirementsApplyConfiguration { return &VolumeResourceRequirementsApplyConfiguration{} } // WithLimits sets the Limits field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Limits field is set to the value of the last call. func (b *VolumeResourceRequirementsApplyConfiguration) WithLimits(value v1.ResourceList) *VolumeResourceRequirementsApplyConfiguration { b.Limits = &value return b } // WithRequests sets the Requests field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Requests field is set to the value of the last call. func (b *VolumeResourceRequirementsApplyConfiguration) WithRequests(value v1.ResourceList) *VolumeResourceRequirementsApplyConfiguration { b.Requests = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/volumesource.go000066400000000000000000000424601472614177300270430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VolumeSourceApplyConfiguration represents a declarative configuration of the VolumeSource type for use // with apply. type VolumeSourceApplyConfiguration struct { HostPath *HostPathVolumeSourceApplyConfiguration `json:"hostPath,omitempty"` EmptyDir *EmptyDirVolumeSourceApplyConfiguration `json:"emptyDir,omitempty"` GCEPersistentDisk *GCEPersistentDiskVolumeSourceApplyConfiguration `json:"gcePersistentDisk,omitempty"` AWSElasticBlockStore *AWSElasticBlockStoreVolumeSourceApplyConfiguration `json:"awsElasticBlockStore,omitempty"` GitRepo *GitRepoVolumeSourceApplyConfiguration `json:"gitRepo,omitempty"` Secret *SecretVolumeSourceApplyConfiguration `json:"secret,omitempty"` NFS *NFSVolumeSourceApplyConfiguration `json:"nfs,omitempty"` ISCSI *ISCSIVolumeSourceApplyConfiguration `json:"iscsi,omitempty"` Glusterfs *GlusterfsVolumeSourceApplyConfiguration `json:"glusterfs,omitempty"` PersistentVolumeClaim *PersistentVolumeClaimVolumeSourceApplyConfiguration `json:"persistentVolumeClaim,omitempty"` RBD *RBDVolumeSourceApplyConfiguration `json:"rbd,omitempty"` FlexVolume *FlexVolumeSourceApplyConfiguration `json:"flexVolume,omitempty"` Cinder *CinderVolumeSourceApplyConfiguration `json:"cinder,omitempty"` CephFS *CephFSVolumeSourceApplyConfiguration `json:"cephfs,omitempty"` Flocker *FlockerVolumeSourceApplyConfiguration `json:"flocker,omitempty"` DownwardAPI *DownwardAPIVolumeSourceApplyConfiguration `json:"downwardAPI,omitempty"` FC *FCVolumeSourceApplyConfiguration `json:"fc,omitempty"` AzureFile *AzureFileVolumeSourceApplyConfiguration `json:"azureFile,omitempty"` ConfigMap *ConfigMapVolumeSourceApplyConfiguration `json:"configMap,omitempty"` VsphereVolume *VsphereVirtualDiskVolumeSourceApplyConfiguration `json:"vsphereVolume,omitempty"` Quobyte *QuobyteVolumeSourceApplyConfiguration `json:"quobyte,omitempty"` AzureDisk *AzureDiskVolumeSourceApplyConfiguration `json:"azureDisk,omitempty"` PhotonPersistentDisk *PhotonPersistentDiskVolumeSourceApplyConfiguration `json:"photonPersistentDisk,omitempty"` Projected *ProjectedVolumeSourceApplyConfiguration `json:"projected,omitempty"` PortworxVolume *PortworxVolumeSourceApplyConfiguration `json:"portworxVolume,omitempty"` ScaleIO *ScaleIOVolumeSourceApplyConfiguration `json:"scaleIO,omitempty"` StorageOS *StorageOSVolumeSourceApplyConfiguration `json:"storageos,omitempty"` CSI *CSIVolumeSourceApplyConfiguration `json:"csi,omitempty"` Ephemeral *EphemeralVolumeSourceApplyConfiguration `json:"ephemeral,omitempty"` Image *ImageVolumeSourceApplyConfiguration `json:"image,omitempty"` } // VolumeSourceApplyConfiguration constructs a declarative configuration of the VolumeSource type for use with // apply. func VolumeSource() *VolumeSourceApplyConfiguration { return &VolumeSourceApplyConfiguration{} } // WithHostPath sets the HostPath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostPath field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.HostPath = value return b } // WithEmptyDir sets the EmptyDir field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EmptyDir field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithEmptyDir(value *EmptyDirVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.EmptyDir = value return b } // WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GCEPersistentDisk field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.GCEPersistentDisk = value return b } // WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.AWSElasticBlockStore = value return b } // WithGitRepo sets the GitRepo field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GitRepo field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithGitRepo(value *GitRepoVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.GitRepo = value return b } // WithSecret sets the Secret field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Secret field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithSecret(value *SecretVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.Secret = value return b } // WithNFS sets the NFS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NFS field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.NFS = value return b } // WithISCSI sets the ISCSI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ISCSI field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithISCSI(value *ISCSIVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.ISCSI = value return b } // WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Glusterfs field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithGlusterfs(value *GlusterfsVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.Glusterfs = value return b } // WithPersistentVolumeClaim sets the PersistentVolumeClaim field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeClaim field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithPersistentVolumeClaim(value *PersistentVolumeClaimVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.PersistentVolumeClaim = value return b } // WithRBD sets the RBD field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RBD field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithRBD(value *RBDVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.RBD = value return b } // WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FlexVolume field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithFlexVolume(value *FlexVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.FlexVolume = value return b } // WithCinder sets the Cinder field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Cinder field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithCinder(value *CinderVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.Cinder = value return b } // WithCephFS sets the CephFS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CephFS field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithCephFS(value *CephFSVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.CephFS = value return b } // WithFlocker sets the Flocker field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Flocker field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.Flocker = value return b } // WithDownwardAPI sets the DownwardAPI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DownwardAPI field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithDownwardAPI(value *DownwardAPIVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.DownwardAPI = value return b } // WithFC sets the FC field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FC field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.FC = value return b } // WithAzureFile sets the AzureFile field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AzureFile field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithAzureFile(value *AzureFileVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.AzureFile = value return b } // WithConfigMap sets the ConfigMap field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ConfigMap field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithConfigMap(value *ConfigMapVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.ConfigMap = value return b } // WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VsphereVolume field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.VsphereVolume = value return b } // WithQuobyte sets the Quobyte field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Quobyte field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.Quobyte = value return b } // WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AzureDisk field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.AzureDisk = value return b } // WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.PhotonPersistentDisk = value return b } // WithProjected sets the Projected field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Projected field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithProjected(value *ProjectedVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.Projected = value return b } // WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PortworxVolume field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.PortworxVolume = value return b } // WithScaleIO sets the ScaleIO field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ScaleIO field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithScaleIO(value *ScaleIOVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.ScaleIO = value return b } // WithStorageOS sets the StorageOS field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageOS field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithStorageOS(value *StorageOSVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.StorageOS = value return b } // WithCSI sets the CSI field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CSI field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithCSI(value *CSIVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.CSI = value return b } // WithEphemeral sets the Ephemeral field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ephemeral field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithEphemeral(value *EphemeralVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.Ephemeral = value return b } // WithImage sets the Image field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Image field is set to the value of the last call. func (b *VolumeSourceApplyConfiguration) WithImage(value *ImageVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { b.Image = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go000066400000000000000000000063211472614177300327160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VsphereVirtualDiskVolumeSourceApplyConfiguration represents a declarative configuration of the VsphereVirtualDiskVolumeSource type for use // with apply. type VsphereVirtualDiskVolumeSourceApplyConfiguration struct { VolumePath *string `json:"volumePath,omitempty"` FSType *string `json:"fsType,omitempty"` StoragePolicyName *string `json:"storagePolicyName,omitempty"` StoragePolicyID *string `json:"storagePolicyID,omitempty"` } // VsphereVirtualDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the VsphereVirtualDiskVolumeSource type for use with // apply. func VsphereVirtualDiskVolumeSource() *VsphereVirtualDiskVolumeSourceApplyConfiguration { return &VsphereVirtualDiskVolumeSourceApplyConfiguration{} } // WithVolumePath sets the VolumePath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumePath field is set to the value of the last call. func (b *VsphereVirtualDiskVolumeSourceApplyConfiguration) WithVolumePath(value string) *VsphereVirtualDiskVolumeSourceApplyConfiguration { b.VolumePath = &value return b } // WithFSType sets the FSType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSType field is set to the value of the last call. func (b *VsphereVirtualDiskVolumeSourceApplyConfiguration) WithFSType(value string) *VsphereVirtualDiskVolumeSourceApplyConfiguration { b.FSType = &value return b } // WithStoragePolicyName sets the StoragePolicyName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StoragePolicyName field is set to the value of the last call. func (b *VsphereVirtualDiskVolumeSourceApplyConfiguration) WithStoragePolicyName(value string) *VsphereVirtualDiskVolumeSourceApplyConfiguration { b.StoragePolicyName = &value return b } // WithStoragePolicyID sets the StoragePolicyID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StoragePolicyID field is set to the value of the last call. func (b *VsphereVirtualDiskVolumeSourceApplyConfiguration) WithStoragePolicyID(value string) *VsphereVirtualDiskVolumeSourceApplyConfiguration { b.StoragePolicyID = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/weightedpodaffinityterm.go000066400000000000000000000042271472614177300312370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // WeightedPodAffinityTermApplyConfiguration represents a declarative configuration of the WeightedPodAffinityTerm type for use // with apply. type WeightedPodAffinityTermApplyConfiguration struct { Weight *int32 `json:"weight,omitempty"` PodAffinityTerm *PodAffinityTermApplyConfiguration `json:"podAffinityTerm,omitempty"` } // WeightedPodAffinityTermApplyConfiguration constructs a declarative configuration of the WeightedPodAffinityTerm type for use with // apply. func WeightedPodAffinityTerm() *WeightedPodAffinityTermApplyConfiguration { return &WeightedPodAffinityTermApplyConfiguration{} } // WithWeight sets the Weight field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Weight field is set to the value of the last call. func (b *WeightedPodAffinityTermApplyConfiguration) WithWeight(value int32) *WeightedPodAffinityTermApplyConfiguration { b.Weight = &value return b } // WithPodAffinityTerm sets the PodAffinityTerm field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodAffinityTerm field is set to the value of the last call. func (b *WeightedPodAffinityTermApplyConfiguration) WithPodAffinityTerm(value *PodAffinityTermApplyConfiguration) *WeightedPodAffinityTermApplyConfiguration { b.PodAffinityTerm = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/core/v1/windowssecuritycontextoptions.go000066400000000000000000000064631472614177300326210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // WindowsSecurityContextOptionsApplyConfiguration represents a declarative configuration of the WindowsSecurityContextOptions type for use // with apply. type WindowsSecurityContextOptionsApplyConfiguration struct { GMSACredentialSpecName *string `json:"gmsaCredentialSpecName,omitempty"` GMSACredentialSpec *string `json:"gmsaCredentialSpec,omitempty"` RunAsUserName *string `json:"runAsUserName,omitempty"` HostProcess *bool `json:"hostProcess,omitempty"` } // WindowsSecurityContextOptionsApplyConfiguration constructs a declarative configuration of the WindowsSecurityContextOptions type for use with // apply. func WindowsSecurityContextOptions() *WindowsSecurityContextOptionsApplyConfiguration { return &WindowsSecurityContextOptionsApplyConfiguration{} } // WithGMSACredentialSpecName sets the GMSACredentialSpecName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GMSACredentialSpecName field is set to the value of the last call. func (b *WindowsSecurityContextOptionsApplyConfiguration) WithGMSACredentialSpecName(value string) *WindowsSecurityContextOptionsApplyConfiguration { b.GMSACredentialSpecName = &value return b } // WithGMSACredentialSpec sets the GMSACredentialSpec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GMSACredentialSpec field is set to the value of the last call. func (b *WindowsSecurityContextOptionsApplyConfiguration) WithGMSACredentialSpec(value string) *WindowsSecurityContextOptionsApplyConfiguration { b.GMSACredentialSpec = &value return b } // WithRunAsUserName sets the RunAsUserName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RunAsUserName field is set to the value of the last call. func (b *WindowsSecurityContextOptionsApplyConfiguration) WithRunAsUserName(value string) *WindowsSecurityContextOptionsApplyConfiguration { b.RunAsUserName = &value return b } // WithHostProcess sets the HostProcess field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostProcess field is set to the value of the last call. func (b *WindowsSecurityContextOptionsApplyConfiguration) WithHostProcess(value bool) *WindowsSecurityContextOptionsApplyConfiguration { b.HostProcess = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/000077500000000000000000000000001472614177300245075ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1/000077500000000000000000000000001472614177300250355ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1/endpoint.go000066400000000000000000000125501472614177300272070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" ) // EndpointApplyConfiguration represents a declarative configuration of the Endpoint type for use // with apply. type EndpointApplyConfiguration struct { Addresses []string `json:"addresses,omitempty"` Conditions *EndpointConditionsApplyConfiguration `json:"conditions,omitempty"` Hostname *string `json:"hostname,omitempty"` TargetRef *corev1.ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"` DeprecatedTopology map[string]string `json:"deprecatedTopology,omitempty"` NodeName *string `json:"nodeName,omitempty"` Zone *string `json:"zone,omitempty"` Hints *EndpointHintsApplyConfiguration `json:"hints,omitempty"` } // EndpointApplyConfiguration constructs a declarative configuration of the Endpoint type for use with // apply. func Endpoint() *EndpointApplyConfiguration { return &EndpointApplyConfiguration{} } // WithAddresses adds the given value to the Addresses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Addresses field. func (b *EndpointApplyConfiguration) WithAddresses(values ...string) *EndpointApplyConfiguration { for i := range values { b.Addresses = append(b.Addresses, values[i]) } return b } // WithConditions sets the Conditions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Conditions field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithConditions(value *EndpointConditionsApplyConfiguration) *EndpointApplyConfiguration { b.Conditions = value return b } // WithHostname sets the Hostname field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hostname field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithHostname(value string) *EndpointApplyConfiguration { b.Hostname = &value return b } // WithTargetRef sets the TargetRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetRef field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithTargetRef(value *corev1.ObjectReferenceApplyConfiguration) *EndpointApplyConfiguration { b.TargetRef = value return b } // WithDeprecatedTopology puts the entries into the DeprecatedTopology field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the DeprecatedTopology field, // overwriting an existing map entries in DeprecatedTopology field with the same key. func (b *EndpointApplyConfiguration) WithDeprecatedTopology(entries map[string]string) *EndpointApplyConfiguration { if b.DeprecatedTopology == nil && len(entries) > 0 { b.DeprecatedTopology = make(map[string]string, len(entries)) } for k, v := range entries { b.DeprecatedTopology[k] = v } return b } // WithNodeName sets the NodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeName field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithNodeName(value string) *EndpointApplyConfiguration { b.NodeName = &value return b } // WithZone sets the Zone field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Zone field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithZone(value string) *EndpointApplyConfiguration { b.Zone = &value return b } // WithHints sets the Hints field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hints field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithHints(value *EndpointHintsApplyConfiguration) *EndpointApplyConfiguration { b.Hints = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1/endpointconditions.go000066400000000000000000000046551472614177300313100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EndpointConditionsApplyConfiguration represents a declarative configuration of the EndpointConditions type for use // with apply. type EndpointConditionsApplyConfiguration struct { Ready *bool `json:"ready,omitempty"` Serving *bool `json:"serving,omitempty"` Terminating *bool `json:"terminating,omitempty"` } // EndpointConditionsApplyConfiguration constructs a declarative configuration of the EndpointConditions type for use with // apply. func EndpointConditions() *EndpointConditionsApplyConfiguration { return &EndpointConditionsApplyConfiguration{} } // WithReady sets the Ready field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ready field is set to the value of the last call. func (b *EndpointConditionsApplyConfiguration) WithReady(value bool) *EndpointConditionsApplyConfiguration { b.Ready = &value return b } // WithServing sets the Serving field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Serving field is set to the value of the last call. func (b *EndpointConditionsApplyConfiguration) WithServing(value bool) *EndpointConditionsApplyConfiguration { b.Serving = &value return b } // WithTerminating sets the Terminating field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Terminating field is set to the value of the last call. func (b *EndpointConditionsApplyConfiguration) WithTerminating(value bool) *EndpointConditionsApplyConfiguration { b.Terminating = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1/endpointhints.go000066400000000000000000000032141472614177300302520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // EndpointHintsApplyConfiguration represents a declarative configuration of the EndpointHints type for use // with apply. type EndpointHintsApplyConfiguration struct { ForZones []ForZoneApplyConfiguration `json:"forZones,omitempty"` } // EndpointHintsApplyConfiguration constructs a declarative configuration of the EndpointHints type for use with // apply. func EndpointHints() *EndpointHintsApplyConfiguration { return &EndpointHintsApplyConfiguration{} } // WithForZones adds the given value to the ForZones field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ForZones field. func (b *EndpointHintsApplyConfiguration) WithForZones(values ...*ForZoneApplyConfiguration) *EndpointHintsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithForZones") } b.ForZones = append(b.ForZones, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1/endpointport.go000066400000000000000000000055301472614177300301140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // EndpointPortApplyConfiguration represents a declarative configuration of the EndpointPort type for use // with apply. type EndpointPortApplyConfiguration struct { Name *string `json:"name,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` Port *int32 `json:"port,omitempty"` AppProtocol *string `json:"appProtocol,omitempty"` } // EndpointPortApplyConfiguration constructs a declarative configuration of the EndpointPort type for use with // apply. func EndpointPort() *EndpointPortApplyConfiguration { return &EndpointPortApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithName(value string) *EndpointPortApplyConfiguration { b.Name = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithProtocol(value v1.Protocol) *EndpointPortApplyConfiguration { b.Protocol = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithPort(value int32) *EndpointPortApplyConfiguration { b.Port = &value return b } // WithAppProtocol sets the AppProtocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AppProtocol field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithAppProtocol(value string) *EndpointPortApplyConfiguration { b.AppProtocol = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1/endpointslice.go000066400000000000000000000326331472614177300302330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( discoveryv1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // EndpointSliceApplyConfiguration represents a declarative configuration of the EndpointSlice type for use // with apply. type EndpointSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` AddressType *discoveryv1.AddressType `json:"addressType,omitempty"` Endpoints []EndpointApplyConfiguration `json:"endpoints,omitempty"` Ports []EndpointPortApplyConfiguration `json:"ports,omitempty"` } // EndpointSlice constructs a declarative configuration of the EndpointSlice type for use with // apply. func EndpointSlice(name, namespace string) *EndpointSliceApplyConfiguration { b := &EndpointSliceApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("EndpointSlice") b.WithAPIVersion("discovery.k8s.io/v1") return b } // ExtractEndpointSlice extracts the applied configuration owned by fieldManager from // endpointSlice. If no managedFields are found in endpointSlice for fieldManager, a // EndpointSliceApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // endpointSlice must be a unmodified EndpointSlice API object that was retrieved from the Kubernetes API. // ExtractEndpointSlice provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractEndpointSlice(endpointSlice *discoveryv1.EndpointSlice, fieldManager string) (*EndpointSliceApplyConfiguration, error) { return extractEndpointSlice(endpointSlice, fieldManager, "") } // ExtractEndpointSliceStatus is the same as ExtractEndpointSlice except // that it extracts the status subresource applied configuration. // Experimental! func ExtractEndpointSliceStatus(endpointSlice *discoveryv1.EndpointSlice, fieldManager string) (*EndpointSliceApplyConfiguration, error) { return extractEndpointSlice(endpointSlice, fieldManager, "status") } func extractEndpointSlice(endpointSlice *discoveryv1.EndpointSlice, fieldManager string, subresource string) (*EndpointSliceApplyConfiguration, error) { b := &EndpointSliceApplyConfiguration{} err := managedfields.ExtractInto(endpointSlice, internal.Parser().Type("io.k8s.api.discovery.v1.EndpointSlice"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(endpointSlice.Name) b.WithNamespace(endpointSlice.Namespace) b.WithKind("EndpointSlice") b.WithAPIVersion("discovery.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithKind(value string) *EndpointSliceApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithAPIVersion(value string) *EndpointSliceApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithName(value string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithGenerateName(value string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithNamespace(value string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithUID(value types.UID) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithResourceVersion(value string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithGeneration(value int64) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *EndpointSliceApplyConfiguration) WithLabels(entries map[string]string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *EndpointSliceApplyConfiguration) WithAnnotations(entries map[string]string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *EndpointSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *EndpointSliceApplyConfiguration) WithFinalizers(values ...string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *EndpointSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithAddressType sets the AddressType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AddressType field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithAddressType(value discoveryv1.AddressType) *EndpointSliceApplyConfiguration { b.AddressType = &value return b } // WithEndpoints adds the given value to the Endpoints field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Endpoints field. func (b *EndpointSliceApplyConfiguration) WithEndpoints(values ...*EndpointApplyConfiguration) *EndpointSliceApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEndpoints") } b.Endpoints = append(b.Endpoints, *values[i]) } return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *EndpointSliceApplyConfiguration) WithPorts(values ...*EndpointPortApplyConfiguration) *EndpointSliceApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *EndpointSliceApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1/forzone.go000066400000000000000000000025761472614177300270600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ForZoneApplyConfiguration represents a declarative configuration of the ForZone type for use // with apply. type ForZoneApplyConfiguration struct { Name *string `json:"name,omitempty"` } // ForZoneApplyConfiguration constructs a declarative configuration of the ForZone type for use with // apply. func ForZone() *ForZoneApplyConfiguration { return &ForZoneApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ForZoneApplyConfiguration) WithName(value string) *ForZoneApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1beta1/000077500000000000000000000000001472614177300257525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1beta1/endpoint.go000066400000000000000000000113401472614177300301200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // EndpointApplyConfiguration represents a declarative configuration of the Endpoint type for use // with apply. type EndpointApplyConfiguration struct { Addresses []string `json:"addresses,omitempty"` Conditions *EndpointConditionsApplyConfiguration `json:"conditions,omitempty"` Hostname *string `json:"hostname,omitempty"` TargetRef *v1.ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"` Topology map[string]string `json:"topology,omitempty"` NodeName *string `json:"nodeName,omitempty"` Hints *EndpointHintsApplyConfiguration `json:"hints,omitempty"` } // EndpointApplyConfiguration constructs a declarative configuration of the Endpoint type for use with // apply. func Endpoint() *EndpointApplyConfiguration { return &EndpointApplyConfiguration{} } // WithAddresses adds the given value to the Addresses field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Addresses field. func (b *EndpointApplyConfiguration) WithAddresses(values ...string) *EndpointApplyConfiguration { for i := range values { b.Addresses = append(b.Addresses, values[i]) } return b } // WithConditions sets the Conditions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Conditions field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithConditions(value *EndpointConditionsApplyConfiguration) *EndpointApplyConfiguration { b.Conditions = value return b } // WithHostname sets the Hostname field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hostname field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithHostname(value string) *EndpointApplyConfiguration { b.Hostname = &value return b } // WithTargetRef sets the TargetRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TargetRef field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithTargetRef(value *v1.ObjectReferenceApplyConfiguration) *EndpointApplyConfiguration { b.TargetRef = value return b } // WithTopology puts the entries into the Topology field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Topology field, // overwriting an existing map entries in Topology field with the same key. func (b *EndpointApplyConfiguration) WithTopology(entries map[string]string) *EndpointApplyConfiguration { if b.Topology == nil && len(entries) > 0 { b.Topology = make(map[string]string, len(entries)) } for k, v := range entries { b.Topology[k] = v } return b } // WithNodeName sets the NodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeName field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithNodeName(value string) *EndpointApplyConfiguration { b.NodeName = &value return b } // WithHints sets the Hints field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hints field is set to the value of the last call. func (b *EndpointApplyConfiguration) WithHints(value *EndpointHintsApplyConfiguration) *EndpointApplyConfiguration { b.Hints = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1beta1/endpointconditions.go000066400000000000000000000046621472614177300322230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // EndpointConditionsApplyConfiguration represents a declarative configuration of the EndpointConditions type for use // with apply. type EndpointConditionsApplyConfiguration struct { Ready *bool `json:"ready,omitempty"` Serving *bool `json:"serving,omitempty"` Terminating *bool `json:"terminating,omitempty"` } // EndpointConditionsApplyConfiguration constructs a declarative configuration of the EndpointConditions type for use with // apply. func EndpointConditions() *EndpointConditionsApplyConfiguration { return &EndpointConditionsApplyConfiguration{} } // WithReady sets the Ready field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Ready field is set to the value of the last call. func (b *EndpointConditionsApplyConfiguration) WithReady(value bool) *EndpointConditionsApplyConfiguration { b.Ready = &value return b } // WithServing sets the Serving field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Serving field is set to the value of the last call. func (b *EndpointConditionsApplyConfiguration) WithServing(value bool) *EndpointConditionsApplyConfiguration { b.Serving = &value return b } // WithTerminating sets the Terminating field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Terminating field is set to the value of the last call. func (b *EndpointConditionsApplyConfiguration) WithTerminating(value bool) *EndpointConditionsApplyConfiguration { b.Terminating = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1beta1/endpointhints.go000066400000000000000000000032211472614177300311650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // EndpointHintsApplyConfiguration represents a declarative configuration of the EndpointHints type for use // with apply. type EndpointHintsApplyConfiguration struct { ForZones []ForZoneApplyConfiguration `json:"forZones,omitempty"` } // EndpointHintsApplyConfiguration constructs a declarative configuration of the EndpointHints type for use with // apply. func EndpointHints() *EndpointHintsApplyConfiguration { return &EndpointHintsApplyConfiguration{} } // WithForZones adds the given value to the ForZones field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ForZones field. func (b *EndpointHintsApplyConfiguration) WithForZones(values ...*ForZoneApplyConfiguration) *EndpointHintsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithForZones") } b.ForZones = append(b.ForZones, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1beta1/endpointport.go000066400000000000000000000055351472614177300310360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" ) // EndpointPortApplyConfiguration represents a declarative configuration of the EndpointPort type for use // with apply. type EndpointPortApplyConfiguration struct { Name *string `json:"name,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` Port *int32 `json:"port,omitempty"` AppProtocol *string `json:"appProtocol,omitempty"` } // EndpointPortApplyConfiguration constructs a declarative configuration of the EndpointPort type for use with // apply. func EndpointPort() *EndpointPortApplyConfiguration { return &EndpointPortApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithName(value string) *EndpointPortApplyConfiguration { b.Name = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithProtocol(value v1.Protocol) *EndpointPortApplyConfiguration { b.Protocol = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithPort(value int32) *EndpointPortApplyConfiguration { b.Port = &value return b } // WithAppProtocol sets the AppProtocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AppProtocol field is set to the value of the last call. func (b *EndpointPortApplyConfiguration) WithAppProtocol(value string) *EndpointPortApplyConfiguration { b.AppProtocol = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1beta1/endpointslice.go000066400000000000000000000326401472614177300311460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/discovery/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // EndpointSliceApplyConfiguration represents a declarative configuration of the EndpointSlice type for use // with apply. type EndpointSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` AddressType *v1beta1.AddressType `json:"addressType,omitempty"` Endpoints []EndpointApplyConfiguration `json:"endpoints,omitempty"` Ports []EndpointPortApplyConfiguration `json:"ports,omitempty"` } // EndpointSlice constructs a declarative configuration of the EndpointSlice type for use with // apply. func EndpointSlice(name, namespace string) *EndpointSliceApplyConfiguration { b := &EndpointSliceApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("EndpointSlice") b.WithAPIVersion("discovery.k8s.io/v1beta1") return b } // ExtractEndpointSlice extracts the applied configuration owned by fieldManager from // endpointSlice. If no managedFields are found in endpointSlice for fieldManager, a // EndpointSliceApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // endpointSlice must be a unmodified EndpointSlice API object that was retrieved from the Kubernetes API. // ExtractEndpointSlice provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractEndpointSlice(endpointSlice *v1beta1.EndpointSlice, fieldManager string) (*EndpointSliceApplyConfiguration, error) { return extractEndpointSlice(endpointSlice, fieldManager, "") } // ExtractEndpointSliceStatus is the same as ExtractEndpointSlice except // that it extracts the status subresource applied configuration. // Experimental! func ExtractEndpointSliceStatus(endpointSlice *v1beta1.EndpointSlice, fieldManager string) (*EndpointSliceApplyConfiguration, error) { return extractEndpointSlice(endpointSlice, fieldManager, "status") } func extractEndpointSlice(endpointSlice *v1beta1.EndpointSlice, fieldManager string, subresource string) (*EndpointSliceApplyConfiguration, error) { b := &EndpointSliceApplyConfiguration{} err := managedfields.ExtractInto(endpointSlice, internal.Parser().Type("io.k8s.api.discovery.v1beta1.EndpointSlice"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(endpointSlice.Name) b.WithNamespace(endpointSlice.Namespace) b.WithKind("EndpointSlice") b.WithAPIVersion("discovery.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithKind(value string) *EndpointSliceApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithAPIVersion(value string) *EndpointSliceApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithName(value string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithGenerateName(value string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithNamespace(value string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithUID(value types.UID) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithResourceVersion(value string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithGeneration(value int64) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *EndpointSliceApplyConfiguration) WithLabels(entries map[string]string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *EndpointSliceApplyConfiguration) WithAnnotations(entries map[string]string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *EndpointSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *EndpointSliceApplyConfiguration) WithFinalizers(values ...string) *EndpointSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *EndpointSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithAddressType sets the AddressType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AddressType field is set to the value of the last call. func (b *EndpointSliceApplyConfiguration) WithAddressType(value v1beta1.AddressType) *EndpointSliceApplyConfiguration { b.AddressType = &value return b } // WithEndpoints adds the given value to the Endpoints field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Endpoints field. func (b *EndpointSliceApplyConfiguration) WithEndpoints(values ...*EndpointApplyConfiguration) *EndpointSliceApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEndpoints") } b.Endpoints = append(b.Endpoints, *values[i]) } return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *EndpointSliceApplyConfiguration) WithPorts(values ...*EndpointPortApplyConfiguration) *EndpointSliceApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *EndpointSliceApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/discovery/v1beta1/forzone.go000066400000000000000000000026031472614177300277640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ForZoneApplyConfiguration represents a declarative configuration of the ForZone type for use // with apply. type ForZoneApplyConfiguration struct { Name *string `json:"name,omitempty"` } // ForZoneApplyConfiguration constructs a declarative configuration of the ForZone type for use with // apply. func ForZone() *ForZoneApplyConfiguration { return &ForZoneApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ForZoneApplyConfiguration) WithName(value string) *ForZoneApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/doc.go000066400000000000000000000151451472614177300236020ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Package applyconfigurations provides typesafe go representations of the apply configurations that are used to constructs Server-side Apply requests. # Basics The Apply functions in the typed client (see the k8s.io/client-go/kubernetes/typed packages) offer a direct and typesafe way of calling Server-side Apply. Each Apply function takes an "apply configuration" type as an argument, which is a structured representation of an Apply request. For example: import ( ... v1ac "k8s.io/client-go/applyconfigurations/autoscaling/v1" ) hpaApplyConfig := v1ac.HorizontalPodAutoscaler(autoscalerName, ns). WithSpec(v1ac.HorizontalPodAutoscalerSpec(). WithMinReplicas(0) ) return hpav1client.Apply(ctx, hpaApplyConfig, metav1.ApplyOptions{FieldManager: "mycontroller", Force: true}) Note in this example that HorizontalPodAutoscaler is imported from an "applyconfigurations" package. Each "apply configuration" type represents the same Kubernetes object kind as the corresponding go struct, but where all fields are pointers to make them optional, allowing apply requests to be accurately represented. For example, this when the apply configuration in the above example is marshalled to YAML, it produces: apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: myHPA namespace: myNamespace spec: minReplicas: 0 To understand why this is needed, the above YAML cannot be produced by the v1.HorizontalPodAutoscaler go struct. Take for example: hpa := v1.HorizontalPodAutoscaler{ TypeMeta: metav1.TypeMeta{ APIVersion: "autoscaling/v1", Kind: "HorizontalPodAutoscaler", }, ObjectMeta: ObjectMeta{ Namespace: ns, Name: autoscalerName, }, Spec: v1.HorizontalPodAutoscalerSpec{ MinReplicas: pointer.Int32Ptr(0), }, } The above code attempts to declare the same apply configuration as shown in the previous examples, but when marshalled to YAML, produces: kind: HorizontalPodAutoscaler apiVersion: autoscaling/v1 metadata: name: myHPA namespace: myNamespace creationTimestamp: null spec: scaleTargetRef: kind: "" name: "" minReplicas: 0 maxReplicas: 0 Which, among other things, contains spec.maxReplicas set to 0. This is almost certainly not what the caller intended (the intended apply configuration says nothing about the maxReplicas field), and could have serious consequences on a production system: it directs the autoscaler to downscale to zero pods. The problem here originates from the fact that the go structs contain required fields that are zero valued if not set explicitly. The go structs work as intended for create and update operations, but are fundamentally incompatible with apply, which is why we have introduced the generated "apply configuration" types. The "apply configurations" also have convenience With functions that make it easier to build apply requests. This allows developers to set fields without having to deal with the fact that all the fields in the "apply configuration" types are pointers, and are inconvenient to set using go. For example "MinReplicas: &0" is not legal go code, so without the With functions, developers would work around this problem by using a library, .e.g. "MinReplicas: pointer.Int32Ptr(0)", but string enumerations like corev1.Protocol are still a problem since they cannot be supported by a general purpose library. In addition to the convenience, the With functions also isolate developers from the underlying representation, which makes it safer for the underlying representation to be changed to support additional features in the future. # Controller Support The new client-go support makes it much easier to use Server-side Apply in controllers, by either of two mechanisms. Mechanism 1: When authoring new controllers to use Server-side Apply, a good approach is to have the controller recreate the apply configuration for an object each time it reconciles that object. This ensures that the controller fully reconciles all the fields that it is responsible for. Controllers typically should unconditionally set all the fields they own by setting "Force: true" in the ApplyOptions. Controllers must also provide a FieldManager name that is unique to the reconciliation loop that apply is called from. When upgrading existing controllers to use Server-side Apply the same approach often works well--migrate the controllers to recreate the apply configuration each time it reconciles any object. For cases where this does not work well, see Mechanism 2. Mechanism 2: When upgrading existing controllers to use Server-side Apply, the controller might have multiple code paths that update different parts of an object depending on various conditions. Migrating a controller like this to Server-side Apply can be risky because if the controller forgets to include any fields in an apply configuration that is included in a previous apply request, a field can be accidentally deleted. For such cases, an alternative to mechanism 1 is to replace any controller reconciliation code that performs a "read/modify-in-place/update" (or patch) workflow with a "extract/modify-in-place/apply" workflow. Here's an example of the new workflow: fieldMgr := "my-field-manager" deploymentClient := clientset.AppsV1().Deployments("default") // read, could also be read from a shared informer deployment, err := deploymentClient.Get(ctx, "example-deployment", metav1.GetOptions{}) if err != nil { // handle error } // extract deploymentApplyConfig, err := appsv1ac.ExtractDeployment(deployment, fieldMgr) if err != nil { // handle error } // modify-in-place deploymentApplyConfig.Spec.Template.Spec.WithContainers(corev1ac.Container(). WithName("modify-slice"). WithImage("nginx:1.14.2"), ) // apply applied, err := deploymentClient.Apply(ctx, extractedDeployment, metav1.ApplyOptions{FieldManager: fieldMgr}) */ package applyconfigurations // import "k8s.io/client-go/applyconfigurations" kubernetes-client-go-a2dfcab/applyconfigurations/events/000077500000000000000000000000001472614177300240045ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/events/v1/000077500000000000000000000000001472614177300243325ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/events/v1/event.go000066400000000000000000000445731472614177300260170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apieventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" corev1 "k8s.io/client-go/applyconfigurations/core/v1" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // EventApplyConfiguration represents a declarative configuration of the Event type for use // with apply. type EventApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` EventTime *metav1.MicroTime `json:"eventTime,omitempty"` Series *EventSeriesApplyConfiguration `json:"series,omitempty"` ReportingController *string `json:"reportingController,omitempty"` ReportingInstance *string `json:"reportingInstance,omitempty"` Action *string `json:"action,omitempty"` Reason *string `json:"reason,omitempty"` Regarding *corev1.ObjectReferenceApplyConfiguration `json:"regarding,omitempty"` Related *corev1.ObjectReferenceApplyConfiguration `json:"related,omitempty"` Note *string `json:"note,omitempty"` Type *string `json:"type,omitempty"` DeprecatedSource *corev1.EventSourceApplyConfiguration `json:"deprecatedSource,omitempty"` DeprecatedFirstTimestamp *metav1.Time `json:"deprecatedFirstTimestamp,omitempty"` DeprecatedLastTimestamp *metav1.Time `json:"deprecatedLastTimestamp,omitempty"` DeprecatedCount *int32 `json:"deprecatedCount,omitempty"` } // Event constructs a declarative configuration of the Event type for use with // apply. func Event(name, namespace string) *EventApplyConfiguration { b := &EventApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Event") b.WithAPIVersion("events.k8s.io/v1") return b } // ExtractEvent extracts the applied configuration owned by fieldManager from // event. If no managedFields are found in event for fieldManager, a // EventApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // event must be a unmodified Event API object that was retrieved from the Kubernetes API. // ExtractEvent provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractEvent(event *apieventsv1.Event, fieldManager string) (*EventApplyConfiguration, error) { return extractEvent(event, fieldManager, "") } // ExtractEventStatus is the same as ExtractEvent except // that it extracts the status subresource applied configuration. // Experimental! func ExtractEventStatus(event *apieventsv1.Event, fieldManager string) (*EventApplyConfiguration, error) { return extractEvent(event, fieldManager, "status") } func extractEvent(event *apieventsv1.Event, fieldManager string, subresource string) (*EventApplyConfiguration, error) { b := &EventApplyConfiguration{} err := managedfields.ExtractInto(event, internal.Parser().Type("io.k8s.api.events.v1.Event"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(event.Name) b.WithNamespace(event.Namespace) b.WithKind("Event") b.WithAPIVersion("events.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *EventApplyConfiguration) WithKind(value string) *EventApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *EventApplyConfiguration) WithAPIVersion(value string) *EventApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EventApplyConfiguration) WithName(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *EventApplyConfiguration) WithGenerateName(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *EventApplyConfiguration) WithNamespace(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *EventApplyConfiguration) WithUID(value types.UID) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *EventApplyConfiguration) WithResourceVersion(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *EventApplyConfiguration) WithGeneration(value int64) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *EventApplyConfiguration) WithLabels(entries map[string]string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *EventApplyConfiguration) WithAnnotations(entries map[string]string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *EventApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *EventApplyConfiguration) WithFinalizers(values ...string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *EventApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithEventTime sets the EventTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EventTime field is set to the value of the last call. func (b *EventApplyConfiguration) WithEventTime(value metav1.MicroTime) *EventApplyConfiguration { b.EventTime = &value return b } // WithSeries sets the Series field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Series field is set to the value of the last call. func (b *EventApplyConfiguration) WithSeries(value *EventSeriesApplyConfiguration) *EventApplyConfiguration { b.Series = value return b } // WithReportingController sets the ReportingController field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReportingController field is set to the value of the last call. func (b *EventApplyConfiguration) WithReportingController(value string) *EventApplyConfiguration { b.ReportingController = &value return b } // WithReportingInstance sets the ReportingInstance field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReportingInstance field is set to the value of the last call. func (b *EventApplyConfiguration) WithReportingInstance(value string) *EventApplyConfiguration { b.ReportingInstance = &value return b } // WithAction sets the Action field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Action field is set to the value of the last call. func (b *EventApplyConfiguration) WithAction(value string) *EventApplyConfiguration { b.Action = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *EventApplyConfiguration) WithReason(value string) *EventApplyConfiguration { b.Reason = &value return b } // WithRegarding sets the Regarding field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Regarding field is set to the value of the last call. func (b *EventApplyConfiguration) WithRegarding(value *corev1.ObjectReferenceApplyConfiguration) *EventApplyConfiguration { b.Regarding = value return b } // WithRelated sets the Related field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Related field is set to the value of the last call. func (b *EventApplyConfiguration) WithRelated(value *corev1.ObjectReferenceApplyConfiguration) *EventApplyConfiguration { b.Related = value return b } // WithNote sets the Note field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Note field is set to the value of the last call. func (b *EventApplyConfiguration) WithNote(value string) *EventApplyConfiguration { b.Note = &value return b } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *EventApplyConfiguration) WithType(value string) *EventApplyConfiguration { b.Type = &value return b } // WithDeprecatedSource sets the DeprecatedSource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedSource field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeprecatedSource(value *corev1.EventSourceApplyConfiguration) *EventApplyConfiguration { b.DeprecatedSource = value return b } // WithDeprecatedFirstTimestamp sets the DeprecatedFirstTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedFirstTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeprecatedFirstTimestamp(value metav1.Time) *EventApplyConfiguration { b.DeprecatedFirstTimestamp = &value return b } // WithDeprecatedLastTimestamp sets the DeprecatedLastTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedLastTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeprecatedLastTimestamp(value metav1.Time) *EventApplyConfiguration { b.DeprecatedLastTimestamp = &value return b } // WithDeprecatedCount sets the DeprecatedCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedCount field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeprecatedCount(value int32) *EventApplyConfiguration { b.DeprecatedCount = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *EventApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/events/v1/eventseries.go000066400000000000000000000040011472614177300272100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // EventSeriesApplyConfiguration represents a declarative configuration of the EventSeries type for use // with apply. type EventSeriesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` LastObservedTime *v1.MicroTime `json:"lastObservedTime,omitempty"` } // EventSeriesApplyConfiguration constructs a declarative configuration of the EventSeries type for use with // apply. func EventSeries() *EventSeriesApplyConfiguration { return &EventSeriesApplyConfiguration{} } // WithCount sets the Count field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Count field is set to the value of the last call. func (b *EventSeriesApplyConfiguration) WithCount(value int32) *EventSeriesApplyConfiguration { b.Count = &value return b } // WithLastObservedTime sets the LastObservedTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastObservedTime field is set to the value of the last call. func (b *EventSeriesApplyConfiguration) WithLastObservedTime(value v1.MicroTime) *EventSeriesApplyConfiguration { b.LastObservedTime = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/events/v1beta1/000077500000000000000000000000001472614177300252475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/events/v1beta1/event.go000066400000000000000000000446341472614177300267320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( eventsv1beta1 "k8s.io/api/events/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" corev1 "k8s.io/client-go/applyconfigurations/core/v1" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // EventApplyConfiguration represents a declarative configuration of the Event type for use // with apply. type EventApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` EventTime *metav1.MicroTime `json:"eventTime,omitempty"` Series *EventSeriesApplyConfiguration `json:"series,omitempty"` ReportingController *string `json:"reportingController,omitempty"` ReportingInstance *string `json:"reportingInstance,omitempty"` Action *string `json:"action,omitempty"` Reason *string `json:"reason,omitempty"` Regarding *corev1.ObjectReferenceApplyConfiguration `json:"regarding,omitempty"` Related *corev1.ObjectReferenceApplyConfiguration `json:"related,omitempty"` Note *string `json:"note,omitempty"` Type *string `json:"type,omitempty"` DeprecatedSource *corev1.EventSourceApplyConfiguration `json:"deprecatedSource,omitempty"` DeprecatedFirstTimestamp *metav1.Time `json:"deprecatedFirstTimestamp,omitempty"` DeprecatedLastTimestamp *metav1.Time `json:"deprecatedLastTimestamp,omitempty"` DeprecatedCount *int32 `json:"deprecatedCount,omitempty"` } // Event constructs a declarative configuration of the Event type for use with // apply. func Event(name, namespace string) *EventApplyConfiguration { b := &EventApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Event") b.WithAPIVersion("events.k8s.io/v1beta1") return b } // ExtractEvent extracts the applied configuration owned by fieldManager from // event. If no managedFields are found in event for fieldManager, a // EventApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // event must be a unmodified Event API object that was retrieved from the Kubernetes API. // ExtractEvent provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractEvent(event *eventsv1beta1.Event, fieldManager string) (*EventApplyConfiguration, error) { return extractEvent(event, fieldManager, "") } // ExtractEventStatus is the same as ExtractEvent except // that it extracts the status subresource applied configuration. // Experimental! func ExtractEventStatus(event *eventsv1beta1.Event, fieldManager string) (*EventApplyConfiguration, error) { return extractEvent(event, fieldManager, "status") } func extractEvent(event *eventsv1beta1.Event, fieldManager string, subresource string) (*EventApplyConfiguration, error) { b := &EventApplyConfiguration{} err := managedfields.ExtractInto(event, internal.Parser().Type("io.k8s.api.events.v1beta1.Event"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(event.Name) b.WithNamespace(event.Namespace) b.WithKind("Event") b.WithAPIVersion("events.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *EventApplyConfiguration) WithKind(value string) *EventApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *EventApplyConfiguration) WithAPIVersion(value string) *EventApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EventApplyConfiguration) WithName(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *EventApplyConfiguration) WithGenerateName(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *EventApplyConfiguration) WithNamespace(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *EventApplyConfiguration) WithUID(value types.UID) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *EventApplyConfiguration) WithResourceVersion(value string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *EventApplyConfiguration) WithGeneration(value int64) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *EventApplyConfiguration) WithLabels(entries map[string]string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *EventApplyConfiguration) WithAnnotations(entries map[string]string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *EventApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *EventApplyConfiguration) WithFinalizers(values ...string) *EventApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *EventApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithEventTime sets the EventTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EventTime field is set to the value of the last call. func (b *EventApplyConfiguration) WithEventTime(value metav1.MicroTime) *EventApplyConfiguration { b.EventTime = &value return b } // WithSeries sets the Series field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Series field is set to the value of the last call. func (b *EventApplyConfiguration) WithSeries(value *EventSeriesApplyConfiguration) *EventApplyConfiguration { b.Series = value return b } // WithReportingController sets the ReportingController field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReportingController field is set to the value of the last call. func (b *EventApplyConfiguration) WithReportingController(value string) *EventApplyConfiguration { b.ReportingController = &value return b } // WithReportingInstance sets the ReportingInstance field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReportingInstance field is set to the value of the last call. func (b *EventApplyConfiguration) WithReportingInstance(value string) *EventApplyConfiguration { b.ReportingInstance = &value return b } // WithAction sets the Action field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Action field is set to the value of the last call. func (b *EventApplyConfiguration) WithAction(value string) *EventApplyConfiguration { b.Action = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *EventApplyConfiguration) WithReason(value string) *EventApplyConfiguration { b.Reason = &value return b } // WithRegarding sets the Regarding field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Regarding field is set to the value of the last call. func (b *EventApplyConfiguration) WithRegarding(value *corev1.ObjectReferenceApplyConfiguration) *EventApplyConfiguration { b.Regarding = value return b } // WithRelated sets the Related field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Related field is set to the value of the last call. func (b *EventApplyConfiguration) WithRelated(value *corev1.ObjectReferenceApplyConfiguration) *EventApplyConfiguration { b.Related = value return b } // WithNote sets the Note field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Note field is set to the value of the last call. func (b *EventApplyConfiguration) WithNote(value string) *EventApplyConfiguration { b.Note = &value return b } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *EventApplyConfiguration) WithType(value string) *EventApplyConfiguration { b.Type = &value return b } // WithDeprecatedSource sets the DeprecatedSource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedSource field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeprecatedSource(value *corev1.EventSourceApplyConfiguration) *EventApplyConfiguration { b.DeprecatedSource = value return b } // WithDeprecatedFirstTimestamp sets the DeprecatedFirstTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedFirstTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeprecatedFirstTimestamp(value metav1.Time) *EventApplyConfiguration { b.DeprecatedFirstTimestamp = &value return b } // WithDeprecatedLastTimestamp sets the DeprecatedLastTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedLastTimestamp field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeprecatedLastTimestamp(value metav1.Time) *EventApplyConfiguration { b.DeprecatedLastTimestamp = &value return b } // WithDeprecatedCount sets the DeprecatedCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeprecatedCount field is set to the value of the last call. func (b *EventApplyConfiguration) WithDeprecatedCount(value int32) *EventApplyConfiguration { b.DeprecatedCount = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *EventApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/events/v1beta1/eventseries.go000066400000000000000000000040061472614177300301320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // EventSeriesApplyConfiguration represents a declarative configuration of the EventSeries type for use // with apply. type EventSeriesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` LastObservedTime *v1.MicroTime `json:"lastObservedTime,omitempty"` } // EventSeriesApplyConfiguration constructs a declarative configuration of the EventSeries type for use with // apply. func EventSeries() *EventSeriesApplyConfiguration { return &EventSeriesApplyConfiguration{} } // WithCount sets the Count field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Count field is set to the value of the last call. func (b *EventSeriesApplyConfiguration) WithCount(value int32) *EventSeriesApplyConfiguration { b.Count = &value return b } // WithLastObservedTime sets the LastObservedTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastObservedTime field is set to the value of the last call. func (b *EventSeriesApplyConfiguration) WithLastObservedTime(value v1.MicroTime) *EventSeriesApplyConfiguration { b.LastObservedTime = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/000077500000000000000000000000001472614177300246775ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/000077500000000000000000000000001472614177300261425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/daemonset.go000066400000000000000000000305131472614177300304520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DaemonSetApplyConfiguration represents a declarative configuration of the DaemonSet type for use // with apply. type DaemonSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *DaemonSetSpecApplyConfiguration `json:"spec,omitempty"` Status *DaemonSetStatusApplyConfiguration `json:"status,omitempty"` } // DaemonSet constructs a declarative configuration of the DaemonSet type for use with // apply. func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration { b := &DaemonSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("DaemonSet") b.WithAPIVersion("extensions/v1beta1") return b } // ExtractDaemonSet extracts the applied configuration owned by fieldManager from // daemonSet. If no managedFields are found in daemonSet for fieldManager, a // DaemonSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // daemonSet must be a unmodified DaemonSet API object that was retrieved from the Kubernetes API. // ExtractDaemonSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractDaemonSet(daemonSet *extensionsv1beta1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { return extractDaemonSet(daemonSet, fieldManager, "") } // ExtractDaemonSetStatus is the same as ExtractDaemonSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractDaemonSetStatus(daemonSet *extensionsv1beta1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) { return extractDaemonSet(daemonSet, fieldManager, "status") } func extractDaemonSet(daemonSet *extensionsv1beta1.DaemonSet, fieldManager string, subresource string) (*DaemonSetApplyConfiguration, error) { b := &DaemonSetApplyConfiguration{} err := managedfields.ExtractInto(daemonSet, internal.Parser().Type("io.k8s.api.extensions.v1beta1.DaemonSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(daemonSet.Name) b.WithNamespace(daemonSet.Namespace) b.WithKind("DaemonSet") b.WithAPIVersion("extensions/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithKind(value string) *DaemonSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithAPIVersion(value string) *DaemonSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithName(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithGenerateName(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithNamespace(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithUID(value types.UID) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithResourceVersion(value string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithGeneration(value int64) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *DaemonSetApplyConfiguration) WithLabels(entries map[string]string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *DaemonSetApplyConfiguration) WithAnnotations(entries map[string]string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *DaemonSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *DaemonSetApplyConfiguration) WithFinalizers(values ...string) *DaemonSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *DaemonSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithSpec(value *DaemonSetSpecApplyConfiguration) *DaemonSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DaemonSetApplyConfiguration) WithStatus(value *DaemonSetStatusApplyConfiguration) *DaemonSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *DaemonSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/daemonsetcondition.go000066400000000000000000000072771472614177300323740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" v1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DaemonSetConditionApplyConfiguration represents a declarative configuration of the DaemonSetCondition type for use // with apply. type DaemonSetConditionApplyConfiguration struct { Type *v1beta1.DaemonSetConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // DaemonSetConditionApplyConfiguration constructs a declarative configuration of the DaemonSetCondition type for use with // apply. func DaemonSetCondition() *DaemonSetConditionApplyConfiguration { return &DaemonSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithType(value v1beta1.DaemonSetConditionType) *DaemonSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *DaemonSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DaemonSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithReason(value string) *DaemonSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *DaemonSetConditionApplyConfiguration) WithMessage(value string) *DaemonSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/daemonsetspec.go000066400000000000000000000106341472614177300313270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DaemonSetSpecApplyConfiguration represents a declarative configuration of the DaemonSetSpec type for use // with apply. type DaemonSetSpecApplyConfiguration struct { Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` UpdateStrategy *DaemonSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` TemplateGeneration *int64 `json:"templateGeneration,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` } // DaemonSetSpecApplyConfiguration constructs a declarative configuration of the DaemonSetSpec type for use with // apply. func DaemonSetSpec() *DaemonSetSpecApplyConfiguration { return &DaemonSetSpecApplyConfiguration{} } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.Template = value return b } // WithUpdateStrategy sets the UpdateStrategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdateStrategy field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithUpdateStrategy(value *DaemonSetUpdateStrategyApplyConfiguration) *DaemonSetSpecApplyConfiguration { b.UpdateStrategy = value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *DaemonSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithTemplateGeneration sets the TemplateGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the TemplateGeneration field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithTemplateGeneration(value int64) *DaemonSetSpecApplyConfiguration { b.TemplateGeneration = &value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *DaemonSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DaemonSetSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/daemonsetstatus.go000066400000000000000000000153101472614177300317140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // DaemonSetStatusApplyConfiguration represents a declarative configuration of the DaemonSetStatus type for use // with apply. type DaemonSetStatusApplyConfiguration struct { CurrentNumberScheduled *int32 `json:"currentNumberScheduled,omitempty"` NumberMisscheduled *int32 `json:"numberMisscheduled,omitempty"` DesiredNumberScheduled *int32 `json:"desiredNumberScheduled,omitempty"` NumberReady *int32 `json:"numberReady,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` UpdatedNumberScheduled *int32 `json:"updatedNumberScheduled,omitempty"` NumberAvailable *int32 `json:"numberAvailable,omitempty"` NumberUnavailable *int32 `json:"numberUnavailable,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` Conditions []DaemonSetConditionApplyConfiguration `json:"conditions,omitempty"` } // DaemonSetStatusApplyConfiguration constructs a declarative configuration of the DaemonSetStatus type for use with // apply. func DaemonSetStatus() *DaemonSetStatusApplyConfiguration { return &DaemonSetStatusApplyConfiguration{} } // WithCurrentNumberScheduled sets the CurrentNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithCurrentNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.CurrentNumberScheduled = &value return b } // WithNumberMisscheduled sets the NumberMisscheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberMisscheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberMisscheduled(value int32) *DaemonSetStatusApplyConfiguration { b.NumberMisscheduled = &value return b } // WithDesiredNumberScheduled sets the DesiredNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithDesiredNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.DesiredNumberScheduled = &value return b } // WithNumberReady sets the NumberReady field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberReady field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberReady(value int32) *DaemonSetStatusApplyConfiguration { b.NumberReady = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithObservedGeneration(value int64) *DaemonSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithUpdatedNumberScheduled sets the UpdatedNumberScheduled field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedNumberScheduled field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithUpdatedNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration { b.UpdatedNumberScheduled = &value return b } // WithNumberAvailable sets the NumberAvailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberAvailable field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberAvailable(value int32) *DaemonSetStatusApplyConfiguration { b.NumberAvailable = &value return b } // WithNumberUnavailable sets the NumberUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NumberUnavailable field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithNumberUnavailable(value int32) *DaemonSetStatusApplyConfiguration { b.NumberUnavailable = &value return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *DaemonSetStatusApplyConfiguration) WithCollisionCount(value int32) *DaemonSetStatusApplyConfiguration { b.CollisionCount = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *DaemonSetStatusApplyConfiguration) WithConditions(values ...*DaemonSetConditionApplyConfiguration) *DaemonSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/daemonsetupdatestrategy.go000066400000000000000000000043501472614177300334400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" ) // DaemonSetUpdateStrategyApplyConfiguration represents a declarative configuration of the DaemonSetUpdateStrategy type for use // with apply. type DaemonSetUpdateStrategyApplyConfiguration struct { Type *v1beta1.DaemonSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDaemonSetApplyConfiguration `json:"rollingUpdate,omitempty"` } // DaemonSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the DaemonSetUpdateStrategy type for use with // apply. func DaemonSetUpdateStrategy() *DaemonSetUpdateStrategyApplyConfiguration { return &DaemonSetUpdateStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DaemonSetUpdateStrategyApplyConfiguration) WithType(value v1beta1.DaemonSetUpdateStrategyType) *DaemonSetUpdateStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *DaemonSetUpdateStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDaemonSetApplyConfiguration) *DaemonSetUpdateStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/deployment.go000066400000000000000000000306331472614177300306560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use // with apply. type DeploymentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *DeploymentSpecApplyConfiguration `json:"spec,omitempty"` Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"` } // Deployment constructs a declarative configuration of the Deployment type for use with // apply. func Deployment(name, namespace string) *DeploymentApplyConfiguration { b := &DeploymentApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Deployment") b.WithAPIVersion("extensions/v1beta1") return b } // ExtractDeployment extracts the applied configuration owned by fieldManager from // deployment. If no managedFields are found in deployment for fieldManager, a // DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API. // ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractDeployment(deployment *extensionsv1beta1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { return extractDeployment(deployment, fieldManager, "") } // ExtractDeploymentStatus is the same as ExtractDeployment except // that it extracts the status subresource applied configuration. // Experimental! func ExtractDeploymentStatus(deployment *extensionsv1beta1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) { return extractDeployment(deployment, fieldManager, "status") } func extractDeployment(deployment *extensionsv1beta1.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) { b := &DeploymentApplyConfiguration{} err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.extensions.v1beta1.Deployment"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(deployment.Name) b.WithNamespace(deployment.Namespace) b.WithKind("Deployment") b.WithAPIVersion("extensions/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithKind(value string) *DeploymentApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithAPIVersion(value string) *DeploymentApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithName(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithGenerateName(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithNamespace(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithUID(value types.UID) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithResourceVersion(value string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithGeneration(value int64) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *DeploymentApplyConfiguration) WithLabels(entries map[string]string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *DeploymentApplyConfiguration) WithAnnotations(entries map[string]string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *DeploymentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *DeploymentApplyConfiguration) WithFinalizers(values ...string) *DeploymentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *DeploymentApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithSpec(value *DeploymentSpecApplyConfiguration) *DeploymentApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyConfiguration) *DeploymentApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *DeploymentApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/deploymentcondition.go000066400000000000000000000103741472614177300325650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" v1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use // with apply. type DeploymentConditionApplyConfiguration struct { Type *v1beta1.DeploymentConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with // apply. func DeploymentCondition() *DeploymentConditionApplyConfiguration { return &DeploymentConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithType(value v1beta1.DeploymentConditionType) *DeploymentConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *DeploymentConditionApplyConfiguration { b.Status = &value return b } // WithLastUpdateTime sets the LastUpdateTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastUpdateTime field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *DeploymentConditionApplyConfiguration { b.LastUpdateTime = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DeploymentConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithReason(value string) *DeploymentConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *DeploymentConditionApplyConfiguration) WithMessage(value string) *DeploymentConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/deploymentspec.go000066400000000000000000000137101472614177300315260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use // with apply. type DeploymentSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` Strategy *DeploymentStrategyApplyConfiguration `json:"strategy,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` Paused *bool `json:"paused,omitempty"` RollbackTo *RollbackConfigApplyConfiguration `json:"rollbackTo,omitempty"` ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } // DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with // apply. func DeploymentSpec() *DeploymentSpecApplyConfiguration { return &DeploymentSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithReplicas(value int32) *DeploymentSpecApplyConfiguration { b.Replicas = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Template = value return b } // WithStrategy sets the Strategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Strategy field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithStrategy(value *DeploymentStrategyApplyConfiguration) *DeploymentSpecApplyConfiguration { b.Strategy = value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithMinReadySeconds(value int32) *DeploymentSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithRevisionHistoryLimit sets the RevisionHistoryLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RevisionHistoryLimit field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DeploymentSpecApplyConfiguration { b.RevisionHistoryLimit = &value return b } // WithPaused sets the Paused field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Paused field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithPaused(value bool) *DeploymentSpecApplyConfiguration { b.Paused = &value return b } // WithRollbackTo sets the RollbackTo field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollbackTo field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithRollbackTo(value *RollbackConfigApplyConfiguration) *DeploymentSpecApplyConfiguration { b.RollbackTo = value return b } // WithProgressDeadlineSeconds sets the ProgressDeadlineSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ProgressDeadlineSeconds field is set to the value of the last call. func (b *DeploymentSpecApplyConfiguration) WithProgressDeadlineSeconds(value int32) *DeploymentSpecApplyConfiguration { b.ProgressDeadlineSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/deploymentstatus.go000066400000000000000000000127551472614177300321270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use // with apply. type DeploymentStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Replicas *int32 `json:"replicas,omitempty"` UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } // DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with // apply. func DeploymentStatus() *DeploymentStatusApplyConfiguration { return &DeploymentStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithObservedGeneration(value int64) *DeploymentStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithReplicas(value int32) *DeploymentStatusApplyConfiguration { b.Replicas = &value return b } // WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UpdatedReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithUpdatedReplicas(value int32) *DeploymentStatusApplyConfiguration { b.UpdatedReplicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithReadyReplicas(value int32) *DeploymentStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithAvailableReplicas(value int32) *DeploymentStatusApplyConfiguration { b.AvailableReplicas = &value return b } // WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UnavailableReplicas field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32) *DeploymentStatusApplyConfiguration { b.UnavailableReplicas = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *DeploymentStatusApplyConfiguration) WithConditions(values ...*DeploymentConditionApplyConfiguration) *DeploymentStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithCollisionCount sets the CollisionCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CollisionCount field is set to the value of the last call. func (b *DeploymentStatusApplyConfiguration) WithCollisionCount(value int32) *DeploymentStatusApplyConfiguration { b.CollisionCount = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/deploymentstrategy.go000066400000000000000000000042521472614177300324370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" ) // DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use // with apply. type DeploymentStrategyApplyConfiguration struct { Type *v1beta1.DeploymentStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"` } // DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with // apply. func DeploymentStrategy() *DeploymentStrategyApplyConfiguration { return &DeploymentStrategyApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *DeploymentStrategyApplyConfiguration) WithType(value v1beta1.DeploymentStrategyType) *DeploymentStrategyApplyConfiguration { b.Type = &value return b } // WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RollingUpdate field is set to the value of the last call. func (b *DeploymentStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDeploymentApplyConfiguration) *DeploymentStrategyApplyConfiguration { b.RollingUpdate = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/httpingresspath.go000066400000000000000000000050321472614177300317200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" ) // HTTPIngressPathApplyConfiguration represents a declarative configuration of the HTTPIngressPath type for use // with apply. type HTTPIngressPathApplyConfiguration struct { Path *string `json:"path,omitempty"` PathType *v1beta1.PathType `json:"pathType,omitempty"` Backend *IngressBackendApplyConfiguration `json:"backend,omitempty"` } // HTTPIngressPathApplyConfiguration constructs a declarative configuration of the HTTPIngressPath type for use with // apply. func HTTPIngressPath() *HTTPIngressPathApplyConfiguration { return &HTTPIngressPathApplyConfiguration{} } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithPath(value string) *HTTPIngressPathApplyConfiguration { b.Path = &value return b } // WithPathType sets the PathType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PathType field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithPathType(value v1beta1.PathType) *HTTPIngressPathApplyConfiguration { b.PathType = &value return b } // WithBackend sets the Backend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Backend field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithBackend(value *IngressBackendApplyConfiguration) *HTTPIngressPathApplyConfiguration { b.Backend = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/httpingressrulevalue.go000066400000000000000000000033141472614177300327710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // HTTPIngressRuleValueApplyConfiguration represents a declarative configuration of the HTTPIngressRuleValue type for use // with apply. type HTTPIngressRuleValueApplyConfiguration struct { Paths []HTTPIngressPathApplyConfiguration `json:"paths,omitempty"` } // HTTPIngressRuleValueApplyConfiguration constructs a declarative configuration of the HTTPIngressRuleValue type for use with // apply. func HTTPIngressRuleValue() *HTTPIngressRuleValueApplyConfiguration { return &HTTPIngressRuleValueApplyConfiguration{} } // WithPaths adds the given value to the Paths field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Paths field. func (b *HTTPIngressRuleValueApplyConfiguration) WithPaths(values ...*HTTPIngressPathApplyConfiguration) *HTTPIngressRuleValueApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPaths") } b.Paths = append(b.Paths, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingress.go000066400000000000000000000302531472614177300301460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // IngressApplyConfiguration represents a declarative configuration of the Ingress type for use // with apply. type IngressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IngressSpecApplyConfiguration `json:"spec,omitempty"` Status *IngressStatusApplyConfiguration `json:"status,omitempty"` } // Ingress constructs a declarative configuration of the Ingress type for use with // apply. func Ingress(name, namespace string) *IngressApplyConfiguration { b := &IngressApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Ingress") b.WithAPIVersion("extensions/v1beta1") return b } // ExtractIngress extracts the applied configuration owned by fieldManager from // ingress. If no managedFields are found in ingress for fieldManager, a // IngressApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // ingress must be a unmodified Ingress API object that was retrieved from the Kubernetes API. // ExtractIngress provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractIngress(ingress *extensionsv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { return extractIngress(ingress, fieldManager, "") } // ExtractIngressStatus is the same as ExtractIngress except // that it extracts the status subresource applied configuration. // Experimental! func ExtractIngressStatus(ingress *extensionsv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { return extractIngress(ingress, fieldManager, "status") } func extractIngress(ingress *extensionsv1beta1.Ingress, fieldManager string, subresource string) (*IngressApplyConfiguration, error) { b := &IngressApplyConfiguration{} err := managedfields.ExtractInto(ingress, internal.Parser().Type("io.k8s.api.extensions.v1beta1.Ingress"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(ingress.Name) b.WithNamespace(ingress.Namespace) b.WithKind("Ingress") b.WithAPIVersion("extensions/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IngressApplyConfiguration) WithKind(value string) *IngressApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *IngressApplyConfiguration) WithAPIVersion(value string) *IngressApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IngressApplyConfiguration) WithName(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *IngressApplyConfiguration) WithGenerateName(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IngressApplyConfiguration) WithNamespace(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *IngressApplyConfiguration) WithUID(value types.UID) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *IngressApplyConfiguration) WithResourceVersion(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *IngressApplyConfiguration) WithGeneration(value int64) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *IngressApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *IngressApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *IngressApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *IngressApplyConfiguration) WithLabels(entries map[string]string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *IngressApplyConfiguration) WithAnnotations(entries map[string]string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *IngressApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *IngressApplyConfiguration) WithFinalizers(values ...string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *IngressApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *IngressApplyConfiguration) WithSpec(value *IngressSpecApplyConfiguration) *IngressApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *IngressApplyConfiguration) WithStatus(value *IngressStatusApplyConfiguration) *IngressApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *IngressApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingressbackend.go000066400000000000000000000053111472614177300314530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // IngressBackendApplyConfiguration represents a declarative configuration of the IngressBackend type for use // with apply. type IngressBackendApplyConfiguration struct { ServiceName *string `json:"serviceName,omitempty"` ServicePort *intstr.IntOrString `json:"servicePort,omitempty"` Resource *v1.TypedLocalObjectReferenceApplyConfiguration `json:"resource,omitempty"` } // IngressBackendApplyConfiguration constructs a declarative configuration of the IngressBackend type for use with // apply. func IngressBackend() *IngressBackendApplyConfiguration { return &IngressBackendApplyConfiguration{} } // WithServiceName sets the ServiceName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceName field is set to the value of the last call. func (b *IngressBackendApplyConfiguration) WithServiceName(value string) *IngressBackendApplyConfiguration { b.ServiceName = &value return b } // WithServicePort sets the ServicePort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServicePort field is set to the value of the last call. func (b *IngressBackendApplyConfiguration) WithServicePort(value intstr.IntOrString) *IngressBackendApplyConfiguration { b.ServicePort = &value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *IngressBackendApplyConfiguration) WithResource(value *v1.TypedLocalObjectReferenceApplyConfiguration) *IngressBackendApplyConfiguration { b.Resource = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingressloadbalanceringress.go000066400000000000000000000053651472614177300340770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressLoadBalancerIngressApplyConfiguration represents a declarative configuration of the IngressLoadBalancerIngress type for use // with apply. type IngressLoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` Hostname *string `json:"hostname,omitempty"` Ports []IngressPortStatusApplyConfiguration `json:"ports,omitempty"` } // IngressLoadBalancerIngressApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerIngress type for use with // apply. func IngressLoadBalancerIngress() *IngressLoadBalancerIngressApplyConfiguration { return &IngressLoadBalancerIngressApplyConfiguration{} } // WithIP sets the IP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IP field is set to the value of the last call. func (b *IngressLoadBalancerIngressApplyConfiguration) WithIP(value string) *IngressLoadBalancerIngressApplyConfiguration { b.IP = &value return b } // WithHostname sets the Hostname field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hostname field is set to the value of the last call. func (b *IngressLoadBalancerIngressApplyConfiguration) WithHostname(value string) *IngressLoadBalancerIngressApplyConfiguration { b.Hostname = &value return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *IngressLoadBalancerIngressApplyConfiguration) WithPorts(values ...*IngressPortStatusApplyConfiguration) *IngressLoadBalancerIngressApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingressloadbalancerstatus.go000066400000000000000000000034461472614177300337460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressLoadBalancerStatusApplyConfiguration represents a declarative configuration of the IngressLoadBalancerStatus type for use // with apply. type IngressLoadBalancerStatusApplyConfiguration struct { Ingress []IngressLoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` } // IngressLoadBalancerStatusApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerStatus type for use with // apply. func IngressLoadBalancerStatus() *IngressLoadBalancerStatusApplyConfiguration { return &IngressLoadBalancerStatusApplyConfiguration{} } // WithIngress adds the given value to the Ingress field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ingress field. func (b *IngressLoadBalancerStatusApplyConfiguration) WithIngress(values ...*IngressLoadBalancerIngressApplyConfiguration) *IngressLoadBalancerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithIngress") } b.Ingress = append(b.Ingress, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingressportstatus.go000066400000000000000000000046731472614177300323260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" ) // IngressPortStatusApplyConfiguration represents a declarative configuration of the IngressPortStatus type for use // with apply. type IngressPortStatusApplyConfiguration struct { Port *int32 `json:"port,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` Error *string `json:"error,omitempty"` } // IngressPortStatusApplyConfiguration constructs a declarative configuration of the IngressPortStatus type for use with // apply. func IngressPortStatus() *IngressPortStatusApplyConfiguration { return &IngressPortStatusApplyConfiguration{} } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithPort(value int32) *IngressPortStatusApplyConfiguration { b.Port = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithProtocol(value v1.Protocol) *IngressPortStatusApplyConfiguration { b.Protocol = &value return b } // WithError sets the Error field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Error field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithError(value string) *IngressPortStatusApplyConfiguration { b.Error = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingressrule.go000066400000000000000000000036451472614177300310430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressRuleApplyConfiguration represents a declarative configuration of the IngressRule type for use // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` IngressRuleValueApplyConfiguration `json:",inline"` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with // apply. func IngressRule() *IngressRuleApplyConfiguration { return &IngressRuleApplyConfiguration{} } // WithHost sets the Host field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Host field is set to the value of the last call. func (b *IngressRuleApplyConfiguration) WithHost(value string) *IngressRuleApplyConfiguration { b.Host = &value return b } // WithHTTP sets the HTTP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTP field is set to the value of the last call. func (b *IngressRuleApplyConfiguration) WithHTTP(value *HTTPIngressRuleValueApplyConfiguration) *IngressRuleApplyConfiguration { b.HTTP = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingressrulevalue.go000066400000000000000000000030351472614177300320710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressRuleValueApplyConfiguration represents a declarative configuration of the IngressRuleValue type for use // with apply. type IngressRuleValueApplyConfiguration struct { HTTP *HTTPIngressRuleValueApplyConfiguration `json:"http,omitempty"` } // IngressRuleValueApplyConfiguration constructs a declarative configuration of the IngressRuleValue type for use with // apply. func IngressRuleValue() *IngressRuleValueApplyConfiguration { return &IngressRuleValueApplyConfiguration{} } // WithHTTP sets the HTTP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTP field is set to the value of the last call. func (b *IngressRuleValueApplyConfiguration) WithHTTP(value *HTTPIngressRuleValueApplyConfiguration) *IngressRuleValueApplyConfiguration { b.HTTP = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingressspec.go000066400000000000000000000063711472614177300310250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressSpecApplyConfiguration represents a declarative configuration of the IngressSpec type for use // with apply. type IngressSpecApplyConfiguration struct { IngressClassName *string `json:"ingressClassName,omitempty"` Backend *IngressBackendApplyConfiguration `json:"backend,omitempty"` TLS []IngressTLSApplyConfiguration `json:"tls,omitempty"` Rules []IngressRuleApplyConfiguration `json:"rules,omitempty"` } // IngressSpecApplyConfiguration constructs a declarative configuration of the IngressSpec type for use with // apply. func IngressSpec() *IngressSpecApplyConfiguration { return &IngressSpecApplyConfiguration{} } // WithIngressClassName sets the IngressClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IngressClassName field is set to the value of the last call. func (b *IngressSpecApplyConfiguration) WithIngressClassName(value string) *IngressSpecApplyConfiguration { b.IngressClassName = &value return b } // WithBackend sets the Backend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Backend field is set to the value of the last call. func (b *IngressSpecApplyConfiguration) WithBackend(value *IngressBackendApplyConfiguration) *IngressSpecApplyConfiguration { b.Backend = value return b } // WithTLS adds the given value to the TLS field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TLS field. func (b *IngressSpecApplyConfiguration) WithTLS(values ...*IngressTLSApplyConfiguration) *IngressSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTLS") } b.TLS = append(b.TLS, *values[i]) } return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *IngressSpecApplyConfiguration) WithRules(values ...*IngressRuleApplyConfiguration) *IngressSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingressstatus.go000066400000000000000000000031011472614177300314020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressStatusApplyConfiguration represents a declarative configuration of the IngressStatus type for use // with apply. type IngressStatusApplyConfiguration struct { LoadBalancer *IngressLoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` } // IngressStatusApplyConfiguration constructs a declarative configuration of the IngressStatus type for use with // apply. func IngressStatus() *IngressStatusApplyConfiguration { return &IngressStatusApplyConfiguration{} } // WithLoadBalancer sets the LoadBalancer field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LoadBalancer field is set to the value of the last call. func (b *IngressStatusApplyConfiguration) WithLoadBalancer(value *IngressLoadBalancerStatusApplyConfiguration) *IngressStatusApplyConfiguration { b.LoadBalancer = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ingresstls.go000066400000000000000000000037051472614177300306730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressTLSApplyConfiguration represents a declarative configuration of the IngressTLS type for use // with apply. type IngressTLSApplyConfiguration struct { Hosts []string `json:"hosts,omitempty"` SecretName *string `json:"secretName,omitempty"` } // IngressTLSApplyConfiguration constructs a declarative configuration of the IngressTLS type for use with // apply. func IngressTLS() *IngressTLSApplyConfiguration { return &IngressTLSApplyConfiguration{} } // WithHosts adds the given value to the Hosts field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Hosts field. func (b *IngressTLSApplyConfiguration) WithHosts(values ...string) *IngressTLSApplyConfiguration { for i := range values { b.Hosts = append(b.Hosts, values[i]) } return b } // WithSecretName sets the SecretName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretName field is set to the value of the last call. func (b *IngressTLSApplyConfiguration) WithSecretName(value string) *IngressTLSApplyConfiguration { b.SecretName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/ipblock.go000066400000000000000000000035741472614177300301250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IPBlockApplyConfiguration represents a declarative configuration of the IPBlock type for use // with apply. type IPBlockApplyConfiguration struct { CIDR *string `json:"cidr,omitempty"` Except []string `json:"except,omitempty"` } // IPBlockApplyConfiguration constructs a declarative configuration of the IPBlock type for use with // apply. func IPBlock() *IPBlockApplyConfiguration { return &IPBlockApplyConfiguration{} } // WithCIDR sets the CIDR field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CIDR field is set to the value of the last call. func (b *IPBlockApplyConfiguration) WithCIDR(value string) *IPBlockApplyConfiguration { b.CIDR = &value return b } // WithExcept adds the given value to the Except field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Except field. func (b *IPBlockApplyConfiguration) WithExcept(values ...string) *IPBlockApplyConfiguration { for i := range values { b.Except = append(b.Except, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/networkpolicy.go000066400000000000000000000301621472614177300314040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NetworkPolicyApplyConfiguration represents a declarative configuration of the NetworkPolicy type for use // with apply. type NetworkPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *NetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` } // NetworkPolicy constructs a declarative configuration of the NetworkPolicy type for use with // apply. func NetworkPolicy(name, namespace string) *NetworkPolicyApplyConfiguration { b := &NetworkPolicyApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("NetworkPolicy") b.WithAPIVersion("extensions/v1beta1") return b } // ExtractNetworkPolicy extracts the applied configuration owned by fieldManager from // networkPolicy. If no managedFields are found in networkPolicy for fieldManager, a // NetworkPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // networkPolicy must be a unmodified NetworkPolicy API object that was retrieved from the Kubernetes API. // ExtractNetworkPolicy provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractNetworkPolicy(networkPolicy *extensionsv1beta1.NetworkPolicy, fieldManager string) (*NetworkPolicyApplyConfiguration, error) { return extractNetworkPolicy(networkPolicy, fieldManager, "") } // ExtractNetworkPolicyStatus is the same as ExtractNetworkPolicy except // that it extracts the status subresource applied configuration. // Experimental! func ExtractNetworkPolicyStatus(networkPolicy *extensionsv1beta1.NetworkPolicy, fieldManager string) (*NetworkPolicyApplyConfiguration, error) { return extractNetworkPolicy(networkPolicy, fieldManager, "status") } func extractNetworkPolicy(networkPolicy *extensionsv1beta1.NetworkPolicy, fieldManager string, subresource string) (*NetworkPolicyApplyConfiguration, error) { b := &NetworkPolicyApplyConfiguration{} err := managedfields.ExtractInto(networkPolicy, internal.Parser().Type("io.k8s.api.extensions.v1beta1.NetworkPolicy"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(networkPolicy.Name) b.WithNamespace(networkPolicy.Namespace) b.WithKind("NetworkPolicy") b.WithAPIVersion("extensions/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithKind(value string) *NetworkPolicyApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithAPIVersion(value string) *NetworkPolicyApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithName(value string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithGenerateName(value string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithNamespace(value string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithUID(value types.UID) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithResourceVersion(value string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithGeneration(value int64) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *NetworkPolicyApplyConfiguration) WithLabels(entries map[string]string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *NetworkPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *NetworkPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *NetworkPolicyApplyConfiguration) WithFinalizers(values ...string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *NetworkPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithSpec(value *NetworkPolicySpecApplyConfiguration) *NetworkPolicyApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *NetworkPolicyApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/networkpolicyegressrule.go000066400000000000000000000045461472614177300335140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // NetworkPolicyEgressRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyEgressRule type for use // with apply. type NetworkPolicyEgressRuleApplyConfiguration struct { Ports []NetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` To []NetworkPolicyPeerApplyConfiguration `json:"to,omitempty"` } // NetworkPolicyEgressRuleApplyConfiguration constructs a declarative configuration of the NetworkPolicyEgressRule type for use with // apply. func NetworkPolicyEgressRule() *NetworkPolicyEgressRuleApplyConfiguration { return &NetworkPolicyEgressRuleApplyConfiguration{} } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *NetworkPolicyEgressRuleApplyConfiguration) WithPorts(values ...*NetworkPolicyPortApplyConfiguration) *NetworkPolicyEgressRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // WithTo adds the given value to the To field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the To field. func (b *NetworkPolicyEgressRuleApplyConfiguration) WithTo(values ...*NetworkPolicyPeerApplyConfiguration) *NetworkPolicyEgressRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTo") } b.To = append(b.To, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/networkpolicyingressrule.go000066400000000000000000000046021472614177300336670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // NetworkPolicyIngressRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyIngressRule type for use // with apply. type NetworkPolicyIngressRuleApplyConfiguration struct { Ports []NetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` From []NetworkPolicyPeerApplyConfiguration `json:"from,omitempty"` } // NetworkPolicyIngressRuleApplyConfiguration constructs a declarative configuration of the NetworkPolicyIngressRule type for use with // apply. func NetworkPolicyIngressRule() *NetworkPolicyIngressRuleApplyConfiguration { return &NetworkPolicyIngressRuleApplyConfiguration{} } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *NetworkPolicyIngressRuleApplyConfiguration) WithPorts(values ...*NetworkPolicyPortApplyConfiguration) *NetworkPolicyIngressRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // WithFrom adds the given value to the From field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the From field. func (b *NetworkPolicyIngressRuleApplyConfiguration) WithFrom(values ...*NetworkPolicyPeerApplyConfiguration) *NetworkPolicyIngressRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithFrom") } b.From = append(b.From, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/networkpolicypeer.go000066400000000000000000000053501472614177300322610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NetworkPolicyPeerApplyConfiguration represents a declarative configuration of the NetworkPolicyPeer type for use // with apply. type NetworkPolicyPeerApplyConfiguration struct { PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` IPBlock *IPBlockApplyConfiguration `json:"ipBlock,omitempty"` } // NetworkPolicyPeerApplyConfiguration constructs a declarative configuration of the NetworkPolicyPeer type for use with // apply. func NetworkPolicyPeer() *NetworkPolicyPeerApplyConfiguration { return &NetworkPolicyPeerApplyConfiguration{} } // WithPodSelector sets the PodSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodSelector field is set to the value of the last call. func (b *NetworkPolicyPeerApplyConfiguration) WithPodSelector(value *v1.LabelSelectorApplyConfiguration) *NetworkPolicyPeerApplyConfiguration { b.PodSelector = value return b } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *NetworkPolicyPeerApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *NetworkPolicyPeerApplyConfiguration { b.NamespaceSelector = value return b } // WithIPBlock sets the IPBlock field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IPBlock field is set to the value of the last call. func (b *NetworkPolicyPeerApplyConfiguration) WithIPBlock(value *IPBlockApplyConfiguration) *NetworkPolicyPeerApplyConfiguration { b.IPBlock = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/networkpolicyport.go000066400000000000000000000050261472614177300323120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" intstr "k8s.io/apimachinery/pkg/util/intstr" ) // NetworkPolicyPortApplyConfiguration represents a declarative configuration of the NetworkPolicyPort type for use // with apply. type NetworkPolicyPortApplyConfiguration struct { Protocol *v1.Protocol `json:"protocol,omitempty"` Port *intstr.IntOrString `json:"port,omitempty"` EndPort *int32 `json:"endPort,omitempty"` } // NetworkPolicyPortApplyConfiguration constructs a declarative configuration of the NetworkPolicyPort type for use with // apply. func NetworkPolicyPort() *NetworkPolicyPortApplyConfiguration { return &NetworkPolicyPortApplyConfiguration{} } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *NetworkPolicyPortApplyConfiguration) WithProtocol(value v1.Protocol) *NetworkPolicyPortApplyConfiguration { b.Protocol = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *NetworkPolicyPortApplyConfiguration) WithPort(value intstr.IntOrString) *NetworkPolicyPortApplyConfiguration { b.Port = &value return b } // WithEndPort sets the EndPort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EndPort field is set to the value of the last call. func (b *NetworkPolicyPortApplyConfiguration) WithEndPort(value int32) *NetworkPolicyPortApplyConfiguration { b.EndPort = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/networkpolicyspec.go000066400000000000000000000071761472614177300322700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( extensionsv1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NetworkPolicySpecApplyConfiguration represents a declarative configuration of the NetworkPolicySpec type for use // with apply. type NetworkPolicySpecApplyConfiguration struct { PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` Ingress []NetworkPolicyIngressRuleApplyConfiguration `json:"ingress,omitempty"` Egress []NetworkPolicyEgressRuleApplyConfiguration `json:"egress,omitempty"` PolicyTypes []extensionsv1beta1.PolicyType `json:"policyTypes,omitempty"` } // NetworkPolicySpecApplyConfiguration constructs a declarative configuration of the NetworkPolicySpec type for use with // apply. func NetworkPolicySpec() *NetworkPolicySpecApplyConfiguration { return &NetworkPolicySpecApplyConfiguration{} } // WithPodSelector sets the PodSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodSelector field is set to the value of the last call. func (b *NetworkPolicySpecApplyConfiguration) WithPodSelector(value *v1.LabelSelectorApplyConfiguration) *NetworkPolicySpecApplyConfiguration { b.PodSelector = value return b } // WithIngress adds the given value to the Ingress field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ingress field. func (b *NetworkPolicySpecApplyConfiguration) WithIngress(values ...*NetworkPolicyIngressRuleApplyConfiguration) *NetworkPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithIngress") } b.Ingress = append(b.Ingress, *values[i]) } return b } // WithEgress adds the given value to the Egress field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Egress field. func (b *NetworkPolicySpecApplyConfiguration) WithEgress(values ...*NetworkPolicyEgressRuleApplyConfiguration) *NetworkPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEgress") } b.Egress = append(b.Egress, *values[i]) } return b } // WithPolicyTypes adds the given value to the PolicyTypes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PolicyTypes field. func (b *NetworkPolicySpecApplyConfiguration) WithPolicyTypes(values ...extensionsv1beta1.PolicyType) *NetworkPolicySpecApplyConfiguration { for i := range values { b.PolicyTypes = append(b.PolicyTypes, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/replicaset.go000066400000000000000000000306331472614177300306310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ReplicaSetApplyConfiguration represents a declarative configuration of the ReplicaSet type for use // with apply. type ReplicaSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ReplicaSetSpecApplyConfiguration `json:"spec,omitempty"` Status *ReplicaSetStatusApplyConfiguration `json:"status,omitempty"` } // ReplicaSet constructs a declarative configuration of the ReplicaSet type for use with // apply. func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { b := &ReplicaSetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ReplicaSet") b.WithAPIVersion("extensions/v1beta1") return b } // ExtractReplicaSet extracts the applied configuration owned by fieldManager from // replicaSet. If no managedFields are found in replicaSet for fieldManager, a // ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API. // ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractReplicaSet(replicaSet *extensionsv1beta1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { return extractReplicaSet(replicaSet, fieldManager, "") } // ExtractReplicaSetStatus is the same as ExtractReplicaSet except // that it extracts the status subresource applied configuration. // Experimental! func ExtractReplicaSetStatus(replicaSet *extensionsv1beta1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) { return extractReplicaSet(replicaSet, fieldManager, "status") } func extractReplicaSet(replicaSet *extensionsv1beta1.ReplicaSet, fieldManager string, subresource string) (*ReplicaSetApplyConfiguration, error) { b := &ReplicaSetApplyConfiguration{} err := managedfields.ExtractInto(replicaSet, internal.Parser().Type("io.k8s.api.extensions.v1beta1.ReplicaSet"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(replicaSet.Name) b.WithNamespace(replicaSet.Namespace) b.WithKind("ReplicaSet") b.WithAPIVersion("extensions/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithKind(value string) *ReplicaSetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithAPIVersion(value string) *ReplicaSetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithName(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithGenerateName(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithNamespace(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithUID(value types.UID) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithResourceVersion(value string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithGeneration(value int64) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ReplicaSetApplyConfiguration) WithLabels(entries map[string]string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ReplicaSetApplyConfiguration) WithAnnotations(entries map[string]string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ReplicaSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ReplicaSetApplyConfiguration) WithFinalizers(values ...string) *ReplicaSetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ReplicaSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithSpec(value *ReplicaSetSpecApplyConfiguration) *ReplicaSetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ReplicaSetApplyConfiguration) WithStatus(value *ReplicaSetStatusApplyConfiguration) *ReplicaSetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ReplicaSetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/replicasetcondition.go000066400000000000000000000073271472614177300325440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" v1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ReplicaSetConditionApplyConfiguration represents a declarative configuration of the ReplicaSetCondition type for use // with apply. type ReplicaSetConditionApplyConfiguration struct { Type *v1beta1.ReplicaSetConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // ReplicaSetConditionApplyConfiguration constructs a declarative configuration of the ReplicaSetCondition type for use with // apply. func ReplicaSetCondition() *ReplicaSetConditionApplyConfiguration { return &ReplicaSetConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithType(value v1beta1.ReplicaSetConditionType) *ReplicaSetConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ReplicaSetConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ReplicaSetConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithReason(value string) *ReplicaSetConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ReplicaSetConditionApplyConfiguration) WithMessage(value string) *ReplicaSetConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/replicasetspec.go000066400000000000000000000063221472614177300315020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ReplicaSetSpecApplyConfiguration represents a declarative configuration of the ReplicaSetSpec type for use // with apply. type ReplicaSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } // ReplicaSetSpecApplyConfiguration constructs a declarative configuration of the ReplicaSetSpec type for use with // apply. func ReplicaSetSpec() *ReplicaSetSpecApplyConfiguration { return &ReplicaSetSpecApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithReplicas(value int32) *ReplicaSetSpecApplyConfiguration { b.Replicas = &value return b } // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinReadySeconds field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *ReplicaSetSpecApplyConfiguration { b.MinReadySeconds = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ReplicaSetSpecApplyConfiguration { b.Selector = value return b } // WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Template field is set to the value of the last call. func (b *ReplicaSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *ReplicaSetSpecApplyConfiguration { b.Template = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/replicasetstatus.go000066400000000000000000000106611472614177300320740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ReplicaSetStatusApplyConfiguration represents a declarative configuration of the ReplicaSetStatus type for use // with apply. type ReplicaSetStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } // ReplicaSetStatusApplyConfiguration constructs a declarative configuration of the ReplicaSetStatus type for use with // apply. func ReplicaSetStatus() *ReplicaSetStatusApplyConfiguration { return &ReplicaSetStatusApplyConfiguration{} } // WithReplicas sets the Replicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Replicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.Replicas = &value return b } // WithFullyLabeledReplicas sets the FullyLabeledReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FullyLabeledReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.FullyLabeledReplicas = &value return b } // WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReadyReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithReadyReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.ReadyReplicas = &value return b } // WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AvailableReplicas field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *ReplicaSetStatusApplyConfiguration { b.AvailableReplicas = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *ReplicaSetStatusApplyConfiguration) WithObservedGeneration(value int64) *ReplicaSetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ReplicaSetStatusApplyConfiguration) WithConditions(values ...*ReplicaSetConditionApplyConfiguration) *ReplicaSetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/rollbackconfig.go000066400000000000000000000027431472614177300314560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // RollbackConfigApplyConfiguration represents a declarative configuration of the RollbackConfig type for use // with apply. type RollbackConfigApplyConfiguration struct { Revision *int64 `json:"revision,omitempty"` } // RollbackConfigApplyConfiguration constructs a declarative configuration of the RollbackConfig type for use with // apply. func RollbackConfig() *RollbackConfigApplyConfiguration { return &RollbackConfigApplyConfiguration{} } // WithRevision sets the Revision field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Revision field is set to the value of the last call. func (b *RollbackConfigApplyConfiguration) WithRevision(value int64) *RollbackConfigApplyConfiguration { b.Revision = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/rollingupdatedaemonset.go000066400000000000000000000042561472614177300332510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateDaemonSetApplyConfiguration represents a declarative configuration of the RollingUpdateDaemonSet type for use // with apply. type RollingUpdateDaemonSetApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } // RollingUpdateDaemonSetApplyConfiguration constructs a declarative configuration of the RollingUpdateDaemonSet type for use with // apply. func RollingUpdateDaemonSet() *RollingUpdateDaemonSetApplyConfiguration { return &RollingUpdateDaemonSetApplyConfiguration{} } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateDaemonSetApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateDaemonSetApplyConfiguration { b.MaxUnavailable = &value return b } // WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxSurge field is set to the value of the last call. func (b *RollingUpdateDaemonSetApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *RollingUpdateDaemonSetApplyConfiguration { b.MaxSurge = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/rollingupdatedeployment.go000066400000000000000000000042721472614177300334500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) // RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use // with apply. type RollingUpdateDeploymentApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } // RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with // apply. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration { return &RollingUpdateDeploymentApplyConfiguration{} } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration { b.MaxUnavailable = &value return b } // WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxSurge field is set to the value of the last call. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration { b.MaxSurge = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/extensions/v1beta1/scale.go000066400000000000000000000240201472614177300275560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ScaleApplyConfiguration represents a declarative configuration of the Scale type for use // with apply. type ScaleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *v1beta1.ScaleSpec `json:"spec,omitempty"` Status *v1beta1.ScaleStatus `json:"status,omitempty"` } // ScaleApplyConfiguration constructs a declarative configuration of the Scale type for use with // apply. func Scale() *ScaleApplyConfiguration { b := &ScaleApplyConfiguration{} b.WithKind("Scale") b.WithAPIVersion("extensions/v1beta1") return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithSpec(value v1beta1.ScaleSpec) *ScaleApplyConfiguration { b.Spec = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ScaleApplyConfiguration) WithStatus(value v1beta1.ScaleStatus) *ScaleApplyConfiguration { b.Status = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ScaleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/000077500000000000000000000000001472614177300250505ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/000077500000000000000000000000001472614177300253765ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go000066400000000000000000000044551472614177300346610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. type ExemptPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` } // ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with // apply. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { return &ExemptPriorityLevelConfigurationApplyConfiguration{} } // WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { b.NominalConcurrencyShares = &value return b } // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LendablePercent field is set to the value of the last call. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { b.LendablePercent = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go000066400000000000000000000031721472614177300327020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/flowcontrol/v1" ) // FlowDistinguisherMethodApplyConfiguration represents a declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { Type *v1.FlowDistinguisherMethodType `json:"type,omitempty"` } // FlowDistinguisherMethodApplyConfiguration constructs a declarative configuration of the FlowDistinguisherMethod type for use with // apply. func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { return &FlowDistinguisherMethodApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *FlowDistinguisherMethodApplyConfiguration) WithType(value v1.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration { b.Type = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/flowschema.go000066400000000000000000000305261472614177300300630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiflowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // FlowSchemaApplyConfiguration represents a declarative configuration of the FlowSchema type for use // with apply. type FlowSchemaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *FlowSchemaSpecApplyConfiguration `json:"spec,omitempty"` Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` } // FlowSchema constructs a declarative configuration of the FlowSchema type for use with // apply. func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} b.WithName(name) b.WithKind("FlowSchema") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") return b } // ExtractFlowSchema extracts the applied configuration owned by fieldManager from // flowSchema. If no managedFields are found in flowSchema for fieldManager, a // FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API. // ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractFlowSchema(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "") } // ExtractFlowSchemaStatus is the same as ExtractFlowSchema except // that it extracts the status subresource applied configuration. // Experimental! func ExtractFlowSchemaStatus(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "status") } func extractFlowSchema(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { b := &FlowSchemaApplyConfiguration{} err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1.FlowSchema"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(flowSchema.Name) b.WithKind("FlowSchema") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithKind(value string) *FlowSchemaApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithAPIVersion(value string) *FlowSchemaApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithName(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithGenerateName(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithNamespace(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithUID(value types.UID) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithResourceVersion(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithGeneration(value int64) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *FlowSchemaApplyConfiguration) WithLabels(entries map[string]string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *FlowSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *FlowSchemaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *FlowSchemaApplyConfiguration) WithFinalizers(values ...string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *FlowSchemaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithSpec(value *FlowSchemaSpecApplyConfiguration) *FlowSchemaApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyConfiguration) *FlowSchemaApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *FlowSchemaApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/flowschemacondition.go000066400000000000000000000072221472614177300317670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FlowSchemaConditionApplyConfiguration represents a declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { Type *v1.FlowSchemaConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // FlowSchemaConditionApplyConfiguration constructs a declarative configuration of the FlowSchemaCondition type for use with // apply. func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { return &FlowSchemaConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *FlowSchemaConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *FlowSchemaConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithReason(value string) *FlowSchemaConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithMessage(value string) *FlowSchemaConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/flowschemaspec.go000066400000000000000000000070461472614177300307370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // FlowSchemaSpecApplyConfiguration represents a declarative configuration of the FlowSchemaSpec type for use // with apply. type FlowSchemaSpecApplyConfiguration struct { PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` MatchingPrecedence *int32 `json:"matchingPrecedence,omitempty"` DistinguisherMethod *FlowDistinguisherMethodApplyConfiguration `json:"distinguisherMethod,omitempty"` Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` } // FlowSchemaSpecApplyConfiguration constructs a declarative configuration of the FlowSchemaSpec type for use with // apply. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { return &FlowSchemaSpecApplyConfiguration{} } // WithPriorityLevelConfiguration sets the PriorityLevelConfiguration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PriorityLevelConfiguration field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithPriorityLevelConfiguration(value *PriorityLevelConfigurationReferenceApplyConfiguration) *FlowSchemaSpecApplyConfiguration { b.PriorityLevelConfiguration = value return b } // WithMatchingPrecedence sets the MatchingPrecedence field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchingPrecedence field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithMatchingPrecedence(value int32) *FlowSchemaSpecApplyConfiguration { b.MatchingPrecedence = &value return b } // WithDistinguisherMethod sets the DistinguisherMethod field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DistinguisherMethod field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithDistinguisherMethod(value *FlowDistinguisherMethodApplyConfiguration) *FlowSchemaSpecApplyConfiguration { b.DistinguisherMethod = value return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *FlowSchemaSpecApplyConfiguration) WithRules(values ...*PolicyRulesWithSubjectsApplyConfiguration) *FlowSchemaSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/flowschemastatus.go000066400000000000000000000033241472614177300313230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // FlowSchemaStatusApplyConfiguration represents a declarative configuration of the FlowSchemaStatus type for use // with apply. type FlowSchemaStatusApplyConfiguration struct { Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` } // FlowSchemaStatusApplyConfiguration constructs a declarative configuration of the FlowSchemaStatus type for use with // apply. func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { return &FlowSchemaStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *FlowSchemaStatusApplyConfiguration) WithConditions(values ...*FlowSchemaConditionApplyConfiguration) *FlowSchemaStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/groupsubject.go000066400000000000000000000026601472614177300304450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // GroupSubjectApplyConfiguration represents a declarative configuration of the GroupSubject type for use // with apply. type GroupSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } // GroupSubjectApplyConfiguration constructs a declarative configuration of the GroupSubject type for use with // apply. func GroupSubject() *GroupSubjectApplyConfiguration { return &GroupSubjectApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *GroupSubjectApplyConfiguration) WithName(value string) *GroupSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go000066400000000000000000000070551472614177300350050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LimitedPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LimitResponse *LimitResponseApplyConfiguration `json:"limitResponse,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` } // LimitedPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the LimitedPriorityLevelConfiguration type for use with // apply. func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { return &LimitedPriorityLevelConfigurationApplyConfiguration{} } // WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.NominalConcurrencyShares = &value return b } // WithLimitResponse sets the LimitResponse field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LimitResponse field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLimitResponse(value *LimitResponseApplyConfiguration) *LimitedPriorityLevelConfigurationApplyConfiguration { b.LimitResponse = value return b } // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LendablePercent field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.LendablePercent = &value return b } // WithBorrowingLimitPercent sets the BorrowingLimitPercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BorrowingLimitPercent field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithBorrowingLimitPercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.BorrowingLimitPercent = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/limitresponse.go000066400000000000000000000040351472614177300306240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/flowcontrol/v1" ) // LimitResponseApplyConfiguration represents a declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { Type *v1.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } // LimitResponseApplyConfiguration constructs a declarative configuration of the LimitResponse type for use with // apply. func LimitResponse() *LimitResponseApplyConfiguration { return &LimitResponseApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *LimitResponseApplyConfiguration) WithType(value v1.LimitResponseType) *LimitResponseApplyConfiguration { b.Type = &value return b } // WithQueuing sets the Queuing field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Queuing field is set to the value of the last call. func (b *LimitResponseApplyConfiguration) WithQueuing(value *QueuingConfigurationApplyConfiguration) *LimitResponseApplyConfiguration { b.Queuing = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go000066400000000000000000000042671472614177300324100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NonResourcePolicyRuleApplyConfiguration represents a declarative configuration of the NonResourcePolicyRule type for use // with apply. type NonResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } // NonResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the NonResourcePolicyRule type for use with // apply. func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { return &NonResourcePolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *NonResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *NonResourcePolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceURLs field. func (b *NonResourcePolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *NonResourcePolicyRuleApplyConfiguration { for i := range values { b.NonResourceURLs = append(b.NonResourceURLs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go000066400000000000000000000063411472614177300327420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PolicyRulesWithSubjectsApplyConfiguration represents a declarative configuration of the PolicyRulesWithSubjects type for use // with apply. type PolicyRulesWithSubjectsApplyConfiguration struct { Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` ResourceRules []ResourcePolicyRuleApplyConfiguration `json:"resourceRules,omitempty"` NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` } // PolicyRulesWithSubjectsApplyConfiguration constructs a declarative configuration of the PolicyRulesWithSubjects type for use with // apply. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { return &PolicyRulesWithSubjectsApplyConfiguration{} } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceRules field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithResourceRules(values ...*ResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceRules") } b.ResourceRules = append(b.ResourceRules, *values[i]) } return b } // WithNonResourceRules adds the given value to the NonResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceRules field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithNonResourceRules(values ...*NonResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithNonResourceRules") } b.NonResourceRules = append(b.NonResourceRules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go000066400000000000000000000331061472614177300334310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apiflowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the PriorityLevelConfiguration type for use // with apply. type PriorityLevelConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PriorityLevelConfigurationSpecApplyConfiguration `json:"spec,omitempty"` Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` } // PriorityLevelConfiguration constructs a declarative configuration of the PriorityLevelConfiguration type for use with // apply. func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { b := &PriorityLevelConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("PriorityLevelConfiguration") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") return b } // ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from // priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a // PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API. // ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") } // ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") } func extractPriorityLevelConfiguration(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { b := &PriorityLevelConfigurationApplyConfiguration{} err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1.PriorityLevelConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(priorityLevelConfiguration.Name) b.WithKind("PriorityLevelConfiguration") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithKind(value string) *PriorityLevelConfigurationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithAPIVersion(value string) *PriorityLevelConfigurationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithName(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithGenerateName(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithNamespace(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithUID(value types.UID) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithResourceVersion(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithGeneration(value int64) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PriorityLevelConfigurationApplyConfiguration) WithLabels(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PriorityLevelConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PriorityLevelConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PriorityLevelConfigurationApplyConfiguration) WithFinalizers(values ...string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PriorityLevelConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithSpec(value *PriorityLevelConfigurationSpecApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *PriorityLevelConfigurationStatusApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PriorityLevelConfigurationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } prioritylevelconfigurationcondition.go000066400000000000000000000100221472614177300352510ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PriorityLevelConfigurationConditionApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { Type *v1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // PriorityLevelConfigurationConditionApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationCondition type for use with // apply. func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { return &PriorityLevelConfigurationConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PriorityLevelConfigurationConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithReason(value string) *PriorityLevelConfigurationConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithMessage(value string) *PriorityLevelConfigurationConditionApplyConfiguration { b.Message = &value return b } prioritylevelconfigurationreference.go000066400000000000000000000032261472614177300352310ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PriorityLevelConfigurationReferenceApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. type PriorityLevelConfigurationReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } // PriorityLevelConfigurationReferenceApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationReference type for use with // apply. func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { return &PriorityLevelConfigurationReferenceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityLevelConfigurationReferenceApplyConfiguration) WithName(value string) *PriorityLevelConfigurationReferenceApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go000066400000000000000000000055211472614177300343040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/flowcontrol/v1" ) // PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { Type *v1.PriorityLevelEnablement `json:"type,omitempty"` Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"` Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } // PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with // apply. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { return &PriorityLevelConfigurationSpecApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration { b.Type = &value return b } // WithLimited sets the Limited field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Limited field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithLimited(value *LimitedPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { b.Limited = value return b } // WithExempt sets the Exempt field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Exempt field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithExempt(value *ExemptPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { b.Exempt = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go000066400000000000000000000036241472614177300346770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PriorityLevelConfigurationStatusApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. type PriorityLevelConfigurationStatusApplyConfiguration struct { Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` } // PriorityLevelConfigurationStatusApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationStatus type for use with // apply. func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { return &PriorityLevelConfigurationStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *PriorityLevelConfigurationStatusApplyConfiguration) WithConditions(values ...*PriorityLevelConfigurationConditionApplyConfiguration) *PriorityLevelConfigurationStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/queuingconfiguration.go000066400000000000000000000050101472614177300321660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // QueuingConfigurationApplyConfiguration represents a declarative configuration of the QueuingConfiguration type for use // with apply. type QueuingConfigurationApplyConfiguration struct { Queues *int32 `json:"queues,omitempty"` HandSize *int32 `json:"handSize,omitempty"` QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` } // QueuingConfigurationApplyConfiguration constructs a declarative configuration of the QueuingConfiguration type for use with // apply. func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { return &QueuingConfigurationApplyConfiguration{} } // WithQueues sets the Queues field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Queues field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithQueues(value int32) *QueuingConfigurationApplyConfiguration { b.Queues = &value return b } // WithHandSize sets the HandSize field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HandSize field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithHandSize(value int32) *QueuingConfigurationApplyConfiguration { b.HandSize = &value return b } // WithQueueLengthLimit sets the QueueLengthLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the QueueLengthLimit field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithQueueLengthLimit(value int32) *QueuingConfigurationApplyConfiguration { b.QueueLengthLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go000066400000000000000000000072521472614177300316720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ResourcePolicyRuleApplyConfiguration represents a declarative configuration of the ResourcePolicyRule type for use // with apply. type ResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` APIGroups []string `json:"apiGroups,omitempty"` Resources []string `json:"resources,omitempty"` ClusterScope *bool `json:"clusterScope,omitempty"` Namespaces []string `json:"namespaces,omitempty"` } // ResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the ResourcePolicyRule type for use with // apply. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { return &ResourcePolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithClusterScope sets the ClusterScope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClusterScope field is set to the value of the last call. func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration { b.ClusterScope = &value return b } // WithNamespaces adds the given value to the Namespaces field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Namespaces field. func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Namespaces = append(b.Namespaces, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go000066400000000000000000000037631472614177300323330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ServiceAccountSubjectApplyConfiguration represents a declarative configuration of the ServiceAccountSubject type for use // with apply. type ServiceAccountSubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } // ServiceAccountSubjectApplyConfiguration constructs a declarative configuration of the ServiceAccountSubject type for use with // apply. func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { return &ServiceAccountSubjectApplyConfiguration{} } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceAccountSubjectApplyConfiguration) WithNamespace(value string) *ServiceAccountSubjectApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceAccountSubjectApplyConfiguration) WithName(value string) *ServiceAccountSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/subject.go000066400000000000000000000057371472614177300274000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/flowcontrol/v1" ) // SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *v1.SubjectKind `json:"kind,omitempty"` User *UserSubjectApplyConfiguration `json:"user,omitempty"` Group *GroupSubjectApplyConfiguration `json:"group,omitempty"` ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` } // SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithKind(value v1.SubjectKind) *SubjectApplyConfiguration { b.Kind = &value return b } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithUser(value *UserSubjectApplyConfiguration) *SubjectApplyConfiguration { b.User = value return b } // WithGroup sets the Group field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithGroup(value *GroupSubjectApplyConfiguration) *SubjectApplyConfiguration { b.Group = value return b } // WithServiceAccount sets the ServiceAccount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccount field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithServiceAccount(value *ServiceAccountSubjectApplyConfiguration) *SubjectApplyConfiguration { b.ServiceAccount = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1/usersubject.go000066400000000000000000000026461472614177300302730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // UserSubjectApplyConfiguration represents a declarative configuration of the UserSubject type for use // with apply. type UserSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } // UserSubjectApplyConfiguration constructs a declarative configuration of the UserSubject type for use with // apply. func UserSubject() *UserSubjectApplyConfiguration { return &UserSubjectApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *UserSubjectApplyConfiguration) WithName(value string) *UserSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/000077500000000000000000000000001472614177300263135ustar00rootroot00000000000000exemptprioritylevelconfiguration.go000066400000000000000000000044621472614177300355150ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. type ExemptPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` } // ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with // apply. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { return &ExemptPriorityLevelConfigurationApplyConfiguration{} } // WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { b.NominalConcurrencyShares = &value return b } // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LendablePercent field is set to the value of the last call. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { b.LendablePercent = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/flowdistinguishermethod.go000066400000000000000000000032231472614177300336140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" ) // FlowDistinguisherMethodApplyConfiguration represents a declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { Type *v1beta1.FlowDistinguisherMethodType `json:"type,omitempty"` } // FlowDistinguisherMethodApplyConfiguration constructs a declarative configuration of the FlowDistinguisherMethod type for use with // apply. func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { return &FlowDistinguisherMethodApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *FlowDistinguisherMethodApplyConfiguration) WithType(value v1beta1.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration { b.Type = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/flowschema.go000066400000000000000000000305671472614177300310050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // FlowSchemaApplyConfiguration represents a declarative configuration of the FlowSchema type for use // with apply. type FlowSchemaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *FlowSchemaSpecApplyConfiguration `json:"spec,omitempty"` Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` } // FlowSchema constructs a declarative configuration of the FlowSchema type for use with // apply. func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} b.WithName(name) b.WithKind("FlowSchema") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta1") return b } // ExtractFlowSchema extracts the applied configuration owned by fieldManager from // flowSchema. If no managedFields are found in flowSchema for fieldManager, a // FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API. // ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractFlowSchema(flowSchema *flowcontrolv1beta1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "") } // ExtractFlowSchemaStatus is the same as ExtractFlowSchema except // that it extracts the status subresource applied configuration. // Experimental! func ExtractFlowSchemaStatus(flowSchema *flowcontrolv1beta1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "status") } func extractFlowSchema(flowSchema *flowcontrolv1beta1.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { b := &FlowSchemaApplyConfiguration{} err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta1.FlowSchema"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(flowSchema.Name) b.WithKind("FlowSchema") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithKind(value string) *FlowSchemaApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithAPIVersion(value string) *FlowSchemaApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithName(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithGenerateName(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithNamespace(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithUID(value types.UID) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithResourceVersion(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithGeneration(value int64) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *FlowSchemaApplyConfiguration) WithLabels(entries map[string]string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *FlowSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *FlowSchemaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *FlowSchemaApplyConfiguration) WithFinalizers(values ...string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *FlowSchemaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithSpec(value *FlowSchemaSpecApplyConfiguration) *FlowSchemaApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyConfiguration) *FlowSchemaApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *FlowSchemaApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go000066400000000000000000000072741472614177300327130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FlowSchemaConditionApplyConfiguration represents a declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { Type *v1beta1.FlowSchemaConditionType `json:"type,omitempty"` Status *v1beta1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // FlowSchemaConditionApplyConfiguration constructs a declarative configuration of the FlowSchemaCondition type for use with // apply. func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { return &FlowSchemaConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1beta1.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1beta1.ConditionStatus) *FlowSchemaConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *FlowSchemaConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithReason(value string) *FlowSchemaConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithMessage(value string) *FlowSchemaConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/flowschemaspec.go000066400000000000000000000070531472614177300316520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // FlowSchemaSpecApplyConfiguration represents a declarative configuration of the FlowSchemaSpec type for use // with apply. type FlowSchemaSpecApplyConfiguration struct { PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` MatchingPrecedence *int32 `json:"matchingPrecedence,omitempty"` DistinguisherMethod *FlowDistinguisherMethodApplyConfiguration `json:"distinguisherMethod,omitempty"` Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` } // FlowSchemaSpecApplyConfiguration constructs a declarative configuration of the FlowSchemaSpec type for use with // apply. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { return &FlowSchemaSpecApplyConfiguration{} } // WithPriorityLevelConfiguration sets the PriorityLevelConfiguration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PriorityLevelConfiguration field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithPriorityLevelConfiguration(value *PriorityLevelConfigurationReferenceApplyConfiguration) *FlowSchemaSpecApplyConfiguration { b.PriorityLevelConfiguration = value return b } // WithMatchingPrecedence sets the MatchingPrecedence field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchingPrecedence field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithMatchingPrecedence(value int32) *FlowSchemaSpecApplyConfiguration { b.MatchingPrecedence = &value return b } // WithDistinguisherMethod sets the DistinguisherMethod field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DistinguisherMethod field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithDistinguisherMethod(value *FlowDistinguisherMethodApplyConfiguration) *FlowSchemaSpecApplyConfiguration { b.DistinguisherMethod = value return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *FlowSchemaSpecApplyConfiguration) WithRules(values ...*PolicyRulesWithSubjectsApplyConfiguration) *FlowSchemaSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/flowschemastatus.go000066400000000000000000000033311472614177300322360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // FlowSchemaStatusApplyConfiguration represents a declarative configuration of the FlowSchemaStatus type for use // with apply. type FlowSchemaStatusApplyConfiguration struct { Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` } // FlowSchemaStatusApplyConfiguration constructs a declarative configuration of the FlowSchemaStatus type for use with // apply. func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { return &FlowSchemaStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *FlowSchemaStatusApplyConfiguration) WithConditions(values ...*FlowSchemaConditionApplyConfiguration) *FlowSchemaStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/groupsubject.go000066400000000000000000000026651472614177300313670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // GroupSubjectApplyConfiguration represents a declarative configuration of the GroupSubject type for use // with apply. type GroupSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } // GroupSubjectApplyConfiguration constructs a declarative configuration of the GroupSubject type for use with // apply. func GroupSubject() *GroupSubjectApplyConfiguration { return &GroupSubjectApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *GroupSubjectApplyConfiguration) WithName(value string) *GroupSubjectApplyConfiguration { b.Name = &value return b } limitedprioritylevelconfiguration.go000066400000000000000000000070621472614177300356410ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // LimitedPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { AssuredConcurrencyShares *int32 `json:"assuredConcurrencyShares,omitempty"` LimitResponse *LimitResponseApplyConfiguration `json:"limitResponse,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` } // LimitedPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the LimitedPriorityLevelConfiguration type for use with // apply. func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { return &LimitedPriorityLevelConfigurationApplyConfiguration{} } // WithAssuredConcurrencyShares sets the AssuredConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AssuredConcurrencyShares field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithAssuredConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.AssuredConcurrencyShares = &value return b } // WithLimitResponse sets the LimitResponse field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LimitResponse field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLimitResponse(value *LimitResponseApplyConfiguration) *LimitedPriorityLevelConfigurationApplyConfiguration { b.LimitResponse = value return b } // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LendablePercent field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.LendablePercent = &value return b } // WithBorrowingLimitPercent sets the BorrowingLimitPercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BorrowingLimitPercent field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithBorrowingLimitPercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.BorrowingLimitPercent = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/limitresponse.go000066400000000000000000000040611472614177300315400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" ) // LimitResponseApplyConfiguration represents a declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { Type *v1beta1.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } // LimitResponseApplyConfiguration constructs a declarative configuration of the LimitResponse type for use with // apply. func LimitResponse() *LimitResponseApplyConfiguration { return &LimitResponseApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *LimitResponseApplyConfiguration) WithType(value v1beta1.LimitResponseType) *LimitResponseApplyConfiguration { b.Type = &value return b } // WithQueuing sets the Queuing field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Queuing field is set to the value of the last call. func (b *LimitResponseApplyConfiguration) WithQueuing(value *QueuingConfigurationApplyConfiguration) *LimitResponseApplyConfiguration { b.Queuing = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/nonresourcepolicyrule.go000066400000000000000000000042741472614177300333230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // NonResourcePolicyRuleApplyConfiguration represents a declarative configuration of the NonResourcePolicyRule type for use // with apply. type NonResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } // NonResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the NonResourcePolicyRule type for use with // apply. func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { return &NonResourcePolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *NonResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *NonResourcePolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceURLs field. func (b *NonResourcePolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *NonResourcePolicyRuleApplyConfiguration { for i := range values { b.NonResourceURLs = append(b.NonResourceURLs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/policyruleswithsubjects.go000066400000000000000000000063461472614177300336640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // PolicyRulesWithSubjectsApplyConfiguration represents a declarative configuration of the PolicyRulesWithSubjects type for use // with apply. type PolicyRulesWithSubjectsApplyConfiguration struct { Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` ResourceRules []ResourcePolicyRuleApplyConfiguration `json:"resourceRules,omitempty"` NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` } // PolicyRulesWithSubjectsApplyConfiguration constructs a declarative configuration of the PolicyRulesWithSubjects type for use with // apply. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { return &PolicyRulesWithSubjectsApplyConfiguration{} } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceRules field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithResourceRules(values ...*ResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceRules") } b.ResourceRules = append(b.ResourceRules, *values[i]) } return b } // WithNonResourceRules adds the given value to the NonResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceRules field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithNonResourceRules(values ...*NonResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithNonResourceRules") } b.NonResourceRules = append(b.NonResourceRules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go000066400000000000000000000331471472614177300343530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the PriorityLevelConfiguration type for use // with apply. type PriorityLevelConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PriorityLevelConfigurationSpecApplyConfiguration `json:"spec,omitempty"` Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` } // PriorityLevelConfiguration constructs a declarative configuration of the PriorityLevelConfiguration type for use with // apply. func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { b := &PriorityLevelConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("PriorityLevelConfiguration") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta1") return b } // ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from // priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a // PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API. // ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") } // ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") } func extractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { b := &PriorityLevelConfigurationApplyConfiguration{} err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(priorityLevelConfiguration.Name) b.WithKind("PriorityLevelConfiguration") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithKind(value string) *PriorityLevelConfigurationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithAPIVersion(value string) *PriorityLevelConfigurationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithName(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithGenerateName(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithNamespace(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithUID(value types.UID) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithResourceVersion(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithGeneration(value int64) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PriorityLevelConfigurationApplyConfiguration) WithLabels(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PriorityLevelConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PriorityLevelConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PriorityLevelConfigurationApplyConfiguration) WithFinalizers(values ...string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PriorityLevelConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithSpec(value *PriorityLevelConfigurationSpecApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *PriorityLevelConfigurationStatusApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PriorityLevelConfigurationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } prioritylevelconfigurationcondition.go000066400000000000000000000100741472614177300361750ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PriorityLevelConfigurationConditionApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { Type *v1beta1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` Status *v1beta1.ConditionStatus `json:"status,omitempty"` LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // PriorityLevelConfigurationConditionApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationCondition type for use with // apply. func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { return &PriorityLevelConfigurationConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1beta1.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1beta1.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *PriorityLevelConfigurationConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithReason(value string) *PriorityLevelConfigurationConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithMessage(value string) *PriorityLevelConfigurationConditionApplyConfiguration { b.Message = &value return b } prioritylevelconfigurationreference.go000066400000000000000000000032331472614177300361440ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // PriorityLevelConfigurationReferenceApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. type PriorityLevelConfigurationReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } // PriorityLevelConfigurationReferenceApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationReference type for use with // apply. func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { return &PriorityLevelConfigurationReferenceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityLevelConfigurationReferenceApplyConfiguration) WithName(value string) *PriorityLevelConfigurationReferenceApplyConfiguration { b.Name = &value return b } prioritylevelconfigurationspec.go000066400000000000000000000055451472614177300351500ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" ) // PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { Type *v1beta1.PriorityLevelEnablement `json:"type,omitempty"` Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"` Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } // PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with // apply. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { return &PriorityLevelConfigurationSpecApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1beta1.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration { b.Type = &value return b } // WithLimited sets the Limited field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Limited field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithLimited(value *LimitedPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { b.Limited = value return b } // WithExempt sets the Exempt field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Exempt field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithExempt(value *ExemptPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { b.Exempt = value return b } prioritylevelconfigurationstatus.go000066400000000000000000000036311472614177300355330ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // PriorityLevelConfigurationStatusApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. type PriorityLevelConfigurationStatusApplyConfiguration struct { Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` } // PriorityLevelConfigurationStatusApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationStatus type for use with // apply. func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { return &PriorityLevelConfigurationStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *PriorityLevelConfigurationStatusApplyConfiguration) WithConditions(values ...*PriorityLevelConfigurationConditionApplyConfiguration) *PriorityLevelConfigurationStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/queuingconfiguration.go000066400000000000000000000050151472614177300331100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // QueuingConfigurationApplyConfiguration represents a declarative configuration of the QueuingConfiguration type for use // with apply. type QueuingConfigurationApplyConfiguration struct { Queues *int32 `json:"queues,omitempty"` HandSize *int32 `json:"handSize,omitempty"` QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` } // QueuingConfigurationApplyConfiguration constructs a declarative configuration of the QueuingConfiguration type for use with // apply. func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { return &QueuingConfigurationApplyConfiguration{} } // WithQueues sets the Queues field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Queues field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithQueues(value int32) *QueuingConfigurationApplyConfiguration { b.Queues = &value return b } // WithHandSize sets the HandSize field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HandSize field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithHandSize(value int32) *QueuingConfigurationApplyConfiguration { b.HandSize = &value return b } // WithQueueLengthLimit sets the QueueLengthLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the QueueLengthLimit field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithQueueLengthLimit(value int32) *QueuingConfigurationApplyConfiguration { b.QueueLengthLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/resourcepolicyrule.go000066400000000000000000000072571472614177300326140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ResourcePolicyRuleApplyConfiguration represents a declarative configuration of the ResourcePolicyRule type for use // with apply. type ResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` APIGroups []string `json:"apiGroups,omitempty"` Resources []string `json:"resources,omitempty"` ClusterScope *bool `json:"clusterScope,omitempty"` Namespaces []string `json:"namespaces,omitempty"` } // ResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the ResourcePolicyRule type for use with // apply. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { return &ResourcePolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithClusterScope sets the ClusterScope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClusterScope field is set to the value of the last call. func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration { b.ClusterScope = &value return b } // WithNamespaces adds the given value to the Namespaces field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Namespaces field. func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Namespaces = append(b.Namespaces, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/serviceaccountsubject.go000066400000000000000000000037701472614177300332460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ServiceAccountSubjectApplyConfiguration represents a declarative configuration of the ServiceAccountSubject type for use // with apply. type ServiceAccountSubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } // ServiceAccountSubjectApplyConfiguration constructs a declarative configuration of the ServiceAccountSubject type for use with // apply. func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { return &ServiceAccountSubjectApplyConfiguration{} } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceAccountSubjectApplyConfiguration) WithNamespace(value string) *ServiceAccountSubjectApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceAccountSubjectApplyConfiguration) WithName(value string) *ServiceAccountSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/subject.go000066400000000000000000000057631472614177300303140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" ) // SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *v1beta1.SubjectKind `json:"kind,omitempty"` User *UserSubjectApplyConfiguration `json:"user,omitempty"` Group *GroupSubjectApplyConfiguration `json:"group,omitempty"` ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` } // SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithKind(value v1beta1.SubjectKind) *SubjectApplyConfiguration { b.Kind = &value return b } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithUser(value *UserSubjectApplyConfiguration) *SubjectApplyConfiguration { b.User = value return b } // WithGroup sets the Group field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithGroup(value *GroupSubjectApplyConfiguration) *SubjectApplyConfiguration { b.Group = value return b } // WithServiceAccount sets the ServiceAccount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccount field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithServiceAccount(value *ServiceAccountSubjectApplyConfiguration) *SubjectApplyConfiguration { b.ServiceAccount = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta1/usersubject.go000066400000000000000000000026531472614177300312060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // UserSubjectApplyConfiguration represents a declarative configuration of the UserSubject type for use // with apply. type UserSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } // UserSubjectApplyConfiguration constructs a declarative configuration of the UserSubject type for use with // apply. func UserSubject() *UserSubjectApplyConfiguration { return &UserSubjectApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *UserSubjectApplyConfiguration) WithName(value string) *UserSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/000077500000000000000000000000001472614177300263145ustar00rootroot00000000000000exemptprioritylevelconfiguration.go000066400000000000000000000044621472614177300355160ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. type ExemptPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` } // ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with // apply. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { return &ExemptPriorityLevelConfigurationApplyConfiguration{} } // WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { b.NominalConcurrencyShares = &value return b } // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LendablePercent field is set to the value of the last call. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { b.LendablePercent = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/flowdistinguishermethod.go000066400000000000000000000032231472614177300336150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" ) // FlowDistinguisherMethodApplyConfiguration represents a declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { Type *v1beta2.FlowDistinguisherMethodType `json:"type,omitempty"` } // FlowDistinguisherMethodApplyConfiguration constructs a declarative configuration of the FlowDistinguisherMethod type for use with // apply. func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { return &FlowDistinguisherMethodApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *FlowDistinguisherMethodApplyConfiguration) WithType(value v1beta2.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration { b.Type = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/flowschema.go000066400000000000000000000305671472614177300310060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // FlowSchemaApplyConfiguration represents a declarative configuration of the FlowSchema type for use // with apply. type FlowSchemaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *FlowSchemaSpecApplyConfiguration `json:"spec,omitempty"` Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` } // FlowSchema constructs a declarative configuration of the FlowSchema type for use with // apply. func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} b.WithName(name) b.WithKind("FlowSchema") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta2") return b } // ExtractFlowSchema extracts the applied configuration owned by fieldManager from // flowSchema. If no managedFields are found in flowSchema for fieldManager, a // FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API. // ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractFlowSchema(flowSchema *flowcontrolv1beta2.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "") } // ExtractFlowSchemaStatus is the same as ExtractFlowSchema except // that it extracts the status subresource applied configuration. // Experimental! func ExtractFlowSchemaStatus(flowSchema *flowcontrolv1beta2.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "status") } func extractFlowSchema(flowSchema *flowcontrolv1beta2.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { b := &FlowSchemaApplyConfiguration{} err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta2.FlowSchema"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(flowSchema.Name) b.WithKind("FlowSchema") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithKind(value string) *FlowSchemaApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithAPIVersion(value string) *FlowSchemaApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithName(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithGenerateName(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithNamespace(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithUID(value types.UID) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithResourceVersion(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithGeneration(value int64) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *FlowSchemaApplyConfiguration) WithLabels(entries map[string]string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *FlowSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *FlowSchemaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *FlowSchemaApplyConfiguration) WithFinalizers(values ...string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *FlowSchemaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithSpec(value *FlowSchemaSpecApplyConfiguration) *FlowSchemaApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyConfiguration) *FlowSchemaApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *FlowSchemaApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go000066400000000000000000000072741472614177300327140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FlowSchemaConditionApplyConfiguration represents a declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { Type *v1beta2.FlowSchemaConditionType `json:"type,omitempty"` Status *v1beta2.ConditionStatus `json:"status,omitempty"` LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // FlowSchemaConditionApplyConfiguration constructs a declarative configuration of the FlowSchemaCondition type for use with // apply. func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { return &FlowSchemaConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1beta2.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1beta2.ConditionStatus) *FlowSchemaConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *FlowSchemaConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithReason(value string) *FlowSchemaConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithMessage(value string) *FlowSchemaConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/flowschemaspec.go000066400000000000000000000070531472614177300316530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // FlowSchemaSpecApplyConfiguration represents a declarative configuration of the FlowSchemaSpec type for use // with apply. type FlowSchemaSpecApplyConfiguration struct { PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` MatchingPrecedence *int32 `json:"matchingPrecedence,omitempty"` DistinguisherMethod *FlowDistinguisherMethodApplyConfiguration `json:"distinguisherMethod,omitempty"` Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` } // FlowSchemaSpecApplyConfiguration constructs a declarative configuration of the FlowSchemaSpec type for use with // apply. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { return &FlowSchemaSpecApplyConfiguration{} } // WithPriorityLevelConfiguration sets the PriorityLevelConfiguration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PriorityLevelConfiguration field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithPriorityLevelConfiguration(value *PriorityLevelConfigurationReferenceApplyConfiguration) *FlowSchemaSpecApplyConfiguration { b.PriorityLevelConfiguration = value return b } // WithMatchingPrecedence sets the MatchingPrecedence field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchingPrecedence field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithMatchingPrecedence(value int32) *FlowSchemaSpecApplyConfiguration { b.MatchingPrecedence = &value return b } // WithDistinguisherMethod sets the DistinguisherMethod field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DistinguisherMethod field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithDistinguisherMethod(value *FlowDistinguisherMethodApplyConfiguration) *FlowSchemaSpecApplyConfiguration { b.DistinguisherMethod = value return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *FlowSchemaSpecApplyConfiguration) WithRules(values ...*PolicyRulesWithSubjectsApplyConfiguration) *FlowSchemaSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/flowschemastatus.go000066400000000000000000000033311472614177300322370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // FlowSchemaStatusApplyConfiguration represents a declarative configuration of the FlowSchemaStatus type for use // with apply. type FlowSchemaStatusApplyConfiguration struct { Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` } // FlowSchemaStatusApplyConfiguration constructs a declarative configuration of the FlowSchemaStatus type for use with // apply. func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { return &FlowSchemaStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *FlowSchemaStatusApplyConfiguration) WithConditions(values ...*FlowSchemaConditionApplyConfiguration) *FlowSchemaStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/groupsubject.go000066400000000000000000000026651472614177300313700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // GroupSubjectApplyConfiguration represents a declarative configuration of the GroupSubject type for use // with apply. type GroupSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } // GroupSubjectApplyConfiguration constructs a declarative configuration of the GroupSubject type for use with // apply. func GroupSubject() *GroupSubjectApplyConfiguration { return &GroupSubjectApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *GroupSubjectApplyConfiguration) WithName(value string) *GroupSubjectApplyConfiguration { b.Name = &value return b } limitedprioritylevelconfiguration.go000066400000000000000000000070621472614177300356420ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // LimitedPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { AssuredConcurrencyShares *int32 `json:"assuredConcurrencyShares,omitempty"` LimitResponse *LimitResponseApplyConfiguration `json:"limitResponse,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` } // LimitedPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the LimitedPriorityLevelConfiguration type for use with // apply. func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { return &LimitedPriorityLevelConfigurationApplyConfiguration{} } // WithAssuredConcurrencyShares sets the AssuredConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AssuredConcurrencyShares field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithAssuredConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.AssuredConcurrencyShares = &value return b } // WithLimitResponse sets the LimitResponse field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LimitResponse field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLimitResponse(value *LimitResponseApplyConfiguration) *LimitedPriorityLevelConfigurationApplyConfiguration { b.LimitResponse = value return b } // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LendablePercent field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.LendablePercent = &value return b } // WithBorrowingLimitPercent sets the BorrowingLimitPercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BorrowingLimitPercent field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithBorrowingLimitPercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.BorrowingLimitPercent = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/limitresponse.go000066400000000000000000000040611472614177300315410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" ) // LimitResponseApplyConfiguration represents a declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { Type *v1beta2.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } // LimitResponseApplyConfiguration constructs a declarative configuration of the LimitResponse type for use with // apply. func LimitResponse() *LimitResponseApplyConfiguration { return &LimitResponseApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *LimitResponseApplyConfiguration) WithType(value v1beta2.LimitResponseType) *LimitResponseApplyConfiguration { b.Type = &value return b } // WithQueuing sets the Queuing field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Queuing field is set to the value of the last call. func (b *LimitResponseApplyConfiguration) WithQueuing(value *QueuingConfigurationApplyConfiguration) *LimitResponseApplyConfiguration { b.Queuing = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/nonresourcepolicyrule.go000066400000000000000000000042741472614177300333240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // NonResourcePolicyRuleApplyConfiguration represents a declarative configuration of the NonResourcePolicyRule type for use // with apply. type NonResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } // NonResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the NonResourcePolicyRule type for use with // apply. func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { return &NonResourcePolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *NonResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *NonResourcePolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceURLs field. func (b *NonResourcePolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *NonResourcePolicyRuleApplyConfiguration { for i := range values { b.NonResourceURLs = append(b.NonResourceURLs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/policyruleswithsubjects.go000066400000000000000000000063461472614177300336650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // PolicyRulesWithSubjectsApplyConfiguration represents a declarative configuration of the PolicyRulesWithSubjects type for use // with apply. type PolicyRulesWithSubjectsApplyConfiguration struct { Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` ResourceRules []ResourcePolicyRuleApplyConfiguration `json:"resourceRules,omitempty"` NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` } // PolicyRulesWithSubjectsApplyConfiguration constructs a declarative configuration of the PolicyRulesWithSubjects type for use with // apply. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { return &PolicyRulesWithSubjectsApplyConfiguration{} } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceRules field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithResourceRules(values ...*ResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceRules") } b.ResourceRules = append(b.ResourceRules, *values[i]) } return b } // WithNonResourceRules adds the given value to the NonResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceRules field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithNonResourceRules(values ...*NonResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithNonResourceRules") } b.NonResourceRules = append(b.NonResourceRules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go000066400000000000000000000331471472614177300343540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the PriorityLevelConfiguration type for use // with apply. type PriorityLevelConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PriorityLevelConfigurationSpecApplyConfiguration `json:"spec,omitempty"` Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` } // PriorityLevelConfiguration constructs a declarative configuration of the PriorityLevelConfiguration type for use with // apply. func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { b := &PriorityLevelConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("PriorityLevelConfiguration") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta2") return b } // ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from // priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a // PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API. // ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") } // ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") } func extractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { b := &PriorityLevelConfigurationApplyConfiguration{} err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(priorityLevelConfiguration.Name) b.WithKind("PriorityLevelConfiguration") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta2") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithKind(value string) *PriorityLevelConfigurationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithAPIVersion(value string) *PriorityLevelConfigurationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithName(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithGenerateName(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithNamespace(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithUID(value types.UID) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithResourceVersion(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithGeneration(value int64) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PriorityLevelConfigurationApplyConfiguration) WithLabels(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PriorityLevelConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PriorityLevelConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PriorityLevelConfigurationApplyConfiguration) WithFinalizers(values ...string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PriorityLevelConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithSpec(value *PriorityLevelConfigurationSpecApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *PriorityLevelConfigurationStatusApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PriorityLevelConfigurationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } prioritylevelconfigurationcondition.go000066400000000000000000000100741472614177300361760ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PriorityLevelConfigurationConditionApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { Type *v1beta2.PriorityLevelConfigurationConditionType `json:"type,omitempty"` Status *v1beta2.ConditionStatus `json:"status,omitempty"` LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // PriorityLevelConfigurationConditionApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationCondition type for use with // apply. func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { return &PriorityLevelConfigurationConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1beta2.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1beta2.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *PriorityLevelConfigurationConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithReason(value string) *PriorityLevelConfigurationConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithMessage(value string) *PriorityLevelConfigurationConditionApplyConfiguration { b.Message = &value return b } prioritylevelconfigurationreference.go000066400000000000000000000032331472614177300361450ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // PriorityLevelConfigurationReferenceApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. type PriorityLevelConfigurationReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } // PriorityLevelConfigurationReferenceApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationReference type for use with // apply. func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { return &PriorityLevelConfigurationReferenceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityLevelConfigurationReferenceApplyConfiguration) WithName(value string) *PriorityLevelConfigurationReferenceApplyConfiguration { b.Name = &value return b } prioritylevelconfigurationspec.go000066400000000000000000000055451472614177300351510ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" ) // PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { Type *v1beta2.PriorityLevelEnablement `json:"type,omitempty"` Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"` Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } // PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with // apply. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { return &PriorityLevelConfigurationSpecApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1beta2.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration { b.Type = &value return b } // WithLimited sets the Limited field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Limited field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithLimited(value *LimitedPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { b.Limited = value return b } // WithExempt sets the Exempt field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Exempt field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithExempt(value *ExemptPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { b.Exempt = value return b } prioritylevelconfigurationstatus.go000066400000000000000000000036311472614177300355340ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // PriorityLevelConfigurationStatusApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. type PriorityLevelConfigurationStatusApplyConfiguration struct { Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` } // PriorityLevelConfigurationStatusApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationStatus type for use with // apply. func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { return &PriorityLevelConfigurationStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *PriorityLevelConfigurationStatusApplyConfiguration) WithConditions(values ...*PriorityLevelConfigurationConditionApplyConfiguration) *PriorityLevelConfigurationStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/queuingconfiguration.go000066400000000000000000000050151472614177300331110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // QueuingConfigurationApplyConfiguration represents a declarative configuration of the QueuingConfiguration type for use // with apply. type QueuingConfigurationApplyConfiguration struct { Queues *int32 `json:"queues,omitempty"` HandSize *int32 `json:"handSize,omitempty"` QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` } // QueuingConfigurationApplyConfiguration constructs a declarative configuration of the QueuingConfiguration type for use with // apply. func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { return &QueuingConfigurationApplyConfiguration{} } // WithQueues sets the Queues field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Queues field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithQueues(value int32) *QueuingConfigurationApplyConfiguration { b.Queues = &value return b } // WithHandSize sets the HandSize field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HandSize field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithHandSize(value int32) *QueuingConfigurationApplyConfiguration { b.HandSize = &value return b } // WithQueueLengthLimit sets the QueueLengthLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the QueueLengthLimit field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithQueueLengthLimit(value int32) *QueuingConfigurationApplyConfiguration { b.QueueLengthLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/resourcepolicyrule.go000066400000000000000000000072571472614177300326150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // ResourcePolicyRuleApplyConfiguration represents a declarative configuration of the ResourcePolicyRule type for use // with apply. type ResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` APIGroups []string `json:"apiGroups,omitempty"` Resources []string `json:"resources,omitempty"` ClusterScope *bool `json:"clusterScope,omitempty"` Namespaces []string `json:"namespaces,omitempty"` } // ResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the ResourcePolicyRule type for use with // apply. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { return &ResourcePolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithClusterScope sets the ClusterScope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClusterScope field is set to the value of the last call. func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration { b.ClusterScope = &value return b } // WithNamespaces adds the given value to the Namespaces field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Namespaces field. func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Namespaces = append(b.Namespaces, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/serviceaccountsubject.go000066400000000000000000000037701472614177300332470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // ServiceAccountSubjectApplyConfiguration represents a declarative configuration of the ServiceAccountSubject type for use // with apply. type ServiceAccountSubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } // ServiceAccountSubjectApplyConfiguration constructs a declarative configuration of the ServiceAccountSubject type for use with // apply. func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { return &ServiceAccountSubjectApplyConfiguration{} } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceAccountSubjectApplyConfiguration) WithNamespace(value string) *ServiceAccountSubjectApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceAccountSubjectApplyConfiguration) WithName(value string) *ServiceAccountSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/subject.go000066400000000000000000000057631472614177300303150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" ) // SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *v1beta2.SubjectKind `json:"kind,omitempty"` User *UserSubjectApplyConfiguration `json:"user,omitempty"` Group *GroupSubjectApplyConfiguration `json:"group,omitempty"` ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` } // SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithKind(value v1beta2.SubjectKind) *SubjectApplyConfiguration { b.Kind = &value return b } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithUser(value *UserSubjectApplyConfiguration) *SubjectApplyConfiguration { b.User = value return b } // WithGroup sets the Group field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithGroup(value *GroupSubjectApplyConfiguration) *SubjectApplyConfiguration { b.Group = value return b } // WithServiceAccount sets the ServiceAccount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccount field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithServiceAccount(value *ServiceAccountSubjectApplyConfiguration) *SubjectApplyConfiguration { b.ServiceAccount = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta2/usersubject.go000066400000000000000000000026531472614177300312070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta2 // UserSubjectApplyConfiguration represents a declarative configuration of the UserSubject type for use // with apply. type UserSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } // UserSubjectApplyConfiguration constructs a declarative configuration of the UserSubject type for use with // apply. func UserSubject() *UserSubjectApplyConfiguration { return &UserSubjectApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *UserSubjectApplyConfiguration) WithName(value string) *UserSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/000077500000000000000000000000001472614177300263155ustar00rootroot00000000000000exemptprioritylevelconfiguration.go000066400000000000000000000044621472614177300355170ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. type ExemptPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` } // ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with // apply. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { return &ExemptPriorityLevelConfigurationApplyConfiguration{} } // WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { b.NominalConcurrencyShares = &value return b } // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LendablePercent field is set to the value of the last call. func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { b.LendablePercent = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/flowdistinguishermethod.go000066400000000000000000000032231472614177300336160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" ) // FlowDistinguisherMethodApplyConfiguration represents a declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { Type *v1beta3.FlowDistinguisherMethodType `json:"type,omitempty"` } // FlowDistinguisherMethodApplyConfiguration constructs a declarative configuration of the FlowDistinguisherMethod type for use with // apply. func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { return &FlowDistinguisherMethodApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *FlowDistinguisherMethodApplyConfiguration) WithType(value v1beta3.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration { b.Type = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/flowschema.go000066400000000000000000000305671472614177300310070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 import ( flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // FlowSchemaApplyConfiguration represents a declarative configuration of the FlowSchema type for use // with apply. type FlowSchemaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *FlowSchemaSpecApplyConfiguration `json:"spec,omitempty"` Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` } // FlowSchema constructs a declarative configuration of the FlowSchema type for use with // apply. func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} b.WithName(name) b.WithKind("FlowSchema") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta3") return b } // ExtractFlowSchema extracts the applied configuration owned by fieldManager from // flowSchema. If no managedFields are found in flowSchema for fieldManager, a // FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API. // ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractFlowSchema(flowSchema *flowcontrolv1beta3.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "") } // ExtractFlowSchemaStatus is the same as ExtractFlowSchema except // that it extracts the status subresource applied configuration. // Experimental! func ExtractFlowSchemaStatus(flowSchema *flowcontrolv1beta3.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { return extractFlowSchema(flowSchema, fieldManager, "status") } func extractFlowSchema(flowSchema *flowcontrolv1beta3.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { b := &FlowSchemaApplyConfiguration{} err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta3.FlowSchema"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(flowSchema.Name) b.WithKind("FlowSchema") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta3") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithKind(value string) *FlowSchemaApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithAPIVersion(value string) *FlowSchemaApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithName(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithGenerateName(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithNamespace(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithUID(value types.UID) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithResourceVersion(value string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithGeneration(value int64) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *FlowSchemaApplyConfiguration) WithLabels(entries map[string]string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *FlowSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *FlowSchemaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *FlowSchemaApplyConfiguration) WithFinalizers(values ...string) *FlowSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *FlowSchemaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithSpec(value *FlowSchemaSpecApplyConfiguration) *FlowSchemaApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyConfiguration) *FlowSchemaApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *FlowSchemaApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go000066400000000000000000000072741472614177300327150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FlowSchemaConditionApplyConfiguration represents a declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { Type *v1beta3.FlowSchemaConditionType `json:"type,omitempty"` Status *v1beta3.ConditionStatus `json:"status,omitempty"` LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // FlowSchemaConditionApplyConfiguration constructs a declarative configuration of the FlowSchemaCondition type for use with // apply. func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { return &FlowSchemaConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1beta3.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1beta3.ConditionStatus) *FlowSchemaConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *FlowSchemaConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithReason(value string) *FlowSchemaConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *FlowSchemaConditionApplyConfiguration) WithMessage(value string) *FlowSchemaConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/flowschemaspec.go000066400000000000000000000070531472614177300316540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // FlowSchemaSpecApplyConfiguration represents a declarative configuration of the FlowSchemaSpec type for use // with apply. type FlowSchemaSpecApplyConfiguration struct { PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` MatchingPrecedence *int32 `json:"matchingPrecedence,omitempty"` DistinguisherMethod *FlowDistinguisherMethodApplyConfiguration `json:"distinguisherMethod,omitempty"` Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` } // FlowSchemaSpecApplyConfiguration constructs a declarative configuration of the FlowSchemaSpec type for use with // apply. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { return &FlowSchemaSpecApplyConfiguration{} } // WithPriorityLevelConfiguration sets the PriorityLevelConfiguration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PriorityLevelConfiguration field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithPriorityLevelConfiguration(value *PriorityLevelConfigurationReferenceApplyConfiguration) *FlowSchemaSpecApplyConfiguration { b.PriorityLevelConfiguration = value return b } // WithMatchingPrecedence sets the MatchingPrecedence field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchingPrecedence field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithMatchingPrecedence(value int32) *FlowSchemaSpecApplyConfiguration { b.MatchingPrecedence = &value return b } // WithDistinguisherMethod sets the DistinguisherMethod field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DistinguisherMethod field is set to the value of the last call. func (b *FlowSchemaSpecApplyConfiguration) WithDistinguisherMethod(value *FlowDistinguisherMethodApplyConfiguration) *FlowSchemaSpecApplyConfiguration { b.DistinguisherMethod = value return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *FlowSchemaSpecApplyConfiguration) WithRules(values ...*PolicyRulesWithSubjectsApplyConfiguration) *FlowSchemaSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/flowschemastatus.go000066400000000000000000000033311472614177300322400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // FlowSchemaStatusApplyConfiguration represents a declarative configuration of the FlowSchemaStatus type for use // with apply. type FlowSchemaStatusApplyConfiguration struct { Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` } // FlowSchemaStatusApplyConfiguration constructs a declarative configuration of the FlowSchemaStatus type for use with // apply. func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { return &FlowSchemaStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *FlowSchemaStatusApplyConfiguration) WithConditions(values ...*FlowSchemaConditionApplyConfiguration) *FlowSchemaStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/groupsubject.go000066400000000000000000000026651472614177300313710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // GroupSubjectApplyConfiguration represents a declarative configuration of the GroupSubject type for use // with apply. type GroupSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } // GroupSubjectApplyConfiguration constructs a declarative configuration of the GroupSubject type for use with // apply. func GroupSubject() *GroupSubjectApplyConfiguration { return &GroupSubjectApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *GroupSubjectApplyConfiguration) WithName(value string) *GroupSubjectApplyConfiguration { b.Name = &value return b } limitedprioritylevelconfiguration.go000066400000000000000000000070621472614177300356430ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // LimitedPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LimitResponse *LimitResponseApplyConfiguration `json:"limitResponse,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` } // LimitedPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the LimitedPriorityLevelConfiguration type for use with // apply. func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { return &LimitedPriorityLevelConfigurationApplyConfiguration{} } // WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.NominalConcurrencyShares = &value return b } // WithLimitResponse sets the LimitResponse field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LimitResponse field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLimitResponse(value *LimitResponseApplyConfiguration) *LimitedPriorityLevelConfigurationApplyConfiguration { b.LimitResponse = value return b } // WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LendablePercent field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.LendablePercent = &value return b } // WithBorrowingLimitPercent sets the BorrowingLimitPercent field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BorrowingLimitPercent field is set to the value of the last call. func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithBorrowingLimitPercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { b.BorrowingLimitPercent = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/limitresponse.go000066400000000000000000000040611472614177300315420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" ) // LimitResponseApplyConfiguration represents a declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { Type *v1beta3.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } // LimitResponseApplyConfiguration constructs a declarative configuration of the LimitResponse type for use with // apply. func LimitResponse() *LimitResponseApplyConfiguration { return &LimitResponseApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *LimitResponseApplyConfiguration) WithType(value v1beta3.LimitResponseType) *LimitResponseApplyConfiguration { b.Type = &value return b } // WithQueuing sets the Queuing field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Queuing field is set to the value of the last call. func (b *LimitResponseApplyConfiguration) WithQueuing(value *QueuingConfigurationApplyConfiguration) *LimitResponseApplyConfiguration { b.Queuing = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/nonresourcepolicyrule.go000066400000000000000000000042741472614177300333250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // NonResourcePolicyRuleApplyConfiguration represents a declarative configuration of the NonResourcePolicyRule type for use // with apply. type NonResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } // NonResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the NonResourcePolicyRule type for use with // apply. func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { return &NonResourcePolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *NonResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *NonResourcePolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceURLs field. func (b *NonResourcePolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *NonResourcePolicyRuleApplyConfiguration { for i := range values { b.NonResourceURLs = append(b.NonResourceURLs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/policyruleswithsubjects.go000066400000000000000000000063461472614177300336660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // PolicyRulesWithSubjectsApplyConfiguration represents a declarative configuration of the PolicyRulesWithSubjects type for use // with apply. type PolicyRulesWithSubjectsApplyConfiguration struct { Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` ResourceRules []ResourcePolicyRuleApplyConfiguration `json:"resourceRules,omitempty"` NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` } // PolicyRulesWithSubjectsApplyConfiguration constructs a declarative configuration of the PolicyRulesWithSubjects type for use with // apply. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { return &PolicyRulesWithSubjectsApplyConfiguration{} } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceRules field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithResourceRules(values ...*ResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceRules") } b.ResourceRules = append(b.ResourceRules, *values[i]) } return b } // WithNonResourceRules adds the given value to the NonResourceRules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceRules field. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithNonResourceRules(values ...*NonResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithNonResourceRules") } b.NonResourceRules = append(b.NonResourceRules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go000066400000000000000000000331471472614177300343550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 import ( flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the PriorityLevelConfiguration type for use // with apply. type PriorityLevelConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PriorityLevelConfigurationSpecApplyConfiguration `json:"spec,omitempty"` Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` } // PriorityLevelConfiguration constructs a declarative configuration of the PriorityLevelConfiguration type for use with // apply. func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { b := &PriorityLevelConfigurationApplyConfiguration{} b.WithName(name) b.WithKind("PriorityLevelConfiguration") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta3") return b } // ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from // priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a // PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API. // ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") } // ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") } func extractPriorityLevelConfiguration(priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { b := &PriorityLevelConfigurationApplyConfiguration{} err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfiguration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(priorityLevelConfiguration.Name) b.WithKind("PriorityLevelConfiguration") b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1beta3") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithKind(value string) *PriorityLevelConfigurationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithAPIVersion(value string) *PriorityLevelConfigurationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithName(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithGenerateName(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithNamespace(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithUID(value types.UID) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithResourceVersion(value string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithGeneration(value int64) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PriorityLevelConfigurationApplyConfiguration) WithLabels(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PriorityLevelConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PriorityLevelConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PriorityLevelConfigurationApplyConfiguration) WithFinalizers(values ...string) *PriorityLevelConfigurationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PriorityLevelConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithSpec(value *PriorityLevelConfigurationSpecApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *PriorityLevelConfigurationStatusApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PriorityLevelConfigurationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } prioritylevelconfigurationcondition.go000066400000000000000000000100741472614177300361770ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PriorityLevelConfigurationConditionApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { Type *v1beta3.PriorityLevelConfigurationConditionType `json:"type,omitempty"` Status *v1beta3.ConditionStatus `json:"status,omitempty"` LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // PriorityLevelConfigurationConditionApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationCondition type for use with // apply. func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { return &PriorityLevelConfigurationConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1beta3.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1beta3.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration { b.Status = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *PriorityLevelConfigurationConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithReason(value string) *PriorityLevelConfigurationConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithMessage(value string) *PriorityLevelConfigurationConditionApplyConfiguration { b.Message = &value return b } prioritylevelconfigurationreference.go000066400000000000000000000032331472614177300361460ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // PriorityLevelConfigurationReferenceApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. type PriorityLevelConfigurationReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } // PriorityLevelConfigurationReferenceApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationReference type for use with // apply. func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { return &PriorityLevelConfigurationReferenceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityLevelConfigurationReferenceApplyConfiguration) WithName(value string) *PriorityLevelConfigurationReferenceApplyConfiguration { b.Name = &value return b } prioritylevelconfigurationspec.go000066400000000000000000000055451472614177300351520ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" ) // PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { Type *v1beta3.PriorityLevelEnablement `json:"type,omitempty"` Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"` Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } // PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with // apply. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { return &PriorityLevelConfigurationSpecApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1beta3.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration { b.Type = &value return b } // WithLimited sets the Limited field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Limited field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithLimited(value *LimitedPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { b.Limited = value return b } // WithExempt sets the Exempt field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Exempt field is set to the value of the last call. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithExempt(value *ExemptPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { b.Exempt = value return b } prioritylevelconfigurationstatus.go000066400000000000000000000036311472614177300355350ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // PriorityLevelConfigurationStatusApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. type PriorityLevelConfigurationStatusApplyConfiguration struct { Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` } // PriorityLevelConfigurationStatusApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationStatus type for use with // apply. func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { return &PriorityLevelConfigurationStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *PriorityLevelConfigurationStatusApplyConfiguration) WithConditions(values ...*PriorityLevelConfigurationConditionApplyConfiguration) *PriorityLevelConfigurationStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/queuingconfiguration.go000066400000000000000000000050151472614177300331120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // QueuingConfigurationApplyConfiguration represents a declarative configuration of the QueuingConfiguration type for use // with apply. type QueuingConfigurationApplyConfiguration struct { Queues *int32 `json:"queues,omitempty"` HandSize *int32 `json:"handSize,omitempty"` QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` } // QueuingConfigurationApplyConfiguration constructs a declarative configuration of the QueuingConfiguration type for use with // apply. func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { return &QueuingConfigurationApplyConfiguration{} } // WithQueues sets the Queues field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Queues field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithQueues(value int32) *QueuingConfigurationApplyConfiguration { b.Queues = &value return b } // WithHandSize sets the HandSize field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HandSize field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithHandSize(value int32) *QueuingConfigurationApplyConfiguration { b.HandSize = &value return b } // WithQueueLengthLimit sets the QueueLengthLimit field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the QueueLengthLimit field is set to the value of the last call. func (b *QueuingConfigurationApplyConfiguration) WithQueueLengthLimit(value int32) *QueuingConfigurationApplyConfiguration { b.QueueLengthLimit = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go000066400000000000000000000072571472614177300326160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // ResourcePolicyRuleApplyConfiguration represents a declarative configuration of the ResourcePolicyRule type for use // with apply. type ResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` APIGroups []string `json:"apiGroups,omitempty"` Resources []string `json:"resources,omitempty"` ClusterScope *bool `json:"clusterScope,omitempty"` Namespaces []string `json:"namespaces,omitempty"` } // ResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the ResourcePolicyRule type for use with // apply. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { return &ResourcePolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithClusterScope sets the ClusterScope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ClusterScope field is set to the value of the last call. func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration { b.ClusterScope = &value return b } // WithNamespaces adds the given value to the Namespaces field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Namespaces field. func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration { for i := range values { b.Namespaces = append(b.Namespaces, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/serviceaccountsubject.go000066400000000000000000000037701472614177300332500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // ServiceAccountSubjectApplyConfiguration represents a declarative configuration of the ServiceAccountSubject type for use // with apply. type ServiceAccountSubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } // ServiceAccountSubjectApplyConfiguration constructs a declarative configuration of the ServiceAccountSubject type for use with // apply. func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { return &ServiceAccountSubjectApplyConfiguration{} } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceAccountSubjectApplyConfiguration) WithNamespace(value string) *ServiceAccountSubjectApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceAccountSubjectApplyConfiguration) WithName(value string) *ServiceAccountSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/subject.go000066400000000000000000000057631472614177300303160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" ) // SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *v1beta3.SubjectKind `json:"kind,omitempty"` User *UserSubjectApplyConfiguration `json:"user,omitempty"` Group *GroupSubjectApplyConfiguration `json:"group,omitempty"` ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` } // SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithKind(value v1beta3.SubjectKind) *SubjectApplyConfiguration { b.Kind = &value return b } // WithUser sets the User field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the User field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithUser(value *UserSubjectApplyConfiguration) *SubjectApplyConfiguration { b.User = value return b } // WithGroup sets the Group field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithGroup(value *GroupSubjectApplyConfiguration) *SubjectApplyConfiguration { b.Group = value return b } // WithServiceAccount sets the ServiceAccount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceAccount field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithServiceAccount(value *ServiceAccountSubjectApplyConfiguration) *SubjectApplyConfiguration { b.ServiceAccount = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/flowcontrol/v1beta3/usersubject.go000066400000000000000000000026531472614177300312100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta3 // UserSubjectApplyConfiguration represents a declarative configuration of the UserSubject type for use // with apply. type UserSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } // UserSubjectApplyConfiguration constructs a declarative configuration of the UserSubject type for use with // apply. func UserSubject() *UserSubjectApplyConfiguration { return &UserSubjectApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *UserSubjectApplyConfiguration) WithName(value string) *UserSubjectApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/imagepolicy/000077500000000000000000000000001472614177300250025ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/imagepolicy/v1alpha1/000077500000000000000000000000001472614177300264175ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/imagepolicy/v1alpha1/imagereview.go000066400000000000000000000306731472614177300312630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ImageReviewApplyConfiguration represents a declarative configuration of the ImageReview type for use // with apply. type ImageReviewApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ImageReviewSpecApplyConfiguration `json:"spec,omitempty"` Status *ImageReviewStatusApplyConfiguration `json:"status,omitempty"` } // ImageReview constructs a declarative configuration of the ImageReview type for use with // apply. func ImageReview(name string) *ImageReviewApplyConfiguration { b := &ImageReviewApplyConfiguration{} b.WithName(name) b.WithKind("ImageReview") b.WithAPIVersion("imagepolicy.k8s.io/v1alpha1") return b } // ExtractImageReview extracts the applied configuration owned by fieldManager from // imageReview. If no managedFields are found in imageReview for fieldManager, a // ImageReviewApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // imageReview must be a unmodified ImageReview API object that was retrieved from the Kubernetes API. // ExtractImageReview provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractImageReview(imageReview *imagepolicyv1alpha1.ImageReview, fieldManager string) (*ImageReviewApplyConfiguration, error) { return extractImageReview(imageReview, fieldManager, "") } // ExtractImageReviewStatus is the same as ExtractImageReview except // that it extracts the status subresource applied configuration. // Experimental! func ExtractImageReviewStatus(imageReview *imagepolicyv1alpha1.ImageReview, fieldManager string) (*ImageReviewApplyConfiguration, error) { return extractImageReview(imageReview, fieldManager, "status") } func extractImageReview(imageReview *imagepolicyv1alpha1.ImageReview, fieldManager string, subresource string) (*ImageReviewApplyConfiguration, error) { b := &ImageReviewApplyConfiguration{} err := managedfields.ExtractInto(imageReview, internal.Parser().Type("io.k8s.api.imagepolicy.v1alpha1.ImageReview"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(imageReview.Name) b.WithKind("ImageReview") b.WithAPIVersion("imagepolicy.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithKind(value string) *ImageReviewApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithAPIVersion(value string) *ImageReviewApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithName(value string) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithGenerateName(value string) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithNamespace(value string) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithUID(value types.UID) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithResourceVersion(value string) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithGeneration(value int64) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ImageReviewApplyConfiguration) WithLabels(entries map[string]string) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ImageReviewApplyConfiguration) WithAnnotations(entries map[string]string) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ImageReviewApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ImageReviewApplyConfiguration) WithFinalizers(values ...string) *ImageReviewApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ImageReviewApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithSpec(value *ImageReviewSpecApplyConfiguration) *ImageReviewApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ImageReviewApplyConfiguration) WithStatus(value *ImageReviewStatusApplyConfiguration) *ImageReviewApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ImageReviewApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go000066400000000000000000000030651472614177300340340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ImageReviewContainerSpecApplyConfiguration represents a declarative configuration of the ImageReviewContainerSpec type for use // with apply. type ImageReviewContainerSpecApplyConfiguration struct { Image *string `json:"image,omitempty"` } // ImageReviewContainerSpecApplyConfiguration constructs a declarative configuration of the ImageReviewContainerSpec type for use with // apply. func ImageReviewContainerSpec() *ImageReviewContainerSpecApplyConfiguration { return &ImageReviewContainerSpecApplyConfiguration{} } // WithImage sets the Image field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Image field is set to the value of the last call. func (b *ImageReviewContainerSpecApplyConfiguration) WithImage(value string) *ImageReviewContainerSpecApplyConfiguration { b.Image = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go000066400000000000000000000057241472614177300321350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ImageReviewSpecApplyConfiguration represents a declarative configuration of the ImageReviewSpec type for use // with apply. type ImageReviewSpecApplyConfiguration struct { Containers []ImageReviewContainerSpecApplyConfiguration `json:"containers,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` Namespace *string `json:"namespace,omitempty"` } // ImageReviewSpecApplyConfiguration constructs a declarative configuration of the ImageReviewSpec type for use with // apply. func ImageReviewSpec() *ImageReviewSpecApplyConfiguration { return &ImageReviewSpecApplyConfiguration{} } // WithContainers adds the given value to the Containers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Containers field. func (b *ImageReviewSpecApplyConfiguration) WithContainers(values ...*ImageReviewContainerSpecApplyConfiguration) *ImageReviewSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithContainers") } b.Containers = append(b.Containers, *values[i]) } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ImageReviewSpecApplyConfiguration) WithAnnotations(entries map[string]string) *ImageReviewSpecApplyConfiguration { if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ImageReviewSpecApplyConfiguration) WithNamespace(value string) *ImageReviewSpecApplyConfiguration { b.Namespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go000066400000000000000000000053761472614177300325310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ImageReviewStatusApplyConfiguration represents a declarative configuration of the ImageReviewStatus type for use // with apply. type ImageReviewStatusApplyConfiguration struct { Allowed *bool `json:"allowed,omitempty"` Reason *string `json:"reason,omitempty"` AuditAnnotations map[string]string `json:"auditAnnotations,omitempty"` } // ImageReviewStatusApplyConfiguration constructs a declarative configuration of the ImageReviewStatus type for use with // apply. func ImageReviewStatus() *ImageReviewStatusApplyConfiguration { return &ImageReviewStatusApplyConfiguration{} } // WithAllowed sets the Allowed field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Allowed field is set to the value of the last call. func (b *ImageReviewStatusApplyConfiguration) WithAllowed(value bool) *ImageReviewStatusApplyConfiguration { b.Allowed = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ImageReviewStatusApplyConfiguration) WithReason(value string) *ImageReviewStatusApplyConfiguration { b.Reason = &value return b } // WithAuditAnnotations puts the entries into the AuditAnnotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the AuditAnnotations field, // overwriting an existing map entries in AuditAnnotations field with the same key. func (b *ImageReviewStatusApplyConfiguration) WithAuditAnnotations(entries map[string]string) *ImageReviewStatusApplyConfiguration { if b.AuditAnnotations == nil && len(entries) > 0 { b.AuditAnnotations = make(map[string]string, len(entries)) } for k, v := range entries { b.AuditAnnotations[k] = v } return b } kubernetes-client-go-a2dfcab/applyconfigurations/internal/000077500000000000000000000000001472614177300243145ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/internal/internal.go000066400000000000000000012115651472614177300264720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package internal import ( "fmt" "sync" typed "sigs.k8s.io/structured-merge-diff/v4/typed" ) func Parser() *typed.Parser { parserOnce.Do(func() { var err error parser, err = typed.NewParser(schemaYAML) if err != nil { panic(fmt.Sprintf("Failed to parse schema: %v", err)) } }) return parser } var parserOnce sync.Once var parser *typed.Parser var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.admissionregistration.v1.AuditAnnotation map: fields: - name: key type: scalar: string default: "" - name: valueExpression type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1.ExpressionWarning map: fields: - name: fieldRef type: scalar: string default: "" - name: warning type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1.MatchCondition map: fields: - name: expression type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1.MatchResources map: fields: - name: excludeResourceRules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations elementRelationship: atomic - name: matchPolicy type: scalar: string - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: objectSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: resourceRules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations elementRelationship: atomic elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.MutatingWebhook map: fields: - name: admissionReviewVersions type: list: elementType: scalar: string elementRelationship: atomic - name: clientConfig type: namedType: io.k8s.api.admissionregistration.v1.WebhookClientConfig default: {} - name: failurePolicy type: scalar: string - name: matchConditions type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.MatchCondition elementRelationship: associative keys: - name - name: matchPolicy type: scalar: string - name: name type: scalar: string default: "" - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: objectSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: reinvocationPolicy type: scalar: string - name: rules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.RuleWithOperations elementRelationship: atomic - name: sideEffects type: scalar: string - name: timeoutSeconds type: scalar: numeric - name: io.k8s.api.admissionregistration.v1.MutatingWebhookConfiguration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: webhooks type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.MutatingWebhook elementRelationship: associative keys: - name - name: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: atomic - name: apiVersions type: list: elementType: scalar: string elementRelationship: atomic - name: operations type: list: elementType: scalar: string elementRelationship: atomic - name: resourceNames type: list: elementType: scalar: string elementRelationship: atomic - name: resources type: list: elementType: scalar: string elementRelationship: atomic - name: scope type: scalar: string elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.ParamKind map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.ParamRef map: fields: - name: name type: scalar: string - name: namespace type: scalar: string - name: parameterNotFoundAction type: scalar: string - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.RuleWithOperations map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: atomic - name: apiVersions type: list: elementType: scalar: string elementRelationship: atomic - name: operations type: list: elementType: scalar: string elementRelationship: atomic - name: resources type: list: elementType: scalar: string elementRelationship: atomic - name: scope type: scalar: string - name: io.k8s.api.admissionregistration.v1.ServiceReference map: fields: - name: name type: scalar: string default: "" - name: namespace type: scalar: string default: "" - name: path type: scalar: string - name: port type: scalar: numeric - name: io.k8s.api.admissionregistration.v1.TypeChecking map: fields: - name: expressionWarnings type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.ExpressionWarning elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicy map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicySpec default: {} - name: status type: namedType: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyStatus default: {} - name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBindingSpec default: {} - name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBindingSpec map: fields: - name: matchResources type: namedType: io.k8s.api.admissionregistration.v1.MatchResources - name: paramRef type: namedType: io.k8s.api.admissionregistration.v1.ParamRef - name: policyName type: scalar: string - name: validationActions type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicySpec map: fields: - name: auditAnnotations type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.AuditAnnotation elementRelationship: atomic - name: failurePolicy type: scalar: string - name: matchConditions type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.MatchCondition elementRelationship: associative keys: - name - name: matchConstraints type: namedType: io.k8s.api.admissionregistration.v1.MatchResources - name: paramKind type: namedType: io.k8s.api.admissionregistration.v1.ParamKind - name: validations type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.Validation elementRelationship: atomic - name: variables type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.Variable elementRelationship: associative keys: - name - name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition elementRelationship: associative keys: - type - name: observedGeneration type: scalar: numeric - name: typeChecking type: namedType: io.k8s.api.admissionregistration.v1.TypeChecking - name: io.k8s.api.admissionregistration.v1.ValidatingWebhook map: fields: - name: admissionReviewVersions type: list: elementType: scalar: string elementRelationship: atomic - name: clientConfig type: namedType: io.k8s.api.admissionregistration.v1.WebhookClientConfig default: {} - name: failurePolicy type: scalar: string - name: matchConditions type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.MatchCondition elementRelationship: associative keys: - name - name: matchPolicy type: scalar: string - name: name type: scalar: string default: "" - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: objectSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: rules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.RuleWithOperations elementRelationship: atomic - name: sideEffects type: scalar: string - name: timeoutSeconds type: scalar: numeric - name: io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: webhooks type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.ValidatingWebhook elementRelationship: associative keys: - name - name: io.k8s.api.admissionregistration.v1.Validation map: fields: - name: expression type: scalar: string default: "" - name: message type: scalar: string - name: messageExpression type: scalar: string - name: reason type: scalar: string - name: io.k8s.api.admissionregistration.v1.Variable map: fields: - name: expression type: scalar: string default: "" - name: name type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1.WebhookClientConfig map: fields: - name: caBundle type: scalar: string - name: service type: namedType: io.k8s.api.admissionregistration.v1.ServiceReference - name: url type: scalar: string - name: io.k8s.api.admissionregistration.v1alpha1.AuditAnnotation map: fields: - name: key type: scalar: string default: "" - name: valueExpression type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1alpha1.ExpressionWarning map: fields: - name: fieldRef type: scalar: string default: "" - name: warning type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1alpha1.MatchCondition map: fields: - name: expression type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1alpha1.MatchResources map: fields: - name: excludeResourceRules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1alpha1.NamedRuleWithOperations elementRelationship: atomic - name: matchPolicy type: scalar: string - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: objectSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: resourceRules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1alpha1.NamedRuleWithOperations elementRelationship: atomic elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1alpha1.NamedRuleWithOperations map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: atomic - name: apiVersions type: list: elementType: scalar: string elementRelationship: atomic - name: operations type: list: elementType: scalar: string elementRelationship: atomic - name: resourceNames type: list: elementType: scalar: string elementRelationship: atomic - name: resources type: list: elementType: scalar: string elementRelationship: atomic - name: scope type: scalar: string elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1alpha1.ParamKind map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1alpha1.ParamRef map: fields: - name: name type: scalar: string - name: namespace type: scalar: string - name: parameterNotFoundAction type: scalar: string - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1alpha1.TypeChecking map: fields: - name: expressionWarnings type: list: elementType: namedType: io.k8s.api.admissionregistration.v1alpha1.ExpressionWarning elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicy map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicySpec default: {} - name: status type: namedType: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyStatus default: {} - name: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyBindingSpec default: {} - name: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyBindingSpec map: fields: - name: matchResources type: namedType: io.k8s.api.admissionregistration.v1alpha1.MatchResources - name: paramRef type: namedType: io.k8s.api.admissionregistration.v1alpha1.ParamRef - name: policyName type: scalar: string - name: validationActions type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicySpec map: fields: - name: auditAnnotations type: list: elementType: namedType: io.k8s.api.admissionregistration.v1alpha1.AuditAnnotation elementRelationship: atomic - name: failurePolicy type: scalar: string - name: matchConditions type: list: elementType: namedType: io.k8s.api.admissionregistration.v1alpha1.MatchCondition elementRelationship: associative keys: - name - name: matchConstraints type: namedType: io.k8s.api.admissionregistration.v1alpha1.MatchResources - name: paramKind type: namedType: io.k8s.api.admissionregistration.v1alpha1.ParamKind - name: validations type: list: elementType: namedType: io.k8s.api.admissionregistration.v1alpha1.Validation elementRelationship: atomic - name: variables type: list: elementType: namedType: io.k8s.api.admissionregistration.v1alpha1.Variable elementRelationship: associative keys: - name - name: io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition elementRelationship: associative keys: - type - name: observedGeneration type: scalar: numeric - name: typeChecking type: namedType: io.k8s.api.admissionregistration.v1alpha1.TypeChecking - name: io.k8s.api.admissionregistration.v1alpha1.Validation map: fields: - name: expression type: scalar: string default: "" - name: message type: scalar: string - name: messageExpression type: scalar: string - name: reason type: scalar: string - name: io.k8s.api.admissionregistration.v1alpha1.Variable map: fields: - name: expression type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1beta1.AuditAnnotation map: fields: - name: key type: scalar: string default: "" - name: valueExpression type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1beta1.ExpressionWarning map: fields: - name: fieldRef type: scalar: string default: "" - name: warning type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1beta1.MatchCondition map: fields: - name: expression type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.admissionregistration.v1beta1.MatchResources map: fields: - name: excludeResourceRules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.NamedRuleWithOperations elementRelationship: atomic - name: matchPolicy type: scalar: string - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: objectSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: resourceRules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.NamedRuleWithOperations elementRelationship: atomic elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1beta1.MutatingWebhook map: fields: - name: admissionReviewVersions type: list: elementType: scalar: string elementRelationship: atomic - name: clientConfig type: namedType: io.k8s.api.admissionregistration.v1beta1.WebhookClientConfig default: {} - name: failurePolicy type: scalar: string - name: matchConditions type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.MatchCondition elementRelationship: associative keys: - name - name: matchPolicy type: scalar: string - name: name type: scalar: string default: "" - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: objectSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: reinvocationPolicy type: scalar: string - name: rules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.RuleWithOperations elementRelationship: atomic - name: sideEffects type: scalar: string - name: timeoutSeconds type: scalar: numeric - name: io.k8s.api.admissionregistration.v1beta1.MutatingWebhookConfiguration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: webhooks type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.MutatingWebhook elementRelationship: associative keys: - name - name: io.k8s.api.admissionregistration.v1beta1.NamedRuleWithOperations map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: atomic - name: apiVersions type: list: elementType: scalar: string elementRelationship: atomic - name: operations type: list: elementType: scalar: string elementRelationship: atomic - name: resourceNames type: list: elementType: scalar: string elementRelationship: atomic - name: resources type: list: elementType: scalar: string elementRelationship: atomic - name: scope type: scalar: string elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1beta1.ParamKind map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1beta1.ParamRef map: fields: - name: name type: scalar: string - name: namespace type: scalar: string - name: parameterNotFoundAction type: scalar: string - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1beta1.ServiceReference map: fields: - name: name type: scalar: string default: "" - name: namespace type: scalar: string default: "" - name: path type: scalar: string - name: port type: scalar: numeric - name: io.k8s.api.admissionregistration.v1beta1.TypeChecking map: fields: - name: expressionWarnings type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.ExpressionWarning elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicy map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicySpec default: {} - name: status type: namedType: io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyStatus default: {} - name: io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBindingSpec default: {} - name: io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBindingSpec map: fields: - name: matchResources type: namedType: io.k8s.api.admissionregistration.v1beta1.MatchResources - name: paramRef type: namedType: io.k8s.api.admissionregistration.v1beta1.ParamRef - name: policyName type: scalar: string - name: validationActions type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicySpec map: fields: - name: auditAnnotations type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.AuditAnnotation elementRelationship: atomic - name: failurePolicy type: scalar: string - name: matchConditions type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.MatchCondition elementRelationship: associative keys: - name - name: matchConstraints type: namedType: io.k8s.api.admissionregistration.v1beta1.MatchResources - name: paramKind type: namedType: io.k8s.api.admissionregistration.v1beta1.ParamKind - name: validations type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.Validation elementRelationship: atomic - name: variables type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.Variable elementRelationship: associative keys: - name - name: io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition elementRelationship: associative keys: - type - name: observedGeneration type: scalar: numeric - name: typeChecking type: namedType: io.k8s.api.admissionregistration.v1beta1.TypeChecking - name: io.k8s.api.admissionregistration.v1beta1.ValidatingWebhook map: fields: - name: admissionReviewVersions type: list: elementType: scalar: string elementRelationship: atomic - name: clientConfig type: namedType: io.k8s.api.admissionregistration.v1beta1.WebhookClientConfig default: {} - name: failurePolicy type: scalar: string - name: matchConditions type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.MatchCondition elementRelationship: associative keys: - name - name: matchPolicy type: scalar: string - name: name type: scalar: string default: "" - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: objectSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: rules type: list: elementType: namedType: io.k8s.api.admissionregistration.v1.RuleWithOperations elementRelationship: atomic - name: sideEffects type: scalar: string - name: timeoutSeconds type: scalar: numeric - name: io.k8s.api.admissionregistration.v1beta1.ValidatingWebhookConfiguration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: webhooks type: list: elementType: namedType: io.k8s.api.admissionregistration.v1beta1.ValidatingWebhook elementRelationship: associative keys: - name - name: io.k8s.api.admissionregistration.v1beta1.Validation map: fields: - name: expression type: scalar: string default: "" - name: message type: scalar: string - name: messageExpression type: scalar: string - name: reason type: scalar: string - name: io.k8s.api.admissionregistration.v1beta1.Variable map: fields: - name: expression type: scalar: string default: "" - name: name type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.api.admissionregistration.v1beta1.WebhookClientConfig map: fields: - name: caBundle type: scalar: string - name: service type: namedType: io.k8s.api.admissionregistration.v1beta1.ServiceReference - name: url type: scalar: string - name: io.k8s.api.apiserverinternal.v1alpha1.ServerStorageVersion map: fields: - name: apiServerID type: scalar: string - name: decodableVersions type: list: elementType: scalar: string elementRelationship: associative - name: encodingVersion type: scalar: string - name: servedVersions type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.apiserverinternal.v1alpha1.StorageVersion map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionSpec default: {} - name: status type: namedType: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionStatus default: {} - name: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: observedGeneration type: scalar: numeric - name: reason type: scalar: string default: "" - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionSpec map: elementType: scalar: untyped list: elementType: namedType: __untyped_atomic_ elementRelationship: atomic map: elementType: namedType: __untyped_deduced_ elementRelationship: separable - name: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionStatus map: fields: - name: commonEncodingVersion type: scalar: string - name: conditions type: list: elementType: namedType: io.k8s.api.apiserverinternal.v1alpha1.StorageVersionCondition elementRelationship: associative keys: - type - name: storageVersions type: list: elementType: namedType: io.k8s.api.apiserverinternal.v1alpha1.ServerStorageVersion elementRelationship: associative keys: - apiServerID - name: io.k8s.api.apps.v1.ControllerRevision map: fields: - name: apiVersion type: scalar: string - name: data type: namedType: __untyped_atomic_ - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: revision type: scalar: numeric default: 0 - name: io.k8s.api.apps.v1.DaemonSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1.DaemonSetSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1.DaemonSetStatus default: {} - name: io.k8s.api.apps.v1.DaemonSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1.DaemonSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: updateStrategy type: namedType: io.k8s.api.apps.v1.DaemonSetUpdateStrategy default: {} - name: io.k8s.api.apps.v1.DaemonSetStatus map: fields: - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1.DaemonSetCondition elementRelationship: associative keys: - type - name: currentNumberScheduled type: scalar: numeric default: 0 - name: desiredNumberScheduled type: scalar: numeric default: 0 - name: numberAvailable type: scalar: numeric - name: numberMisscheduled type: scalar: numeric default: 0 - name: numberReady type: scalar: numeric default: 0 - name: numberUnavailable type: scalar: numeric - name: observedGeneration type: scalar: numeric - name: updatedNumberScheduled type: scalar: numeric - name: io.k8s.api.apps.v1.DaemonSetUpdateStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.apps.v1.RollingUpdateDaemonSet - name: type type: scalar: string - name: io.k8s.api.apps.v1.Deployment map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1.DeploymentSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1.DeploymentStatus default: {} - name: io.k8s.api.apps.v1.DeploymentCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1.DeploymentSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: paused type: scalar: boolean - name: progressDeadlineSeconds type: scalar: numeric - name: replicas type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: strategy type: namedType: io.k8s.api.apps.v1.DeploymentStrategy default: {} - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: io.k8s.api.apps.v1.DeploymentStatus map: fields: - name: availableReplicas type: scalar: numeric - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1.DeploymentCondition elementRelationship: associative keys: - type - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric - name: unavailableReplicas type: scalar: numeric - name: updatedReplicas type: scalar: numeric - name: io.k8s.api.apps.v1.DeploymentStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.apps.v1.RollingUpdateDeployment - name: type type: scalar: string - name: io.k8s.api.apps.v1.ReplicaSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1.ReplicaSetSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1.ReplicaSetStatus default: {} - name: io.k8s.api.apps.v1.ReplicaSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1.ReplicaSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: replicas type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: io.k8s.api.apps.v1.ReplicaSetStatus map: fields: - name: availableReplicas type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1.ReplicaSetCondition elementRelationship: associative keys: - type - name: fullyLabeledReplicas type: scalar: numeric - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric default: 0 - name: io.k8s.api.apps.v1.RollingUpdateDaemonSet map: fields: - name: maxSurge type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.apps.v1.RollingUpdateDeployment map: fields: - name: maxSurge type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.apps.v1.RollingUpdateStatefulSetStrategy map: fields: - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: partition type: scalar: numeric - name: io.k8s.api.apps.v1.StatefulSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1.StatefulSetSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1.StatefulSetStatus default: {} - name: io.k8s.api.apps.v1.StatefulSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1.StatefulSetOrdinals map: fields: - name: start type: scalar: numeric default: 0 - name: io.k8s.api.apps.v1.StatefulSetPersistentVolumeClaimRetentionPolicy map: fields: - name: whenDeleted type: scalar: string - name: whenScaled type: scalar: string - name: io.k8s.api.apps.v1.StatefulSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: ordinals type: namedType: io.k8s.api.apps.v1.StatefulSetOrdinals - name: persistentVolumeClaimRetentionPolicy type: namedType: io.k8s.api.apps.v1.StatefulSetPersistentVolumeClaimRetentionPolicy - name: podManagementPolicy type: scalar: string - name: replicas type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: serviceName type: scalar: string default: "" - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: updateStrategy type: namedType: io.k8s.api.apps.v1.StatefulSetUpdateStrategy default: {} - name: volumeClaimTemplates type: list: elementType: namedType: io.k8s.api.core.v1.PersistentVolumeClaim elementRelationship: atomic - name: io.k8s.api.apps.v1.StatefulSetStatus map: fields: - name: availableReplicas type: scalar: numeric default: 0 - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1.StatefulSetCondition elementRelationship: associative keys: - type - name: currentReplicas type: scalar: numeric - name: currentRevision type: scalar: string - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric default: 0 - name: updateRevision type: scalar: string - name: updatedReplicas type: scalar: numeric - name: io.k8s.api.apps.v1.StatefulSetUpdateStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.apps.v1.RollingUpdateStatefulSetStrategy - name: type type: scalar: string - name: io.k8s.api.apps.v1beta1.ControllerRevision map: fields: - name: apiVersion type: scalar: string - name: data type: namedType: __untyped_atomic_ - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: revision type: scalar: numeric default: 0 - name: io.k8s.api.apps.v1beta1.Deployment map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1beta1.DeploymentSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1beta1.DeploymentStatus default: {} - name: io.k8s.api.apps.v1beta1.DeploymentCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1beta1.DeploymentSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: paused type: scalar: boolean - name: progressDeadlineSeconds type: scalar: numeric - name: replicas type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: rollbackTo type: namedType: io.k8s.api.apps.v1beta1.RollbackConfig - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: strategy type: namedType: io.k8s.api.apps.v1beta1.DeploymentStrategy default: {} - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: io.k8s.api.apps.v1beta1.DeploymentStatus map: fields: - name: availableReplicas type: scalar: numeric - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1beta1.DeploymentCondition elementRelationship: associative keys: - type - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric - name: unavailableReplicas type: scalar: numeric - name: updatedReplicas type: scalar: numeric - name: io.k8s.api.apps.v1beta1.DeploymentStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.apps.v1beta1.RollingUpdateDeployment - name: type type: scalar: string - name: io.k8s.api.apps.v1beta1.RollbackConfig map: fields: - name: revision type: scalar: numeric - name: io.k8s.api.apps.v1beta1.RollingUpdateDeployment map: fields: - name: maxSurge type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.apps.v1beta1.RollingUpdateStatefulSetStrategy map: fields: - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: partition type: scalar: numeric - name: io.k8s.api.apps.v1beta1.StatefulSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1beta1.StatefulSetSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1beta1.StatefulSetStatus default: {} - name: io.k8s.api.apps.v1beta1.StatefulSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1beta1.StatefulSetOrdinals map: fields: - name: start type: scalar: numeric default: 0 - name: io.k8s.api.apps.v1beta1.StatefulSetPersistentVolumeClaimRetentionPolicy map: fields: - name: whenDeleted type: scalar: string - name: whenScaled type: scalar: string - name: io.k8s.api.apps.v1beta1.StatefulSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: ordinals type: namedType: io.k8s.api.apps.v1beta1.StatefulSetOrdinals - name: persistentVolumeClaimRetentionPolicy type: namedType: io.k8s.api.apps.v1beta1.StatefulSetPersistentVolumeClaimRetentionPolicy - name: podManagementPolicy type: scalar: string - name: replicas type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: serviceName type: scalar: string default: "" - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: updateStrategy type: namedType: io.k8s.api.apps.v1beta1.StatefulSetUpdateStrategy default: {} - name: volumeClaimTemplates type: list: elementType: namedType: io.k8s.api.core.v1.PersistentVolumeClaim elementRelationship: atomic - name: io.k8s.api.apps.v1beta1.StatefulSetStatus map: fields: - name: availableReplicas type: scalar: numeric default: 0 - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1beta1.StatefulSetCondition elementRelationship: associative keys: - type - name: currentReplicas type: scalar: numeric - name: currentRevision type: scalar: string - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric default: 0 - name: updateRevision type: scalar: string - name: updatedReplicas type: scalar: numeric - name: io.k8s.api.apps.v1beta1.StatefulSetUpdateStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.apps.v1beta1.RollingUpdateStatefulSetStrategy - name: type type: scalar: string - name: io.k8s.api.apps.v1beta2.ControllerRevision map: fields: - name: apiVersion type: scalar: string - name: data type: namedType: __untyped_atomic_ - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: revision type: scalar: numeric default: 0 - name: io.k8s.api.apps.v1beta2.DaemonSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1beta2.DaemonSetSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1beta2.DaemonSetStatus default: {} - name: io.k8s.api.apps.v1beta2.DaemonSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1beta2.DaemonSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: updateStrategy type: namedType: io.k8s.api.apps.v1beta2.DaemonSetUpdateStrategy default: {} - name: io.k8s.api.apps.v1beta2.DaemonSetStatus map: fields: - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1beta2.DaemonSetCondition elementRelationship: associative keys: - type - name: currentNumberScheduled type: scalar: numeric default: 0 - name: desiredNumberScheduled type: scalar: numeric default: 0 - name: numberAvailable type: scalar: numeric - name: numberMisscheduled type: scalar: numeric default: 0 - name: numberReady type: scalar: numeric default: 0 - name: numberUnavailable type: scalar: numeric - name: observedGeneration type: scalar: numeric - name: updatedNumberScheduled type: scalar: numeric - name: io.k8s.api.apps.v1beta2.DaemonSetUpdateStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.apps.v1beta2.RollingUpdateDaemonSet - name: type type: scalar: string - name: io.k8s.api.apps.v1beta2.Deployment map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1beta2.DeploymentSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1beta2.DeploymentStatus default: {} - name: io.k8s.api.apps.v1beta2.DeploymentCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1beta2.DeploymentSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: paused type: scalar: boolean - name: progressDeadlineSeconds type: scalar: numeric - name: replicas type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: strategy type: namedType: io.k8s.api.apps.v1beta2.DeploymentStrategy default: {} - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: io.k8s.api.apps.v1beta2.DeploymentStatus map: fields: - name: availableReplicas type: scalar: numeric - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1beta2.DeploymentCondition elementRelationship: associative keys: - type - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric - name: unavailableReplicas type: scalar: numeric - name: updatedReplicas type: scalar: numeric - name: io.k8s.api.apps.v1beta2.DeploymentStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.apps.v1beta2.RollingUpdateDeployment - name: type type: scalar: string - name: io.k8s.api.apps.v1beta2.ReplicaSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1beta2.ReplicaSetSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1beta2.ReplicaSetStatus default: {} - name: io.k8s.api.apps.v1beta2.ReplicaSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1beta2.ReplicaSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: replicas type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: io.k8s.api.apps.v1beta2.ReplicaSetStatus map: fields: - name: availableReplicas type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1beta2.ReplicaSetCondition elementRelationship: associative keys: - type - name: fullyLabeledReplicas type: scalar: numeric - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric default: 0 - name: io.k8s.api.apps.v1beta2.RollingUpdateDaemonSet map: fields: - name: maxSurge type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.apps.v1beta2.RollingUpdateDeployment map: fields: - name: maxSurge type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.apps.v1beta2.RollingUpdateStatefulSetStrategy map: fields: - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: partition type: scalar: numeric - name: io.k8s.api.apps.v1beta2.StatefulSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.apps.v1beta2.StatefulSetSpec default: {} - name: status type: namedType: io.k8s.api.apps.v1beta2.StatefulSetStatus default: {} - name: io.k8s.api.apps.v1beta2.StatefulSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.apps.v1beta2.StatefulSetOrdinals map: fields: - name: start type: scalar: numeric default: 0 - name: io.k8s.api.apps.v1beta2.StatefulSetPersistentVolumeClaimRetentionPolicy map: fields: - name: whenDeleted type: scalar: string - name: whenScaled type: scalar: string - name: io.k8s.api.apps.v1beta2.StatefulSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: ordinals type: namedType: io.k8s.api.apps.v1beta2.StatefulSetOrdinals - name: persistentVolumeClaimRetentionPolicy type: namedType: io.k8s.api.apps.v1beta2.StatefulSetPersistentVolumeClaimRetentionPolicy - name: podManagementPolicy type: scalar: string - name: replicas type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: serviceName type: scalar: string default: "" - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: updateStrategy type: namedType: io.k8s.api.apps.v1beta2.StatefulSetUpdateStrategy default: {} - name: volumeClaimTemplates type: list: elementType: namedType: io.k8s.api.core.v1.PersistentVolumeClaim elementRelationship: atomic - name: io.k8s.api.apps.v1beta2.StatefulSetStatus map: fields: - name: availableReplicas type: scalar: numeric default: 0 - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.apps.v1beta2.StatefulSetCondition elementRelationship: associative keys: - type - name: currentReplicas type: scalar: numeric - name: currentRevision type: scalar: string - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric default: 0 - name: updateRevision type: scalar: string - name: updatedReplicas type: scalar: numeric - name: io.k8s.api.apps.v1beta2.StatefulSetUpdateStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.apps.v1beta2.RollingUpdateStatefulSetStrategy - name: type type: scalar: string - name: io.k8s.api.autoscaling.v1.CrossVersionObjectReference map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscaler map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerSpec default: {} - name: status type: namedType: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerStatus default: {} - name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerSpec map: fields: - name: maxReplicas type: scalar: numeric default: 0 - name: minReplicas type: scalar: numeric - name: scaleTargetRef type: namedType: io.k8s.api.autoscaling.v1.CrossVersionObjectReference default: {} - name: targetCPUUtilizationPercentage type: scalar: numeric - name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerStatus map: fields: - name: currentCPUUtilizationPercentage type: scalar: numeric - name: currentReplicas type: scalar: numeric default: 0 - name: desiredReplicas type: scalar: numeric default: 0 - name: lastScaleTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: observedGeneration type: scalar: numeric - name: io.k8s.api.autoscaling.v2.ContainerResourceMetricSource map: fields: - name: container type: scalar: string default: "" - name: name type: scalar: string default: "" - name: target type: namedType: io.k8s.api.autoscaling.v2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2.ContainerResourceMetricStatus map: fields: - name: container type: scalar: string default: "" - name: current type: namedType: io.k8s.api.autoscaling.v2.MetricValueStatus default: {} - name: name type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2.CrossVersionObjectReference map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2.ExternalMetricSource map: fields: - name: metric type: namedType: io.k8s.api.autoscaling.v2.MetricIdentifier default: {} - name: target type: namedType: io.k8s.api.autoscaling.v2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2.ExternalMetricStatus map: fields: - name: current type: namedType: io.k8s.api.autoscaling.v2.MetricValueStatus default: {} - name: metric type: namedType: io.k8s.api.autoscaling.v2.MetricIdentifier default: {} - name: io.k8s.api.autoscaling.v2.HPAScalingPolicy map: fields: - name: periodSeconds type: scalar: numeric default: 0 - name: type type: scalar: string default: "" - name: value type: scalar: numeric default: 0 - name: io.k8s.api.autoscaling.v2.HPAScalingRules map: fields: - name: policies type: list: elementType: namedType: io.k8s.api.autoscaling.v2.HPAScalingPolicy elementRelationship: atomic - name: selectPolicy type: scalar: string - name: stabilizationWindowSeconds type: scalar: numeric - name: io.k8s.api.autoscaling.v2.HorizontalPodAutoscaler map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerSpec default: {} - name: status type: namedType: io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerStatus default: {} - name: io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerBehavior map: fields: - name: scaleDown type: namedType: io.k8s.api.autoscaling.v2.HPAScalingRules - name: scaleUp type: namedType: io.k8s.api.autoscaling.v2.HPAScalingRules - name: io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerSpec map: fields: - name: behavior type: namedType: io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerBehavior - name: maxReplicas type: scalar: numeric default: 0 - name: metrics type: list: elementType: namedType: io.k8s.api.autoscaling.v2.MetricSpec elementRelationship: atomic - name: minReplicas type: scalar: numeric - name: scaleTargetRef type: namedType: io.k8s.api.autoscaling.v2.CrossVersionObjectReference default: {} - name: io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerCondition elementRelationship: associative keys: - type - name: currentMetrics type: list: elementType: namedType: io.k8s.api.autoscaling.v2.MetricStatus elementRelationship: atomic - name: currentReplicas type: scalar: numeric - name: desiredReplicas type: scalar: numeric default: 0 - name: lastScaleTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: observedGeneration type: scalar: numeric - name: io.k8s.api.autoscaling.v2.MetricIdentifier map: fields: - name: name type: scalar: string default: "" - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: io.k8s.api.autoscaling.v2.MetricSpec map: fields: - name: containerResource type: namedType: io.k8s.api.autoscaling.v2.ContainerResourceMetricSource - name: external type: namedType: io.k8s.api.autoscaling.v2.ExternalMetricSource - name: object type: namedType: io.k8s.api.autoscaling.v2.ObjectMetricSource - name: pods type: namedType: io.k8s.api.autoscaling.v2.PodsMetricSource - name: resource type: namedType: io.k8s.api.autoscaling.v2.ResourceMetricSource - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2.MetricStatus map: fields: - name: containerResource type: namedType: io.k8s.api.autoscaling.v2.ContainerResourceMetricStatus - name: external type: namedType: io.k8s.api.autoscaling.v2.ExternalMetricStatus - name: object type: namedType: io.k8s.api.autoscaling.v2.ObjectMetricStatus - name: pods type: namedType: io.k8s.api.autoscaling.v2.PodsMetricStatus - name: resource type: namedType: io.k8s.api.autoscaling.v2.ResourceMetricStatus - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2.MetricTarget map: fields: - name: averageUtilization type: scalar: numeric - name: averageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: type type: scalar: string default: "" - name: value type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2.MetricValueStatus map: fields: - name: averageUtilization type: scalar: numeric - name: averageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: value type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2.ObjectMetricSource map: fields: - name: describedObject type: namedType: io.k8s.api.autoscaling.v2.CrossVersionObjectReference default: {} - name: metric type: namedType: io.k8s.api.autoscaling.v2.MetricIdentifier default: {} - name: target type: namedType: io.k8s.api.autoscaling.v2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2.ObjectMetricStatus map: fields: - name: current type: namedType: io.k8s.api.autoscaling.v2.MetricValueStatus default: {} - name: describedObject type: namedType: io.k8s.api.autoscaling.v2.CrossVersionObjectReference default: {} - name: metric type: namedType: io.k8s.api.autoscaling.v2.MetricIdentifier default: {} - name: io.k8s.api.autoscaling.v2.PodsMetricSource map: fields: - name: metric type: namedType: io.k8s.api.autoscaling.v2.MetricIdentifier default: {} - name: target type: namedType: io.k8s.api.autoscaling.v2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2.PodsMetricStatus map: fields: - name: current type: namedType: io.k8s.api.autoscaling.v2.MetricValueStatus default: {} - name: metric type: namedType: io.k8s.api.autoscaling.v2.MetricIdentifier default: {} - name: io.k8s.api.autoscaling.v2.ResourceMetricSource map: fields: - name: name type: scalar: string default: "" - name: target type: namedType: io.k8s.api.autoscaling.v2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2.ResourceMetricStatus map: fields: - name: current type: namedType: io.k8s.api.autoscaling.v2.MetricValueStatus default: {} - name: name type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricSource map: fields: - name: container type: scalar: string default: "" - name: name type: scalar: string default: "" - name: targetAverageUtilization type: scalar: numeric - name: targetAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricStatus map: fields: - name: container type: scalar: string default: "" - name: currentAverageUtilization type: scalar: numeric - name: currentAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: name type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta1.ExternalMetricSource map: fields: - name: metricName type: scalar: string default: "" - name: metricSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: targetAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: targetValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2beta1.ExternalMetricStatus map: fields: - name: currentAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: currentValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: metricName type: scalar: string default: "" - name: metricSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscaler map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerSpec default: {} - name: status type: namedType: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerStatus default: {} - name: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerSpec map: fields: - name: maxReplicas type: scalar: numeric default: 0 - name: metrics type: list: elementType: namedType: io.k8s.api.autoscaling.v2beta1.MetricSpec elementRelationship: atomic - name: minReplicas type: scalar: numeric - name: scaleTargetRef type: namedType: io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference default: {} - name: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerCondition elementRelationship: atomic - name: currentMetrics type: list: elementType: namedType: io.k8s.api.autoscaling.v2beta1.MetricStatus elementRelationship: atomic - name: currentReplicas type: scalar: numeric default: 0 - name: desiredReplicas type: scalar: numeric default: 0 - name: lastScaleTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: observedGeneration type: scalar: numeric - name: io.k8s.api.autoscaling.v2beta1.MetricSpec map: fields: - name: containerResource type: namedType: io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricSource - name: external type: namedType: io.k8s.api.autoscaling.v2beta1.ExternalMetricSource - name: object type: namedType: io.k8s.api.autoscaling.v2beta1.ObjectMetricSource - name: pods type: namedType: io.k8s.api.autoscaling.v2beta1.PodsMetricSource - name: resource type: namedType: io.k8s.api.autoscaling.v2beta1.ResourceMetricSource - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta1.MetricStatus map: fields: - name: containerResource type: namedType: io.k8s.api.autoscaling.v2beta1.ContainerResourceMetricStatus - name: external type: namedType: io.k8s.api.autoscaling.v2beta1.ExternalMetricStatus - name: object type: namedType: io.k8s.api.autoscaling.v2beta1.ObjectMetricStatus - name: pods type: namedType: io.k8s.api.autoscaling.v2beta1.PodsMetricStatus - name: resource type: namedType: io.k8s.api.autoscaling.v2beta1.ResourceMetricStatus - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta1.ObjectMetricSource map: fields: - name: averageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: metricName type: scalar: string default: "" - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: target type: namedType: io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference default: {} - name: targetValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2beta1.ObjectMetricStatus map: fields: - name: averageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: currentValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: metricName type: scalar: string default: "" - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: target type: namedType: io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference default: {} - name: io.k8s.api.autoscaling.v2beta1.PodsMetricSource map: fields: - name: metricName type: scalar: string default: "" - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: targetAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2beta1.PodsMetricStatus map: fields: - name: currentAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: metricName type: scalar: string default: "" - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: io.k8s.api.autoscaling.v2beta1.ResourceMetricSource map: fields: - name: name type: scalar: string default: "" - name: targetAverageUtilization type: scalar: numeric - name: targetAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2beta1.ResourceMetricStatus map: fields: - name: currentAverageUtilization type: scalar: numeric - name: currentAverageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: name type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricSource map: fields: - name: container type: scalar: string default: "" - name: name type: scalar: string default: "" - name: target type: namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricStatus map: fields: - name: container type: scalar: string default: "" - name: current type: namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus default: {} - name: name type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta2.ExternalMetricSource map: fields: - name: metric type: namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier default: {} - name: target type: namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2beta2.ExternalMetricStatus map: fields: - name: current type: namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus default: {} - name: metric type: namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier default: {} - name: io.k8s.api.autoscaling.v2beta2.HPAScalingPolicy map: fields: - name: periodSeconds type: scalar: numeric default: 0 - name: type type: scalar: string default: "" - name: value type: scalar: numeric default: 0 - name: io.k8s.api.autoscaling.v2beta2.HPAScalingRules map: fields: - name: policies type: list: elementType: namedType: io.k8s.api.autoscaling.v2beta2.HPAScalingPolicy elementRelationship: atomic - name: selectPolicy type: scalar: string - name: stabilizationWindowSeconds type: scalar: numeric - name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscaler map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec default: {} - name: status type: namedType: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerStatus default: {} - name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerBehavior map: fields: - name: scaleDown type: namedType: io.k8s.api.autoscaling.v2beta2.HPAScalingRules - name: scaleUp type: namedType: io.k8s.api.autoscaling.v2beta2.HPAScalingRules - name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec map: fields: - name: behavior type: namedType: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerBehavior - name: maxReplicas type: scalar: numeric default: 0 - name: metrics type: list: elementType: namedType: io.k8s.api.autoscaling.v2beta2.MetricSpec elementRelationship: atomic - name: minReplicas type: scalar: numeric - name: scaleTargetRef type: namedType: io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference default: {} - name: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerCondition elementRelationship: atomic - name: currentMetrics type: list: elementType: namedType: io.k8s.api.autoscaling.v2beta2.MetricStatus elementRelationship: atomic - name: currentReplicas type: scalar: numeric default: 0 - name: desiredReplicas type: scalar: numeric default: 0 - name: lastScaleTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: observedGeneration type: scalar: numeric - name: io.k8s.api.autoscaling.v2beta2.MetricIdentifier map: fields: - name: name type: scalar: string default: "" - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: io.k8s.api.autoscaling.v2beta2.MetricSpec map: fields: - name: containerResource type: namedType: io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricSource - name: external type: namedType: io.k8s.api.autoscaling.v2beta2.ExternalMetricSource - name: object type: namedType: io.k8s.api.autoscaling.v2beta2.ObjectMetricSource - name: pods type: namedType: io.k8s.api.autoscaling.v2beta2.PodsMetricSource - name: resource type: namedType: io.k8s.api.autoscaling.v2beta2.ResourceMetricSource - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta2.MetricStatus map: fields: - name: containerResource type: namedType: io.k8s.api.autoscaling.v2beta2.ContainerResourceMetricStatus - name: external type: namedType: io.k8s.api.autoscaling.v2beta2.ExternalMetricStatus - name: object type: namedType: io.k8s.api.autoscaling.v2beta2.ObjectMetricStatus - name: pods type: namedType: io.k8s.api.autoscaling.v2beta2.PodsMetricStatus - name: resource type: namedType: io.k8s.api.autoscaling.v2beta2.ResourceMetricStatus - name: type type: scalar: string default: "" - name: io.k8s.api.autoscaling.v2beta2.MetricTarget map: fields: - name: averageUtilization type: scalar: numeric - name: averageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: type type: scalar: string default: "" - name: value type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2beta2.MetricValueStatus map: fields: - name: averageUtilization type: scalar: numeric - name: averageValue type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: value type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2beta2.ObjectMetricSource map: fields: - name: describedObject type: namedType: io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference default: {} - name: metric type: namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier default: {} - name: target type: namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2beta2.ObjectMetricStatus map: fields: - name: current type: namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus default: {} - name: describedObject type: namedType: io.k8s.api.autoscaling.v2beta2.CrossVersionObjectReference default: {} - name: metric type: namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier default: {} - name: io.k8s.api.autoscaling.v2beta2.PodsMetricSource map: fields: - name: metric type: namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier default: {} - name: target type: namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2beta2.PodsMetricStatus map: fields: - name: current type: namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus default: {} - name: metric type: namedType: io.k8s.api.autoscaling.v2beta2.MetricIdentifier default: {} - name: io.k8s.api.autoscaling.v2beta2.ResourceMetricSource map: fields: - name: name type: scalar: string default: "" - name: target type: namedType: io.k8s.api.autoscaling.v2beta2.MetricTarget default: {} - name: io.k8s.api.autoscaling.v2beta2.ResourceMetricStatus map: fields: - name: current type: namedType: io.k8s.api.autoscaling.v2beta2.MetricValueStatus default: {} - name: name type: scalar: string default: "" - name: io.k8s.api.batch.v1.CronJob map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.batch.v1.CronJobSpec default: {} - name: status type: namedType: io.k8s.api.batch.v1.CronJobStatus default: {} - name: io.k8s.api.batch.v1.CronJobSpec map: fields: - name: concurrencyPolicy type: scalar: string - name: failedJobsHistoryLimit type: scalar: numeric - name: jobTemplate type: namedType: io.k8s.api.batch.v1.JobTemplateSpec default: {} - name: schedule type: scalar: string default: "" - name: startingDeadlineSeconds type: scalar: numeric - name: successfulJobsHistoryLimit type: scalar: numeric - name: suspend type: scalar: boolean - name: timeZone type: scalar: string - name: io.k8s.api.batch.v1.CronJobStatus map: fields: - name: active type: list: elementType: namedType: io.k8s.api.core.v1.ObjectReference elementRelationship: atomic - name: lastScheduleTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastSuccessfulTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.batch.v1.Job map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.batch.v1.JobSpec default: {} - name: status type: namedType: io.k8s.api.batch.v1.JobStatus default: {} - name: io.k8s.api.batch.v1.JobCondition map: fields: - name: lastProbeTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.batch.v1.JobSpec map: fields: - name: activeDeadlineSeconds type: scalar: numeric - name: backoffLimit type: scalar: numeric - name: backoffLimitPerIndex type: scalar: numeric - name: completionMode type: scalar: string - name: completions type: scalar: numeric - name: managedBy type: scalar: string - name: manualSelector type: scalar: boolean - name: maxFailedIndexes type: scalar: numeric - name: parallelism type: scalar: numeric - name: podFailurePolicy type: namedType: io.k8s.api.batch.v1.PodFailurePolicy - name: podReplacementPolicy type: scalar: string - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: successPolicy type: namedType: io.k8s.api.batch.v1.SuccessPolicy - name: suspend type: scalar: boolean - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: ttlSecondsAfterFinished type: scalar: numeric - name: io.k8s.api.batch.v1.JobStatus map: fields: - name: active type: scalar: numeric - name: completedIndexes type: scalar: string - name: completionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: conditions type: list: elementType: namedType: io.k8s.api.batch.v1.JobCondition elementRelationship: atomic - name: failed type: scalar: numeric - name: failedIndexes type: scalar: string - name: ready type: scalar: numeric - name: startTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: succeeded type: scalar: numeric - name: terminating type: scalar: numeric - name: uncountedTerminatedPods type: namedType: io.k8s.api.batch.v1.UncountedTerminatedPods - name: io.k8s.api.batch.v1.JobTemplateSpec map: fields: - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.batch.v1.JobSpec default: {} - name: io.k8s.api.batch.v1.PodFailurePolicy map: fields: - name: rules type: list: elementType: namedType: io.k8s.api.batch.v1.PodFailurePolicyRule elementRelationship: atomic - name: io.k8s.api.batch.v1.PodFailurePolicyOnExitCodesRequirement map: fields: - name: containerName type: scalar: string - name: operator type: scalar: string default: "" - name: values type: list: elementType: scalar: numeric elementRelationship: associative - name: io.k8s.api.batch.v1.PodFailurePolicyOnPodConditionsPattern map: fields: - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.batch.v1.PodFailurePolicyRule map: fields: - name: action type: scalar: string default: "" - name: onExitCodes type: namedType: io.k8s.api.batch.v1.PodFailurePolicyOnExitCodesRequirement - name: onPodConditions type: list: elementType: namedType: io.k8s.api.batch.v1.PodFailurePolicyOnPodConditionsPattern elementRelationship: atomic - name: io.k8s.api.batch.v1.SuccessPolicy map: fields: - name: rules type: list: elementType: namedType: io.k8s.api.batch.v1.SuccessPolicyRule elementRelationship: atomic - name: io.k8s.api.batch.v1.SuccessPolicyRule map: fields: - name: succeededCount type: scalar: numeric - name: succeededIndexes type: scalar: string - name: io.k8s.api.batch.v1.UncountedTerminatedPods map: fields: - name: failed type: list: elementType: scalar: string elementRelationship: associative - name: succeeded type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.batch.v1beta1.CronJob map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.batch.v1beta1.CronJobSpec default: {} - name: status type: namedType: io.k8s.api.batch.v1beta1.CronJobStatus default: {} - name: io.k8s.api.batch.v1beta1.CronJobSpec map: fields: - name: concurrencyPolicy type: scalar: string - name: failedJobsHistoryLimit type: scalar: numeric - name: jobTemplate type: namedType: io.k8s.api.batch.v1beta1.JobTemplateSpec default: {} - name: schedule type: scalar: string default: "" - name: startingDeadlineSeconds type: scalar: numeric - name: successfulJobsHistoryLimit type: scalar: numeric - name: suspend type: scalar: boolean - name: timeZone type: scalar: string - name: io.k8s.api.batch.v1beta1.CronJobStatus map: fields: - name: active type: list: elementType: namedType: io.k8s.api.core.v1.ObjectReference elementRelationship: atomic - name: lastScheduleTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastSuccessfulTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.batch.v1beta1.JobTemplateSpec map: fields: - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.batch.v1.JobSpec default: {} - name: io.k8s.api.certificates.v1.CertificateSigningRequest map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.certificates.v1.CertificateSigningRequestSpec default: {} - name: status type: namedType: io.k8s.api.certificates.v1.CertificateSigningRequestStatus default: {} - name: io.k8s.api.certificates.v1.CertificateSigningRequestCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.certificates.v1.CertificateSigningRequestSpec map: fields: - name: expirationSeconds type: scalar: numeric - name: extra type: map: elementType: list: elementType: scalar: string elementRelationship: atomic - name: groups type: list: elementType: scalar: string elementRelationship: atomic - name: request type: scalar: string - name: signerName type: scalar: string default: "" - name: uid type: scalar: string - name: usages type: list: elementType: scalar: string elementRelationship: atomic - name: username type: scalar: string - name: io.k8s.api.certificates.v1.CertificateSigningRequestStatus map: fields: - name: certificate type: scalar: string - name: conditions type: list: elementType: namedType: io.k8s.api.certificates.v1.CertificateSigningRequestCondition elementRelationship: associative keys: - type - name: io.k8s.api.certificates.v1alpha1.ClusterTrustBundle map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.certificates.v1alpha1.ClusterTrustBundleSpec default: {} - name: io.k8s.api.certificates.v1alpha1.ClusterTrustBundleSpec map: fields: - name: signerName type: scalar: string - name: trustBundle type: scalar: string default: "" - name: io.k8s.api.certificates.v1beta1.CertificateSigningRequest map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.certificates.v1beta1.CertificateSigningRequestSpec default: {} - name: status type: namedType: io.k8s.api.certificates.v1beta1.CertificateSigningRequestStatus default: {} - name: io.k8s.api.certificates.v1beta1.CertificateSigningRequestCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.certificates.v1beta1.CertificateSigningRequestSpec map: fields: - name: expirationSeconds type: scalar: numeric - name: extra type: map: elementType: list: elementType: scalar: string elementRelationship: atomic - name: groups type: list: elementType: scalar: string elementRelationship: atomic - name: request type: scalar: string - name: signerName type: scalar: string - name: uid type: scalar: string - name: usages type: list: elementType: scalar: string elementRelationship: atomic - name: username type: scalar: string - name: io.k8s.api.certificates.v1beta1.CertificateSigningRequestStatus map: fields: - name: certificate type: scalar: string - name: conditions type: list: elementType: namedType: io.k8s.api.certificates.v1beta1.CertificateSigningRequestCondition elementRelationship: associative keys: - type - name: io.k8s.api.coordination.v1.Lease map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.coordination.v1.LeaseSpec default: {} - name: io.k8s.api.coordination.v1.LeaseSpec map: fields: - name: acquireTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: holderIdentity type: scalar: string - name: leaseDurationSeconds type: scalar: numeric - name: leaseTransitions type: scalar: numeric - name: preferredHolder type: scalar: string - name: renewTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: strategy type: scalar: string - name: io.k8s.api.coordination.v1alpha1.LeaseCandidate map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.coordination.v1alpha1.LeaseCandidateSpec default: {} - name: io.k8s.api.coordination.v1alpha1.LeaseCandidateSpec map: fields: - name: binaryVersion type: scalar: string - name: emulationVersion type: scalar: string - name: leaseName type: scalar: string default: "" - name: pingTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: preferredStrategies type: list: elementType: scalar: string elementRelationship: atomic - name: renewTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: io.k8s.api.coordination.v1beta1.Lease map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.coordination.v1beta1.LeaseSpec default: {} - name: io.k8s.api.coordination.v1beta1.LeaseSpec map: fields: - name: acquireTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: holderIdentity type: scalar: string - name: leaseDurationSeconds type: scalar: numeric - name: leaseTransitions type: scalar: numeric - name: preferredHolder type: scalar: string - name: renewTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: strategy type: scalar: string - name: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource map: fields: - name: fsType type: scalar: string - name: partition type: scalar: numeric - name: readOnly type: scalar: boolean - name: volumeID type: scalar: string default: "" - name: io.k8s.api.core.v1.Affinity map: fields: - name: nodeAffinity type: namedType: io.k8s.api.core.v1.NodeAffinity - name: podAffinity type: namedType: io.k8s.api.core.v1.PodAffinity - name: podAntiAffinity type: namedType: io.k8s.api.core.v1.PodAntiAffinity - name: io.k8s.api.core.v1.AppArmorProfile map: fields: - name: localhostProfile type: scalar: string - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: localhostProfile discriminatorValue: LocalhostProfile - name: io.k8s.api.core.v1.AttachedVolume map: fields: - name: devicePath type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.core.v1.AzureDiskVolumeSource map: fields: - name: cachingMode type: scalar: string default: ReadWrite - name: diskName type: scalar: string default: "" - name: diskURI type: scalar: string default: "" - name: fsType type: scalar: string default: ext4 - name: kind type: scalar: string default: Shared - name: readOnly type: scalar: boolean default: false - name: io.k8s.api.core.v1.AzureFilePersistentVolumeSource map: fields: - name: readOnly type: scalar: boolean - name: secretName type: scalar: string default: "" - name: secretNamespace type: scalar: string - name: shareName type: scalar: string default: "" - name: io.k8s.api.core.v1.AzureFileVolumeSource map: fields: - name: readOnly type: scalar: boolean - name: secretName type: scalar: string default: "" - name: shareName type: scalar: string default: "" - name: io.k8s.api.core.v1.CSIPersistentVolumeSource map: fields: - name: controllerExpandSecretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: controllerPublishSecretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: driver type: scalar: string default: "" - name: fsType type: scalar: string - name: nodeExpandSecretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: nodePublishSecretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: nodeStageSecretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: readOnly type: scalar: boolean - name: volumeAttributes type: map: elementType: scalar: string - name: volumeHandle type: scalar: string default: "" - name: io.k8s.api.core.v1.CSIVolumeSource map: fields: - name: driver type: scalar: string default: "" - name: fsType type: scalar: string - name: nodePublishSecretRef type: namedType: io.k8s.api.core.v1.LocalObjectReference - name: readOnly type: scalar: boolean - name: volumeAttributes type: map: elementType: scalar: string - name: io.k8s.api.core.v1.Capabilities map: fields: - name: add type: list: elementType: scalar: string elementRelationship: atomic - name: drop type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.CephFSPersistentVolumeSource map: fields: - name: monitors type: list: elementType: scalar: string elementRelationship: atomic - name: path type: scalar: string - name: readOnly type: scalar: boolean - name: secretFile type: scalar: string - name: secretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: user type: scalar: string - name: io.k8s.api.core.v1.CephFSVolumeSource map: fields: - name: monitors type: list: elementType: scalar: string elementRelationship: atomic - name: path type: scalar: string - name: readOnly type: scalar: boolean - name: secretFile type: scalar: string - name: secretRef type: namedType: io.k8s.api.core.v1.LocalObjectReference - name: user type: scalar: string - name: io.k8s.api.core.v1.CinderPersistentVolumeSource map: fields: - name: fsType type: scalar: string - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: volumeID type: scalar: string default: "" - name: io.k8s.api.core.v1.CinderVolumeSource map: fields: - name: fsType type: scalar: string - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.LocalObjectReference - name: volumeID type: scalar: string default: "" - name: io.k8s.api.core.v1.ClientIPConfig map: fields: - name: timeoutSeconds type: scalar: numeric - name: io.k8s.api.core.v1.ClusterTrustBundleProjection map: fields: - name: labelSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: name type: scalar: string - name: optional type: scalar: boolean - name: path type: scalar: string default: "" - name: signerName type: scalar: string - name: io.k8s.api.core.v1.ComponentCondition map: fields: - name: error type: scalar: string - name: message type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.core.v1.ComponentStatus map: fields: - name: apiVersion type: scalar: string - name: conditions type: list: elementType: namedType: io.k8s.api.core.v1.ComponentCondition elementRelationship: associative keys: - type - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: io.k8s.api.core.v1.ConfigMap map: fields: - name: apiVersion type: scalar: string - name: binaryData type: map: elementType: scalar: string - name: data type: map: elementType: scalar: string - name: immutable type: scalar: boolean - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: io.k8s.api.core.v1.ConfigMapEnvSource map: fields: - name: name type: scalar: string default: "" - name: optional type: scalar: boolean - name: io.k8s.api.core.v1.ConfigMapKeySelector map: fields: - name: key type: scalar: string default: "" - name: name type: scalar: string default: "" - name: optional type: scalar: boolean elementRelationship: atomic - name: io.k8s.api.core.v1.ConfigMapNodeConfigSource map: fields: - name: kubeletConfigKey type: scalar: string default: "" - name: name type: scalar: string default: "" - name: namespace type: scalar: string default: "" - name: resourceVersion type: scalar: string - name: uid type: scalar: string - name: io.k8s.api.core.v1.ConfigMapProjection map: fields: - name: items type: list: elementType: namedType: io.k8s.api.core.v1.KeyToPath elementRelationship: atomic - name: name type: scalar: string default: "" - name: optional type: scalar: boolean - name: io.k8s.api.core.v1.ConfigMapVolumeSource map: fields: - name: defaultMode type: scalar: numeric - name: items type: list: elementType: namedType: io.k8s.api.core.v1.KeyToPath elementRelationship: atomic - name: name type: scalar: string default: "" - name: optional type: scalar: boolean - name: io.k8s.api.core.v1.Container map: fields: - name: args type: list: elementType: scalar: string elementRelationship: atomic - name: command type: list: elementType: scalar: string elementRelationship: atomic - name: env type: list: elementType: namedType: io.k8s.api.core.v1.EnvVar elementRelationship: associative keys: - name - name: envFrom type: list: elementType: namedType: io.k8s.api.core.v1.EnvFromSource elementRelationship: atomic - name: image type: scalar: string - name: imagePullPolicy type: scalar: string - name: lifecycle type: namedType: io.k8s.api.core.v1.Lifecycle - name: livenessProbe type: namedType: io.k8s.api.core.v1.Probe - name: name type: scalar: string default: "" - name: ports type: list: elementType: namedType: io.k8s.api.core.v1.ContainerPort elementRelationship: associative keys: - containerPort - protocol - name: readinessProbe type: namedType: io.k8s.api.core.v1.Probe - name: resizePolicy type: list: elementType: namedType: io.k8s.api.core.v1.ContainerResizePolicy elementRelationship: atomic - name: resources type: namedType: io.k8s.api.core.v1.ResourceRequirements default: {} - name: restartPolicy type: scalar: string - name: securityContext type: namedType: io.k8s.api.core.v1.SecurityContext - name: startupProbe type: namedType: io.k8s.api.core.v1.Probe - name: stdin type: scalar: boolean - name: stdinOnce type: scalar: boolean - name: terminationMessagePath type: scalar: string - name: terminationMessagePolicy type: scalar: string - name: tty type: scalar: boolean - name: volumeDevices type: list: elementType: namedType: io.k8s.api.core.v1.VolumeDevice elementRelationship: associative keys: - devicePath - name: volumeMounts type: list: elementType: namedType: io.k8s.api.core.v1.VolumeMount elementRelationship: associative keys: - mountPath - name: workingDir type: scalar: string - name: io.k8s.api.core.v1.ContainerImage map: fields: - name: names type: list: elementType: scalar: string elementRelationship: atomic - name: sizeBytes type: scalar: numeric - name: io.k8s.api.core.v1.ContainerPort map: fields: - name: containerPort type: scalar: numeric default: 0 - name: hostIP type: scalar: string - name: hostPort type: scalar: numeric - name: name type: scalar: string - name: protocol type: scalar: string default: TCP - name: io.k8s.api.core.v1.ContainerResizePolicy map: fields: - name: resourceName type: scalar: string default: "" - name: restartPolicy type: scalar: string default: "" - name: io.k8s.api.core.v1.ContainerState map: fields: - name: running type: namedType: io.k8s.api.core.v1.ContainerStateRunning - name: terminated type: namedType: io.k8s.api.core.v1.ContainerStateTerminated - name: waiting type: namedType: io.k8s.api.core.v1.ContainerStateWaiting - name: io.k8s.api.core.v1.ContainerStateRunning map: fields: - name: startedAt type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.core.v1.ContainerStateTerminated map: fields: - name: containerID type: scalar: string - name: exitCode type: scalar: numeric default: 0 - name: finishedAt type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: signal type: scalar: numeric - name: startedAt type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.core.v1.ContainerStateWaiting map: fields: - name: message type: scalar: string - name: reason type: scalar: string - name: io.k8s.api.core.v1.ContainerStatus map: fields: - name: allocatedResources type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: allocatedResourcesStatus type: list: elementType: namedType: io.k8s.api.core.v1.ResourceStatus elementRelationship: associative keys: - name - name: containerID type: scalar: string - name: image type: scalar: string default: "" - name: imageID type: scalar: string default: "" - name: lastState type: namedType: io.k8s.api.core.v1.ContainerState default: {} - name: name type: scalar: string default: "" - name: ready type: scalar: boolean default: false - name: resources type: namedType: io.k8s.api.core.v1.ResourceRequirements - name: restartCount type: scalar: numeric default: 0 - name: started type: scalar: boolean - name: state type: namedType: io.k8s.api.core.v1.ContainerState default: {} - name: user type: namedType: io.k8s.api.core.v1.ContainerUser - name: volumeMounts type: list: elementType: namedType: io.k8s.api.core.v1.VolumeMountStatus elementRelationship: associative keys: - mountPath - name: io.k8s.api.core.v1.ContainerUser map: fields: - name: linux type: namedType: io.k8s.api.core.v1.LinuxContainerUser - name: io.k8s.api.core.v1.DaemonEndpoint map: fields: - name: Port type: scalar: numeric default: 0 - name: io.k8s.api.core.v1.DownwardAPIProjection map: fields: - name: items type: list: elementType: namedType: io.k8s.api.core.v1.DownwardAPIVolumeFile elementRelationship: atomic - name: io.k8s.api.core.v1.DownwardAPIVolumeFile map: fields: - name: fieldRef type: namedType: io.k8s.api.core.v1.ObjectFieldSelector - name: mode type: scalar: numeric - name: path type: scalar: string default: "" - name: resourceFieldRef type: namedType: io.k8s.api.core.v1.ResourceFieldSelector - name: io.k8s.api.core.v1.DownwardAPIVolumeSource map: fields: - name: defaultMode type: scalar: numeric - name: items type: list: elementType: namedType: io.k8s.api.core.v1.DownwardAPIVolumeFile elementRelationship: atomic - name: io.k8s.api.core.v1.EmptyDirVolumeSource map: fields: - name: medium type: scalar: string - name: sizeLimit type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.EndpointAddress map: fields: - name: hostname type: scalar: string - name: ip type: scalar: string default: "" - name: nodeName type: scalar: string - name: targetRef type: namedType: io.k8s.api.core.v1.ObjectReference elementRelationship: atomic - name: io.k8s.api.core.v1.EndpointPort map: fields: - name: appProtocol type: scalar: string - name: name type: scalar: string - name: port type: scalar: numeric default: 0 - name: protocol type: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.EndpointSubset map: fields: - name: addresses type: list: elementType: namedType: io.k8s.api.core.v1.EndpointAddress elementRelationship: atomic - name: notReadyAddresses type: list: elementType: namedType: io.k8s.api.core.v1.EndpointAddress elementRelationship: atomic - name: ports type: list: elementType: namedType: io.k8s.api.core.v1.EndpointPort elementRelationship: atomic - name: io.k8s.api.core.v1.Endpoints map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: subsets type: list: elementType: namedType: io.k8s.api.core.v1.EndpointSubset elementRelationship: atomic - name: io.k8s.api.core.v1.EnvFromSource map: fields: - name: configMapRef type: namedType: io.k8s.api.core.v1.ConfigMapEnvSource - name: prefix type: scalar: string - name: secretRef type: namedType: io.k8s.api.core.v1.SecretEnvSource - name: io.k8s.api.core.v1.EnvVar map: fields: - name: name type: scalar: string default: "" - name: value type: scalar: string - name: valueFrom type: namedType: io.k8s.api.core.v1.EnvVarSource - name: io.k8s.api.core.v1.EnvVarSource map: fields: - name: configMapKeyRef type: namedType: io.k8s.api.core.v1.ConfigMapKeySelector - name: fieldRef type: namedType: io.k8s.api.core.v1.ObjectFieldSelector - name: resourceFieldRef type: namedType: io.k8s.api.core.v1.ResourceFieldSelector - name: secretKeyRef type: namedType: io.k8s.api.core.v1.SecretKeySelector - name: io.k8s.api.core.v1.EphemeralContainer map: fields: - name: args type: list: elementType: scalar: string elementRelationship: atomic - name: command type: list: elementType: scalar: string elementRelationship: atomic - name: env type: list: elementType: namedType: io.k8s.api.core.v1.EnvVar elementRelationship: associative keys: - name - name: envFrom type: list: elementType: namedType: io.k8s.api.core.v1.EnvFromSource elementRelationship: atomic - name: image type: scalar: string - name: imagePullPolicy type: scalar: string - name: lifecycle type: namedType: io.k8s.api.core.v1.Lifecycle - name: livenessProbe type: namedType: io.k8s.api.core.v1.Probe - name: name type: scalar: string default: "" - name: ports type: list: elementType: namedType: io.k8s.api.core.v1.ContainerPort elementRelationship: associative keys: - containerPort - protocol - name: readinessProbe type: namedType: io.k8s.api.core.v1.Probe - name: resizePolicy type: list: elementType: namedType: io.k8s.api.core.v1.ContainerResizePolicy elementRelationship: atomic - name: resources type: namedType: io.k8s.api.core.v1.ResourceRequirements default: {} - name: restartPolicy type: scalar: string - name: securityContext type: namedType: io.k8s.api.core.v1.SecurityContext - name: startupProbe type: namedType: io.k8s.api.core.v1.Probe - name: stdin type: scalar: boolean - name: stdinOnce type: scalar: boolean - name: targetContainerName type: scalar: string - name: terminationMessagePath type: scalar: string - name: terminationMessagePolicy type: scalar: string - name: tty type: scalar: boolean - name: volumeDevices type: list: elementType: namedType: io.k8s.api.core.v1.VolumeDevice elementRelationship: associative keys: - devicePath - name: volumeMounts type: list: elementType: namedType: io.k8s.api.core.v1.VolumeMount elementRelationship: associative keys: - mountPath - name: workingDir type: scalar: string - name: io.k8s.api.core.v1.EphemeralVolumeSource map: fields: - name: volumeClaimTemplate type: namedType: io.k8s.api.core.v1.PersistentVolumeClaimTemplate - name: io.k8s.api.core.v1.Event map: fields: - name: action type: scalar: string - name: apiVersion type: scalar: string - name: count type: scalar: numeric - name: eventTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: firstTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: involvedObject type: namedType: io.k8s.api.core.v1.ObjectReference default: {} - name: kind type: scalar: string - name: lastTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: reason type: scalar: string - name: related type: namedType: io.k8s.api.core.v1.ObjectReference - name: reportingComponent type: scalar: string default: "" - name: reportingInstance type: scalar: string default: "" - name: series type: namedType: io.k8s.api.core.v1.EventSeries - name: source type: namedType: io.k8s.api.core.v1.EventSource default: {} - name: type type: scalar: string - name: io.k8s.api.core.v1.EventSeries map: fields: - name: count type: scalar: numeric - name: lastObservedTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: io.k8s.api.core.v1.EventSource map: fields: - name: component type: scalar: string - name: host type: scalar: string - name: io.k8s.api.core.v1.ExecAction map: fields: - name: command type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.FCVolumeSource map: fields: - name: fsType type: scalar: string - name: lun type: scalar: numeric - name: readOnly type: scalar: boolean - name: targetWWNs type: list: elementType: scalar: string elementRelationship: atomic - name: wwids type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.FlexPersistentVolumeSource map: fields: - name: driver type: scalar: string default: "" - name: fsType type: scalar: string - name: options type: map: elementType: scalar: string - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: io.k8s.api.core.v1.FlexVolumeSource map: fields: - name: driver type: scalar: string default: "" - name: fsType type: scalar: string - name: options type: map: elementType: scalar: string - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.LocalObjectReference - name: io.k8s.api.core.v1.FlockerVolumeSource map: fields: - name: datasetName type: scalar: string - name: datasetUUID type: scalar: string - name: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource map: fields: - name: fsType type: scalar: string - name: partition type: scalar: numeric - name: pdName type: scalar: string default: "" - name: readOnly type: scalar: boolean - name: io.k8s.api.core.v1.GRPCAction map: fields: - name: port type: scalar: numeric default: 0 - name: service type: scalar: string default: "" - name: io.k8s.api.core.v1.GitRepoVolumeSource map: fields: - name: directory type: scalar: string - name: repository type: scalar: string default: "" - name: revision type: scalar: string - name: io.k8s.api.core.v1.GlusterfsPersistentVolumeSource map: fields: - name: endpoints type: scalar: string default: "" - name: endpointsNamespace type: scalar: string - name: path type: scalar: string default: "" - name: readOnly type: scalar: boolean - name: io.k8s.api.core.v1.GlusterfsVolumeSource map: fields: - name: endpoints type: scalar: string default: "" - name: path type: scalar: string default: "" - name: readOnly type: scalar: boolean - name: io.k8s.api.core.v1.HTTPGetAction map: fields: - name: host type: scalar: string - name: httpHeaders type: list: elementType: namedType: io.k8s.api.core.v1.HTTPHeader elementRelationship: atomic - name: path type: scalar: string - name: port type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: scheme type: scalar: string - name: io.k8s.api.core.v1.HTTPHeader map: fields: - name: name type: scalar: string default: "" - name: value type: scalar: string default: "" - name: io.k8s.api.core.v1.HostAlias map: fields: - name: hostnames type: list: elementType: scalar: string elementRelationship: atomic - name: ip type: scalar: string default: "" - name: io.k8s.api.core.v1.HostIP map: fields: - name: ip type: scalar: string default: "" - name: io.k8s.api.core.v1.HostPathVolumeSource map: fields: - name: path type: scalar: string default: "" - name: type type: scalar: string - name: io.k8s.api.core.v1.ISCSIPersistentVolumeSource map: fields: - name: chapAuthDiscovery type: scalar: boolean - name: chapAuthSession type: scalar: boolean - name: fsType type: scalar: string - name: initiatorName type: scalar: string - name: iqn type: scalar: string default: "" - name: iscsiInterface type: scalar: string default: default - name: lun type: scalar: numeric default: 0 - name: portals type: list: elementType: scalar: string elementRelationship: atomic - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: targetPortal type: scalar: string default: "" - name: io.k8s.api.core.v1.ISCSIVolumeSource map: fields: - name: chapAuthDiscovery type: scalar: boolean - name: chapAuthSession type: scalar: boolean - name: fsType type: scalar: string - name: initiatorName type: scalar: string - name: iqn type: scalar: string default: "" - name: iscsiInterface type: scalar: string default: default - name: lun type: scalar: numeric default: 0 - name: portals type: list: elementType: scalar: string elementRelationship: atomic - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.LocalObjectReference - name: targetPortal type: scalar: string default: "" - name: io.k8s.api.core.v1.ImageVolumeSource map: fields: - name: pullPolicy type: scalar: string - name: reference type: scalar: string - name: io.k8s.api.core.v1.KeyToPath map: fields: - name: key type: scalar: string default: "" - name: mode type: scalar: numeric - name: path type: scalar: string default: "" - name: io.k8s.api.core.v1.Lifecycle map: fields: - name: postStart type: namedType: io.k8s.api.core.v1.LifecycleHandler - name: preStop type: namedType: io.k8s.api.core.v1.LifecycleHandler - name: io.k8s.api.core.v1.LifecycleHandler map: fields: - name: exec type: namedType: io.k8s.api.core.v1.ExecAction - name: httpGet type: namedType: io.k8s.api.core.v1.HTTPGetAction - name: sleep type: namedType: io.k8s.api.core.v1.SleepAction - name: tcpSocket type: namedType: io.k8s.api.core.v1.TCPSocketAction - name: io.k8s.api.core.v1.LimitRange map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.LimitRangeSpec default: {} - name: io.k8s.api.core.v1.LimitRangeItem map: fields: - name: default type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: defaultRequest type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: max type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: maxLimitRequestRatio type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: min type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: type type: scalar: string default: "" - name: io.k8s.api.core.v1.LimitRangeSpec map: fields: - name: limits type: list: elementType: namedType: io.k8s.api.core.v1.LimitRangeItem elementRelationship: atomic - name: io.k8s.api.core.v1.LinuxContainerUser map: fields: - name: gid type: scalar: numeric default: 0 - name: supplementalGroups type: list: elementType: scalar: numeric elementRelationship: atomic - name: uid type: scalar: numeric default: 0 - name: io.k8s.api.core.v1.LoadBalancerIngress map: fields: - name: hostname type: scalar: string - name: ip type: scalar: string - name: ipMode type: scalar: string - name: ports type: list: elementType: namedType: io.k8s.api.core.v1.PortStatus elementRelationship: atomic - name: io.k8s.api.core.v1.LoadBalancerStatus map: fields: - name: ingress type: list: elementType: namedType: io.k8s.api.core.v1.LoadBalancerIngress elementRelationship: atomic - name: io.k8s.api.core.v1.LocalObjectReference map: fields: - name: name type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.api.core.v1.LocalVolumeSource map: fields: - name: fsType type: scalar: string - name: path type: scalar: string default: "" - name: io.k8s.api.core.v1.ModifyVolumeStatus map: fields: - name: status type: scalar: string default: "" - name: targetVolumeAttributesClassName type: scalar: string - name: io.k8s.api.core.v1.NFSVolumeSource map: fields: - name: path type: scalar: string default: "" - name: readOnly type: scalar: boolean - name: server type: scalar: string default: "" - name: io.k8s.api.core.v1.Namespace map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.NamespaceSpec default: {} - name: status type: namedType: io.k8s.api.core.v1.NamespaceStatus default: {} - name: io.k8s.api.core.v1.NamespaceCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.core.v1.NamespaceSpec map: fields: - name: finalizers type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.NamespaceStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.core.v1.NamespaceCondition elementRelationship: associative keys: - type - name: phase type: scalar: string - name: io.k8s.api.core.v1.Node map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.NodeSpec default: {} - name: status type: namedType: io.k8s.api.core.v1.NodeStatus default: {} - name: io.k8s.api.core.v1.NodeAddress map: fields: - name: address type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.core.v1.NodeAffinity map: fields: - name: preferredDuringSchedulingIgnoredDuringExecution type: list: elementType: namedType: io.k8s.api.core.v1.PreferredSchedulingTerm elementRelationship: atomic - name: requiredDuringSchedulingIgnoredDuringExecution type: namedType: io.k8s.api.core.v1.NodeSelector - name: io.k8s.api.core.v1.NodeCondition map: fields: - name: lastHeartbeatTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.core.v1.NodeConfigSource map: fields: - name: configMap type: namedType: io.k8s.api.core.v1.ConfigMapNodeConfigSource - name: io.k8s.api.core.v1.NodeConfigStatus map: fields: - name: active type: namedType: io.k8s.api.core.v1.NodeConfigSource - name: assigned type: namedType: io.k8s.api.core.v1.NodeConfigSource - name: error type: scalar: string - name: lastKnownGood type: namedType: io.k8s.api.core.v1.NodeConfigSource - name: io.k8s.api.core.v1.NodeDaemonEndpoints map: fields: - name: kubeletEndpoint type: namedType: io.k8s.api.core.v1.DaemonEndpoint default: {} - name: io.k8s.api.core.v1.NodeFeatures map: fields: - name: supplementalGroupsPolicy type: scalar: boolean - name: io.k8s.api.core.v1.NodeRuntimeHandler map: fields: - name: features type: namedType: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures - name: name type: scalar: string default: "" - name: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures map: fields: - name: recursiveReadOnlyMounts type: scalar: boolean - name: userNamespaces type: scalar: boolean - name: io.k8s.api.core.v1.NodeSelector map: fields: - name: nodeSelectorTerms type: list: elementType: namedType: io.k8s.api.core.v1.NodeSelectorTerm elementRelationship: atomic elementRelationship: atomic - name: io.k8s.api.core.v1.NodeSelectorRequirement map: fields: - name: key type: scalar: string default: "" - name: operator type: scalar: string default: "" - name: values type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.NodeSelectorTerm map: fields: - name: matchExpressions type: list: elementType: namedType: io.k8s.api.core.v1.NodeSelectorRequirement elementRelationship: atomic - name: matchFields type: list: elementType: namedType: io.k8s.api.core.v1.NodeSelectorRequirement elementRelationship: atomic elementRelationship: atomic - name: io.k8s.api.core.v1.NodeSpec map: fields: - name: configSource type: namedType: io.k8s.api.core.v1.NodeConfigSource - name: externalID type: scalar: string - name: podCIDR type: scalar: string - name: podCIDRs type: list: elementType: scalar: string elementRelationship: associative - name: providerID type: scalar: string - name: taints type: list: elementType: namedType: io.k8s.api.core.v1.Taint elementRelationship: atomic - name: unschedulable type: scalar: boolean - name: io.k8s.api.core.v1.NodeStatus map: fields: - name: addresses type: list: elementType: namedType: io.k8s.api.core.v1.NodeAddress elementRelationship: associative keys: - type - name: allocatable type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: capacity type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: conditions type: list: elementType: namedType: io.k8s.api.core.v1.NodeCondition elementRelationship: associative keys: - type - name: config type: namedType: io.k8s.api.core.v1.NodeConfigStatus - name: daemonEndpoints type: namedType: io.k8s.api.core.v1.NodeDaemonEndpoints default: {} - name: features type: namedType: io.k8s.api.core.v1.NodeFeatures - name: images type: list: elementType: namedType: io.k8s.api.core.v1.ContainerImage elementRelationship: atomic - name: nodeInfo type: namedType: io.k8s.api.core.v1.NodeSystemInfo default: {} - name: phase type: scalar: string - name: runtimeHandlers type: list: elementType: namedType: io.k8s.api.core.v1.NodeRuntimeHandler elementRelationship: atomic - name: volumesAttached type: list: elementType: namedType: io.k8s.api.core.v1.AttachedVolume elementRelationship: atomic - name: volumesInUse type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.NodeSystemInfo map: fields: - name: architecture type: scalar: string default: "" - name: bootID type: scalar: string default: "" - name: containerRuntimeVersion type: scalar: string default: "" - name: kernelVersion type: scalar: string default: "" - name: kubeProxyVersion type: scalar: string default: "" - name: kubeletVersion type: scalar: string default: "" - name: machineID type: scalar: string default: "" - name: operatingSystem type: scalar: string default: "" - name: osImage type: scalar: string default: "" - name: systemUUID type: scalar: string default: "" - name: io.k8s.api.core.v1.ObjectFieldSelector map: fields: - name: apiVersion type: scalar: string - name: fieldPath type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.api.core.v1.ObjectReference map: fields: - name: apiVersion type: scalar: string - name: fieldPath type: scalar: string - name: kind type: scalar: string - name: name type: scalar: string - name: namespace type: scalar: string - name: resourceVersion type: scalar: string - name: uid type: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.PersistentVolume map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.PersistentVolumeSpec default: {} - name: status type: namedType: io.k8s.api.core.v1.PersistentVolumeStatus default: {} - name: io.k8s.api.core.v1.PersistentVolumeClaim map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.PersistentVolumeClaimSpec default: {} - name: status type: namedType: io.k8s.api.core.v1.PersistentVolumeClaimStatus default: {} - name: io.k8s.api.core.v1.PersistentVolumeClaimCondition map: fields: - name: lastProbeTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.core.v1.PersistentVolumeClaimSpec map: fields: - name: accessModes type: list: elementType: scalar: string elementRelationship: atomic - name: dataSource type: namedType: io.k8s.api.core.v1.TypedLocalObjectReference - name: dataSourceRef type: namedType: io.k8s.api.core.v1.TypedObjectReference - name: resources type: namedType: io.k8s.api.core.v1.VolumeResourceRequirements default: {} - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: storageClassName type: scalar: string - name: volumeAttributesClassName type: scalar: string - name: volumeMode type: scalar: string - name: volumeName type: scalar: string - name: io.k8s.api.core.v1.PersistentVolumeClaimStatus map: fields: - name: accessModes type: list: elementType: scalar: string elementRelationship: atomic - name: allocatedResourceStatuses type: map: elementType: scalar: string elementRelationship: separable - name: allocatedResources type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: capacity type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: conditions type: list: elementType: namedType: io.k8s.api.core.v1.PersistentVolumeClaimCondition elementRelationship: associative keys: - type - name: currentVolumeAttributesClassName type: scalar: string - name: modifyVolumeStatus type: namedType: io.k8s.api.core.v1.ModifyVolumeStatus - name: phase type: scalar: string - name: io.k8s.api.core.v1.PersistentVolumeClaimTemplate map: fields: - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.PersistentVolumeClaimSpec default: {} - name: io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource map: fields: - name: claimName type: scalar: string default: "" - name: readOnly type: scalar: boolean - name: io.k8s.api.core.v1.PersistentVolumeSpec map: fields: - name: accessModes type: list: elementType: scalar: string elementRelationship: atomic - name: awsElasticBlockStore type: namedType: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource - name: azureDisk type: namedType: io.k8s.api.core.v1.AzureDiskVolumeSource - name: azureFile type: namedType: io.k8s.api.core.v1.AzureFilePersistentVolumeSource - name: capacity type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: cephfs type: namedType: io.k8s.api.core.v1.CephFSPersistentVolumeSource - name: cinder type: namedType: io.k8s.api.core.v1.CinderPersistentVolumeSource - name: claimRef type: namedType: io.k8s.api.core.v1.ObjectReference elementRelationship: separable - name: csi type: namedType: io.k8s.api.core.v1.CSIPersistentVolumeSource - name: fc type: namedType: io.k8s.api.core.v1.FCVolumeSource - name: flexVolume type: namedType: io.k8s.api.core.v1.FlexPersistentVolumeSource - name: flocker type: namedType: io.k8s.api.core.v1.FlockerVolumeSource - name: gcePersistentDisk type: namedType: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource - name: glusterfs type: namedType: io.k8s.api.core.v1.GlusterfsPersistentVolumeSource - name: hostPath type: namedType: io.k8s.api.core.v1.HostPathVolumeSource - name: iscsi type: namedType: io.k8s.api.core.v1.ISCSIPersistentVolumeSource - name: local type: namedType: io.k8s.api.core.v1.LocalVolumeSource - name: mountOptions type: list: elementType: scalar: string elementRelationship: atomic - name: nfs type: namedType: io.k8s.api.core.v1.NFSVolumeSource - name: nodeAffinity type: namedType: io.k8s.api.core.v1.VolumeNodeAffinity - name: persistentVolumeReclaimPolicy type: scalar: string - name: photonPersistentDisk type: namedType: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource - name: portworxVolume type: namedType: io.k8s.api.core.v1.PortworxVolumeSource - name: quobyte type: namedType: io.k8s.api.core.v1.QuobyteVolumeSource - name: rbd type: namedType: io.k8s.api.core.v1.RBDPersistentVolumeSource - name: scaleIO type: namedType: io.k8s.api.core.v1.ScaleIOPersistentVolumeSource - name: storageClassName type: scalar: string - name: storageos type: namedType: io.k8s.api.core.v1.StorageOSPersistentVolumeSource - name: volumeAttributesClassName type: scalar: string - name: volumeMode type: scalar: string - name: vsphereVolume type: namedType: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource - name: io.k8s.api.core.v1.PersistentVolumeStatus map: fields: - name: lastPhaseTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: phase type: scalar: string - name: reason type: scalar: string - name: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource map: fields: - name: fsType type: scalar: string - name: pdID type: scalar: string default: "" - name: io.k8s.api.core.v1.Pod map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.PodSpec default: {} - name: status type: namedType: io.k8s.api.core.v1.PodStatus default: {} - name: io.k8s.api.core.v1.PodAffinity map: fields: - name: preferredDuringSchedulingIgnoredDuringExecution type: list: elementType: namedType: io.k8s.api.core.v1.WeightedPodAffinityTerm elementRelationship: atomic - name: requiredDuringSchedulingIgnoredDuringExecution type: list: elementType: namedType: io.k8s.api.core.v1.PodAffinityTerm elementRelationship: atomic - name: io.k8s.api.core.v1.PodAffinityTerm map: fields: - name: labelSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: matchLabelKeys type: list: elementType: scalar: string elementRelationship: atomic - name: mismatchLabelKeys type: list: elementType: scalar: string elementRelationship: atomic - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: namespaces type: list: elementType: scalar: string elementRelationship: atomic - name: topologyKey type: scalar: string default: "" - name: io.k8s.api.core.v1.PodAntiAffinity map: fields: - name: preferredDuringSchedulingIgnoredDuringExecution type: list: elementType: namedType: io.k8s.api.core.v1.WeightedPodAffinityTerm elementRelationship: atomic - name: requiredDuringSchedulingIgnoredDuringExecution type: list: elementType: namedType: io.k8s.api.core.v1.PodAffinityTerm elementRelationship: atomic - name: io.k8s.api.core.v1.PodCondition map: fields: - name: lastProbeTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.core.v1.PodDNSConfig map: fields: - name: nameservers type: list: elementType: scalar: string elementRelationship: atomic - name: options type: list: elementType: namedType: io.k8s.api.core.v1.PodDNSConfigOption elementRelationship: atomic - name: searches type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.PodDNSConfigOption map: fields: - name: name type: scalar: string - name: value type: scalar: string - name: io.k8s.api.core.v1.PodIP map: fields: - name: ip type: scalar: string default: "" - name: io.k8s.api.core.v1.PodOS map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.core.v1.PodReadinessGate map: fields: - name: conditionType type: scalar: string default: "" - name: io.k8s.api.core.v1.PodResourceClaim map: fields: - name: name type: scalar: string default: "" - name: resourceClaimName type: scalar: string - name: resourceClaimTemplateName type: scalar: string - name: io.k8s.api.core.v1.PodResourceClaimStatus map: fields: - name: name type: scalar: string default: "" - name: resourceClaimName type: scalar: string - name: io.k8s.api.core.v1.PodSchedulingGate map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.core.v1.PodSecurityContext map: fields: - name: appArmorProfile type: namedType: io.k8s.api.core.v1.AppArmorProfile - name: fsGroup type: scalar: numeric - name: fsGroupChangePolicy type: scalar: string - name: runAsGroup type: scalar: numeric - name: runAsNonRoot type: scalar: boolean - name: runAsUser type: scalar: numeric - name: seLinuxOptions type: namedType: io.k8s.api.core.v1.SELinuxOptions - name: seccompProfile type: namedType: io.k8s.api.core.v1.SeccompProfile - name: supplementalGroups type: list: elementType: scalar: numeric elementRelationship: atomic - name: supplementalGroupsPolicy type: scalar: string - name: sysctls type: list: elementType: namedType: io.k8s.api.core.v1.Sysctl elementRelationship: atomic - name: windowsOptions type: namedType: io.k8s.api.core.v1.WindowsSecurityContextOptions - name: io.k8s.api.core.v1.PodSpec map: fields: - name: activeDeadlineSeconds type: scalar: numeric - name: affinity type: namedType: io.k8s.api.core.v1.Affinity - name: automountServiceAccountToken type: scalar: boolean - name: containers type: list: elementType: namedType: io.k8s.api.core.v1.Container elementRelationship: associative keys: - name - name: dnsConfig type: namedType: io.k8s.api.core.v1.PodDNSConfig - name: dnsPolicy type: scalar: string - name: enableServiceLinks type: scalar: boolean - name: ephemeralContainers type: list: elementType: namedType: io.k8s.api.core.v1.EphemeralContainer elementRelationship: associative keys: - name - name: hostAliases type: list: elementType: namedType: io.k8s.api.core.v1.HostAlias elementRelationship: associative keys: - ip - name: hostIPC type: scalar: boolean - name: hostNetwork type: scalar: boolean - name: hostPID type: scalar: boolean - name: hostUsers type: scalar: boolean - name: hostname type: scalar: string - name: imagePullSecrets type: list: elementType: namedType: io.k8s.api.core.v1.LocalObjectReference elementRelationship: associative keys: - name - name: initContainers type: list: elementType: namedType: io.k8s.api.core.v1.Container elementRelationship: associative keys: - name - name: nodeName type: scalar: string - name: nodeSelector type: map: elementType: scalar: string elementRelationship: atomic - name: os type: namedType: io.k8s.api.core.v1.PodOS - name: overhead type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: preemptionPolicy type: scalar: string - name: priority type: scalar: numeric - name: priorityClassName type: scalar: string - name: readinessGates type: list: elementType: namedType: io.k8s.api.core.v1.PodReadinessGate elementRelationship: atomic - name: resourceClaims type: list: elementType: namedType: io.k8s.api.core.v1.PodResourceClaim elementRelationship: associative keys: - name - name: restartPolicy type: scalar: string - name: runtimeClassName type: scalar: string - name: schedulerName type: scalar: string - name: schedulingGates type: list: elementType: namedType: io.k8s.api.core.v1.PodSchedulingGate elementRelationship: associative keys: - name - name: securityContext type: namedType: io.k8s.api.core.v1.PodSecurityContext - name: serviceAccount type: scalar: string - name: serviceAccountName type: scalar: string - name: setHostnameAsFQDN type: scalar: boolean - name: shareProcessNamespace type: scalar: boolean - name: subdomain type: scalar: string - name: terminationGracePeriodSeconds type: scalar: numeric - name: tolerations type: list: elementType: namedType: io.k8s.api.core.v1.Toleration elementRelationship: atomic - name: topologySpreadConstraints type: list: elementType: namedType: io.k8s.api.core.v1.TopologySpreadConstraint elementRelationship: associative keys: - topologyKey - whenUnsatisfiable - name: volumes type: list: elementType: namedType: io.k8s.api.core.v1.Volume elementRelationship: associative keys: - name - name: io.k8s.api.core.v1.PodStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.core.v1.PodCondition elementRelationship: associative keys: - type - name: containerStatuses type: list: elementType: namedType: io.k8s.api.core.v1.ContainerStatus elementRelationship: atomic - name: ephemeralContainerStatuses type: list: elementType: namedType: io.k8s.api.core.v1.ContainerStatus elementRelationship: atomic - name: hostIP type: scalar: string - name: hostIPs type: list: elementType: namedType: io.k8s.api.core.v1.HostIP elementRelationship: atomic - name: initContainerStatuses type: list: elementType: namedType: io.k8s.api.core.v1.ContainerStatus elementRelationship: atomic - name: message type: scalar: string - name: nominatedNodeName type: scalar: string - name: phase type: scalar: string - name: podIP type: scalar: string - name: podIPs type: list: elementType: namedType: io.k8s.api.core.v1.PodIP elementRelationship: associative keys: - ip - name: qosClass type: scalar: string - name: reason type: scalar: string - name: resize type: scalar: string - name: resourceClaimStatuses type: list: elementType: namedType: io.k8s.api.core.v1.PodResourceClaimStatus elementRelationship: associative keys: - name - name: startTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.core.v1.PodTemplate map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: io.k8s.api.core.v1.PodTemplateSpec map: fields: - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.PodSpec default: {} - name: io.k8s.api.core.v1.PortStatus map: fields: - name: error type: scalar: string - name: port type: scalar: numeric default: 0 - name: protocol type: scalar: string default: "" - name: io.k8s.api.core.v1.PortworxVolumeSource map: fields: - name: fsType type: scalar: string - name: readOnly type: scalar: boolean - name: volumeID type: scalar: string default: "" - name: io.k8s.api.core.v1.PreferredSchedulingTerm map: fields: - name: preference type: namedType: io.k8s.api.core.v1.NodeSelectorTerm default: {} - name: weight type: scalar: numeric default: 0 - name: io.k8s.api.core.v1.Probe map: fields: - name: exec type: namedType: io.k8s.api.core.v1.ExecAction - name: failureThreshold type: scalar: numeric - name: grpc type: namedType: io.k8s.api.core.v1.GRPCAction - name: httpGet type: namedType: io.k8s.api.core.v1.HTTPGetAction - name: initialDelaySeconds type: scalar: numeric - name: periodSeconds type: scalar: numeric - name: successThreshold type: scalar: numeric - name: tcpSocket type: namedType: io.k8s.api.core.v1.TCPSocketAction - name: terminationGracePeriodSeconds type: scalar: numeric - name: timeoutSeconds type: scalar: numeric - name: io.k8s.api.core.v1.ProjectedVolumeSource map: fields: - name: defaultMode type: scalar: numeric - name: sources type: list: elementType: namedType: io.k8s.api.core.v1.VolumeProjection elementRelationship: atomic - name: io.k8s.api.core.v1.QuobyteVolumeSource map: fields: - name: group type: scalar: string - name: readOnly type: scalar: boolean - name: registry type: scalar: string default: "" - name: tenant type: scalar: string - name: user type: scalar: string - name: volume type: scalar: string default: "" - name: io.k8s.api.core.v1.RBDPersistentVolumeSource map: fields: - name: fsType type: scalar: string - name: image type: scalar: string default: "" - name: keyring type: scalar: string default: /etc/ceph/keyring - name: monitors type: list: elementType: scalar: string elementRelationship: atomic - name: pool type: scalar: string default: rbd - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: user type: scalar: string default: admin - name: io.k8s.api.core.v1.RBDVolumeSource map: fields: - name: fsType type: scalar: string - name: image type: scalar: string default: "" - name: keyring type: scalar: string default: /etc/ceph/keyring - name: monitors type: list: elementType: scalar: string elementRelationship: atomic - name: pool type: scalar: string default: rbd - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.LocalObjectReference - name: user type: scalar: string default: admin - name: io.k8s.api.core.v1.ReplicationController map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.ReplicationControllerSpec default: {} - name: status type: namedType: io.k8s.api.core.v1.ReplicationControllerStatus default: {} - name: io.k8s.api.core.v1.ReplicationControllerCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.core.v1.ReplicationControllerSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: replicas type: scalar: numeric - name: selector type: map: elementType: scalar: string elementRelationship: atomic - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec - name: io.k8s.api.core.v1.ReplicationControllerStatus map: fields: - name: availableReplicas type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.core.v1.ReplicationControllerCondition elementRelationship: associative keys: - type - name: fullyLabeledReplicas type: scalar: numeric - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric default: 0 - name: io.k8s.api.core.v1.ResourceClaim map: fields: - name: name type: scalar: string default: "" - name: request type: scalar: string - name: io.k8s.api.core.v1.ResourceFieldSelector map: fields: - name: containerName type: scalar: string - name: divisor type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: resource type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.api.core.v1.ResourceHealth map: fields: - name: health type: scalar: string - name: resourceID type: scalar: string default: "" - name: io.k8s.api.core.v1.ResourceQuota map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.ResourceQuotaSpec default: {} - name: status type: namedType: io.k8s.api.core.v1.ResourceQuotaStatus default: {} - name: io.k8s.api.core.v1.ResourceQuotaSpec map: fields: - name: hard type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: scopeSelector type: namedType: io.k8s.api.core.v1.ScopeSelector - name: scopes type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.ResourceQuotaStatus map: fields: - name: hard type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: used type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.ResourceRequirements map: fields: - name: claims type: list: elementType: namedType: io.k8s.api.core.v1.ResourceClaim elementRelationship: associative keys: - name - name: limits type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: requests type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.ResourceStatus map: fields: - name: name type: scalar: string default: "" - name: resources type: list: elementType: namedType: io.k8s.api.core.v1.ResourceHealth elementRelationship: associative keys: - resourceID - name: io.k8s.api.core.v1.SELinuxOptions map: fields: - name: level type: scalar: string - name: role type: scalar: string - name: type type: scalar: string - name: user type: scalar: string - name: io.k8s.api.core.v1.ScaleIOPersistentVolumeSource map: fields: - name: fsType type: scalar: string default: xfs - name: gateway type: scalar: string default: "" - name: protectionDomain type: scalar: string - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.SecretReference - name: sslEnabled type: scalar: boolean - name: storageMode type: scalar: string default: ThinProvisioned - name: storagePool type: scalar: string - name: system type: scalar: string default: "" - name: volumeName type: scalar: string - name: io.k8s.api.core.v1.ScaleIOVolumeSource map: fields: - name: fsType type: scalar: string default: xfs - name: gateway type: scalar: string default: "" - name: protectionDomain type: scalar: string - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.LocalObjectReference - name: sslEnabled type: scalar: boolean - name: storageMode type: scalar: string default: ThinProvisioned - name: storagePool type: scalar: string - name: system type: scalar: string default: "" - name: volumeName type: scalar: string - name: io.k8s.api.core.v1.ScopeSelector map: fields: - name: matchExpressions type: list: elementType: namedType: io.k8s.api.core.v1.ScopedResourceSelectorRequirement elementRelationship: atomic elementRelationship: atomic - name: io.k8s.api.core.v1.ScopedResourceSelectorRequirement map: fields: - name: operator type: scalar: string default: "" - name: scopeName type: scalar: string default: "" - name: values type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.SeccompProfile map: fields: - name: localhostProfile type: scalar: string - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: localhostProfile discriminatorValue: LocalhostProfile - name: io.k8s.api.core.v1.Secret map: fields: - name: apiVersion type: scalar: string - name: data type: map: elementType: scalar: string - name: immutable type: scalar: boolean - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: stringData type: map: elementType: scalar: string - name: type type: scalar: string - name: io.k8s.api.core.v1.SecretEnvSource map: fields: - name: name type: scalar: string default: "" - name: optional type: scalar: boolean - name: io.k8s.api.core.v1.SecretKeySelector map: fields: - name: key type: scalar: string default: "" - name: name type: scalar: string default: "" - name: optional type: scalar: boolean elementRelationship: atomic - name: io.k8s.api.core.v1.SecretProjection map: fields: - name: items type: list: elementType: namedType: io.k8s.api.core.v1.KeyToPath elementRelationship: atomic - name: name type: scalar: string default: "" - name: optional type: scalar: boolean - name: io.k8s.api.core.v1.SecretReference map: fields: - name: name type: scalar: string - name: namespace type: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.SecretVolumeSource map: fields: - name: defaultMode type: scalar: numeric - name: items type: list: elementType: namedType: io.k8s.api.core.v1.KeyToPath elementRelationship: atomic - name: optional type: scalar: boolean - name: secretName type: scalar: string - name: io.k8s.api.core.v1.SecurityContext map: fields: - name: allowPrivilegeEscalation type: scalar: boolean - name: appArmorProfile type: namedType: io.k8s.api.core.v1.AppArmorProfile - name: capabilities type: namedType: io.k8s.api.core.v1.Capabilities - name: privileged type: scalar: boolean - name: procMount type: scalar: string - name: readOnlyRootFilesystem type: scalar: boolean - name: runAsGroup type: scalar: numeric - name: runAsNonRoot type: scalar: boolean - name: runAsUser type: scalar: numeric - name: seLinuxOptions type: namedType: io.k8s.api.core.v1.SELinuxOptions - name: seccompProfile type: namedType: io.k8s.api.core.v1.SeccompProfile - name: windowsOptions type: namedType: io.k8s.api.core.v1.WindowsSecurityContextOptions - name: io.k8s.api.core.v1.Service map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.core.v1.ServiceSpec default: {} - name: status type: namedType: io.k8s.api.core.v1.ServiceStatus default: {} - name: io.k8s.api.core.v1.ServiceAccount map: fields: - name: apiVersion type: scalar: string - name: automountServiceAccountToken type: scalar: boolean - name: imagePullSecrets type: list: elementType: namedType: io.k8s.api.core.v1.LocalObjectReference elementRelationship: atomic - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: secrets type: list: elementType: namedType: io.k8s.api.core.v1.ObjectReference elementRelationship: associative keys: - name - name: io.k8s.api.core.v1.ServiceAccountTokenProjection map: fields: - name: audience type: scalar: string - name: expirationSeconds type: scalar: numeric - name: path type: scalar: string default: "" - name: io.k8s.api.core.v1.ServicePort map: fields: - name: appProtocol type: scalar: string - name: name type: scalar: string - name: nodePort type: scalar: numeric - name: port type: scalar: numeric default: 0 - name: protocol type: scalar: string default: TCP - name: targetPort type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.core.v1.ServiceSpec map: fields: - name: allocateLoadBalancerNodePorts type: scalar: boolean - name: clusterIP type: scalar: string - name: clusterIPs type: list: elementType: scalar: string elementRelationship: atomic - name: externalIPs type: list: elementType: scalar: string elementRelationship: atomic - name: externalName type: scalar: string - name: externalTrafficPolicy type: scalar: string - name: healthCheckNodePort type: scalar: numeric - name: internalTrafficPolicy type: scalar: string - name: ipFamilies type: list: elementType: scalar: string elementRelationship: atomic - name: ipFamilyPolicy type: scalar: string - name: loadBalancerClass type: scalar: string - name: loadBalancerIP type: scalar: string - name: loadBalancerSourceRanges type: list: elementType: scalar: string elementRelationship: atomic - name: ports type: list: elementType: namedType: io.k8s.api.core.v1.ServicePort elementRelationship: associative keys: - port - protocol - name: publishNotReadyAddresses type: scalar: boolean - name: selector type: map: elementType: scalar: string elementRelationship: atomic - name: sessionAffinity type: scalar: string - name: sessionAffinityConfig type: namedType: io.k8s.api.core.v1.SessionAffinityConfig - name: trafficDistribution type: scalar: string - name: type type: scalar: string - name: io.k8s.api.core.v1.ServiceStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition elementRelationship: associative keys: - type - name: loadBalancer type: namedType: io.k8s.api.core.v1.LoadBalancerStatus default: {} - name: io.k8s.api.core.v1.SessionAffinityConfig map: fields: - name: clientIP type: namedType: io.k8s.api.core.v1.ClientIPConfig - name: io.k8s.api.core.v1.SleepAction map: fields: - name: seconds type: scalar: numeric default: 0 - name: io.k8s.api.core.v1.StorageOSPersistentVolumeSource map: fields: - name: fsType type: scalar: string - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.ObjectReference - name: volumeName type: scalar: string - name: volumeNamespace type: scalar: string - name: io.k8s.api.core.v1.StorageOSVolumeSource map: fields: - name: fsType type: scalar: string - name: readOnly type: scalar: boolean - name: secretRef type: namedType: io.k8s.api.core.v1.LocalObjectReference - name: volumeName type: scalar: string - name: volumeNamespace type: scalar: string - name: io.k8s.api.core.v1.Sysctl map: fields: - name: name type: scalar: string default: "" - name: value type: scalar: string default: "" - name: io.k8s.api.core.v1.TCPSocketAction map: fields: - name: host type: scalar: string - name: port type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.core.v1.Taint map: fields: - name: effect type: scalar: string default: "" - name: key type: scalar: string default: "" - name: timeAdded type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: value type: scalar: string - name: io.k8s.api.core.v1.Toleration map: fields: - name: effect type: scalar: string - name: key type: scalar: string - name: operator type: scalar: string - name: tolerationSeconds type: scalar: numeric - name: value type: scalar: string - name: io.k8s.api.core.v1.TopologySelectorLabelRequirement map: fields: - name: key type: scalar: string default: "" - name: values type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.core.v1.TopologySelectorTerm map: fields: - name: matchLabelExpressions type: list: elementType: namedType: io.k8s.api.core.v1.TopologySelectorLabelRequirement elementRelationship: atomic elementRelationship: atomic - name: io.k8s.api.core.v1.TopologySpreadConstraint map: fields: - name: labelSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: matchLabelKeys type: list: elementType: scalar: string elementRelationship: atomic - name: maxSkew type: scalar: numeric default: 0 - name: minDomains type: scalar: numeric - name: nodeAffinityPolicy type: scalar: string - name: nodeTaintsPolicy type: scalar: string - name: topologyKey type: scalar: string default: "" - name: whenUnsatisfiable type: scalar: string default: "" - name: io.k8s.api.core.v1.TypedLocalObjectReference map: fields: - name: apiGroup type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.api.core.v1.TypedObjectReference map: fields: - name: apiGroup type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: namespace type: scalar: string - name: io.k8s.api.core.v1.Volume map: fields: - name: awsElasticBlockStore type: namedType: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource - name: azureDisk type: namedType: io.k8s.api.core.v1.AzureDiskVolumeSource - name: azureFile type: namedType: io.k8s.api.core.v1.AzureFileVolumeSource - name: cephfs type: namedType: io.k8s.api.core.v1.CephFSVolumeSource - name: cinder type: namedType: io.k8s.api.core.v1.CinderVolumeSource - name: configMap type: namedType: io.k8s.api.core.v1.ConfigMapVolumeSource - name: csi type: namedType: io.k8s.api.core.v1.CSIVolumeSource - name: downwardAPI type: namedType: io.k8s.api.core.v1.DownwardAPIVolumeSource - name: emptyDir type: namedType: io.k8s.api.core.v1.EmptyDirVolumeSource - name: ephemeral type: namedType: io.k8s.api.core.v1.EphemeralVolumeSource - name: fc type: namedType: io.k8s.api.core.v1.FCVolumeSource - name: flexVolume type: namedType: io.k8s.api.core.v1.FlexVolumeSource - name: flocker type: namedType: io.k8s.api.core.v1.FlockerVolumeSource - name: gcePersistentDisk type: namedType: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource - name: gitRepo type: namedType: io.k8s.api.core.v1.GitRepoVolumeSource - name: glusterfs type: namedType: io.k8s.api.core.v1.GlusterfsVolumeSource - name: hostPath type: namedType: io.k8s.api.core.v1.HostPathVolumeSource - name: image type: namedType: io.k8s.api.core.v1.ImageVolumeSource - name: iscsi type: namedType: io.k8s.api.core.v1.ISCSIVolumeSource - name: name type: scalar: string default: "" - name: nfs type: namedType: io.k8s.api.core.v1.NFSVolumeSource - name: persistentVolumeClaim type: namedType: io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource - name: photonPersistentDisk type: namedType: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource - name: portworxVolume type: namedType: io.k8s.api.core.v1.PortworxVolumeSource - name: projected type: namedType: io.k8s.api.core.v1.ProjectedVolumeSource - name: quobyte type: namedType: io.k8s.api.core.v1.QuobyteVolumeSource - name: rbd type: namedType: io.k8s.api.core.v1.RBDVolumeSource - name: scaleIO type: namedType: io.k8s.api.core.v1.ScaleIOVolumeSource - name: secret type: namedType: io.k8s.api.core.v1.SecretVolumeSource - name: storageos type: namedType: io.k8s.api.core.v1.StorageOSVolumeSource - name: vsphereVolume type: namedType: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource - name: io.k8s.api.core.v1.VolumeDevice map: fields: - name: devicePath type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.core.v1.VolumeMount map: fields: - name: mountPath type: scalar: string default: "" - name: mountPropagation type: scalar: string - name: name type: scalar: string default: "" - name: readOnly type: scalar: boolean - name: recursiveReadOnly type: scalar: string - name: subPath type: scalar: string - name: subPathExpr type: scalar: string - name: io.k8s.api.core.v1.VolumeMountStatus map: fields: - name: mountPath type: scalar: string default: "" - name: name type: scalar: string default: "" - name: readOnly type: scalar: boolean - name: recursiveReadOnly type: scalar: string - name: io.k8s.api.core.v1.VolumeNodeAffinity map: fields: - name: required type: namedType: io.k8s.api.core.v1.NodeSelector - name: io.k8s.api.core.v1.VolumeProjection map: fields: - name: clusterTrustBundle type: namedType: io.k8s.api.core.v1.ClusterTrustBundleProjection - name: configMap type: namedType: io.k8s.api.core.v1.ConfigMapProjection - name: downwardAPI type: namedType: io.k8s.api.core.v1.DownwardAPIProjection - name: secret type: namedType: io.k8s.api.core.v1.SecretProjection - name: serviceAccountToken type: namedType: io.k8s.api.core.v1.ServiceAccountTokenProjection - name: io.k8s.api.core.v1.VolumeResourceRequirements map: fields: - name: limits type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: requests type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource map: fields: - name: fsType type: scalar: string - name: storagePolicyID type: scalar: string - name: storagePolicyName type: scalar: string - name: volumePath type: scalar: string default: "" - name: io.k8s.api.core.v1.WeightedPodAffinityTerm map: fields: - name: podAffinityTerm type: namedType: io.k8s.api.core.v1.PodAffinityTerm default: {} - name: weight type: scalar: numeric default: 0 - name: io.k8s.api.core.v1.WindowsSecurityContextOptions map: fields: - name: gmsaCredentialSpec type: scalar: string - name: gmsaCredentialSpecName type: scalar: string - name: hostProcess type: scalar: boolean - name: runAsUserName type: scalar: string - name: io.k8s.api.discovery.v1.Endpoint map: fields: - name: addresses type: list: elementType: scalar: string elementRelationship: associative - name: conditions type: namedType: io.k8s.api.discovery.v1.EndpointConditions default: {} - name: deprecatedTopology type: map: elementType: scalar: string - name: hints type: namedType: io.k8s.api.discovery.v1.EndpointHints - name: hostname type: scalar: string - name: nodeName type: scalar: string - name: targetRef type: namedType: io.k8s.api.core.v1.ObjectReference - name: zone type: scalar: string - name: io.k8s.api.discovery.v1.EndpointConditions map: fields: - name: ready type: scalar: boolean - name: serving type: scalar: boolean - name: terminating type: scalar: boolean - name: io.k8s.api.discovery.v1.EndpointHints map: fields: - name: forZones type: list: elementType: namedType: io.k8s.api.discovery.v1.ForZone elementRelationship: atomic - name: io.k8s.api.discovery.v1.EndpointPort map: fields: - name: appProtocol type: scalar: string - name: name type: scalar: string - name: port type: scalar: numeric - name: protocol type: scalar: string elementRelationship: atomic - name: io.k8s.api.discovery.v1.EndpointSlice map: fields: - name: addressType type: scalar: string default: "" - name: apiVersion type: scalar: string - name: endpoints type: list: elementType: namedType: io.k8s.api.discovery.v1.Endpoint elementRelationship: atomic - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: ports type: list: elementType: namedType: io.k8s.api.discovery.v1.EndpointPort elementRelationship: atomic - name: io.k8s.api.discovery.v1.ForZone map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.discovery.v1beta1.Endpoint map: fields: - name: addresses type: list: elementType: scalar: string elementRelationship: associative - name: conditions type: namedType: io.k8s.api.discovery.v1beta1.EndpointConditions default: {} - name: hints type: namedType: io.k8s.api.discovery.v1beta1.EndpointHints - name: hostname type: scalar: string - name: nodeName type: scalar: string - name: targetRef type: namedType: io.k8s.api.core.v1.ObjectReference - name: topology type: map: elementType: scalar: string - name: io.k8s.api.discovery.v1beta1.EndpointConditions map: fields: - name: ready type: scalar: boolean - name: serving type: scalar: boolean - name: terminating type: scalar: boolean - name: io.k8s.api.discovery.v1beta1.EndpointHints map: fields: - name: forZones type: list: elementType: namedType: io.k8s.api.discovery.v1beta1.ForZone elementRelationship: atomic - name: io.k8s.api.discovery.v1beta1.EndpointPort map: fields: - name: appProtocol type: scalar: string - name: name type: scalar: string - name: port type: scalar: numeric - name: protocol type: scalar: string - name: io.k8s.api.discovery.v1beta1.EndpointSlice map: fields: - name: addressType type: scalar: string default: "" - name: apiVersion type: scalar: string - name: endpoints type: list: elementType: namedType: io.k8s.api.discovery.v1beta1.Endpoint elementRelationship: atomic - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: ports type: list: elementType: namedType: io.k8s.api.discovery.v1beta1.EndpointPort elementRelationship: atomic - name: io.k8s.api.discovery.v1beta1.ForZone map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.events.v1.Event map: fields: - name: action type: scalar: string - name: apiVersion type: scalar: string - name: deprecatedCount type: scalar: numeric - name: deprecatedFirstTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: deprecatedLastTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: deprecatedSource type: namedType: io.k8s.api.core.v1.EventSource default: {} - name: eventTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: note type: scalar: string - name: reason type: scalar: string - name: regarding type: namedType: io.k8s.api.core.v1.ObjectReference default: {} - name: related type: namedType: io.k8s.api.core.v1.ObjectReference - name: reportingController type: scalar: string - name: reportingInstance type: scalar: string - name: series type: namedType: io.k8s.api.events.v1.EventSeries - name: type type: scalar: string - name: io.k8s.api.events.v1.EventSeries map: fields: - name: count type: scalar: numeric default: 0 - name: lastObservedTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: io.k8s.api.events.v1beta1.Event map: fields: - name: action type: scalar: string - name: apiVersion type: scalar: string - name: deprecatedCount type: scalar: numeric - name: deprecatedFirstTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: deprecatedLastTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: deprecatedSource type: namedType: io.k8s.api.core.v1.EventSource default: {} - name: eventTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: note type: scalar: string - name: reason type: scalar: string - name: regarding type: namedType: io.k8s.api.core.v1.ObjectReference default: {} - name: related type: namedType: io.k8s.api.core.v1.ObjectReference - name: reportingController type: scalar: string - name: reportingInstance type: scalar: string - name: series type: namedType: io.k8s.api.events.v1beta1.EventSeries - name: type type: scalar: string - name: io.k8s.api.events.v1beta1.EventSeries map: fields: - name: count type: scalar: numeric default: 0 - name: lastObservedTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime - name: io.k8s.api.extensions.v1beta1.DaemonSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.extensions.v1beta1.DaemonSetSpec default: {} - name: status type: namedType: io.k8s.api.extensions.v1beta1.DaemonSetStatus default: {} - name: io.k8s.api.extensions.v1beta1.DaemonSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.extensions.v1beta1.DaemonSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: templateGeneration type: scalar: numeric - name: updateStrategy type: namedType: io.k8s.api.extensions.v1beta1.DaemonSetUpdateStrategy default: {} - name: io.k8s.api.extensions.v1beta1.DaemonSetStatus map: fields: - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.DaemonSetCondition elementRelationship: associative keys: - type - name: currentNumberScheduled type: scalar: numeric default: 0 - name: desiredNumberScheduled type: scalar: numeric default: 0 - name: numberAvailable type: scalar: numeric - name: numberMisscheduled type: scalar: numeric default: 0 - name: numberReady type: scalar: numeric default: 0 - name: numberUnavailable type: scalar: numeric - name: observedGeneration type: scalar: numeric - name: updatedNumberScheduled type: scalar: numeric - name: io.k8s.api.extensions.v1beta1.DaemonSetUpdateStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.extensions.v1beta1.RollingUpdateDaemonSet - name: type type: scalar: string - name: io.k8s.api.extensions.v1beta1.Deployment map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.extensions.v1beta1.DeploymentSpec default: {} - name: status type: namedType: io.k8s.api.extensions.v1beta1.DeploymentStatus default: {} - name: io.k8s.api.extensions.v1beta1.DeploymentCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.extensions.v1beta1.DeploymentSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: paused type: scalar: boolean - name: progressDeadlineSeconds type: scalar: numeric - name: replicas type: scalar: numeric - name: revisionHistoryLimit type: scalar: numeric - name: rollbackTo type: namedType: io.k8s.api.extensions.v1beta1.RollbackConfig - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: strategy type: namedType: io.k8s.api.extensions.v1beta1.DeploymentStrategy default: {} - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: io.k8s.api.extensions.v1beta1.DeploymentStatus map: fields: - name: availableReplicas type: scalar: numeric - name: collisionCount type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.DeploymentCondition elementRelationship: associative keys: - type - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric - name: unavailableReplicas type: scalar: numeric - name: updatedReplicas type: scalar: numeric - name: io.k8s.api.extensions.v1beta1.DeploymentStrategy map: fields: - name: rollingUpdate type: namedType: io.k8s.api.extensions.v1beta1.RollingUpdateDeployment - name: type type: scalar: string - name: io.k8s.api.extensions.v1beta1.HTTPIngressPath map: fields: - name: backend type: namedType: io.k8s.api.extensions.v1beta1.IngressBackend default: {} - name: path type: scalar: string - name: pathType type: scalar: string - name: io.k8s.api.extensions.v1beta1.HTTPIngressRuleValue map: fields: - name: paths type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.HTTPIngressPath elementRelationship: atomic - name: io.k8s.api.extensions.v1beta1.IPBlock map: fields: - name: cidr type: scalar: string default: "" - name: except type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.extensions.v1beta1.Ingress map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.extensions.v1beta1.IngressSpec default: {} - name: status type: namedType: io.k8s.api.extensions.v1beta1.IngressStatus default: {} - name: io.k8s.api.extensions.v1beta1.IngressBackend map: fields: - name: resource type: namedType: io.k8s.api.core.v1.TypedLocalObjectReference - name: serviceName type: scalar: string - name: servicePort type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.extensions.v1beta1.IngressLoadBalancerIngress map: fields: - name: hostname type: scalar: string - name: ip type: scalar: string - name: ports type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.IngressPortStatus elementRelationship: atomic - name: io.k8s.api.extensions.v1beta1.IngressLoadBalancerStatus map: fields: - name: ingress type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.IngressLoadBalancerIngress elementRelationship: atomic - name: io.k8s.api.extensions.v1beta1.IngressPortStatus map: fields: - name: error type: scalar: string - name: port type: scalar: numeric default: 0 - name: protocol type: scalar: string default: "" - name: io.k8s.api.extensions.v1beta1.IngressRule map: fields: - name: host type: scalar: string - name: http type: namedType: io.k8s.api.extensions.v1beta1.HTTPIngressRuleValue - name: io.k8s.api.extensions.v1beta1.IngressSpec map: fields: - name: backend type: namedType: io.k8s.api.extensions.v1beta1.IngressBackend - name: ingressClassName type: scalar: string - name: rules type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.IngressRule elementRelationship: atomic - name: tls type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.IngressTLS elementRelationship: atomic - name: io.k8s.api.extensions.v1beta1.IngressStatus map: fields: - name: loadBalancer type: namedType: io.k8s.api.extensions.v1beta1.IngressLoadBalancerStatus default: {} - name: io.k8s.api.extensions.v1beta1.IngressTLS map: fields: - name: hosts type: list: elementType: scalar: string elementRelationship: atomic - name: secretName type: scalar: string - name: io.k8s.api.extensions.v1beta1.NetworkPolicy map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.extensions.v1beta1.NetworkPolicySpec default: {} - name: io.k8s.api.extensions.v1beta1.NetworkPolicyEgressRule map: fields: - name: ports type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyPort elementRelationship: atomic - name: to type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyPeer elementRelationship: atomic - name: io.k8s.api.extensions.v1beta1.NetworkPolicyIngressRule map: fields: - name: from type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyPeer elementRelationship: atomic - name: ports type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyPort elementRelationship: atomic - name: io.k8s.api.extensions.v1beta1.NetworkPolicyPeer map: fields: - name: ipBlock type: namedType: io.k8s.api.extensions.v1beta1.IPBlock - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: podSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: io.k8s.api.extensions.v1beta1.NetworkPolicyPort map: fields: - name: endPort type: scalar: numeric - name: port type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: protocol type: scalar: string - name: io.k8s.api.extensions.v1beta1.NetworkPolicySpec map: fields: - name: egress type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyEgressRule elementRelationship: atomic - name: ingress type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.NetworkPolicyIngressRule elementRelationship: atomic - name: podSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector default: {} - name: policyTypes type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.extensions.v1beta1.ReplicaSet map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.extensions.v1beta1.ReplicaSetSpec default: {} - name: status type: namedType: io.k8s.api.extensions.v1beta1.ReplicaSetStatus default: {} - name: io.k8s.api.extensions.v1beta1.ReplicaSetCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.extensions.v1beta1.ReplicaSetSpec map: fields: - name: minReadySeconds type: scalar: numeric - name: replicas type: scalar: numeric - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: template type: namedType: io.k8s.api.core.v1.PodTemplateSpec default: {} - name: io.k8s.api.extensions.v1beta1.ReplicaSetStatus map: fields: - name: availableReplicas type: scalar: numeric - name: conditions type: list: elementType: namedType: io.k8s.api.extensions.v1beta1.ReplicaSetCondition elementRelationship: associative keys: - type - name: fullyLabeledReplicas type: scalar: numeric - name: observedGeneration type: scalar: numeric - name: readyReplicas type: scalar: numeric - name: replicas type: scalar: numeric default: 0 - name: io.k8s.api.extensions.v1beta1.RollbackConfig map: fields: - name: revision type: scalar: numeric - name: io.k8s.api.extensions.v1beta1.RollingUpdateDaemonSet map: fields: - name: maxSurge type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.extensions.v1beta1.RollingUpdateDeployment map: fields: - name: maxSurge type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.flowcontrol.v1.ExemptPriorityLevelConfiguration map: fields: - name: lendablePercent type: scalar: numeric - name: nominalConcurrencyShares type: scalar: numeric - name: io.k8s.api.flowcontrol.v1.FlowDistinguisherMethod map: fields: - name: type type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1.FlowSchema map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.flowcontrol.v1.FlowSchemaSpec default: {} - name: status type: namedType: io.k8s.api.flowcontrol.v1.FlowSchemaStatus default: {} - name: io.k8s.api.flowcontrol.v1.FlowSchemaCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string - name: type type: scalar: string - name: io.k8s.api.flowcontrol.v1.FlowSchemaSpec map: fields: - name: distinguisherMethod type: namedType: io.k8s.api.flowcontrol.v1.FlowDistinguisherMethod - name: matchingPrecedence type: scalar: numeric default: 0 - name: priorityLevelConfiguration type: namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationReference default: {} - name: rules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1.PolicyRulesWithSubjects elementRelationship: atomic - name: io.k8s.api.flowcontrol.v1.FlowSchemaStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.flowcontrol.v1.FlowSchemaCondition elementRelationship: associative keys: - type - name: io.k8s.api.flowcontrol.v1.GroupSubject map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1.LimitResponse map: fields: - name: queuing type: namedType: io.k8s.api.flowcontrol.v1.QueuingConfiguration - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: queuing discriminatorValue: Queuing - name: io.k8s.api.flowcontrol.v1.LimitedPriorityLevelConfiguration map: fields: - name: borrowingLimitPercent type: scalar: numeric - name: lendablePercent type: scalar: numeric - name: limitResponse type: namedType: io.k8s.api.flowcontrol.v1.LimitResponse default: {} - name: nominalConcurrencyShares type: scalar: numeric - name: io.k8s.api.flowcontrol.v1.NonResourcePolicyRule map: fields: - name: nonResourceURLs type: list: elementType: scalar: string elementRelationship: associative - name: verbs type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.flowcontrol.v1.PolicyRulesWithSubjects map: fields: - name: nonResourceRules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1.NonResourcePolicyRule elementRelationship: atomic - name: resourceRules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1.ResourcePolicyRule elementRelationship: atomic - name: subjects type: list: elementType: namedType: io.k8s.api.flowcontrol.v1.Subject elementRelationship: atomic - name: io.k8s.api.flowcontrol.v1.PriorityLevelConfiguration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationSpec default: {} - name: status type: namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationStatus default: {} - name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string - name: type type: scalar: string - name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationReference map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationSpec map: fields: - name: exempt type: namedType: io.k8s.api.flowcontrol.v1.ExemptPriorityLevelConfiguration - name: limited type: namedType: io.k8s.api.flowcontrol.v1.LimitedPriorityLevelConfiguration - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: exempt discriminatorValue: Exempt - fieldName: limited discriminatorValue: Limited - name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationCondition elementRelationship: associative keys: - type - name: io.k8s.api.flowcontrol.v1.QueuingConfiguration map: fields: - name: handSize type: scalar: numeric default: 0 - name: queueLengthLimit type: scalar: numeric default: 0 - name: queues type: scalar: numeric default: 0 - name: io.k8s.api.flowcontrol.v1.ResourcePolicyRule map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: associative - name: clusterScope type: scalar: boolean - name: namespaces type: list: elementType: scalar: string elementRelationship: associative - name: resources type: list: elementType: scalar: string elementRelationship: associative - name: verbs type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.flowcontrol.v1.ServiceAccountSubject map: fields: - name: name type: scalar: string default: "" - name: namespace type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1.Subject map: fields: - name: group type: namedType: io.k8s.api.flowcontrol.v1.GroupSubject - name: kind type: scalar: string default: "" - name: serviceAccount type: namedType: io.k8s.api.flowcontrol.v1.ServiceAccountSubject - name: user type: namedType: io.k8s.api.flowcontrol.v1.UserSubject unions: - discriminator: kind fields: - fieldName: group discriminatorValue: Group - fieldName: serviceAccount discriminatorValue: ServiceAccount - fieldName: user discriminatorValue: User - name: io.k8s.api.flowcontrol.v1.UserSubject map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta1.ExemptPriorityLevelConfiguration map: fields: - name: lendablePercent type: scalar: numeric - name: nominalConcurrencyShares type: scalar: numeric - name: io.k8s.api.flowcontrol.v1beta1.FlowDistinguisherMethod map: fields: - name: type type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta1.FlowSchema map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.flowcontrol.v1beta1.FlowSchemaSpec default: {} - name: status type: namedType: io.k8s.api.flowcontrol.v1beta1.FlowSchemaStatus default: {} - name: io.k8s.api.flowcontrol.v1beta1.FlowSchemaCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string - name: type type: scalar: string - name: io.k8s.api.flowcontrol.v1beta1.FlowSchemaSpec map: fields: - name: distinguisherMethod type: namedType: io.k8s.api.flowcontrol.v1beta1.FlowDistinguisherMethod - name: matchingPrecedence type: scalar: numeric default: 0 - name: priorityLevelConfiguration type: namedType: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationReference default: {} - name: rules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta1.PolicyRulesWithSubjects elementRelationship: atomic - name: io.k8s.api.flowcontrol.v1beta1.FlowSchemaStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta1.FlowSchemaCondition elementRelationship: associative keys: - type - name: io.k8s.api.flowcontrol.v1beta1.GroupSubject map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta1.LimitResponse map: fields: - name: queuing type: namedType: io.k8s.api.flowcontrol.v1beta1.QueuingConfiguration - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: queuing discriminatorValue: Queuing - name: io.k8s.api.flowcontrol.v1beta1.LimitedPriorityLevelConfiguration map: fields: - name: assuredConcurrencyShares type: scalar: numeric default: 0 - name: borrowingLimitPercent type: scalar: numeric - name: lendablePercent type: scalar: numeric - name: limitResponse type: namedType: io.k8s.api.flowcontrol.v1beta1.LimitResponse default: {} - name: io.k8s.api.flowcontrol.v1beta1.NonResourcePolicyRule map: fields: - name: nonResourceURLs type: list: elementType: scalar: string elementRelationship: associative - name: verbs type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.flowcontrol.v1beta1.PolicyRulesWithSubjects map: fields: - name: nonResourceRules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta1.NonResourcePolicyRule elementRelationship: atomic - name: resourceRules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta1.ResourcePolicyRule elementRelationship: atomic - name: subjects type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta1.Subject elementRelationship: atomic - name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfiguration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationSpec default: {} - name: status type: namedType: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationStatus default: {} - name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string - name: type type: scalar: string - name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationReference map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationSpec map: fields: - name: exempt type: namedType: io.k8s.api.flowcontrol.v1beta1.ExemptPriorityLevelConfiguration - name: limited type: namedType: io.k8s.api.flowcontrol.v1beta1.LimitedPriorityLevelConfiguration - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: exempt discriminatorValue: Exempt - fieldName: limited discriminatorValue: Limited - name: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta1.PriorityLevelConfigurationCondition elementRelationship: associative keys: - type - name: io.k8s.api.flowcontrol.v1beta1.QueuingConfiguration map: fields: - name: handSize type: scalar: numeric default: 0 - name: queueLengthLimit type: scalar: numeric default: 0 - name: queues type: scalar: numeric default: 0 - name: io.k8s.api.flowcontrol.v1beta1.ResourcePolicyRule map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: associative - name: clusterScope type: scalar: boolean - name: namespaces type: list: elementType: scalar: string elementRelationship: associative - name: resources type: list: elementType: scalar: string elementRelationship: associative - name: verbs type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.flowcontrol.v1beta1.ServiceAccountSubject map: fields: - name: name type: scalar: string default: "" - name: namespace type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta1.Subject map: fields: - name: group type: namedType: io.k8s.api.flowcontrol.v1beta1.GroupSubject - name: kind type: scalar: string default: "" - name: serviceAccount type: namedType: io.k8s.api.flowcontrol.v1beta1.ServiceAccountSubject - name: user type: namedType: io.k8s.api.flowcontrol.v1beta1.UserSubject unions: - discriminator: kind fields: - fieldName: group discriminatorValue: Group - fieldName: serviceAccount discriminatorValue: ServiceAccount - fieldName: user discriminatorValue: User - name: io.k8s.api.flowcontrol.v1beta1.UserSubject map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta2.ExemptPriorityLevelConfiguration map: fields: - name: lendablePercent type: scalar: numeric - name: nominalConcurrencyShares type: scalar: numeric - name: io.k8s.api.flowcontrol.v1beta2.FlowDistinguisherMethod map: fields: - name: type type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta2.FlowSchema map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.flowcontrol.v1beta2.FlowSchemaSpec default: {} - name: status type: namedType: io.k8s.api.flowcontrol.v1beta2.FlowSchemaStatus default: {} - name: io.k8s.api.flowcontrol.v1beta2.FlowSchemaCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string - name: type type: scalar: string - name: io.k8s.api.flowcontrol.v1beta2.FlowSchemaSpec map: fields: - name: distinguisherMethod type: namedType: io.k8s.api.flowcontrol.v1beta2.FlowDistinguisherMethod - name: matchingPrecedence type: scalar: numeric default: 0 - name: priorityLevelConfiguration type: namedType: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationReference default: {} - name: rules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta2.PolicyRulesWithSubjects elementRelationship: atomic - name: io.k8s.api.flowcontrol.v1beta2.FlowSchemaStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta2.FlowSchemaCondition elementRelationship: associative keys: - type - name: io.k8s.api.flowcontrol.v1beta2.GroupSubject map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta2.LimitResponse map: fields: - name: queuing type: namedType: io.k8s.api.flowcontrol.v1beta2.QueuingConfiguration - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: queuing discriminatorValue: Queuing - name: io.k8s.api.flowcontrol.v1beta2.LimitedPriorityLevelConfiguration map: fields: - name: assuredConcurrencyShares type: scalar: numeric default: 0 - name: borrowingLimitPercent type: scalar: numeric - name: lendablePercent type: scalar: numeric - name: limitResponse type: namedType: io.k8s.api.flowcontrol.v1beta2.LimitResponse default: {} - name: io.k8s.api.flowcontrol.v1beta2.NonResourcePolicyRule map: fields: - name: nonResourceURLs type: list: elementType: scalar: string elementRelationship: associative - name: verbs type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.flowcontrol.v1beta2.PolicyRulesWithSubjects map: fields: - name: nonResourceRules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta2.NonResourcePolicyRule elementRelationship: atomic - name: resourceRules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta2.ResourcePolicyRule elementRelationship: atomic - name: subjects type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta2.Subject elementRelationship: atomic - name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfiguration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationSpec default: {} - name: status type: namedType: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationStatus default: {} - name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string - name: type type: scalar: string - name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationReference map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationSpec map: fields: - name: exempt type: namedType: io.k8s.api.flowcontrol.v1beta2.ExemptPriorityLevelConfiguration - name: limited type: namedType: io.k8s.api.flowcontrol.v1beta2.LimitedPriorityLevelConfiguration - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: exempt discriminatorValue: Exempt - fieldName: limited discriminatorValue: Limited - name: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta2.PriorityLevelConfigurationCondition elementRelationship: associative keys: - type - name: io.k8s.api.flowcontrol.v1beta2.QueuingConfiguration map: fields: - name: handSize type: scalar: numeric default: 0 - name: queueLengthLimit type: scalar: numeric default: 0 - name: queues type: scalar: numeric default: 0 - name: io.k8s.api.flowcontrol.v1beta2.ResourcePolicyRule map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: associative - name: clusterScope type: scalar: boolean - name: namespaces type: list: elementType: scalar: string elementRelationship: associative - name: resources type: list: elementType: scalar: string elementRelationship: associative - name: verbs type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.flowcontrol.v1beta2.ServiceAccountSubject map: fields: - name: name type: scalar: string default: "" - name: namespace type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta2.Subject map: fields: - name: group type: namedType: io.k8s.api.flowcontrol.v1beta2.GroupSubject - name: kind type: scalar: string default: "" - name: serviceAccount type: namedType: io.k8s.api.flowcontrol.v1beta2.ServiceAccountSubject - name: user type: namedType: io.k8s.api.flowcontrol.v1beta2.UserSubject unions: - discriminator: kind fields: - fieldName: group discriminatorValue: Group - fieldName: serviceAccount discriminatorValue: ServiceAccount - fieldName: user discriminatorValue: User - name: io.k8s.api.flowcontrol.v1beta2.UserSubject map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta3.ExemptPriorityLevelConfiguration map: fields: - name: lendablePercent type: scalar: numeric - name: nominalConcurrencyShares type: scalar: numeric - name: io.k8s.api.flowcontrol.v1beta3.FlowDistinguisherMethod map: fields: - name: type type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta3.FlowSchema map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.flowcontrol.v1beta3.FlowSchemaSpec default: {} - name: status type: namedType: io.k8s.api.flowcontrol.v1beta3.FlowSchemaStatus default: {} - name: io.k8s.api.flowcontrol.v1beta3.FlowSchemaCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string - name: type type: scalar: string - name: io.k8s.api.flowcontrol.v1beta3.FlowSchemaSpec map: fields: - name: distinguisherMethod type: namedType: io.k8s.api.flowcontrol.v1beta3.FlowDistinguisherMethod - name: matchingPrecedence type: scalar: numeric default: 0 - name: priorityLevelConfiguration type: namedType: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfigurationReference default: {} - name: rules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta3.PolicyRulesWithSubjects elementRelationship: atomic - name: io.k8s.api.flowcontrol.v1beta3.FlowSchemaStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta3.FlowSchemaCondition elementRelationship: associative keys: - type - name: io.k8s.api.flowcontrol.v1beta3.GroupSubject map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta3.LimitResponse map: fields: - name: queuing type: namedType: io.k8s.api.flowcontrol.v1beta3.QueuingConfiguration - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: queuing discriminatorValue: Queuing - name: io.k8s.api.flowcontrol.v1beta3.LimitedPriorityLevelConfiguration map: fields: - name: borrowingLimitPercent type: scalar: numeric - name: lendablePercent type: scalar: numeric - name: limitResponse type: namedType: io.k8s.api.flowcontrol.v1beta3.LimitResponse default: {} - name: nominalConcurrencyShares type: scalar: numeric default: 0 - name: io.k8s.api.flowcontrol.v1beta3.NonResourcePolicyRule map: fields: - name: nonResourceURLs type: list: elementType: scalar: string elementRelationship: associative - name: verbs type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.flowcontrol.v1beta3.PolicyRulesWithSubjects map: fields: - name: nonResourceRules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta3.NonResourcePolicyRule elementRelationship: atomic - name: resourceRules type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta3.ResourcePolicyRule elementRelationship: atomic - name: subjects type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta3.Subject elementRelationship: atomic - name: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfiguration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfigurationSpec default: {} - name: status type: namedType: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfigurationStatus default: {} - name: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfigurationCondition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string - name: type type: scalar: string - name: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfigurationReference map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfigurationSpec map: fields: - name: exempt type: namedType: io.k8s.api.flowcontrol.v1beta3.ExemptPriorityLevelConfiguration - name: limited type: namedType: io.k8s.api.flowcontrol.v1beta3.LimitedPriorityLevelConfiguration - name: type type: scalar: string default: "" unions: - discriminator: type fields: - fieldName: exempt discriminatorValue: Exempt - fieldName: limited discriminatorValue: Limited - name: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfigurationStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.flowcontrol.v1beta3.PriorityLevelConfigurationCondition elementRelationship: associative keys: - type - name: io.k8s.api.flowcontrol.v1beta3.QueuingConfiguration map: fields: - name: handSize type: scalar: numeric default: 0 - name: queueLengthLimit type: scalar: numeric default: 0 - name: queues type: scalar: numeric default: 0 - name: io.k8s.api.flowcontrol.v1beta3.ResourcePolicyRule map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: associative - name: clusterScope type: scalar: boolean - name: namespaces type: list: elementType: scalar: string elementRelationship: associative - name: resources type: list: elementType: scalar: string elementRelationship: associative - name: verbs type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.flowcontrol.v1beta3.ServiceAccountSubject map: fields: - name: name type: scalar: string default: "" - name: namespace type: scalar: string default: "" - name: io.k8s.api.flowcontrol.v1beta3.Subject map: fields: - name: group type: namedType: io.k8s.api.flowcontrol.v1beta3.GroupSubject - name: kind type: scalar: string default: "" - name: serviceAccount type: namedType: io.k8s.api.flowcontrol.v1beta3.ServiceAccountSubject - name: user type: namedType: io.k8s.api.flowcontrol.v1beta3.UserSubject unions: - discriminator: kind fields: - fieldName: group discriminatorValue: Group - fieldName: serviceAccount discriminatorValue: ServiceAccount - fieldName: user discriminatorValue: User - name: io.k8s.api.flowcontrol.v1beta3.UserSubject map: fields: - name: name type: scalar: string default: "" - name: io.k8s.api.imagepolicy.v1alpha1.ImageReview map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.imagepolicy.v1alpha1.ImageReviewSpec default: {} - name: status type: namedType: io.k8s.api.imagepolicy.v1alpha1.ImageReviewStatus default: {} - name: io.k8s.api.imagepolicy.v1alpha1.ImageReviewContainerSpec map: fields: - name: image type: scalar: string - name: io.k8s.api.imagepolicy.v1alpha1.ImageReviewSpec map: fields: - name: annotations type: map: elementType: scalar: string - name: containers type: list: elementType: namedType: io.k8s.api.imagepolicy.v1alpha1.ImageReviewContainerSpec elementRelationship: atomic - name: namespace type: scalar: string - name: io.k8s.api.imagepolicy.v1alpha1.ImageReviewStatus map: fields: - name: allowed type: scalar: boolean default: false - name: auditAnnotations type: map: elementType: scalar: string - name: reason type: scalar: string - name: io.k8s.api.networking.v1.HTTPIngressPath map: fields: - name: backend type: namedType: io.k8s.api.networking.v1.IngressBackend default: {} - name: path type: scalar: string - name: pathType type: scalar: string - name: io.k8s.api.networking.v1.HTTPIngressRuleValue map: fields: - name: paths type: list: elementType: namedType: io.k8s.api.networking.v1.HTTPIngressPath elementRelationship: atomic - name: io.k8s.api.networking.v1.IPBlock map: fields: - name: cidr type: scalar: string default: "" - name: except type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.networking.v1.Ingress map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1.IngressSpec default: {} - name: status type: namedType: io.k8s.api.networking.v1.IngressStatus default: {} - name: io.k8s.api.networking.v1.IngressBackend map: fields: - name: resource type: namedType: io.k8s.api.core.v1.TypedLocalObjectReference - name: service type: namedType: io.k8s.api.networking.v1.IngressServiceBackend - name: io.k8s.api.networking.v1.IngressClass map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1.IngressClassSpec default: {} - name: io.k8s.api.networking.v1.IngressClassParametersReference map: fields: - name: apiGroup type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: namespace type: scalar: string - name: scope type: scalar: string - name: io.k8s.api.networking.v1.IngressClassSpec map: fields: - name: controller type: scalar: string - name: parameters type: namedType: io.k8s.api.networking.v1.IngressClassParametersReference - name: io.k8s.api.networking.v1.IngressLoadBalancerIngress map: fields: - name: hostname type: scalar: string - name: ip type: scalar: string - name: ports type: list: elementType: namedType: io.k8s.api.networking.v1.IngressPortStatus elementRelationship: atomic - name: io.k8s.api.networking.v1.IngressLoadBalancerStatus map: fields: - name: ingress type: list: elementType: namedType: io.k8s.api.networking.v1.IngressLoadBalancerIngress elementRelationship: atomic - name: io.k8s.api.networking.v1.IngressPortStatus map: fields: - name: error type: scalar: string - name: port type: scalar: numeric default: 0 - name: protocol type: scalar: string default: "" - name: io.k8s.api.networking.v1.IngressRule map: fields: - name: host type: scalar: string - name: http type: namedType: io.k8s.api.networking.v1.HTTPIngressRuleValue - name: io.k8s.api.networking.v1.IngressServiceBackend map: fields: - name: name type: scalar: string default: "" - name: port type: namedType: io.k8s.api.networking.v1.ServiceBackendPort default: {} - name: io.k8s.api.networking.v1.IngressSpec map: fields: - name: defaultBackend type: namedType: io.k8s.api.networking.v1.IngressBackend - name: ingressClassName type: scalar: string - name: rules type: list: elementType: namedType: io.k8s.api.networking.v1.IngressRule elementRelationship: atomic - name: tls type: list: elementType: namedType: io.k8s.api.networking.v1.IngressTLS elementRelationship: atomic - name: io.k8s.api.networking.v1.IngressStatus map: fields: - name: loadBalancer type: namedType: io.k8s.api.networking.v1.IngressLoadBalancerStatus default: {} - name: io.k8s.api.networking.v1.IngressTLS map: fields: - name: hosts type: list: elementType: scalar: string elementRelationship: atomic - name: secretName type: scalar: string - name: io.k8s.api.networking.v1.NetworkPolicy map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1.NetworkPolicySpec default: {} - name: io.k8s.api.networking.v1.NetworkPolicyEgressRule map: fields: - name: ports type: list: elementType: namedType: io.k8s.api.networking.v1.NetworkPolicyPort elementRelationship: atomic - name: to type: list: elementType: namedType: io.k8s.api.networking.v1.NetworkPolicyPeer elementRelationship: atomic - name: io.k8s.api.networking.v1.NetworkPolicyIngressRule map: fields: - name: from type: list: elementType: namedType: io.k8s.api.networking.v1.NetworkPolicyPeer elementRelationship: atomic - name: ports type: list: elementType: namedType: io.k8s.api.networking.v1.NetworkPolicyPort elementRelationship: atomic - name: io.k8s.api.networking.v1.NetworkPolicyPeer map: fields: - name: ipBlock type: namedType: io.k8s.api.networking.v1.IPBlock - name: namespaceSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: podSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: io.k8s.api.networking.v1.NetworkPolicyPort map: fields: - name: endPort type: scalar: numeric - name: port type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: protocol type: scalar: string - name: io.k8s.api.networking.v1.NetworkPolicySpec map: fields: - name: egress type: list: elementType: namedType: io.k8s.api.networking.v1.NetworkPolicyEgressRule elementRelationship: atomic - name: ingress type: list: elementType: namedType: io.k8s.api.networking.v1.NetworkPolicyIngressRule elementRelationship: atomic - name: podSelector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector default: {} - name: policyTypes type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.networking.v1.ServiceBackendPort map: fields: - name: name type: scalar: string - name: number type: scalar: numeric elementRelationship: atomic - name: io.k8s.api.networking.v1alpha1.IPAddress map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1alpha1.IPAddressSpec default: {} - name: io.k8s.api.networking.v1alpha1.IPAddressSpec map: fields: - name: parentRef type: namedType: io.k8s.api.networking.v1alpha1.ParentReference - name: io.k8s.api.networking.v1alpha1.ParentReference map: fields: - name: group type: scalar: string - name: name type: scalar: string - name: namespace type: scalar: string - name: resource type: scalar: string - name: io.k8s.api.networking.v1alpha1.ServiceCIDR map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1alpha1.ServiceCIDRSpec default: {} - name: status type: namedType: io.k8s.api.networking.v1alpha1.ServiceCIDRStatus default: {} - name: io.k8s.api.networking.v1alpha1.ServiceCIDRSpec map: fields: - name: cidrs type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.networking.v1alpha1.ServiceCIDRStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition elementRelationship: associative keys: - type - name: io.k8s.api.networking.v1beta1.HTTPIngressPath map: fields: - name: backend type: namedType: io.k8s.api.networking.v1beta1.IngressBackend default: {} - name: path type: scalar: string - name: pathType type: scalar: string - name: io.k8s.api.networking.v1beta1.HTTPIngressRuleValue map: fields: - name: paths type: list: elementType: namedType: io.k8s.api.networking.v1beta1.HTTPIngressPath elementRelationship: atomic - name: io.k8s.api.networking.v1beta1.IPAddress map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1beta1.IPAddressSpec default: {} - name: io.k8s.api.networking.v1beta1.IPAddressSpec map: fields: - name: parentRef type: namedType: io.k8s.api.networking.v1beta1.ParentReference - name: io.k8s.api.networking.v1beta1.Ingress map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1beta1.IngressSpec default: {} - name: status type: namedType: io.k8s.api.networking.v1beta1.IngressStatus default: {} - name: io.k8s.api.networking.v1beta1.IngressBackend map: fields: - name: resource type: namedType: io.k8s.api.core.v1.TypedLocalObjectReference - name: serviceName type: scalar: string - name: servicePort type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: io.k8s.api.networking.v1beta1.IngressClass map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1beta1.IngressClassSpec default: {} - name: io.k8s.api.networking.v1beta1.IngressClassParametersReference map: fields: - name: apiGroup type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: namespace type: scalar: string - name: scope type: scalar: string - name: io.k8s.api.networking.v1beta1.IngressClassSpec map: fields: - name: controller type: scalar: string - name: parameters type: namedType: io.k8s.api.networking.v1beta1.IngressClassParametersReference - name: io.k8s.api.networking.v1beta1.IngressLoadBalancerIngress map: fields: - name: hostname type: scalar: string - name: ip type: scalar: string - name: ports type: list: elementType: namedType: io.k8s.api.networking.v1beta1.IngressPortStatus elementRelationship: atomic - name: io.k8s.api.networking.v1beta1.IngressLoadBalancerStatus map: fields: - name: ingress type: list: elementType: namedType: io.k8s.api.networking.v1beta1.IngressLoadBalancerIngress elementRelationship: atomic - name: io.k8s.api.networking.v1beta1.IngressPortStatus map: fields: - name: error type: scalar: string - name: port type: scalar: numeric default: 0 - name: protocol type: scalar: string default: "" - name: io.k8s.api.networking.v1beta1.IngressRule map: fields: - name: host type: scalar: string - name: http type: namedType: io.k8s.api.networking.v1beta1.HTTPIngressRuleValue - name: io.k8s.api.networking.v1beta1.IngressSpec map: fields: - name: backend type: namedType: io.k8s.api.networking.v1beta1.IngressBackend - name: ingressClassName type: scalar: string - name: rules type: list: elementType: namedType: io.k8s.api.networking.v1beta1.IngressRule elementRelationship: atomic - name: tls type: list: elementType: namedType: io.k8s.api.networking.v1beta1.IngressTLS elementRelationship: atomic - name: io.k8s.api.networking.v1beta1.IngressStatus map: fields: - name: loadBalancer type: namedType: io.k8s.api.networking.v1beta1.IngressLoadBalancerStatus default: {} - name: io.k8s.api.networking.v1beta1.IngressTLS map: fields: - name: hosts type: list: elementType: scalar: string elementRelationship: atomic - name: secretName type: scalar: string - name: io.k8s.api.networking.v1beta1.ParentReference map: fields: - name: group type: scalar: string - name: name type: scalar: string - name: namespace type: scalar: string - name: resource type: scalar: string - name: io.k8s.api.networking.v1beta1.ServiceCIDR map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.networking.v1beta1.ServiceCIDRSpec default: {} - name: status type: namedType: io.k8s.api.networking.v1beta1.ServiceCIDRStatus default: {} - name: io.k8s.api.networking.v1beta1.ServiceCIDRSpec map: fields: - name: cidrs type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.networking.v1beta1.ServiceCIDRStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition elementRelationship: associative keys: - type - name: io.k8s.api.node.v1.Overhead map: fields: - name: podFixed type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.node.v1.RuntimeClass map: fields: - name: apiVersion type: scalar: string - name: handler type: scalar: string default: "" - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: overhead type: namedType: io.k8s.api.node.v1.Overhead - name: scheduling type: namedType: io.k8s.api.node.v1.Scheduling - name: io.k8s.api.node.v1.Scheduling map: fields: - name: nodeSelector type: map: elementType: scalar: string elementRelationship: atomic - name: tolerations type: list: elementType: namedType: io.k8s.api.core.v1.Toleration elementRelationship: atomic - name: io.k8s.api.node.v1alpha1.Overhead map: fields: - name: podFixed type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.node.v1alpha1.RuntimeClass map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.node.v1alpha1.RuntimeClassSpec default: {} - name: io.k8s.api.node.v1alpha1.RuntimeClassSpec map: fields: - name: overhead type: namedType: io.k8s.api.node.v1alpha1.Overhead - name: runtimeHandler type: scalar: string default: "" - name: scheduling type: namedType: io.k8s.api.node.v1alpha1.Scheduling - name: io.k8s.api.node.v1alpha1.Scheduling map: fields: - name: nodeSelector type: map: elementType: scalar: string elementRelationship: atomic - name: tolerations type: list: elementType: namedType: io.k8s.api.core.v1.Toleration elementRelationship: atomic - name: io.k8s.api.node.v1beta1.Overhead map: fields: - name: podFixed type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.node.v1beta1.RuntimeClass map: fields: - name: apiVersion type: scalar: string - name: handler type: scalar: string default: "" - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: overhead type: namedType: io.k8s.api.node.v1beta1.Overhead - name: scheduling type: namedType: io.k8s.api.node.v1beta1.Scheduling - name: io.k8s.api.node.v1beta1.Scheduling map: fields: - name: nodeSelector type: map: elementType: scalar: string elementRelationship: atomic - name: tolerations type: list: elementType: namedType: io.k8s.api.core.v1.Toleration elementRelationship: atomic - name: io.k8s.api.policy.v1.Eviction map: fields: - name: apiVersion type: scalar: string - name: deleteOptions type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: io.k8s.api.policy.v1.PodDisruptionBudget map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.policy.v1.PodDisruptionBudgetSpec default: {} - name: status type: namedType: io.k8s.api.policy.v1.PodDisruptionBudgetStatus default: {} - name: io.k8s.api.policy.v1.PodDisruptionBudgetSpec map: fields: - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: minAvailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: unhealthyPodEvictionPolicy type: scalar: string - name: io.k8s.api.policy.v1.PodDisruptionBudgetStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition elementRelationship: associative keys: - type - name: currentHealthy type: scalar: numeric default: 0 - name: desiredHealthy type: scalar: numeric default: 0 - name: disruptedPods type: map: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: disruptionsAllowed type: scalar: numeric default: 0 - name: expectedPods type: scalar: numeric default: 0 - name: observedGeneration type: scalar: numeric - name: io.k8s.api.policy.v1beta1.Eviction map: fields: - name: apiVersion type: scalar: string - name: deleteOptions type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: io.k8s.api.policy.v1beta1.PodDisruptionBudget map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.policy.v1beta1.PodDisruptionBudgetSpec default: {} - name: status type: namedType: io.k8s.api.policy.v1beta1.PodDisruptionBudgetStatus default: {} - name: io.k8s.api.policy.v1beta1.PodDisruptionBudgetSpec map: fields: - name: maxUnavailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: minAvailable type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: unhealthyPodEvictionPolicy type: scalar: string - name: io.k8s.api.policy.v1beta1.PodDisruptionBudgetStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition elementRelationship: associative keys: - type - name: currentHealthy type: scalar: numeric default: 0 - name: desiredHealthy type: scalar: numeric default: 0 - name: disruptedPods type: map: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: disruptionsAllowed type: scalar: numeric default: 0 - name: expectedPods type: scalar: numeric default: 0 - name: observedGeneration type: scalar: numeric - name: io.k8s.api.rbac.v1.AggregationRule map: fields: - name: clusterRoleSelectors type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector elementRelationship: atomic - name: io.k8s.api.rbac.v1.ClusterRole map: fields: - name: aggregationRule type: namedType: io.k8s.api.rbac.v1.AggregationRule - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: rules type: list: elementType: namedType: io.k8s.api.rbac.v1.PolicyRule elementRelationship: atomic - name: io.k8s.api.rbac.v1.ClusterRoleBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: roleRef type: namedType: io.k8s.api.rbac.v1.RoleRef default: {} - name: subjects type: list: elementType: namedType: io.k8s.api.rbac.v1.Subject elementRelationship: atomic - name: io.k8s.api.rbac.v1.PolicyRule map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: atomic - name: nonResourceURLs type: list: elementType: scalar: string elementRelationship: atomic - name: resourceNames type: list: elementType: scalar: string elementRelationship: atomic - name: resources type: list: elementType: scalar: string elementRelationship: atomic - name: verbs type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.rbac.v1.Role map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: rules type: list: elementType: namedType: io.k8s.api.rbac.v1.PolicyRule elementRelationship: atomic - name: io.k8s.api.rbac.v1.RoleBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: roleRef type: namedType: io.k8s.api.rbac.v1.RoleRef default: {} - name: subjects type: list: elementType: namedType: io.k8s.api.rbac.v1.Subject elementRelationship: atomic - name: io.k8s.api.rbac.v1.RoleRef map: fields: - name: apiGroup type: scalar: string default: "" - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.api.rbac.v1.Subject map: fields: - name: apiGroup type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: namespace type: scalar: string elementRelationship: atomic - name: io.k8s.api.rbac.v1alpha1.AggregationRule map: fields: - name: clusterRoleSelectors type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector elementRelationship: atomic - name: io.k8s.api.rbac.v1alpha1.ClusterRole map: fields: - name: aggregationRule type: namedType: io.k8s.api.rbac.v1alpha1.AggregationRule - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: rules type: list: elementType: namedType: io.k8s.api.rbac.v1alpha1.PolicyRule elementRelationship: atomic - name: io.k8s.api.rbac.v1alpha1.ClusterRoleBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: roleRef type: namedType: io.k8s.api.rbac.v1alpha1.RoleRef default: {} - name: subjects type: list: elementType: namedType: io.k8s.api.rbac.v1alpha1.Subject elementRelationship: atomic - name: io.k8s.api.rbac.v1alpha1.PolicyRule map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: atomic - name: nonResourceURLs type: list: elementType: scalar: string elementRelationship: atomic - name: resourceNames type: list: elementType: scalar: string elementRelationship: atomic - name: resources type: list: elementType: scalar: string elementRelationship: atomic - name: verbs type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.rbac.v1alpha1.Role map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: rules type: list: elementType: namedType: io.k8s.api.rbac.v1alpha1.PolicyRule elementRelationship: atomic - name: io.k8s.api.rbac.v1alpha1.RoleBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: roleRef type: namedType: io.k8s.api.rbac.v1alpha1.RoleRef default: {} - name: subjects type: list: elementType: namedType: io.k8s.api.rbac.v1alpha1.Subject elementRelationship: atomic - name: io.k8s.api.rbac.v1alpha1.RoleRef map: fields: - name: apiGroup type: scalar: string default: "" - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.rbac.v1alpha1.Subject map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: namespace type: scalar: string - name: io.k8s.api.rbac.v1beta1.AggregationRule map: fields: - name: clusterRoleSelectors type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector elementRelationship: atomic - name: io.k8s.api.rbac.v1beta1.ClusterRole map: fields: - name: aggregationRule type: namedType: io.k8s.api.rbac.v1beta1.AggregationRule - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: rules type: list: elementType: namedType: io.k8s.api.rbac.v1beta1.PolicyRule elementRelationship: atomic - name: io.k8s.api.rbac.v1beta1.ClusterRoleBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: roleRef type: namedType: io.k8s.api.rbac.v1beta1.RoleRef default: {} - name: subjects type: list: elementType: namedType: io.k8s.api.rbac.v1beta1.Subject elementRelationship: atomic - name: io.k8s.api.rbac.v1beta1.PolicyRule map: fields: - name: apiGroups type: list: elementType: scalar: string elementRelationship: atomic - name: nonResourceURLs type: list: elementType: scalar: string elementRelationship: atomic - name: resourceNames type: list: elementType: scalar: string elementRelationship: atomic - name: resources type: list: elementType: scalar: string elementRelationship: atomic - name: verbs type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.rbac.v1beta1.Role map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: rules type: list: elementType: namedType: io.k8s.api.rbac.v1beta1.PolicyRule elementRelationship: atomic - name: io.k8s.api.rbac.v1beta1.RoleBinding map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: roleRef type: namedType: io.k8s.api.rbac.v1beta1.RoleRef default: {} - name: subjects type: list: elementType: namedType: io.k8s.api.rbac.v1beta1.Subject elementRelationship: atomic - name: io.k8s.api.rbac.v1beta1.RoleRef map: fields: - name: apiGroup type: scalar: string default: "" - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: io.k8s.api.rbac.v1beta1.Subject map: fields: - name: apiGroup type: scalar: string - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: namespace type: scalar: string - name: io.k8s.api.resource.v1alpha3.AllocationResult map: fields: - name: controller type: scalar: string - name: devices type: namedType: io.k8s.api.resource.v1alpha3.DeviceAllocationResult default: {} - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector - name: io.k8s.api.resource.v1alpha3.BasicDevice map: fields: - name: attributes type: map: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceAttribute - name: capacity type: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.resource.v1alpha3.CELDeviceSelector map: fields: - name: expression type: scalar: string default: "" - name: io.k8s.api.resource.v1alpha3.Device map: fields: - name: basic type: namedType: io.k8s.api.resource.v1alpha3.BasicDevice - name: name type: scalar: string default: "" - name: io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration map: fields: - name: opaque type: namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration - name: requests type: list: elementType: scalar: string elementRelationship: atomic - name: source type: scalar: string default: "" - name: io.k8s.api.resource.v1alpha3.DeviceAllocationResult map: fields: - name: config type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration elementRelationship: atomic - name: results type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.DeviceAttribute map: fields: - name: bool type: scalar: boolean - name: int type: scalar: numeric - name: string type: scalar: string - name: version type: scalar: string - name: io.k8s.api.resource.v1alpha3.DeviceClaim map: fields: - name: config type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration elementRelationship: atomic - name: constraints type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceConstraint elementRelationship: atomic - name: requests type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceRequest elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration map: fields: - name: opaque type: namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration - name: requests type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.DeviceClass map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.resource.v1alpha3.DeviceClassSpec default: {} - name: io.k8s.api.resource.v1alpha3.DeviceClassConfiguration map: fields: - name: opaque type: namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration - name: io.k8s.api.resource.v1alpha3.DeviceClassSpec map: fields: - name: config type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceClassConfiguration elementRelationship: atomic - name: selectors type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceSelector elementRelationship: atomic - name: suitableNodes type: namedType: io.k8s.api.core.v1.NodeSelector - name: io.k8s.api.resource.v1alpha3.DeviceConstraint map: fields: - name: matchAttribute type: scalar: string - name: requests type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.DeviceRequest map: fields: - name: adminAccess type: scalar: boolean default: false - name: allocationMode type: scalar: string - name: count type: scalar: numeric - name: deviceClassName type: scalar: string default: "" - name: name type: scalar: string default: "" - name: selectors type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceSelector elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult map: fields: - name: device type: scalar: string default: "" - name: driver type: scalar: string default: "" - name: pool type: scalar: string default: "" - name: request type: scalar: string default: "" - name: io.k8s.api.resource.v1alpha3.DeviceSelector map: fields: - name: cel type: namedType: io.k8s.api.resource.v1alpha3.CELDeviceSelector - name: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration map: fields: - name: driver type: scalar: string default: "" - name: parameters type: namedType: __untyped_atomic_ - name: io.k8s.api.resource.v1alpha3.PodSchedulingContext map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec default: {} - name: status type: namedType: io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus default: {} - name: io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec map: fields: - name: potentialNodes type: list: elementType: scalar: string elementRelationship: atomic - name: selectedNode type: scalar: string - name: io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus map: fields: - name: resourceClaims type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus elementRelationship: associative keys: - name - name: io.k8s.api.resource.v1alpha3.ResourceClaim map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSpec default: {} - name: status type: namedType: io.k8s.api.resource.v1alpha3.ResourceClaimStatus default: {} - name: io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference map: fields: - name: apiGroup type: scalar: string - name: name type: scalar: string default: "" - name: resource type: scalar: string default: "" - name: uid type: scalar: string default: "" - name: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus map: fields: - name: name type: scalar: string default: "" - name: unsuitableNodes type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.ResourceClaimSpec map: fields: - name: controller type: scalar: string - name: devices type: namedType: io.k8s.api.resource.v1alpha3.DeviceClaim default: {} - name: io.k8s.api.resource.v1alpha3.ResourceClaimStatus map: fields: - name: allocation type: namedType: io.k8s.api.resource.v1alpha3.AllocationResult - name: deallocationRequested type: scalar: boolean - name: reservedFor type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference elementRelationship: associative keys: - uid - name: io.k8s.api.resource.v1alpha3.ResourceClaimTemplate map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec default: {} - name: io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec map: fields: - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSpec default: {} - name: io.k8s.api.resource.v1alpha3.ResourcePool map: fields: - name: generation type: scalar: numeric default: 0 - name: name type: scalar: string default: "" - name: resourceSliceCount type: scalar: numeric default: 0 - name: io.k8s.api.resource.v1alpha3.ResourceSlice map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.resource.v1alpha3.ResourceSliceSpec default: {} - name: io.k8s.api.resource.v1alpha3.ResourceSliceSpec map: fields: - name: allNodes type: scalar: boolean - name: devices type: list: elementType: namedType: io.k8s.api.resource.v1alpha3.Device elementRelationship: atomic - name: driver type: scalar: string default: "" - name: nodeName type: scalar: string - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector - name: pool type: namedType: io.k8s.api.resource.v1alpha3.ResourcePool default: {} - name: io.k8s.api.scheduling.v1.PriorityClass map: fields: - name: apiVersion type: scalar: string - name: description type: scalar: string - name: globalDefault type: scalar: boolean - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: preemptionPolicy type: scalar: string - name: value type: scalar: numeric default: 0 - name: io.k8s.api.scheduling.v1alpha1.PriorityClass map: fields: - name: apiVersion type: scalar: string - name: description type: scalar: string - name: globalDefault type: scalar: boolean - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: preemptionPolicy type: scalar: string - name: value type: scalar: numeric default: 0 - name: io.k8s.api.scheduling.v1beta1.PriorityClass map: fields: - name: apiVersion type: scalar: string - name: description type: scalar: string - name: globalDefault type: scalar: boolean - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: preemptionPolicy type: scalar: string - name: value type: scalar: numeric default: 0 - name: io.k8s.api.storage.v1.CSIDriver map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.storage.v1.CSIDriverSpec default: {} - name: io.k8s.api.storage.v1.CSIDriverSpec map: fields: - name: attachRequired type: scalar: boolean - name: fsGroupPolicy type: scalar: string - name: podInfoOnMount type: scalar: boolean - name: requiresRepublish type: scalar: boolean - name: seLinuxMount type: scalar: boolean - name: storageCapacity type: scalar: boolean - name: tokenRequests type: list: elementType: namedType: io.k8s.api.storage.v1.TokenRequest elementRelationship: atomic - name: volumeLifecycleModes type: list: elementType: scalar: string elementRelationship: associative - name: io.k8s.api.storage.v1.CSINode map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.storage.v1.CSINodeSpec default: {} - name: io.k8s.api.storage.v1.CSINodeDriver map: fields: - name: allocatable type: namedType: io.k8s.api.storage.v1.VolumeNodeResources - name: name type: scalar: string default: "" - name: nodeID type: scalar: string default: "" - name: topologyKeys type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.storage.v1.CSINodeSpec map: fields: - name: drivers type: list: elementType: namedType: io.k8s.api.storage.v1.CSINodeDriver elementRelationship: associative keys: - name - name: io.k8s.api.storage.v1.CSIStorageCapacity map: fields: - name: apiVersion type: scalar: string - name: capacity type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: kind type: scalar: string - name: maximumVolumeSize type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: nodeTopology type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: storageClassName type: scalar: string default: "" - name: io.k8s.api.storage.v1.StorageClass map: fields: - name: allowVolumeExpansion type: scalar: boolean - name: allowedTopologies type: list: elementType: namedType: io.k8s.api.core.v1.TopologySelectorTerm elementRelationship: atomic - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: mountOptions type: list: elementType: scalar: string elementRelationship: atomic - name: parameters type: map: elementType: scalar: string - name: provisioner type: scalar: string default: "" - name: reclaimPolicy type: scalar: string - name: volumeBindingMode type: scalar: string - name: io.k8s.api.storage.v1.TokenRequest map: fields: - name: audience type: scalar: string default: "" - name: expirationSeconds type: scalar: numeric - name: io.k8s.api.storage.v1.VolumeAttachment map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.storage.v1.VolumeAttachmentSpec default: {} - name: status type: namedType: io.k8s.api.storage.v1.VolumeAttachmentStatus default: {} - name: io.k8s.api.storage.v1.VolumeAttachmentSource map: fields: - name: inlineVolumeSpec type: namedType: io.k8s.api.core.v1.PersistentVolumeSpec - name: persistentVolumeName type: scalar: string - name: io.k8s.api.storage.v1.VolumeAttachmentSpec map: fields: - name: attacher type: scalar: string default: "" - name: nodeName type: scalar: string default: "" - name: source type: namedType: io.k8s.api.storage.v1.VolumeAttachmentSource default: {} - name: io.k8s.api.storage.v1.VolumeAttachmentStatus map: fields: - name: attachError type: namedType: io.k8s.api.storage.v1.VolumeError - name: attached type: scalar: boolean default: false - name: attachmentMetadata type: map: elementType: scalar: string - name: detachError type: namedType: io.k8s.api.storage.v1.VolumeError - name: io.k8s.api.storage.v1.VolumeError map: fields: - name: message type: scalar: string - name: time type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.storage.v1.VolumeNodeResources map: fields: - name: count type: scalar: numeric - name: io.k8s.api.storage.v1alpha1.CSIStorageCapacity map: fields: - name: apiVersion type: scalar: string - name: capacity type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: kind type: scalar: string - name: maximumVolumeSize type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: nodeTopology type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: storageClassName type: scalar: string default: "" - name: io.k8s.api.storage.v1alpha1.VolumeAttachment map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.storage.v1alpha1.VolumeAttachmentSpec default: {} - name: status type: namedType: io.k8s.api.storage.v1alpha1.VolumeAttachmentStatus default: {} - name: io.k8s.api.storage.v1alpha1.VolumeAttachmentSource map: fields: - name: inlineVolumeSpec type: namedType: io.k8s.api.core.v1.PersistentVolumeSpec - name: persistentVolumeName type: scalar: string - name: io.k8s.api.storage.v1alpha1.VolumeAttachmentSpec map: fields: - name: attacher type: scalar: string default: "" - name: nodeName type: scalar: string default: "" - name: source type: namedType: io.k8s.api.storage.v1alpha1.VolumeAttachmentSource default: {} - name: io.k8s.api.storage.v1alpha1.VolumeAttachmentStatus map: fields: - name: attachError type: namedType: io.k8s.api.storage.v1alpha1.VolumeError - name: attached type: scalar: boolean default: false - name: attachmentMetadata type: map: elementType: scalar: string - name: detachError type: namedType: io.k8s.api.storage.v1alpha1.VolumeError - name: io.k8s.api.storage.v1alpha1.VolumeAttributesClass map: fields: - name: apiVersion type: scalar: string - name: driverName type: scalar: string default: "" - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: parameters type: map: elementType: scalar: string - name: io.k8s.api.storage.v1alpha1.VolumeError map: fields: - name: message type: scalar: string - name: time type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.storage.v1beta1.CSIDriver map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.storage.v1beta1.CSIDriverSpec default: {} - name: io.k8s.api.storage.v1beta1.CSIDriverSpec map: fields: - name: attachRequired type: scalar: boolean - name: fsGroupPolicy type: scalar: string - name: podInfoOnMount type: scalar: boolean - name: requiresRepublish type: scalar: boolean - name: seLinuxMount type: scalar: boolean - name: storageCapacity type: scalar: boolean - name: tokenRequests type: list: elementType: namedType: io.k8s.api.storage.v1beta1.TokenRequest elementRelationship: atomic - name: volumeLifecycleModes type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.storage.v1beta1.CSINode map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.storage.v1beta1.CSINodeSpec default: {} - name: io.k8s.api.storage.v1beta1.CSINodeDriver map: fields: - name: allocatable type: namedType: io.k8s.api.storage.v1beta1.VolumeNodeResources - name: name type: scalar: string default: "" - name: nodeID type: scalar: string default: "" - name: topologyKeys type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.api.storage.v1beta1.CSINodeSpec map: fields: - name: drivers type: list: elementType: namedType: io.k8s.api.storage.v1beta1.CSINodeDriver elementRelationship: associative keys: - name - name: io.k8s.api.storage.v1beta1.CSIStorageCapacity map: fields: - name: apiVersion type: scalar: string - name: capacity type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: kind type: scalar: string - name: maximumVolumeSize type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: nodeTopology type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector - name: storageClassName type: scalar: string default: "" - name: io.k8s.api.storage.v1beta1.StorageClass map: fields: - name: allowVolumeExpansion type: scalar: boolean - name: allowedTopologies type: list: elementType: namedType: io.k8s.api.core.v1.TopologySelectorTerm elementRelationship: atomic - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: mountOptions type: list: elementType: scalar: string elementRelationship: atomic - name: parameters type: map: elementType: scalar: string - name: provisioner type: scalar: string default: "" - name: reclaimPolicy type: scalar: string - name: volumeBindingMode type: scalar: string - name: io.k8s.api.storage.v1beta1.TokenRequest map: fields: - name: audience type: scalar: string default: "" - name: expirationSeconds type: scalar: numeric - name: io.k8s.api.storage.v1beta1.VolumeAttachment map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.storage.v1beta1.VolumeAttachmentSpec default: {} - name: status type: namedType: io.k8s.api.storage.v1beta1.VolumeAttachmentStatus default: {} - name: io.k8s.api.storage.v1beta1.VolumeAttachmentSource map: fields: - name: inlineVolumeSpec type: namedType: io.k8s.api.core.v1.PersistentVolumeSpec - name: persistentVolumeName type: scalar: string - name: io.k8s.api.storage.v1beta1.VolumeAttachmentSpec map: fields: - name: attacher type: scalar: string default: "" - name: nodeName type: scalar: string default: "" - name: source type: namedType: io.k8s.api.storage.v1beta1.VolumeAttachmentSource default: {} - name: io.k8s.api.storage.v1beta1.VolumeAttachmentStatus map: fields: - name: attachError type: namedType: io.k8s.api.storage.v1beta1.VolumeError - name: attached type: scalar: boolean default: false - name: attachmentMetadata type: map: elementType: scalar: string - name: detachError type: namedType: io.k8s.api.storage.v1beta1.VolumeError - name: io.k8s.api.storage.v1beta1.VolumeAttributesClass map: fields: - name: apiVersion type: scalar: string - name: driverName type: scalar: string default: "" - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: parameters type: map: elementType: scalar: string - name: io.k8s.api.storage.v1beta1.VolumeError map: fields: - name: message type: scalar: string - name: time type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.storage.v1beta1.VolumeNodeResources map: fields: - name: count type: scalar: numeric - name: io.k8s.api.storagemigration.v1alpha1.GroupVersionResource map: fields: - name: group type: scalar: string - name: resource type: scalar: string - name: version type: scalar: string - name: io.k8s.api.storagemigration.v1alpha1.MigrationCondition map: fields: - name: lastUpdateTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string - name: reason type: scalar: string - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigration map: fields: - name: apiVersion type: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: spec type: namedType: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationSpec default: {} - name: status type: namedType: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationStatus default: {} - name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationSpec map: fields: - name: continueToken type: scalar: string - name: resource type: namedType: io.k8s.api.storagemigration.v1alpha1.GroupVersionResource default: {} - name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationStatus map: fields: - name: conditions type: list: elementType: namedType: io.k8s.api.storagemigration.v1alpha1.MigrationCondition elementRelationship: associative keys: - type - name: resourceVersion type: scalar: string - name: io.k8s.apimachinery.pkg.api.resource.Quantity scalar: untyped - name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition map: fields: - name: lastTransitionTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: message type: scalar: string default: "" - name: observedGeneration type: scalar: numeric - name: reason type: scalar: string default: "" - name: status type: scalar: string default: "" - name: type type: scalar: string default: "" - name: io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions map: fields: - name: apiVersion type: scalar: string - name: dryRun type: list: elementType: scalar: string elementRelationship: atomic - name: gracePeriodSeconds type: scalar: numeric - name: kind type: scalar: string - name: orphanDependents type: scalar: boolean - name: preconditions type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions - name: propagationPolicy type: scalar: string - name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 map: elementType: scalar: untyped list: elementType: namedType: __untyped_atomic_ elementRelationship: atomic map: elementType: namedType: __untyped_deduced_ elementRelationship: separable - name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector map: fields: - name: matchExpressions type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement elementRelationship: atomic - name: matchLabels type: map: elementType: scalar: string elementRelationship: atomic - name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement map: fields: - name: key type: scalar: string default: "" - name: operator type: scalar: string default: "" - name: values type: list: elementType: scalar: string elementRelationship: atomic - name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry map: fields: - name: apiVersion type: scalar: string - name: fieldsType type: scalar: string - name: fieldsV1 type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 - name: manager type: scalar: string - name: operation type: scalar: string - name: subresource type: scalar: string - name: time type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime scalar: untyped - name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta map: fields: - name: annotations type: map: elementType: scalar: string - name: creationTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: deletionGracePeriodSeconds type: scalar: numeric - name: deletionTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: finalizers type: list: elementType: scalar: string elementRelationship: associative - name: generateName type: scalar: string - name: generation type: scalar: numeric - name: labels type: map: elementType: scalar: string - name: managedFields type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry elementRelationship: atomic - name: name type: scalar: string - name: namespace type: scalar: string - name: ownerReferences type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference elementRelationship: associative keys: - uid - name: resourceVersion type: scalar: string - name: selfLink type: scalar: string - name: uid type: scalar: string - name: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference map: fields: - name: apiVersion type: scalar: string default: "" - name: blockOwnerDeletion type: scalar: boolean - name: controller type: scalar: boolean - name: kind type: scalar: string default: "" - name: name type: scalar: string default: "" - name: uid type: scalar: string default: "" elementRelationship: atomic - name: io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions map: fields: - name: resourceVersion type: scalar: string - name: uid type: scalar: string - name: io.k8s.apimachinery.pkg.apis.meta.v1.Time scalar: untyped - name: io.k8s.apimachinery.pkg.runtime.RawExtension map: elementType: scalar: untyped list: elementType: namedType: __untyped_atomic_ elementRelationship: atomic map: elementType: namedType: __untyped_deduced_ elementRelationship: separable - name: io.k8s.apimachinery.pkg.util.intstr.IntOrString scalar: untyped - name: __untyped_atomic_ scalar: untyped list: elementType: namedType: __untyped_atomic_ elementRelationship: atomic map: elementType: namedType: __untyped_atomic_ elementRelationship: atomic - name: __untyped_deduced_ scalar: untyped list: elementType: namedType: __untyped_atomic_ elementRelationship: atomic map: elementType: namedType: __untyped_deduced_ elementRelationship: separable `) kubernetes-client-go-a2dfcab/applyconfigurations/meta/000077500000000000000000000000001472614177300234265ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/000077500000000000000000000000001472614177300237545ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/condition.go000066400000000000000000000076201472614177300262760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ConditionApplyConfiguration represents a declarative configuration of the Condition type for use // with apply. type ConditionApplyConfiguration struct { Type *string `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // ConditionApplyConfiguration constructs a declarative configuration of the Condition type for use with // apply. func Condition() *ConditionApplyConfiguration { return &ConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *ConditionApplyConfiguration) WithType(value string) *ConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ConditionApplyConfiguration { b.Status = &value return b } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *ConditionApplyConfiguration) WithObservedGeneration(value int64) *ConditionApplyConfiguration { b.ObservedGeneration = &value return b } // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. func (b *ConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *ConditionApplyConfiguration { b.LastTransitionTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *ConditionApplyConfiguration) WithReason(value string) *ConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *ConditionApplyConfiguration) WithMessage(value string) *ConditionApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/deleteoptions.go000066400000000000000000000113461472614177300271660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DeleteOptionsApplyConfiguration represents a declarative configuration of the DeleteOptions type for use // with apply. type DeleteOptionsApplyConfiguration struct { TypeMetaApplyConfiguration `json:",inline"` GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty"` Preconditions *PreconditionsApplyConfiguration `json:"preconditions,omitempty"` OrphanDependents *bool `json:"orphanDependents,omitempty"` PropagationPolicy *metav1.DeletionPropagation `json:"propagationPolicy,omitempty"` DryRun []string `json:"dryRun,omitempty"` } // DeleteOptionsApplyConfiguration constructs a declarative configuration of the DeleteOptions type for use with // apply. func DeleteOptions() *DeleteOptionsApplyConfiguration { b := &DeleteOptionsApplyConfiguration{} b.WithKind("DeleteOptions") b.WithAPIVersion("meta.k8s.io/v1") return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DeleteOptionsApplyConfiguration) WithKind(value string) *DeleteOptionsApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DeleteOptionsApplyConfiguration) WithAPIVersion(value string) *DeleteOptionsApplyConfiguration { b.APIVersion = &value return b } // WithGracePeriodSeconds sets the GracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GracePeriodSeconds field is set to the value of the last call. func (b *DeleteOptionsApplyConfiguration) WithGracePeriodSeconds(value int64) *DeleteOptionsApplyConfiguration { b.GracePeriodSeconds = &value return b } // WithPreconditions sets the Preconditions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Preconditions field is set to the value of the last call. func (b *DeleteOptionsApplyConfiguration) WithPreconditions(value *PreconditionsApplyConfiguration) *DeleteOptionsApplyConfiguration { b.Preconditions = value return b } // WithOrphanDependents sets the OrphanDependents field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the OrphanDependents field is set to the value of the last call. func (b *DeleteOptionsApplyConfiguration) WithOrphanDependents(value bool) *DeleteOptionsApplyConfiguration { b.OrphanDependents = &value return b } // WithPropagationPolicy sets the PropagationPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PropagationPolicy field is set to the value of the last call. func (b *DeleteOptionsApplyConfiguration) WithPropagationPolicy(value metav1.DeletionPropagation) *DeleteOptionsApplyConfiguration { b.PropagationPolicy = &value return b } // WithDryRun adds the given value to the DryRun field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the DryRun field. func (b *DeleteOptionsApplyConfiguration) WithDryRun(values ...string) *DeleteOptionsApplyConfiguration { for i := range values { b.DryRun = append(b.DryRun, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/labelselector.go000066400000000000000000000047611472614177300271330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // LabelSelectorApplyConfiguration represents a declarative configuration of the LabelSelector type for use // with apply. type LabelSelectorApplyConfiguration struct { MatchLabels map[string]string `json:"matchLabels,omitempty"` MatchExpressions []LabelSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` } // LabelSelectorApplyConfiguration constructs a declarative configuration of the LabelSelector type for use with // apply. func LabelSelector() *LabelSelectorApplyConfiguration { return &LabelSelectorApplyConfiguration{} } // WithMatchLabels puts the entries into the MatchLabels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the MatchLabels field, // overwriting an existing map entries in MatchLabels field with the same key. func (b *LabelSelectorApplyConfiguration) WithMatchLabels(entries map[string]string) *LabelSelectorApplyConfiguration { if b.MatchLabels == nil && len(entries) > 0 { b.MatchLabels = make(map[string]string, len(entries)) } for k, v := range entries { b.MatchLabels[k] = v } return b } // WithMatchExpressions adds the given value to the MatchExpressions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchExpressions field. func (b *LabelSelectorApplyConfiguration) WithMatchExpressions(values ...*LabelSelectorRequirementApplyConfiguration) *LabelSelectorApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchExpressions") } b.MatchExpressions = append(b.MatchExpressions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/labelselectorrequirement.go000066400000000000000000000052411472614177300314060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // LabelSelectorRequirementApplyConfiguration represents a declarative configuration of the LabelSelectorRequirement type for use // with apply. type LabelSelectorRequirementApplyConfiguration struct { Key *string `json:"key,omitempty"` Operator *v1.LabelSelectorOperator `json:"operator,omitempty"` Values []string `json:"values,omitempty"` } // LabelSelectorRequirementApplyConfiguration constructs a declarative configuration of the LabelSelectorRequirement type for use with // apply. func LabelSelectorRequirement() *LabelSelectorRequirementApplyConfiguration { return &LabelSelectorRequirementApplyConfiguration{} } // WithKey sets the Key field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *LabelSelectorRequirementApplyConfiguration) WithKey(value string) *LabelSelectorRequirementApplyConfiguration { b.Key = &value return b } // WithOperator sets the Operator field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Operator field is set to the value of the last call. func (b *LabelSelectorRequirementApplyConfiguration) WithOperator(value v1.LabelSelectorOperator) *LabelSelectorRequirementApplyConfiguration { b.Operator = &value return b } // WithValues adds the given value to the Values field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Values field. func (b *LabelSelectorRequirementApplyConfiguration) WithValues(values ...string) *LabelSelectorRequirementApplyConfiguration { for i := range values { b.Values = append(b.Values, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/managedfieldsentry.go000066400000000000000000000110561472614177300301530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ManagedFieldsEntryApplyConfiguration represents a declarative configuration of the ManagedFieldsEntry type for use // with apply. type ManagedFieldsEntryApplyConfiguration struct { Manager *string `json:"manager,omitempty"` Operation *v1.ManagedFieldsOperationType `json:"operation,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` Time *v1.Time `json:"time,omitempty"` FieldsType *string `json:"fieldsType,omitempty"` FieldsV1 *v1.FieldsV1 `json:"fieldsV1,omitempty"` Subresource *string `json:"subresource,omitempty"` } // ManagedFieldsEntryApplyConfiguration constructs a declarative configuration of the ManagedFieldsEntry type for use with // apply. func ManagedFieldsEntry() *ManagedFieldsEntryApplyConfiguration { return &ManagedFieldsEntryApplyConfiguration{} } // WithManager sets the Manager field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Manager field is set to the value of the last call. func (b *ManagedFieldsEntryApplyConfiguration) WithManager(value string) *ManagedFieldsEntryApplyConfiguration { b.Manager = &value return b } // WithOperation sets the Operation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Operation field is set to the value of the last call. func (b *ManagedFieldsEntryApplyConfiguration) WithOperation(value v1.ManagedFieldsOperationType) *ManagedFieldsEntryApplyConfiguration { b.Operation = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ManagedFieldsEntryApplyConfiguration) WithAPIVersion(value string) *ManagedFieldsEntryApplyConfiguration { b.APIVersion = &value return b } // WithTime sets the Time field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Time field is set to the value of the last call. func (b *ManagedFieldsEntryApplyConfiguration) WithTime(value v1.Time) *ManagedFieldsEntryApplyConfiguration { b.Time = &value return b } // WithFieldsType sets the FieldsType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldsType field is set to the value of the last call. func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsType(value string) *ManagedFieldsEntryApplyConfiguration { b.FieldsType = &value return b } // WithFieldsV1 sets the FieldsV1 field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldsV1 field is set to the value of the last call. func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsV1(value v1.FieldsV1) *ManagedFieldsEntryApplyConfiguration { b.FieldsV1 = &value return b } // WithSubresource sets the Subresource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Subresource field is set to the value of the last call. func (b *ManagedFieldsEntryApplyConfiguration) WithSubresource(value string) *ManagedFieldsEntryApplyConfiguration { b.Subresource = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/objectmeta.go000066400000000000000000000211241472614177300264200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" ) // ObjectMetaApplyConfiguration represents a declarative configuration of the ObjectMeta type for use // with apply. type ObjectMetaApplyConfiguration struct { Name *string `json:"name,omitempty"` GenerateName *string `json:"generateName,omitempty"` Namespace *string `json:"namespace,omitempty"` UID *types.UID `json:"uid,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` Generation *int64 `json:"generation,omitempty"` CreationTimestamp *v1.Time `json:"creationTimestamp,omitempty"` DeletionTimestamp *v1.Time `json:"deletionTimestamp,omitempty"` DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"` Labels map[string]string `json:"labels,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` OwnerReferences []OwnerReferenceApplyConfiguration `json:"ownerReferences,omitempty"` Finalizers []string `json:"finalizers,omitempty"` } // ObjectMetaApplyConfiguration constructs a declarative configuration of the ObjectMeta type for use with // apply. func ObjectMeta() *ObjectMetaApplyConfiguration { return &ObjectMetaApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithName(value string) *ObjectMetaApplyConfiguration { b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithGenerateName(value string) *ObjectMetaApplyConfiguration { b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithNamespace(value string) *ObjectMetaApplyConfiguration { b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithUID(value types.UID) *ObjectMetaApplyConfiguration { b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithResourceVersion(value string) *ObjectMetaApplyConfiguration { b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithGeneration(value int64) *ObjectMetaApplyConfiguration { b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithCreationTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithDeletionTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ObjectMetaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ObjectMetaApplyConfiguration { b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration { if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration { if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ObjectMetaApplyConfiguration) WithOwnerReferences(values ...*OwnerReferenceApplyConfiguration) *ObjectMetaApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ObjectMetaApplyConfiguration) WithFinalizers(values ...string) *ObjectMetaApplyConfiguration { for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ObjectMetaApplyConfiguration) GetName() *string { return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/ownerreference.go000066400000000000000000000075611472614177300273250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( types "k8s.io/apimachinery/pkg/types" ) // OwnerReferenceApplyConfiguration represents a declarative configuration of the OwnerReference type for use // with apply. type OwnerReferenceApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` UID *types.UID `json:"uid,omitempty"` Controller *bool `json:"controller,omitempty"` BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty"` } // OwnerReferenceApplyConfiguration constructs a declarative configuration of the OwnerReference type for use with // apply. func OwnerReference() *OwnerReferenceApplyConfiguration { return &OwnerReferenceApplyConfiguration{} } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *OwnerReferenceApplyConfiguration) WithAPIVersion(value string) *OwnerReferenceApplyConfiguration { b.APIVersion = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *OwnerReferenceApplyConfiguration) WithKind(value string) *OwnerReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *OwnerReferenceApplyConfiguration) WithName(value string) *OwnerReferenceApplyConfiguration { b.Name = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *OwnerReferenceApplyConfiguration) WithUID(value types.UID) *OwnerReferenceApplyConfiguration { b.UID = &value return b } // WithController sets the Controller field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Controller field is set to the value of the last call. func (b *OwnerReferenceApplyConfiguration) WithController(value bool) *OwnerReferenceApplyConfiguration { b.Controller = &value return b } // WithBlockOwnerDeletion sets the BlockOwnerDeletion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BlockOwnerDeletion field is set to the value of the last call. func (b *OwnerReferenceApplyConfiguration) WithBlockOwnerDeletion(value bool) *OwnerReferenceApplyConfiguration { b.BlockOwnerDeletion = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/preconditions.go000066400000000000000000000037711472614177300271730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( types "k8s.io/apimachinery/pkg/types" ) // PreconditionsApplyConfiguration represents a declarative configuration of the Preconditions type for use // with apply. type PreconditionsApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` } // PreconditionsApplyConfiguration constructs a declarative configuration of the Preconditions type for use with // apply. func Preconditions() *PreconditionsApplyConfiguration { return &PreconditionsApplyConfiguration{} } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PreconditionsApplyConfiguration) WithUID(value types.UID) *PreconditionsApplyConfiguration { b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PreconditionsApplyConfiguration) WithResourceVersion(value string) *PreconditionsApplyConfiguration { b.ResourceVersion = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/typemeta.go000066400000000000000000000035371472614177300261430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // TypeMetaApplyConfiguration represents a declarative configuration of the TypeMeta type for use // with apply. type TypeMetaApplyConfiguration struct { Kind *string `json:"kind,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` } // TypeMetaApplyConfiguration constructs a declarative configuration of the TypeMeta type for use with // apply. func TypeMeta() *TypeMetaApplyConfiguration { return &TypeMetaApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *TypeMetaApplyConfiguration) WithKind(value string) *TypeMetaApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *TypeMetaApplyConfiguration) WithAPIVersion(value string) *TypeMetaApplyConfiguration { b.APIVersion = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/meta/v1/unstructured.go000066400000000000000000000115231472614177300270540ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "fmt" "sync" "time" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/managedfields" "k8s.io/client-go/discovery" "k8s.io/kube-openapi/pkg/util/proto" "sigs.k8s.io/structured-merge-diff/v4/typed" ) // openAPISchemaTTL is how frequently we need to check // whether the open API schema has changed or not. const openAPISchemaTTL = time.Minute // UnstructuredExtractor enables extracting the applied configuration state from object for fieldManager into an // unstructured object type. type UnstructuredExtractor interface { Extract(object *unstructured.Unstructured, fieldManager string) (*unstructured.Unstructured, error) ExtractStatus(object *unstructured.Unstructured, fieldManager string) (*unstructured.Unstructured, error) } // gvkParserCache caches the GVKParser in order to prevent from having to repeatedly // parse the models from the open API schema when the schema itself changes infrequently. type gvkParserCache struct { // discoveryClient is the client for retrieving the openAPI document and checking // whether the document has changed recently discoveryClient discovery.DiscoveryInterface // mu protects the gvkParser mu sync.Mutex // gvkParser retrieves the objectType for a given gvk gvkParser *managedfields.GvkParser // lastChecked is the last time we checked if the openAPI doc has changed. lastChecked time.Time } // regenerateGVKParser builds the parser from the raw OpenAPI schema. func regenerateGVKParser(dc discovery.DiscoveryInterface) (*managedfields.GvkParser, error) { doc, err := dc.OpenAPISchema() if err != nil { return nil, err } models, err := proto.NewOpenAPIData(doc) if err != nil { return nil, err } return managedfields.NewGVKParser(models, false) } // objectTypeForGVK retrieves the typed.ParseableType for a given gvk from the cache func (c *gvkParserCache) objectTypeForGVK(gvk schema.GroupVersionKind) (*typed.ParseableType, error) { c.mu.Lock() defer c.mu.Unlock() // if the ttl on the openAPISchema has expired, // regenerate the gvk parser if time.Since(c.lastChecked) > openAPISchemaTTL { c.lastChecked = time.Now() parser, err := regenerateGVKParser(c.discoveryClient) if err != nil { return nil, err } c.gvkParser = parser } return c.gvkParser.Type(gvk), nil } type extractor struct { cache *gvkParserCache } // NewUnstructuredExtractor creates the extractor with which you can extract the applied configuration // for a given manager from an unstructured object. func NewUnstructuredExtractor(dc discovery.DiscoveryInterface) (UnstructuredExtractor, error) { parser, err := regenerateGVKParser(dc) if err != nil { return nil, fmt.Errorf("failed generating initial GVK Parser: %v", err) } return &extractor{ cache: &gvkParserCache{ gvkParser: parser, discoveryClient: dc, }, }, nil } // Extract extracts the applied configuration owned by fieldManager from an unstructured object. // Note that the apply configuration itself is also an unstructured object. func (e *extractor) Extract(object *unstructured.Unstructured, fieldManager string) (*unstructured.Unstructured, error) { return e.extractUnstructured(object, fieldManager, "") } // ExtractStatus is the same as ExtractUnstructured except // that it extracts the status subresource applied configuration. // Experimental! func (e *extractor) ExtractStatus(object *unstructured.Unstructured, fieldManager string) (*unstructured.Unstructured, error) { return e.extractUnstructured(object, fieldManager, "status") } func (e *extractor) extractUnstructured(object *unstructured.Unstructured, fieldManager string, subresource string) (*unstructured.Unstructured, error) { gvk := object.GetObjectKind().GroupVersionKind() objectType, err := e.cache.objectTypeForGVK(gvk) if err != nil { return nil, fmt.Errorf("failed to fetch the objectType: %v", err) } result := &unstructured.Unstructured{} err = managedfields.ExtractInto(object, *objectType, fieldManager, result, subresource) //nolint:forbidigo if err != nil { return nil, fmt.Errorf("failed calling ExtractInto for unstructured: %v", err) } result.SetName(object.GetName()) result.SetNamespace(object.GetNamespace()) result.SetKind(object.GetKind()) result.SetAPIVersion(object.GetAPIVersion()) return result, nil } kubernetes-client-go-a2dfcab/applyconfigurations/networking/000077500000000000000000000000001472614177300246675ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/000077500000000000000000000000001472614177300252155ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/httpingresspath.go000066400000000000000000000050061472614177300307740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/networking/v1" ) // HTTPIngressPathApplyConfiguration represents a declarative configuration of the HTTPIngressPath type for use // with apply. type HTTPIngressPathApplyConfiguration struct { Path *string `json:"path,omitempty"` PathType *v1.PathType `json:"pathType,omitempty"` Backend *IngressBackendApplyConfiguration `json:"backend,omitempty"` } // HTTPIngressPathApplyConfiguration constructs a declarative configuration of the HTTPIngressPath type for use with // apply. func HTTPIngressPath() *HTTPIngressPathApplyConfiguration { return &HTTPIngressPathApplyConfiguration{} } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithPath(value string) *HTTPIngressPathApplyConfiguration { b.Path = &value return b } // WithPathType sets the PathType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PathType field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithPathType(value v1.PathType) *HTTPIngressPathApplyConfiguration { b.PathType = &value return b } // WithBackend sets the Backend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Backend field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithBackend(value *IngressBackendApplyConfiguration) *HTTPIngressPathApplyConfiguration { b.Backend = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/httpingressrulevalue.go000066400000000000000000000033071472614177300320460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // HTTPIngressRuleValueApplyConfiguration represents a declarative configuration of the HTTPIngressRuleValue type for use // with apply. type HTTPIngressRuleValueApplyConfiguration struct { Paths []HTTPIngressPathApplyConfiguration `json:"paths,omitempty"` } // HTTPIngressRuleValueApplyConfiguration constructs a declarative configuration of the HTTPIngressRuleValue type for use with // apply. func HTTPIngressRuleValue() *HTTPIngressRuleValueApplyConfiguration { return &HTTPIngressRuleValueApplyConfiguration{} } // WithPaths adds the given value to the Paths field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Paths field. func (b *HTTPIngressRuleValueApplyConfiguration) WithPaths(values ...*HTTPIngressPathApplyConfiguration) *HTTPIngressRuleValueApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPaths") } b.Paths = append(b.Paths, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingress.go000066400000000000000000000302301472614177300272140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apinetworkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // IngressApplyConfiguration represents a declarative configuration of the Ingress type for use // with apply. type IngressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IngressSpecApplyConfiguration `json:"spec,omitempty"` Status *IngressStatusApplyConfiguration `json:"status,omitempty"` } // Ingress constructs a declarative configuration of the Ingress type for use with // apply. func Ingress(name, namespace string) *IngressApplyConfiguration { b := &IngressApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Ingress") b.WithAPIVersion("networking.k8s.io/v1") return b } // ExtractIngress extracts the applied configuration owned by fieldManager from // ingress. If no managedFields are found in ingress for fieldManager, a // IngressApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // ingress must be a unmodified Ingress API object that was retrieved from the Kubernetes API. // ExtractIngress provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractIngress(ingress *apinetworkingv1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { return extractIngress(ingress, fieldManager, "") } // ExtractIngressStatus is the same as ExtractIngress except // that it extracts the status subresource applied configuration. // Experimental! func ExtractIngressStatus(ingress *apinetworkingv1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { return extractIngress(ingress, fieldManager, "status") } func extractIngress(ingress *apinetworkingv1.Ingress, fieldManager string, subresource string) (*IngressApplyConfiguration, error) { b := &IngressApplyConfiguration{} err := managedfields.ExtractInto(ingress, internal.Parser().Type("io.k8s.api.networking.v1.Ingress"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(ingress.Name) b.WithNamespace(ingress.Namespace) b.WithKind("Ingress") b.WithAPIVersion("networking.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IngressApplyConfiguration) WithKind(value string) *IngressApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *IngressApplyConfiguration) WithAPIVersion(value string) *IngressApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IngressApplyConfiguration) WithName(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *IngressApplyConfiguration) WithGenerateName(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IngressApplyConfiguration) WithNamespace(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *IngressApplyConfiguration) WithUID(value types.UID) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *IngressApplyConfiguration) WithResourceVersion(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *IngressApplyConfiguration) WithGeneration(value int64) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *IngressApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *IngressApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *IngressApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *IngressApplyConfiguration) WithLabels(entries map[string]string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *IngressApplyConfiguration) WithAnnotations(entries map[string]string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *IngressApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *IngressApplyConfiguration) WithFinalizers(values ...string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *IngressApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *IngressApplyConfiguration) WithSpec(value *IngressSpecApplyConfiguration) *IngressApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *IngressApplyConfiguration) WithStatus(value *IngressStatusApplyConfiguration) *IngressApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *IngressApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressbackend.go000066400000000000000000000042211472614177300305250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" ) // IngressBackendApplyConfiguration represents a declarative configuration of the IngressBackend type for use // with apply. type IngressBackendApplyConfiguration struct { Service *IngressServiceBackendApplyConfiguration `json:"service,omitempty"` Resource *corev1.TypedLocalObjectReferenceApplyConfiguration `json:"resource,omitempty"` } // IngressBackendApplyConfiguration constructs a declarative configuration of the IngressBackend type for use with // apply. func IngressBackend() *IngressBackendApplyConfiguration { return &IngressBackendApplyConfiguration{} } // WithService sets the Service field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Service field is set to the value of the last call. func (b *IngressBackendApplyConfiguration) WithService(value *IngressServiceBackendApplyConfiguration) *IngressBackendApplyConfiguration { b.Service = value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *IngressBackendApplyConfiguration) WithResource(value *corev1.TypedLocalObjectReferenceApplyConfiguration) *IngressBackendApplyConfiguration { b.Resource = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressclass.go000066400000000000000000000277031472614177300302550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apinetworkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // IngressClassApplyConfiguration represents a declarative configuration of the IngressClass type for use // with apply. type IngressClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IngressClassSpecApplyConfiguration `json:"spec,omitempty"` } // IngressClass constructs a declarative configuration of the IngressClass type for use with // apply. func IngressClass(name string) *IngressClassApplyConfiguration { b := &IngressClassApplyConfiguration{} b.WithName(name) b.WithKind("IngressClass") b.WithAPIVersion("networking.k8s.io/v1") return b } // ExtractIngressClass extracts the applied configuration owned by fieldManager from // ingressClass. If no managedFields are found in ingressClass for fieldManager, a // IngressClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // ingressClass must be a unmodified IngressClass API object that was retrieved from the Kubernetes API. // ExtractIngressClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractIngressClass(ingressClass *apinetworkingv1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { return extractIngressClass(ingressClass, fieldManager, "") } // ExtractIngressClassStatus is the same as ExtractIngressClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractIngressClassStatus(ingressClass *apinetworkingv1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { return extractIngressClass(ingressClass, fieldManager, "status") } func extractIngressClass(ingressClass *apinetworkingv1.IngressClass, fieldManager string, subresource string) (*IngressClassApplyConfiguration, error) { b := &IngressClassApplyConfiguration{} err := managedfields.ExtractInto(ingressClass, internal.Parser().Type("io.k8s.api.networking.v1.IngressClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(ingressClass.Name) b.WithKind("IngressClass") b.WithAPIVersion("networking.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithKind(value string) *IngressClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithAPIVersion(value string) *IngressClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithName(value string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithGenerateName(value string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithNamespace(value string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithUID(value types.UID) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithResourceVersion(value string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithGeneration(value int64) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *IngressClassApplyConfiguration) WithLabels(entries map[string]string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *IngressClassApplyConfiguration) WithAnnotations(entries map[string]string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *IngressClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *IngressClassApplyConfiguration) WithFinalizers(values ...string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *IngressClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithSpec(value *IngressClassSpecApplyConfiguration) *IngressClassApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *IngressClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressclassparametersreference.go000066400000000000000000000070271472614177300342150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressClassParametersReferenceApplyConfiguration represents a declarative configuration of the IngressClassParametersReference type for use // with apply. type IngressClassParametersReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` Scope *string `json:"scope,omitempty"` Namespace *string `json:"namespace,omitempty"` } // IngressClassParametersReferenceApplyConfiguration constructs a declarative configuration of the IngressClassParametersReference type for use with // apply. func IngressClassParametersReference() *IngressClassParametersReferenceApplyConfiguration { return &IngressClassParametersReferenceApplyConfiguration{} } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithAPIGroup(value string) *IngressClassParametersReferenceApplyConfiguration { b.APIGroup = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithKind(value string) *IngressClassParametersReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithName(value string) *IngressClassParametersReferenceApplyConfiguration { b.Name = &value return b } // WithScope sets the Scope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithScope(value string) *IngressClassParametersReferenceApplyConfiguration { b.Scope = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithNamespace(value string) *IngressClassParametersReferenceApplyConfiguration { b.Namespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressclassspec.go000066400000000000000000000041441472614177300311220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressClassSpecApplyConfiguration represents a declarative configuration of the IngressClassSpec type for use // with apply. type IngressClassSpecApplyConfiguration struct { Controller *string `json:"controller,omitempty"` Parameters *IngressClassParametersReferenceApplyConfiguration `json:"parameters,omitempty"` } // IngressClassSpecApplyConfiguration constructs a declarative configuration of the IngressClassSpec type for use with // apply. func IngressClassSpec() *IngressClassSpecApplyConfiguration { return &IngressClassSpecApplyConfiguration{} } // WithController sets the Controller field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Controller field is set to the value of the last call. func (b *IngressClassSpecApplyConfiguration) WithController(value string) *IngressClassSpecApplyConfiguration { b.Controller = &value return b } // WithParameters sets the Parameters field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Parameters field is set to the value of the last call. func (b *IngressClassSpecApplyConfiguration) WithParameters(value *IngressClassParametersReferenceApplyConfiguration) *IngressClassSpecApplyConfiguration { b.Parameters = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressloadbalanceringress.go000066400000000000000000000053601472614177300331450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressLoadBalancerIngressApplyConfiguration represents a declarative configuration of the IngressLoadBalancerIngress type for use // with apply. type IngressLoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` Hostname *string `json:"hostname,omitempty"` Ports []IngressPortStatusApplyConfiguration `json:"ports,omitempty"` } // IngressLoadBalancerIngressApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerIngress type for use with // apply. func IngressLoadBalancerIngress() *IngressLoadBalancerIngressApplyConfiguration { return &IngressLoadBalancerIngressApplyConfiguration{} } // WithIP sets the IP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IP field is set to the value of the last call. func (b *IngressLoadBalancerIngressApplyConfiguration) WithIP(value string) *IngressLoadBalancerIngressApplyConfiguration { b.IP = &value return b } // WithHostname sets the Hostname field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hostname field is set to the value of the last call. func (b *IngressLoadBalancerIngressApplyConfiguration) WithHostname(value string) *IngressLoadBalancerIngressApplyConfiguration { b.Hostname = &value return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *IngressLoadBalancerIngressApplyConfiguration) WithPorts(values ...*IngressPortStatusApplyConfiguration) *IngressLoadBalancerIngressApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressloadbalancerstatus.go000066400000000000000000000034411472614177300330140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressLoadBalancerStatusApplyConfiguration represents a declarative configuration of the IngressLoadBalancerStatus type for use // with apply. type IngressLoadBalancerStatusApplyConfiguration struct { Ingress []IngressLoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` } // IngressLoadBalancerStatusApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerStatus type for use with // apply. func IngressLoadBalancerStatus() *IngressLoadBalancerStatusApplyConfiguration { return &IngressLoadBalancerStatusApplyConfiguration{} } // WithIngress adds the given value to the Ingress field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ingress field. func (b *IngressLoadBalancerStatusApplyConfiguration) WithIngress(values ...*IngressLoadBalancerIngressApplyConfiguration) *IngressLoadBalancerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithIngress") } b.Ingress = append(b.Ingress, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressportstatus.go000066400000000000000000000046661472614177300314030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // IngressPortStatusApplyConfiguration represents a declarative configuration of the IngressPortStatus type for use // with apply. type IngressPortStatusApplyConfiguration struct { Port *int32 `json:"port,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` Error *string `json:"error,omitempty"` } // IngressPortStatusApplyConfiguration constructs a declarative configuration of the IngressPortStatus type for use with // apply. func IngressPortStatus() *IngressPortStatusApplyConfiguration { return &IngressPortStatusApplyConfiguration{} } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithPort(value int32) *IngressPortStatusApplyConfiguration { b.Port = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithProtocol(value v1.Protocol) *IngressPortStatusApplyConfiguration { b.Protocol = &value return b } // WithError sets the Error field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Error field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithError(value string) *IngressPortStatusApplyConfiguration { b.Error = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressrule.go000066400000000000000000000036401472614177300301110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressRuleApplyConfiguration represents a declarative configuration of the IngressRule type for use // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` IngressRuleValueApplyConfiguration `json:",inline"` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with // apply. func IngressRule() *IngressRuleApplyConfiguration { return &IngressRuleApplyConfiguration{} } // WithHost sets the Host field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Host field is set to the value of the last call. func (b *IngressRuleApplyConfiguration) WithHost(value string) *IngressRuleApplyConfiguration { b.Host = &value return b } // WithHTTP sets the HTTP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTP field is set to the value of the last call. func (b *IngressRuleApplyConfiguration) WithHTTP(value *HTTPIngressRuleValueApplyConfiguration) *IngressRuleApplyConfiguration { b.HTTP = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressrulevalue.go000066400000000000000000000030301472614177300311370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressRuleValueApplyConfiguration represents a declarative configuration of the IngressRuleValue type for use // with apply. type IngressRuleValueApplyConfiguration struct { HTTP *HTTPIngressRuleValueApplyConfiguration `json:"http,omitempty"` } // IngressRuleValueApplyConfiguration constructs a declarative configuration of the IngressRuleValue type for use with // apply. func IngressRuleValue() *IngressRuleValueApplyConfiguration { return &IngressRuleValueApplyConfiguration{} } // WithHTTP sets the HTTP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTP field is set to the value of the last call. func (b *IngressRuleValueApplyConfiguration) WithHTTP(value *HTTPIngressRuleValueApplyConfiguration) *IngressRuleValueApplyConfiguration { b.HTTP = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressservicebackend.go000066400000000000000000000040451472614177300321120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressServiceBackendApplyConfiguration represents a declarative configuration of the IngressServiceBackend type for use // with apply. type IngressServiceBackendApplyConfiguration struct { Name *string `json:"name,omitempty"` Port *ServiceBackendPortApplyConfiguration `json:"port,omitempty"` } // IngressServiceBackendApplyConfiguration constructs a declarative configuration of the IngressServiceBackend type for use with // apply. func IngressServiceBackend() *IngressServiceBackendApplyConfiguration { return &IngressServiceBackendApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IngressServiceBackendApplyConfiguration) WithName(value string) *IngressServiceBackendApplyConfiguration { b.Name = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *IngressServiceBackendApplyConfiguration) WithPort(value *ServiceBackendPortApplyConfiguration) *IngressServiceBackendApplyConfiguration { b.Port = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressspec.go000066400000000000000000000064361472614177300301020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressSpecApplyConfiguration represents a declarative configuration of the IngressSpec type for use // with apply. type IngressSpecApplyConfiguration struct { IngressClassName *string `json:"ingressClassName,omitempty"` DefaultBackend *IngressBackendApplyConfiguration `json:"defaultBackend,omitempty"` TLS []IngressTLSApplyConfiguration `json:"tls,omitempty"` Rules []IngressRuleApplyConfiguration `json:"rules,omitempty"` } // IngressSpecApplyConfiguration constructs a declarative configuration of the IngressSpec type for use with // apply. func IngressSpec() *IngressSpecApplyConfiguration { return &IngressSpecApplyConfiguration{} } // WithIngressClassName sets the IngressClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IngressClassName field is set to the value of the last call. func (b *IngressSpecApplyConfiguration) WithIngressClassName(value string) *IngressSpecApplyConfiguration { b.IngressClassName = &value return b } // WithDefaultBackend sets the DefaultBackend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DefaultBackend field is set to the value of the last call. func (b *IngressSpecApplyConfiguration) WithDefaultBackend(value *IngressBackendApplyConfiguration) *IngressSpecApplyConfiguration { b.DefaultBackend = value return b } // WithTLS adds the given value to the TLS field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TLS field. func (b *IngressSpecApplyConfiguration) WithTLS(values ...*IngressTLSApplyConfiguration) *IngressSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTLS") } b.TLS = append(b.TLS, *values[i]) } return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *IngressSpecApplyConfiguration) WithRules(values ...*IngressRuleApplyConfiguration) *IngressSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingressstatus.go000066400000000000000000000030741472614177300304660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressStatusApplyConfiguration represents a declarative configuration of the IngressStatus type for use // with apply. type IngressStatusApplyConfiguration struct { LoadBalancer *IngressLoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` } // IngressStatusApplyConfiguration constructs a declarative configuration of the IngressStatus type for use with // apply. func IngressStatus() *IngressStatusApplyConfiguration { return &IngressStatusApplyConfiguration{} } // WithLoadBalancer sets the LoadBalancer field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LoadBalancer field is set to the value of the last call. func (b *IngressStatusApplyConfiguration) WithLoadBalancer(value *IngressLoadBalancerStatusApplyConfiguration) *IngressStatusApplyConfiguration { b.LoadBalancer = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ingresstls.go000066400000000000000000000037001472614177300277410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IngressTLSApplyConfiguration represents a declarative configuration of the IngressTLS type for use // with apply. type IngressTLSApplyConfiguration struct { Hosts []string `json:"hosts,omitempty"` SecretName *string `json:"secretName,omitempty"` } // IngressTLSApplyConfiguration constructs a declarative configuration of the IngressTLS type for use with // apply. func IngressTLS() *IngressTLSApplyConfiguration { return &IngressTLSApplyConfiguration{} } // WithHosts adds the given value to the Hosts field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Hosts field. func (b *IngressTLSApplyConfiguration) WithHosts(values ...string) *IngressTLSApplyConfiguration { for i := range values { b.Hosts = append(b.Hosts, values[i]) } return b } // WithSecretName sets the SecretName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretName field is set to the value of the last call. func (b *IngressTLSApplyConfiguration) WithSecretName(value string) *IngressTLSApplyConfiguration { b.SecretName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/ipblock.go000066400000000000000000000035671472614177300272020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // IPBlockApplyConfiguration represents a declarative configuration of the IPBlock type for use // with apply. type IPBlockApplyConfiguration struct { CIDR *string `json:"cidr,omitempty"` Except []string `json:"except,omitempty"` } // IPBlockApplyConfiguration constructs a declarative configuration of the IPBlock type for use with // apply. func IPBlock() *IPBlockApplyConfiguration { return &IPBlockApplyConfiguration{} } // WithCIDR sets the CIDR field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CIDR field is set to the value of the last call. func (b *IPBlockApplyConfiguration) WithCIDR(value string) *IPBlockApplyConfiguration { b.CIDR = &value return b } // WithExcept adds the given value to the Except field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Except field. func (b *IPBlockApplyConfiguration) WithExcept(values ...string) *IPBlockApplyConfiguration { for i := range values { b.Except = append(b.Except, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/networkpolicy.go000066400000000000000000000301371472614177300304610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apinetworkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NetworkPolicyApplyConfiguration represents a declarative configuration of the NetworkPolicy type for use // with apply. type NetworkPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *NetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` } // NetworkPolicy constructs a declarative configuration of the NetworkPolicy type for use with // apply. func NetworkPolicy(name, namespace string) *NetworkPolicyApplyConfiguration { b := &NetworkPolicyApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("NetworkPolicy") b.WithAPIVersion("networking.k8s.io/v1") return b } // ExtractNetworkPolicy extracts the applied configuration owned by fieldManager from // networkPolicy. If no managedFields are found in networkPolicy for fieldManager, a // NetworkPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // networkPolicy must be a unmodified NetworkPolicy API object that was retrieved from the Kubernetes API. // ExtractNetworkPolicy provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractNetworkPolicy(networkPolicy *apinetworkingv1.NetworkPolicy, fieldManager string) (*NetworkPolicyApplyConfiguration, error) { return extractNetworkPolicy(networkPolicy, fieldManager, "") } // ExtractNetworkPolicyStatus is the same as ExtractNetworkPolicy except // that it extracts the status subresource applied configuration. // Experimental! func ExtractNetworkPolicyStatus(networkPolicy *apinetworkingv1.NetworkPolicy, fieldManager string) (*NetworkPolicyApplyConfiguration, error) { return extractNetworkPolicy(networkPolicy, fieldManager, "status") } func extractNetworkPolicy(networkPolicy *apinetworkingv1.NetworkPolicy, fieldManager string, subresource string) (*NetworkPolicyApplyConfiguration, error) { b := &NetworkPolicyApplyConfiguration{} err := managedfields.ExtractInto(networkPolicy, internal.Parser().Type("io.k8s.api.networking.v1.NetworkPolicy"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(networkPolicy.Name) b.WithNamespace(networkPolicy.Namespace) b.WithKind("NetworkPolicy") b.WithAPIVersion("networking.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithKind(value string) *NetworkPolicyApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithAPIVersion(value string) *NetworkPolicyApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithName(value string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithGenerateName(value string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithNamespace(value string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithUID(value types.UID) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithResourceVersion(value string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithGeneration(value int64) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *NetworkPolicyApplyConfiguration) WithLabels(entries map[string]string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *NetworkPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *NetworkPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *NetworkPolicyApplyConfiguration) WithFinalizers(values ...string) *NetworkPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *NetworkPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *NetworkPolicyApplyConfiguration) WithSpec(value *NetworkPolicySpecApplyConfiguration) *NetworkPolicyApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *NetworkPolicyApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/networkpolicyegressrule.go000066400000000000000000000045411472614177300325620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NetworkPolicyEgressRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyEgressRule type for use // with apply. type NetworkPolicyEgressRuleApplyConfiguration struct { Ports []NetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` To []NetworkPolicyPeerApplyConfiguration `json:"to,omitempty"` } // NetworkPolicyEgressRuleApplyConfiguration constructs a declarative configuration of the NetworkPolicyEgressRule type for use with // apply. func NetworkPolicyEgressRule() *NetworkPolicyEgressRuleApplyConfiguration { return &NetworkPolicyEgressRuleApplyConfiguration{} } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *NetworkPolicyEgressRuleApplyConfiguration) WithPorts(values ...*NetworkPolicyPortApplyConfiguration) *NetworkPolicyEgressRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // WithTo adds the given value to the To field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the To field. func (b *NetworkPolicyEgressRuleApplyConfiguration) WithTo(values ...*NetworkPolicyPeerApplyConfiguration) *NetworkPolicyEgressRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTo") } b.To = append(b.To, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/networkpolicyingressrule.go000066400000000000000000000045751472614177300327530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // NetworkPolicyIngressRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyIngressRule type for use // with apply. type NetworkPolicyIngressRuleApplyConfiguration struct { Ports []NetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` From []NetworkPolicyPeerApplyConfiguration `json:"from,omitempty"` } // NetworkPolicyIngressRuleApplyConfiguration constructs a declarative configuration of the NetworkPolicyIngressRule type for use with // apply. func NetworkPolicyIngressRule() *NetworkPolicyIngressRuleApplyConfiguration { return &NetworkPolicyIngressRuleApplyConfiguration{} } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *NetworkPolicyIngressRuleApplyConfiguration) WithPorts(values ...*NetworkPolicyPortApplyConfiguration) *NetworkPolicyIngressRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } // WithFrom adds the given value to the From field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the From field. func (b *NetworkPolicyIngressRuleApplyConfiguration) WithFrom(values ...*NetworkPolicyPeerApplyConfiguration) *NetworkPolicyIngressRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithFrom") } b.From = append(b.From, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/networkpolicypeer.go000066400000000000000000000053431472614177300313360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NetworkPolicyPeerApplyConfiguration represents a declarative configuration of the NetworkPolicyPeer type for use // with apply. type NetworkPolicyPeerApplyConfiguration struct { PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` IPBlock *IPBlockApplyConfiguration `json:"ipBlock,omitempty"` } // NetworkPolicyPeerApplyConfiguration constructs a declarative configuration of the NetworkPolicyPeer type for use with // apply. func NetworkPolicyPeer() *NetworkPolicyPeerApplyConfiguration { return &NetworkPolicyPeerApplyConfiguration{} } // WithPodSelector sets the PodSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodSelector field is set to the value of the last call. func (b *NetworkPolicyPeerApplyConfiguration) WithPodSelector(value *v1.LabelSelectorApplyConfiguration) *NetworkPolicyPeerApplyConfiguration { b.PodSelector = value return b } // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NamespaceSelector field is set to the value of the last call. func (b *NetworkPolicyPeerApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *NetworkPolicyPeerApplyConfiguration { b.NamespaceSelector = value return b } // WithIPBlock sets the IPBlock field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IPBlock field is set to the value of the last call. func (b *NetworkPolicyPeerApplyConfiguration) WithIPBlock(value *IPBlockApplyConfiguration) *NetworkPolicyPeerApplyConfiguration { b.IPBlock = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/networkpolicyport.go000066400000000000000000000050211472614177300313600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" intstr "k8s.io/apimachinery/pkg/util/intstr" ) // NetworkPolicyPortApplyConfiguration represents a declarative configuration of the NetworkPolicyPort type for use // with apply. type NetworkPolicyPortApplyConfiguration struct { Protocol *v1.Protocol `json:"protocol,omitempty"` Port *intstr.IntOrString `json:"port,omitempty"` EndPort *int32 `json:"endPort,omitempty"` } // NetworkPolicyPortApplyConfiguration constructs a declarative configuration of the NetworkPolicyPort type for use with // apply. func NetworkPolicyPort() *NetworkPolicyPortApplyConfiguration { return &NetworkPolicyPortApplyConfiguration{} } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *NetworkPolicyPortApplyConfiguration) WithProtocol(value v1.Protocol) *NetworkPolicyPortApplyConfiguration { b.Protocol = &value return b } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *NetworkPolicyPortApplyConfiguration) WithPort(value intstr.IntOrString) *NetworkPolicyPortApplyConfiguration { b.Port = &value return b } // WithEndPort sets the EndPort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the EndPort field is set to the value of the last call. func (b *NetworkPolicyPortApplyConfiguration) WithEndPort(value int32) *NetworkPolicyPortApplyConfiguration { b.EndPort = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/networkpolicyspec.go000066400000000000000000000071601472614177300313340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apinetworkingv1 "k8s.io/api/networking/v1" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // NetworkPolicySpecApplyConfiguration represents a declarative configuration of the NetworkPolicySpec type for use // with apply. type NetworkPolicySpecApplyConfiguration struct { PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` Ingress []NetworkPolicyIngressRuleApplyConfiguration `json:"ingress,omitempty"` Egress []NetworkPolicyEgressRuleApplyConfiguration `json:"egress,omitempty"` PolicyTypes []apinetworkingv1.PolicyType `json:"policyTypes,omitempty"` } // NetworkPolicySpecApplyConfiguration constructs a declarative configuration of the NetworkPolicySpec type for use with // apply. func NetworkPolicySpec() *NetworkPolicySpecApplyConfiguration { return &NetworkPolicySpecApplyConfiguration{} } // WithPodSelector sets the PodSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodSelector field is set to the value of the last call. func (b *NetworkPolicySpecApplyConfiguration) WithPodSelector(value *v1.LabelSelectorApplyConfiguration) *NetworkPolicySpecApplyConfiguration { b.PodSelector = value return b } // WithIngress adds the given value to the Ingress field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ingress field. func (b *NetworkPolicySpecApplyConfiguration) WithIngress(values ...*NetworkPolicyIngressRuleApplyConfiguration) *NetworkPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithIngress") } b.Ingress = append(b.Ingress, *values[i]) } return b } // WithEgress adds the given value to the Egress field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Egress field. func (b *NetworkPolicySpecApplyConfiguration) WithEgress(values ...*NetworkPolicyEgressRuleApplyConfiguration) *NetworkPolicySpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithEgress") } b.Egress = append(b.Egress, *values[i]) } return b } // WithPolicyTypes adds the given value to the PolicyTypes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PolicyTypes field. func (b *NetworkPolicySpecApplyConfiguration) WithPolicyTypes(values ...apinetworkingv1.PolicyType) *NetworkPolicySpecApplyConfiguration { for i := range values { b.PolicyTypes = append(b.PolicyTypes, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1/servicebackendport.go000066400000000000000000000036661472614177300314340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // ServiceBackendPortApplyConfiguration represents a declarative configuration of the ServiceBackendPort type for use // with apply. type ServiceBackendPortApplyConfiguration struct { Name *string `json:"name,omitempty"` Number *int32 `json:"number,omitempty"` } // ServiceBackendPortApplyConfiguration constructs a declarative configuration of the ServiceBackendPort type for use with // apply. func ServiceBackendPort() *ServiceBackendPortApplyConfiguration { return &ServiceBackendPortApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceBackendPortApplyConfiguration) WithName(value string) *ServiceBackendPortApplyConfiguration { b.Name = &value return b } // WithNumber sets the Number field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Number field is set to the value of the last call. func (b *ServiceBackendPortApplyConfiguration) WithNumber(value int32) *ServiceBackendPortApplyConfiguration { b.Number = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1alpha1/000077500000000000000000000000001472614177300263045ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1alpha1/ipaddress.go000066400000000000000000000274141472614177300306210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( networkingv1alpha1 "k8s.io/api/networking/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // IPAddressApplyConfiguration represents a declarative configuration of the IPAddress type for use // with apply. type IPAddressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IPAddressSpecApplyConfiguration `json:"spec,omitempty"` } // IPAddress constructs a declarative configuration of the IPAddress type for use with // apply. func IPAddress(name string) *IPAddressApplyConfiguration { b := &IPAddressApplyConfiguration{} b.WithName(name) b.WithKind("IPAddress") b.WithAPIVersion("networking.k8s.io/v1alpha1") return b } // ExtractIPAddress extracts the applied configuration owned by fieldManager from // iPAddress. If no managedFields are found in iPAddress for fieldManager, a // IPAddressApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // iPAddress must be a unmodified IPAddress API object that was retrieved from the Kubernetes API. // ExtractIPAddress provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractIPAddress(iPAddress *networkingv1alpha1.IPAddress, fieldManager string) (*IPAddressApplyConfiguration, error) { return extractIPAddress(iPAddress, fieldManager, "") } // ExtractIPAddressStatus is the same as ExtractIPAddress except // that it extracts the status subresource applied configuration. // Experimental! func ExtractIPAddressStatus(iPAddress *networkingv1alpha1.IPAddress, fieldManager string) (*IPAddressApplyConfiguration, error) { return extractIPAddress(iPAddress, fieldManager, "status") } func extractIPAddress(iPAddress *networkingv1alpha1.IPAddress, fieldManager string, subresource string) (*IPAddressApplyConfiguration, error) { b := &IPAddressApplyConfiguration{} err := managedfields.ExtractInto(iPAddress, internal.Parser().Type("io.k8s.api.networking.v1alpha1.IPAddress"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(iPAddress.Name) b.WithKind("IPAddress") b.WithAPIVersion("networking.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithKind(value string) *IPAddressApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithAPIVersion(value string) *IPAddressApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithName(value string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithGenerateName(value string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithNamespace(value string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithUID(value types.UID) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithResourceVersion(value string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithGeneration(value int64) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *IPAddressApplyConfiguration) WithLabels(entries map[string]string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *IPAddressApplyConfiguration) WithAnnotations(entries map[string]string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *IPAddressApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *IPAddressApplyConfiguration) WithFinalizers(values ...string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *IPAddressApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithSpec(value *IPAddressSpecApplyConfiguration) *IPAddressApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *IPAddressApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1alpha1/ipaddressspec.go000066400000000000000000000030311472614177300314610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // IPAddressSpecApplyConfiguration represents a declarative configuration of the IPAddressSpec type for use // with apply. type IPAddressSpecApplyConfiguration struct { ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` } // IPAddressSpecApplyConfiguration constructs a declarative configuration of the IPAddressSpec type for use with // apply. func IPAddressSpec() *IPAddressSpecApplyConfiguration { return &IPAddressSpecApplyConfiguration{} } // WithParentRef sets the ParentRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParentRef field is set to the value of the last call. func (b *IPAddressSpecApplyConfiguration) WithParentRef(value *ParentReferenceApplyConfiguration) *IPAddressSpecApplyConfiguration { b.ParentRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1alpha1/parentreference.go000066400000000000000000000055031472614177300320060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ParentReferenceApplyConfiguration represents a declarative configuration of the ParentReference type for use // with apply. type ParentReferenceApplyConfiguration struct { Group *string `json:"group,omitempty"` Resource *string `json:"resource,omitempty"` Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } // ParentReferenceApplyConfiguration constructs a declarative configuration of the ParentReference type for use with // apply. func ParentReference() *ParentReferenceApplyConfiguration { return &ParentReferenceApplyConfiguration{} } // WithGroup sets the Group field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *ParentReferenceApplyConfiguration) WithGroup(value string) *ParentReferenceApplyConfiguration { b.Group = &value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *ParentReferenceApplyConfiguration) WithResource(value string) *ParentReferenceApplyConfiguration { b.Resource = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ParentReferenceApplyConfiguration) WithNamespace(value string) *ParentReferenceApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ParentReferenceApplyConfiguration) WithName(value string) *ParentReferenceApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1alpha1/servicecidr.go000066400000000000000000000306631472614177300311450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( networkingv1alpha1 "k8s.io/api/networking/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ServiceCIDRApplyConfiguration represents a declarative configuration of the ServiceCIDR type for use // with apply. type ServiceCIDRApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ServiceCIDRSpecApplyConfiguration `json:"spec,omitempty"` Status *ServiceCIDRStatusApplyConfiguration `json:"status,omitempty"` } // ServiceCIDR constructs a declarative configuration of the ServiceCIDR type for use with // apply. func ServiceCIDR(name string) *ServiceCIDRApplyConfiguration { b := &ServiceCIDRApplyConfiguration{} b.WithName(name) b.WithKind("ServiceCIDR") b.WithAPIVersion("networking.k8s.io/v1alpha1") return b } // ExtractServiceCIDR extracts the applied configuration owned by fieldManager from // serviceCIDR. If no managedFields are found in serviceCIDR for fieldManager, a // ServiceCIDRApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // serviceCIDR must be a unmodified ServiceCIDR API object that was retrieved from the Kubernetes API. // ExtractServiceCIDR provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractServiceCIDR(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { return extractServiceCIDR(serviceCIDR, fieldManager, "") } // ExtractServiceCIDRStatus is the same as ExtractServiceCIDR except // that it extracts the status subresource applied configuration. // Experimental! func ExtractServiceCIDRStatus(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { return extractServiceCIDR(serviceCIDR, fieldManager, "status") } func extractServiceCIDR(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string, subresource string) (*ServiceCIDRApplyConfiguration, error) { b := &ServiceCIDRApplyConfiguration{} err := managedfields.ExtractInto(serviceCIDR, internal.Parser().Type("io.k8s.api.networking.v1alpha1.ServiceCIDR"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(serviceCIDR.Name) b.WithKind("ServiceCIDR") b.WithAPIVersion("networking.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithKind(value string) *ServiceCIDRApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithAPIVersion(value string) *ServiceCIDRApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithName(value string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithGenerateName(value string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithNamespace(value string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithUID(value types.UID) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithResourceVersion(value string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithGeneration(value int64) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ServiceCIDRApplyConfiguration) WithLabels(entries map[string]string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ServiceCIDRApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ServiceCIDRApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ServiceCIDRApplyConfiguration) WithFinalizers(values ...string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ServiceCIDRApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithSpec(value *ServiceCIDRSpecApplyConfiguration) *ServiceCIDRApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithStatus(value *ServiceCIDRStatusApplyConfiguration) *ServiceCIDRApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ServiceCIDRApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1alpha1/servicecidrspec.go000066400000000000000000000030351472614177300320110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // ServiceCIDRSpecApplyConfiguration represents a declarative configuration of the ServiceCIDRSpec type for use // with apply. type ServiceCIDRSpecApplyConfiguration struct { CIDRs []string `json:"cidrs,omitempty"` } // ServiceCIDRSpecApplyConfiguration constructs a declarative configuration of the ServiceCIDRSpec type for use with // apply. func ServiceCIDRSpec() *ServiceCIDRSpecApplyConfiguration { return &ServiceCIDRSpecApplyConfiguration{} } // WithCIDRs adds the given value to the CIDRs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CIDRs field. func (b *ServiceCIDRSpecApplyConfiguration) WithCIDRs(values ...string) *ServiceCIDRSpecApplyConfiguration { for i := range values { b.CIDRs = append(b.CIDRs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1alpha1/servicecidrstatus.go000066400000000000000000000034251472614177300324050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ServiceCIDRStatusApplyConfiguration represents a declarative configuration of the ServiceCIDRStatus type for use // with apply. type ServiceCIDRStatusApplyConfiguration struct { Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } // ServiceCIDRStatusApplyConfiguration constructs a declarative configuration of the ServiceCIDRStatus type for use with // apply. func ServiceCIDRStatus() *ServiceCIDRStatusApplyConfiguration { return &ServiceCIDRStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ServiceCIDRStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ServiceCIDRStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/000077500000000000000000000000001472614177300261325ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/httpingresspath.go000066400000000000000000000050321472614177300317100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/networking/v1beta1" ) // HTTPIngressPathApplyConfiguration represents a declarative configuration of the HTTPIngressPath type for use // with apply. type HTTPIngressPathApplyConfiguration struct { Path *string `json:"path,omitempty"` PathType *v1beta1.PathType `json:"pathType,omitempty"` Backend *IngressBackendApplyConfiguration `json:"backend,omitempty"` } // HTTPIngressPathApplyConfiguration constructs a declarative configuration of the HTTPIngressPath type for use with // apply. func HTTPIngressPath() *HTTPIngressPathApplyConfiguration { return &HTTPIngressPathApplyConfiguration{} } // WithPath sets the Path field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Path field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithPath(value string) *HTTPIngressPathApplyConfiguration { b.Path = &value return b } // WithPathType sets the PathType field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PathType field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithPathType(value v1beta1.PathType) *HTTPIngressPathApplyConfiguration { b.PathType = &value return b } // WithBackend sets the Backend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Backend field is set to the value of the last call. func (b *HTTPIngressPathApplyConfiguration) WithBackend(value *IngressBackendApplyConfiguration) *HTTPIngressPathApplyConfiguration { b.Backend = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/httpingressrulevalue.go000066400000000000000000000033141472614177300327610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // HTTPIngressRuleValueApplyConfiguration represents a declarative configuration of the HTTPIngressRuleValue type for use // with apply. type HTTPIngressRuleValueApplyConfiguration struct { Paths []HTTPIngressPathApplyConfiguration `json:"paths,omitempty"` } // HTTPIngressRuleValueApplyConfiguration constructs a declarative configuration of the HTTPIngressRuleValue type for use with // apply. func HTTPIngressRuleValue() *HTTPIngressRuleValueApplyConfiguration { return &HTTPIngressRuleValueApplyConfiguration{} } // WithPaths adds the given value to the Paths field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Paths field. func (b *HTTPIngressRuleValueApplyConfiguration) WithPaths(values ...*HTTPIngressPathApplyConfiguration) *HTTPIngressRuleValueApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPaths") } b.Paths = append(b.Paths, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingress.go000066400000000000000000000302711472614177300301360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // IngressApplyConfiguration represents a declarative configuration of the Ingress type for use // with apply. type IngressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IngressSpecApplyConfiguration `json:"spec,omitempty"` Status *IngressStatusApplyConfiguration `json:"status,omitempty"` } // Ingress constructs a declarative configuration of the Ingress type for use with // apply. func Ingress(name, namespace string) *IngressApplyConfiguration { b := &IngressApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Ingress") b.WithAPIVersion("networking.k8s.io/v1beta1") return b } // ExtractIngress extracts the applied configuration owned by fieldManager from // ingress. If no managedFields are found in ingress for fieldManager, a // IngressApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // ingress must be a unmodified Ingress API object that was retrieved from the Kubernetes API. // ExtractIngress provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractIngress(ingress *networkingv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { return extractIngress(ingress, fieldManager, "") } // ExtractIngressStatus is the same as ExtractIngress except // that it extracts the status subresource applied configuration. // Experimental! func ExtractIngressStatus(ingress *networkingv1beta1.Ingress, fieldManager string) (*IngressApplyConfiguration, error) { return extractIngress(ingress, fieldManager, "status") } func extractIngress(ingress *networkingv1beta1.Ingress, fieldManager string, subresource string) (*IngressApplyConfiguration, error) { b := &IngressApplyConfiguration{} err := managedfields.ExtractInto(ingress, internal.Parser().Type("io.k8s.api.networking.v1beta1.Ingress"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(ingress.Name) b.WithNamespace(ingress.Namespace) b.WithKind("Ingress") b.WithAPIVersion("networking.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IngressApplyConfiguration) WithKind(value string) *IngressApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *IngressApplyConfiguration) WithAPIVersion(value string) *IngressApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IngressApplyConfiguration) WithName(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *IngressApplyConfiguration) WithGenerateName(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IngressApplyConfiguration) WithNamespace(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *IngressApplyConfiguration) WithUID(value types.UID) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *IngressApplyConfiguration) WithResourceVersion(value string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *IngressApplyConfiguration) WithGeneration(value int64) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *IngressApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *IngressApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *IngressApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *IngressApplyConfiguration) WithLabels(entries map[string]string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *IngressApplyConfiguration) WithAnnotations(entries map[string]string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *IngressApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *IngressApplyConfiguration) WithFinalizers(values ...string) *IngressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *IngressApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *IngressApplyConfiguration) WithSpec(value *IngressSpecApplyConfiguration) *IngressApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *IngressApplyConfiguration) WithStatus(value *IngressStatusApplyConfiguration) *IngressApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *IngressApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressbackend.go000066400000000000000000000053111472614177300314430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( intstr "k8s.io/apimachinery/pkg/util/intstr" v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // IngressBackendApplyConfiguration represents a declarative configuration of the IngressBackend type for use // with apply. type IngressBackendApplyConfiguration struct { ServiceName *string `json:"serviceName,omitempty"` ServicePort *intstr.IntOrString `json:"servicePort,omitempty"` Resource *v1.TypedLocalObjectReferenceApplyConfiguration `json:"resource,omitempty"` } // IngressBackendApplyConfiguration constructs a declarative configuration of the IngressBackend type for use with // apply. func IngressBackend() *IngressBackendApplyConfiguration { return &IngressBackendApplyConfiguration{} } // WithServiceName sets the ServiceName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServiceName field is set to the value of the last call. func (b *IngressBackendApplyConfiguration) WithServiceName(value string) *IngressBackendApplyConfiguration { b.ServiceName = &value return b } // WithServicePort sets the ServicePort field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ServicePort field is set to the value of the last call. func (b *IngressBackendApplyConfiguration) WithServicePort(value intstr.IntOrString) *IngressBackendApplyConfiguration { b.ServicePort = &value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *IngressBackendApplyConfiguration) WithResource(value *v1.TypedLocalObjectReferenceApplyConfiguration) *IngressBackendApplyConfiguration { b.Resource = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressclass.go000066400000000000000000000277441472614177300311770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // IngressClassApplyConfiguration represents a declarative configuration of the IngressClass type for use // with apply. type IngressClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IngressClassSpecApplyConfiguration `json:"spec,omitempty"` } // IngressClass constructs a declarative configuration of the IngressClass type for use with // apply. func IngressClass(name string) *IngressClassApplyConfiguration { b := &IngressClassApplyConfiguration{} b.WithName(name) b.WithKind("IngressClass") b.WithAPIVersion("networking.k8s.io/v1beta1") return b } // ExtractIngressClass extracts the applied configuration owned by fieldManager from // ingressClass. If no managedFields are found in ingressClass for fieldManager, a // IngressClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // ingressClass must be a unmodified IngressClass API object that was retrieved from the Kubernetes API. // ExtractIngressClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractIngressClass(ingressClass *networkingv1beta1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { return extractIngressClass(ingressClass, fieldManager, "") } // ExtractIngressClassStatus is the same as ExtractIngressClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractIngressClassStatus(ingressClass *networkingv1beta1.IngressClass, fieldManager string) (*IngressClassApplyConfiguration, error) { return extractIngressClass(ingressClass, fieldManager, "status") } func extractIngressClass(ingressClass *networkingv1beta1.IngressClass, fieldManager string, subresource string) (*IngressClassApplyConfiguration, error) { b := &IngressClassApplyConfiguration{} err := managedfields.ExtractInto(ingressClass, internal.Parser().Type("io.k8s.api.networking.v1beta1.IngressClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(ingressClass.Name) b.WithKind("IngressClass") b.WithAPIVersion("networking.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithKind(value string) *IngressClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithAPIVersion(value string) *IngressClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithName(value string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithGenerateName(value string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithNamespace(value string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithUID(value types.UID) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithResourceVersion(value string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithGeneration(value int64) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *IngressClassApplyConfiguration) WithLabels(entries map[string]string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *IngressClassApplyConfiguration) WithAnnotations(entries map[string]string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *IngressClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *IngressClassApplyConfiguration) WithFinalizers(values ...string) *IngressClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *IngressClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *IngressClassApplyConfiguration) WithSpec(value *IngressClassSpecApplyConfiguration) *IngressClassApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *IngressClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } ingressclassparametersreference.go000066400000000000000000000070341472614177300350510ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressClassParametersReferenceApplyConfiguration represents a declarative configuration of the IngressClassParametersReference type for use // with apply. type IngressClassParametersReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` Scope *string `json:"scope,omitempty"` Namespace *string `json:"namespace,omitempty"` } // IngressClassParametersReferenceApplyConfiguration constructs a declarative configuration of the IngressClassParametersReference type for use with // apply. func IngressClassParametersReference() *IngressClassParametersReferenceApplyConfiguration { return &IngressClassParametersReferenceApplyConfiguration{} } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithAPIGroup(value string) *IngressClassParametersReferenceApplyConfiguration { b.APIGroup = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithKind(value string) *IngressClassParametersReferenceApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithName(value string) *IngressClassParametersReferenceApplyConfiguration { b.Name = &value return b } // WithScope sets the Scope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithScope(value string) *IngressClassParametersReferenceApplyConfiguration { b.Scope = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IngressClassParametersReferenceApplyConfiguration) WithNamespace(value string) *IngressClassParametersReferenceApplyConfiguration { b.Namespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressclassspec.go000066400000000000000000000041511472614177300320350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressClassSpecApplyConfiguration represents a declarative configuration of the IngressClassSpec type for use // with apply. type IngressClassSpecApplyConfiguration struct { Controller *string `json:"controller,omitempty"` Parameters *IngressClassParametersReferenceApplyConfiguration `json:"parameters,omitempty"` } // IngressClassSpecApplyConfiguration constructs a declarative configuration of the IngressClassSpec type for use with // apply. func IngressClassSpec() *IngressClassSpecApplyConfiguration { return &IngressClassSpecApplyConfiguration{} } // WithController sets the Controller field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Controller field is set to the value of the last call. func (b *IngressClassSpecApplyConfiguration) WithController(value string) *IngressClassSpecApplyConfiguration { b.Controller = &value return b } // WithParameters sets the Parameters field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Parameters field is set to the value of the last call. func (b *IngressClassSpecApplyConfiguration) WithParameters(value *IngressClassParametersReferenceApplyConfiguration) *IngressClassSpecApplyConfiguration { b.Parameters = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressloadbalanceringress.go000066400000000000000000000053651472614177300340670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressLoadBalancerIngressApplyConfiguration represents a declarative configuration of the IngressLoadBalancerIngress type for use // with apply. type IngressLoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` Hostname *string `json:"hostname,omitempty"` Ports []IngressPortStatusApplyConfiguration `json:"ports,omitempty"` } // IngressLoadBalancerIngressApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerIngress type for use with // apply. func IngressLoadBalancerIngress() *IngressLoadBalancerIngressApplyConfiguration { return &IngressLoadBalancerIngressApplyConfiguration{} } // WithIP sets the IP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IP field is set to the value of the last call. func (b *IngressLoadBalancerIngressApplyConfiguration) WithIP(value string) *IngressLoadBalancerIngressApplyConfiguration { b.IP = &value return b } // WithHostname sets the Hostname field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Hostname field is set to the value of the last call. func (b *IngressLoadBalancerIngressApplyConfiguration) WithHostname(value string) *IngressLoadBalancerIngressApplyConfiguration { b.Hostname = &value return b } // WithPorts adds the given value to the Ports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ports field. func (b *IngressLoadBalancerIngressApplyConfiguration) WithPorts(values ...*IngressPortStatusApplyConfiguration) *IngressLoadBalancerIngressApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressloadbalancerstatus.go000066400000000000000000000034461472614177300337360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressLoadBalancerStatusApplyConfiguration represents a declarative configuration of the IngressLoadBalancerStatus type for use // with apply. type IngressLoadBalancerStatusApplyConfiguration struct { Ingress []IngressLoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` } // IngressLoadBalancerStatusApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerStatus type for use with // apply. func IngressLoadBalancerStatus() *IngressLoadBalancerStatusApplyConfiguration { return &IngressLoadBalancerStatusApplyConfiguration{} } // WithIngress adds the given value to the Ingress field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Ingress field. func (b *IngressLoadBalancerStatusApplyConfiguration) WithIngress(values ...*IngressLoadBalancerIngressApplyConfiguration) *IngressLoadBalancerStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithIngress") } b.Ingress = append(b.Ingress, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressportstatus.go000066400000000000000000000046731472614177300323160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" ) // IngressPortStatusApplyConfiguration represents a declarative configuration of the IngressPortStatus type for use // with apply. type IngressPortStatusApplyConfiguration struct { Port *int32 `json:"port,omitempty"` Protocol *v1.Protocol `json:"protocol,omitempty"` Error *string `json:"error,omitempty"` } // IngressPortStatusApplyConfiguration constructs a declarative configuration of the IngressPortStatus type for use with // apply. func IngressPortStatus() *IngressPortStatusApplyConfiguration { return &IngressPortStatusApplyConfiguration{} } // WithPort sets the Port field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Port field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithPort(value int32) *IngressPortStatusApplyConfiguration { b.Port = &value return b } // WithProtocol sets the Protocol field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Protocol field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithProtocol(value v1.Protocol) *IngressPortStatusApplyConfiguration { b.Protocol = &value return b } // WithError sets the Error field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Error field is set to the value of the last call. func (b *IngressPortStatusApplyConfiguration) WithError(value string) *IngressPortStatusApplyConfiguration { b.Error = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressrule.go000066400000000000000000000036451472614177300310330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressRuleApplyConfiguration represents a declarative configuration of the IngressRule type for use // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` IngressRuleValueApplyConfiguration `json:",inline"` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with // apply. func IngressRule() *IngressRuleApplyConfiguration { return &IngressRuleApplyConfiguration{} } // WithHost sets the Host field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Host field is set to the value of the last call. func (b *IngressRuleApplyConfiguration) WithHost(value string) *IngressRuleApplyConfiguration { b.Host = &value return b } // WithHTTP sets the HTTP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTP field is set to the value of the last call. func (b *IngressRuleApplyConfiguration) WithHTTP(value *HTTPIngressRuleValueApplyConfiguration) *IngressRuleApplyConfiguration { b.HTTP = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressrulevalue.go000066400000000000000000000030351472614177300320610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressRuleValueApplyConfiguration represents a declarative configuration of the IngressRuleValue type for use // with apply. type IngressRuleValueApplyConfiguration struct { HTTP *HTTPIngressRuleValueApplyConfiguration `json:"http,omitempty"` } // IngressRuleValueApplyConfiguration constructs a declarative configuration of the IngressRuleValue type for use with // apply. func IngressRuleValue() *IngressRuleValueApplyConfiguration { return &IngressRuleValueApplyConfiguration{} } // WithHTTP sets the HTTP field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HTTP field is set to the value of the last call. func (b *IngressRuleValueApplyConfiguration) WithHTTP(value *HTTPIngressRuleValueApplyConfiguration) *IngressRuleValueApplyConfiguration { b.HTTP = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressspec.go000066400000000000000000000063711472614177300310150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressSpecApplyConfiguration represents a declarative configuration of the IngressSpec type for use // with apply. type IngressSpecApplyConfiguration struct { IngressClassName *string `json:"ingressClassName,omitempty"` Backend *IngressBackendApplyConfiguration `json:"backend,omitempty"` TLS []IngressTLSApplyConfiguration `json:"tls,omitempty"` Rules []IngressRuleApplyConfiguration `json:"rules,omitempty"` } // IngressSpecApplyConfiguration constructs a declarative configuration of the IngressSpec type for use with // apply. func IngressSpec() *IngressSpecApplyConfiguration { return &IngressSpecApplyConfiguration{} } // WithIngressClassName sets the IngressClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IngressClassName field is set to the value of the last call. func (b *IngressSpecApplyConfiguration) WithIngressClassName(value string) *IngressSpecApplyConfiguration { b.IngressClassName = &value return b } // WithBackend sets the Backend field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Backend field is set to the value of the last call. func (b *IngressSpecApplyConfiguration) WithBackend(value *IngressBackendApplyConfiguration) *IngressSpecApplyConfiguration { b.Backend = value return b } // WithTLS adds the given value to the TLS field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TLS field. func (b *IngressSpecApplyConfiguration) WithTLS(values ...*IngressTLSApplyConfiguration) *IngressSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTLS") } b.TLS = append(b.TLS, *values[i]) } return b } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *IngressSpecApplyConfiguration) WithRules(values ...*IngressRuleApplyConfiguration) *IngressSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingressstatus.go000066400000000000000000000031011472614177300313720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressStatusApplyConfiguration represents a declarative configuration of the IngressStatus type for use // with apply. type IngressStatusApplyConfiguration struct { LoadBalancer *IngressLoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` } // IngressStatusApplyConfiguration constructs a declarative configuration of the IngressStatus type for use with // apply. func IngressStatus() *IngressStatusApplyConfiguration { return &IngressStatusApplyConfiguration{} } // WithLoadBalancer sets the LoadBalancer field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LoadBalancer field is set to the value of the last call. func (b *IngressStatusApplyConfiguration) WithLoadBalancer(value *IngressLoadBalancerStatusApplyConfiguration) *IngressStatusApplyConfiguration { b.LoadBalancer = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ingresstls.go000066400000000000000000000037051472614177300306630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IngressTLSApplyConfiguration represents a declarative configuration of the IngressTLS type for use // with apply. type IngressTLSApplyConfiguration struct { Hosts []string `json:"hosts,omitempty"` SecretName *string `json:"secretName,omitempty"` } // IngressTLSApplyConfiguration constructs a declarative configuration of the IngressTLS type for use with // apply. func IngressTLS() *IngressTLSApplyConfiguration { return &IngressTLSApplyConfiguration{} } // WithHosts adds the given value to the Hosts field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Hosts field. func (b *IngressTLSApplyConfiguration) WithHosts(values ...string) *IngressTLSApplyConfiguration { for i := range values { b.Hosts = append(b.Hosts, values[i]) } return b } // WithSecretName sets the SecretName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretName field is set to the value of the last call. func (b *IngressTLSApplyConfiguration) WithSecretName(value string) *IngressTLSApplyConfiguration { b.SecretName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ipaddress.go000066400000000000000000000274031472614177300304450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // IPAddressApplyConfiguration represents a declarative configuration of the IPAddress type for use // with apply. type IPAddressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IPAddressSpecApplyConfiguration `json:"spec,omitempty"` } // IPAddress constructs a declarative configuration of the IPAddress type for use with // apply. func IPAddress(name string) *IPAddressApplyConfiguration { b := &IPAddressApplyConfiguration{} b.WithName(name) b.WithKind("IPAddress") b.WithAPIVersion("networking.k8s.io/v1beta1") return b } // ExtractIPAddress extracts the applied configuration owned by fieldManager from // iPAddress. If no managedFields are found in iPAddress for fieldManager, a // IPAddressApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // iPAddress must be a unmodified IPAddress API object that was retrieved from the Kubernetes API. // ExtractIPAddress provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractIPAddress(iPAddress *networkingv1beta1.IPAddress, fieldManager string) (*IPAddressApplyConfiguration, error) { return extractIPAddress(iPAddress, fieldManager, "") } // ExtractIPAddressStatus is the same as ExtractIPAddress except // that it extracts the status subresource applied configuration. // Experimental! func ExtractIPAddressStatus(iPAddress *networkingv1beta1.IPAddress, fieldManager string) (*IPAddressApplyConfiguration, error) { return extractIPAddress(iPAddress, fieldManager, "status") } func extractIPAddress(iPAddress *networkingv1beta1.IPAddress, fieldManager string, subresource string) (*IPAddressApplyConfiguration, error) { b := &IPAddressApplyConfiguration{} err := managedfields.ExtractInto(iPAddress, internal.Parser().Type("io.k8s.api.networking.v1beta1.IPAddress"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(iPAddress.Name) b.WithKind("IPAddress") b.WithAPIVersion("networking.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithKind(value string) *IPAddressApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithAPIVersion(value string) *IPAddressApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithName(value string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithGenerateName(value string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithNamespace(value string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithUID(value types.UID) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithResourceVersion(value string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithGeneration(value int64) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *IPAddressApplyConfiguration) WithLabels(entries map[string]string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *IPAddressApplyConfiguration) WithAnnotations(entries map[string]string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *IPAddressApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *IPAddressApplyConfiguration) WithFinalizers(values ...string) *IPAddressApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *IPAddressApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *IPAddressApplyConfiguration) WithSpec(value *IPAddressSpecApplyConfiguration) *IPAddressApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *IPAddressApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/ipaddressspec.go000066400000000000000000000030301472614177300313060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // IPAddressSpecApplyConfiguration represents a declarative configuration of the IPAddressSpec type for use // with apply. type IPAddressSpecApplyConfiguration struct { ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` } // IPAddressSpecApplyConfiguration constructs a declarative configuration of the IPAddressSpec type for use with // apply. func IPAddressSpec() *IPAddressSpecApplyConfiguration { return &IPAddressSpecApplyConfiguration{} } // WithParentRef sets the ParentRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ParentRef field is set to the value of the last call. func (b *IPAddressSpecApplyConfiguration) WithParentRef(value *ParentReferenceApplyConfiguration) *IPAddressSpecApplyConfiguration { b.ParentRef = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/parentreference.go000066400000000000000000000055021472614177300316330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ParentReferenceApplyConfiguration represents a declarative configuration of the ParentReference type for use // with apply. type ParentReferenceApplyConfiguration struct { Group *string `json:"group,omitempty"` Resource *string `json:"resource,omitempty"` Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } // ParentReferenceApplyConfiguration constructs a declarative configuration of the ParentReference type for use with // apply. func ParentReference() *ParentReferenceApplyConfiguration { return &ParentReferenceApplyConfiguration{} } // WithGroup sets the Group field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *ParentReferenceApplyConfiguration) WithGroup(value string) *ParentReferenceApplyConfiguration { b.Group = &value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *ParentReferenceApplyConfiguration) WithResource(value string) *ParentReferenceApplyConfiguration { b.Resource = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ParentReferenceApplyConfiguration) WithNamespace(value string) *ParentReferenceApplyConfiguration { b.Namespace = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ParentReferenceApplyConfiguration) WithName(value string) *ParentReferenceApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/servicecidr.go000066400000000000000000000306521472614177300307710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ServiceCIDRApplyConfiguration represents a declarative configuration of the ServiceCIDR type for use // with apply. type ServiceCIDRApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ServiceCIDRSpecApplyConfiguration `json:"spec,omitempty"` Status *ServiceCIDRStatusApplyConfiguration `json:"status,omitempty"` } // ServiceCIDR constructs a declarative configuration of the ServiceCIDR type for use with // apply. func ServiceCIDR(name string) *ServiceCIDRApplyConfiguration { b := &ServiceCIDRApplyConfiguration{} b.WithName(name) b.WithKind("ServiceCIDR") b.WithAPIVersion("networking.k8s.io/v1beta1") return b } // ExtractServiceCIDR extracts the applied configuration owned by fieldManager from // serviceCIDR. If no managedFields are found in serviceCIDR for fieldManager, a // ServiceCIDRApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // serviceCIDR must be a unmodified ServiceCIDR API object that was retrieved from the Kubernetes API. // ExtractServiceCIDR provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractServiceCIDR(serviceCIDR *networkingv1beta1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { return extractServiceCIDR(serviceCIDR, fieldManager, "") } // ExtractServiceCIDRStatus is the same as ExtractServiceCIDR except // that it extracts the status subresource applied configuration. // Experimental! func ExtractServiceCIDRStatus(serviceCIDR *networkingv1beta1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { return extractServiceCIDR(serviceCIDR, fieldManager, "status") } func extractServiceCIDR(serviceCIDR *networkingv1beta1.ServiceCIDR, fieldManager string, subresource string) (*ServiceCIDRApplyConfiguration, error) { b := &ServiceCIDRApplyConfiguration{} err := managedfields.ExtractInto(serviceCIDR, internal.Parser().Type("io.k8s.api.networking.v1beta1.ServiceCIDR"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(serviceCIDR.Name) b.WithKind("ServiceCIDR") b.WithAPIVersion("networking.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithKind(value string) *ServiceCIDRApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithAPIVersion(value string) *ServiceCIDRApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithName(value string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithGenerateName(value string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithNamespace(value string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithUID(value types.UID) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithResourceVersion(value string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithGeneration(value int64) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ServiceCIDRApplyConfiguration) WithLabels(entries map[string]string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ServiceCIDRApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ServiceCIDRApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ServiceCIDRApplyConfiguration) WithFinalizers(values ...string) *ServiceCIDRApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ServiceCIDRApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithSpec(value *ServiceCIDRSpecApplyConfiguration) *ServiceCIDRApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ServiceCIDRApplyConfiguration) WithStatus(value *ServiceCIDRStatusApplyConfiguration) *ServiceCIDRApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ServiceCIDRApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/servicecidrspec.go000066400000000000000000000030341472614177300316360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // ServiceCIDRSpecApplyConfiguration represents a declarative configuration of the ServiceCIDRSpec type for use // with apply. type ServiceCIDRSpecApplyConfiguration struct { CIDRs []string `json:"cidrs,omitempty"` } // ServiceCIDRSpecApplyConfiguration constructs a declarative configuration of the ServiceCIDRSpec type for use with // apply. func ServiceCIDRSpec() *ServiceCIDRSpecApplyConfiguration { return &ServiceCIDRSpecApplyConfiguration{} } // WithCIDRs adds the given value to the CIDRs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the CIDRs field. func (b *ServiceCIDRSpecApplyConfiguration) WithCIDRs(values ...string) *ServiceCIDRSpecApplyConfiguration { for i := range values { b.CIDRs = append(b.CIDRs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/networking/v1beta1/servicecidrstatus.go000066400000000000000000000034241472614177300322320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ServiceCIDRStatusApplyConfiguration represents a declarative configuration of the ServiceCIDRStatus type for use // with apply. type ServiceCIDRStatusApplyConfiguration struct { Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } // ServiceCIDRStatusApplyConfiguration constructs a declarative configuration of the ServiceCIDRStatus type for use with // apply. func ServiceCIDRStatus() *ServiceCIDRStatusApplyConfiguration { return &ServiceCIDRStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *ServiceCIDRStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ServiceCIDRStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/node/000077500000000000000000000000001472614177300234255ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/node/v1/000077500000000000000000000000001472614177300237535ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/node/v1/overhead.go000066400000000000000000000027331472614177300261040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" ) // OverheadApplyConfiguration represents a declarative configuration of the Overhead type for use // with apply. type OverheadApplyConfiguration struct { PodFixed *v1.ResourceList `json:"podFixed,omitempty"` } // OverheadApplyConfiguration constructs a declarative configuration of the Overhead type for use with // apply. func Overhead() *OverheadApplyConfiguration { return &OverheadApplyConfiguration{} } // WithPodFixed sets the PodFixed field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodFixed field is set to the value of the last call. func (b *OverheadApplyConfiguration) WithPodFixed(value v1.ResourceList) *OverheadApplyConfiguration { b.PodFixed = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1/runtimeclass.go000066400000000000000000000316531472614177300270230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apinodev1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RuntimeClassApplyConfiguration represents a declarative configuration of the RuntimeClass type for use // with apply. type RuntimeClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Handler *string `json:"handler,omitempty"` Overhead *OverheadApplyConfiguration `json:"overhead,omitempty"` Scheduling *SchedulingApplyConfiguration `json:"scheduling,omitempty"` } // RuntimeClass constructs a declarative configuration of the RuntimeClass type for use with // apply. func RuntimeClass(name string) *RuntimeClassApplyConfiguration { b := &RuntimeClassApplyConfiguration{} b.WithName(name) b.WithKind("RuntimeClass") b.WithAPIVersion("node.k8s.io/v1") return b } // ExtractRuntimeClass extracts the applied configuration owned by fieldManager from // runtimeClass. If no managedFields are found in runtimeClass for fieldManager, a // RuntimeClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // runtimeClass must be a unmodified RuntimeClass API object that was retrieved from the Kubernetes API. // ExtractRuntimeClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRuntimeClass(runtimeClass *apinodev1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { return extractRuntimeClass(runtimeClass, fieldManager, "") } // ExtractRuntimeClassStatus is the same as ExtractRuntimeClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRuntimeClassStatus(runtimeClass *apinodev1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { return extractRuntimeClass(runtimeClass, fieldManager, "status") } func extractRuntimeClass(runtimeClass *apinodev1.RuntimeClass, fieldManager string, subresource string) (*RuntimeClassApplyConfiguration, error) { b := &RuntimeClassApplyConfiguration{} err := managedfields.ExtractInto(runtimeClass, internal.Parser().Type("io.k8s.api.node.v1.RuntimeClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(runtimeClass.Name) b.WithKind("RuntimeClass") b.WithAPIVersion("node.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithKind(value string) *RuntimeClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithAPIVersion(value string) *RuntimeClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithName(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithGenerateName(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithNamespace(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithUID(value types.UID) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithResourceVersion(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithGeneration(value int64) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RuntimeClassApplyConfiguration) WithLabels(entries map[string]string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RuntimeClassApplyConfiguration) WithAnnotations(entries map[string]string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RuntimeClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RuntimeClassApplyConfiguration) WithFinalizers(values ...string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RuntimeClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithHandler sets the Handler field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Handler field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithHandler(value string) *RuntimeClassApplyConfiguration { b.Handler = &value return b } // WithOverhead sets the Overhead field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Overhead field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithOverhead(value *OverheadApplyConfiguration) *RuntimeClassApplyConfiguration { b.Overhead = value return b } // WithScheduling sets the Scheduling field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scheduling field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithScheduling(value *SchedulingApplyConfiguration) *RuntimeClassApplyConfiguration { b.Scheduling = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RuntimeClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1/scheduling.go000066400000000000000000000047041472614177300264340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // SchedulingApplyConfiguration represents a declarative configuration of the Scheduling type for use // with apply. type SchedulingApplyConfiguration struct { NodeSelector map[string]string `json:"nodeSelector,omitempty"` Tolerations []v1.TolerationApplyConfiguration `json:"tolerations,omitempty"` } // SchedulingApplyConfiguration constructs a declarative configuration of the Scheduling type for use with // apply. func Scheduling() *SchedulingApplyConfiguration { return &SchedulingApplyConfiguration{} } // WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the NodeSelector field, // overwriting an existing map entries in NodeSelector field with the same key. func (b *SchedulingApplyConfiguration) WithNodeSelector(entries map[string]string) *SchedulingApplyConfiguration { if b.NodeSelector == nil && len(entries) > 0 { b.NodeSelector = make(map[string]string, len(entries)) } for k, v := range entries { b.NodeSelector[k] = v } return b } // WithTolerations adds the given value to the Tolerations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Tolerations field. func (b *SchedulingApplyConfiguration) WithTolerations(values ...*v1.TolerationApplyConfiguration) *SchedulingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTolerations") } b.Tolerations = append(b.Tolerations, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1alpha1/000077500000000000000000000000001472614177300250425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/node/v1alpha1/overhead.go000066400000000000000000000027411472614177300271720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/api/core/v1" ) // OverheadApplyConfiguration represents a declarative configuration of the Overhead type for use // with apply. type OverheadApplyConfiguration struct { PodFixed *v1.ResourceList `json:"podFixed,omitempty"` } // OverheadApplyConfiguration constructs a declarative configuration of the Overhead type for use with // apply. func Overhead() *OverheadApplyConfiguration { return &OverheadApplyConfiguration{} } // WithPodFixed sets the PodFixed field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodFixed field is set to the value of the last call. func (b *OverheadApplyConfiguration) WithPodFixed(value v1.ResourceList) *OverheadApplyConfiguration { b.PodFixed = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1alpha1/runtimeclass.go000066400000000000000000000276751472614177300301230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( nodev1alpha1 "k8s.io/api/node/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RuntimeClassApplyConfiguration represents a declarative configuration of the RuntimeClass type for use // with apply. type RuntimeClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *RuntimeClassSpecApplyConfiguration `json:"spec,omitempty"` } // RuntimeClass constructs a declarative configuration of the RuntimeClass type for use with // apply. func RuntimeClass(name string) *RuntimeClassApplyConfiguration { b := &RuntimeClassApplyConfiguration{} b.WithName(name) b.WithKind("RuntimeClass") b.WithAPIVersion("node.k8s.io/v1alpha1") return b } // ExtractRuntimeClass extracts the applied configuration owned by fieldManager from // runtimeClass. If no managedFields are found in runtimeClass for fieldManager, a // RuntimeClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // runtimeClass must be a unmodified RuntimeClass API object that was retrieved from the Kubernetes API. // ExtractRuntimeClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRuntimeClass(runtimeClass *nodev1alpha1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { return extractRuntimeClass(runtimeClass, fieldManager, "") } // ExtractRuntimeClassStatus is the same as ExtractRuntimeClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRuntimeClassStatus(runtimeClass *nodev1alpha1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { return extractRuntimeClass(runtimeClass, fieldManager, "status") } func extractRuntimeClass(runtimeClass *nodev1alpha1.RuntimeClass, fieldManager string, subresource string) (*RuntimeClassApplyConfiguration, error) { b := &RuntimeClassApplyConfiguration{} err := managedfields.ExtractInto(runtimeClass, internal.Parser().Type("io.k8s.api.node.v1alpha1.RuntimeClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(runtimeClass.Name) b.WithKind("RuntimeClass") b.WithAPIVersion("node.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithKind(value string) *RuntimeClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithAPIVersion(value string) *RuntimeClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithName(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithGenerateName(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithNamespace(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithUID(value types.UID) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithResourceVersion(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithGeneration(value int64) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RuntimeClassApplyConfiguration) WithLabels(entries map[string]string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RuntimeClassApplyConfiguration) WithAnnotations(entries map[string]string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RuntimeClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RuntimeClassApplyConfiguration) WithFinalizers(values ...string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RuntimeClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithSpec(value *RuntimeClassSpecApplyConfiguration) *RuntimeClassApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RuntimeClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1alpha1/runtimeclassspec.go000066400000000000000000000051161472614177300307600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // RuntimeClassSpecApplyConfiguration represents a declarative configuration of the RuntimeClassSpec type for use // with apply. type RuntimeClassSpecApplyConfiguration struct { RuntimeHandler *string `json:"runtimeHandler,omitempty"` Overhead *OverheadApplyConfiguration `json:"overhead,omitempty"` Scheduling *SchedulingApplyConfiguration `json:"scheduling,omitempty"` } // RuntimeClassSpecApplyConfiguration constructs a declarative configuration of the RuntimeClassSpec type for use with // apply. func RuntimeClassSpec() *RuntimeClassSpecApplyConfiguration { return &RuntimeClassSpecApplyConfiguration{} } // WithRuntimeHandler sets the RuntimeHandler field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RuntimeHandler field is set to the value of the last call. func (b *RuntimeClassSpecApplyConfiguration) WithRuntimeHandler(value string) *RuntimeClassSpecApplyConfiguration { b.RuntimeHandler = &value return b } // WithOverhead sets the Overhead field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Overhead field is set to the value of the last call. func (b *RuntimeClassSpecApplyConfiguration) WithOverhead(value *OverheadApplyConfiguration) *RuntimeClassSpecApplyConfiguration { b.Overhead = value return b } // WithScheduling sets the Scheduling field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scheduling field is set to the value of the last call. func (b *RuntimeClassSpecApplyConfiguration) WithScheduling(value *SchedulingApplyConfiguration) *RuntimeClassSpecApplyConfiguration { b.Scheduling = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1alpha1/scheduling.go000066400000000000000000000047121472614177300275220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // SchedulingApplyConfiguration represents a declarative configuration of the Scheduling type for use // with apply. type SchedulingApplyConfiguration struct { NodeSelector map[string]string `json:"nodeSelector,omitempty"` Tolerations []v1.TolerationApplyConfiguration `json:"tolerations,omitempty"` } // SchedulingApplyConfiguration constructs a declarative configuration of the Scheduling type for use with // apply. func Scheduling() *SchedulingApplyConfiguration { return &SchedulingApplyConfiguration{} } // WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the NodeSelector field, // overwriting an existing map entries in NodeSelector field with the same key. func (b *SchedulingApplyConfiguration) WithNodeSelector(entries map[string]string) *SchedulingApplyConfiguration { if b.NodeSelector == nil && len(entries) > 0 { b.NodeSelector = make(map[string]string, len(entries)) } for k, v := range entries { b.NodeSelector[k] = v } return b } // WithTolerations adds the given value to the Tolerations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Tolerations field. func (b *SchedulingApplyConfiguration) WithTolerations(values ...*v1.TolerationApplyConfiguration) *SchedulingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTolerations") } b.Tolerations = append(b.Tolerations, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1beta1/000077500000000000000000000000001472614177300246705ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/node/v1beta1/overhead.go000066400000000000000000000027401472614177300270170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/api/core/v1" ) // OverheadApplyConfiguration represents a declarative configuration of the Overhead type for use // with apply. type OverheadApplyConfiguration struct { PodFixed *v1.ResourceList `json:"podFixed,omitempty"` } // OverheadApplyConfiguration constructs a declarative configuration of the Overhead type for use with // apply. func Overhead() *OverheadApplyConfiguration { return &OverheadApplyConfiguration{} } // WithPodFixed sets the PodFixed field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodFixed field is set to the value of the last call. func (b *OverheadApplyConfiguration) WithPodFixed(value v1.ResourceList) *OverheadApplyConfiguration { b.PodFixed = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1beta1/runtimeclass.go000066400000000000000000000317141472614177300277360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( nodev1beta1 "k8s.io/api/node/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RuntimeClassApplyConfiguration represents a declarative configuration of the RuntimeClass type for use // with apply. type RuntimeClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Handler *string `json:"handler,omitempty"` Overhead *OverheadApplyConfiguration `json:"overhead,omitempty"` Scheduling *SchedulingApplyConfiguration `json:"scheduling,omitempty"` } // RuntimeClass constructs a declarative configuration of the RuntimeClass type for use with // apply. func RuntimeClass(name string) *RuntimeClassApplyConfiguration { b := &RuntimeClassApplyConfiguration{} b.WithName(name) b.WithKind("RuntimeClass") b.WithAPIVersion("node.k8s.io/v1beta1") return b } // ExtractRuntimeClass extracts the applied configuration owned by fieldManager from // runtimeClass. If no managedFields are found in runtimeClass for fieldManager, a // RuntimeClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // runtimeClass must be a unmodified RuntimeClass API object that was retrieved from the Kubernetes API. // ExtractRuntimeClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRuntimeClass(runtimeClass *nodev1beta1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { return extractRuntimeClass(runtimeClass, fieldManager, "") } // ExtractRuntimeClassStatus is the same as ExtractRuntimeClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRuntimeClassStatus(runtimeClass *nodev1beta1.RuntimeClass, fieldManager string) (*RuntimeClassApplyConfiguration, error) { return extractRuntimeClass(runtimeClass, fieldManager, "status") } func extractRuntimeClass(runtimeClass *nodev1beta1.RuntimeClass, fieldManager string, subresource string) (*RuntimeClassApplyConfiguration, error) { b := &RuntimeClassApplyConfiguration{} err := managedfields.ExtractInto(runtimeClass, internal.Parser().Type("io.k8s.api.node.v1beta1.RuntimeClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(runtimeClass.Name) b.WithKind("RuntimeClass") b.WithAPIVersion("node.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithKind(value string) *RuntimeClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithAPIVersion(value string) *RuntimeClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithName(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithGenerateName(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithNamespace(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithUID(value types.UID) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithResourceVersion(value string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithGeneration(value int64) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RuntimeClassApplyConfiguration) WithLabels(entries map[string]string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RuntimeClassApplyConfiguration) WithAnnotations(entries map[string]string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RuntimeClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RuntimeClassApplyConfiguration) WithFinalizers(values ...string) *RuntimeClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RuntimeClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithHandler sets the Handler field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Handler field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithHandler(value string) *RuntimeClassApplyConfiguration { b.Handler = &value return b } // WithOverhead sets the Overhead field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Overhead field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithOverhead(value *OverheadApplyConfiguration) *RuntimeClassApplyConfiguration { b.Overhead = value return b } // WithScheduling sets the Scheduling field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scheduling field is set to the value of the last call. func (b *RuntimeClassApplyConfiguration) WithScheduling(value *SchedulingApplyConfiguration) *RuntimeClassApplyConfiguration { b.Scheduling = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RuntimeClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/node/v1beta1/scheduling.go000066400000000000000000000047111472614177300273470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // SchedulingApplyConfiguration represents a declarative configuration of the Scheduling type for use // with apply. type SchedulingApplyConfiguration struct { NodeSelector map[string]string `json:"nodeSelector,omitempty"` Tolerations []v1.TolerationApplyConfiguration `json:"tolerations,omitempty"` } // SchedulingApplyConfiguration constructs a declarative configuration of the Scheduling type for use with // apply. func Scheduling() *SchedulingApplyConfiguration { return &SchedulingApplyConfiguration{} } // WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the NodeSelector field, // overwriting an existing map entries in NodeSelector field with the same key. func (b *SchedulingApplyConfiguration) WithNodeSelector(entries map[string]string) *SchedulingApplyConfiguration { if b.NodeSelector == nil && len(entries) > 0 { b.NodeSelector = make(map[string]string, len(entries)) } for k, v := range entries { b.NodeSelector[k] = v } return b } // WithTolerations adds the given value to the Tolerations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Tolerations field. func (b *SchedulingApplyConfiguration) WithTolerations(values ...*v1.TolerationApplyConfiguration) *SchedulingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTolerations") } b.Tolerations = append(b.Tolerations, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/policy/000077500000000000000000000000001472614177300237775ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1/000077500000000000000000000000001472614177300243255ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1/eviction.go000066400000000000000000000273471472614177300265110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( policyv1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // EvictionApplyConfiguration represents a declarative configuration of the Eviction type for use // with apply. type EvictionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` DeleteOptions *v1.DeleteOptionsApplyConfiguration `json:"deleteOptions,omitempty"` } // Eviction constructs a declarative configuration of the Eviction type for use with // apply. func Eviction(name, namespace string) *EvictionApplyConfiguration { b := &EvictionApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Eviction") b.WithAPIVersion("policy/v1") return b } // ExtractEviction extracts the applied configuration owned by fieldManager from // eviction. If no managedFields are found in eviction for fieldManager, a // EvictionApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // eviction must be a unmodified Eviction API object that was retrieved from the Kubernetes API. // ExtractEviction provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractEviction(eviction *policyv1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { return extractEviction(eviction, fieldManager, "") } // ExtractEvictionStatus is the same as ExtractEviction except // that it extracts the status subresource applied configuration. // Experimental! func ExtractEvictionStatus(eviction *policyv1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { return extractEviction(eviction, fieldManager, "status") } func extractEviction(eviction *policyv1.Eviction, fieldManager string, subresource string) (*EvictionApplyConfiguration, error) { b := &EvictionApplyConfiguration{} err := managedfields.ExtractInto(eviction, internal.Parser().Type("io.k8s.api.policy.v1.Eviction"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(eviction.Name) b.WithNamespace(eviction.Namespace) b.WithKind("Eviction") b.WithAPIVersion("policy/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithKind(value string) *EvictionApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithAPIVersion(value string) *EvictionApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithName(value string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithGenerateName(value string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithNamespace(value string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithUID(value types.UID) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithResourceVersion(value string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithGeneration(value int64) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *EvictionApplyConfiguration) WithLabels(entries map[string]string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *EvictionApplyConfiguration) WithAnnotations(entries map[string]string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *EvictionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *EvictionApplyConfiguration) WithFinalizers(values ...string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *EvictionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithDeleteOptions sets the DeleteOptions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeleteOptions field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithDeleteOptions(value *v1.DeleteOptionsApplyConfiguration) *EvictionApplyConfiguration { b.DeleteOptions = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *EvictionApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1/poddisruptionbudget.go000066400000000000000000000320521472614177300307540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apipolicyv1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodDisruptionBudgetApplyConfiguration represents a declarative configuration of the PodDisruptionBudget type for use // with apply. type PodDisruptionBudgetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PodDisruptionBudgetSpecApplyConfiguration `json:"spec,omitempty"` Status *PodDisruptionBudgetStatusApplyConfiguration `json:"status,omitempty"` } // PodDisruptionBudget constructs a declarative configuration of the PodDisruptionBudget type for use with // apply. func PodDisruptionBudget(name, namespace string) *PodDisruptionBudgetApplyConfiguration { b := &PodDisruptionBudgetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("PodDisruptionBudget") b.WithAPIVersion("policy/v1") return b } // ExtractPodDisruptionBudget extracts the applied configuration owned by fieldManager from // podDisruptionBudget. If no managedFields are found in podDisruptionBudget for fieldManager, a // PodDisruptionBudgetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // podDisruptionBudget must be a unmodified PodDisruptionBudget API object that was retrieved from the Kubernetes API. // ExtractPodDisruptionBudget provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPodDisruptionBudget(podDisruptionBudget *apipolicyv1.PodDisruptionBudget, fieldManager string) (*PodDisruptionBudgetApplyConfiguration, error) { return extractPodDisruptionBudget(podDisruptionBudget, fieldManager, "") } // ExtractPodDisruptionBudgetStatus is the same as ExtractPodDisruptionBudget except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPodDisruptionBudgetStatus(podDisruptionBudget *apipolicyv1.PodDisruptionBudget, fieldManager string) (*PodDisruptionBudgetApplyConfiguration, error) { return extractPodDisruptionBudget(podDisruptionBudget, fieldManager, "status") } func extractPodDisruptionBudget(podDisruptionBudget *apipolicyv1.PodDisruptionBudget, fieldManager string, subresource string) (*PodDisruptionBudgetApplyConfiguration, error) { b := &PodDisruptionBudgetApplyConfiguration{} err := managedfields.ExtractInto(podDisruptionBudget, internal.Parser().Type("io.k8s.api.policy.v1.PodDisruptionBudget"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(podDisruptionBudget.Name) b.WithNamespace(podDisruptionBudget.Namespace) b.WithKind("PodDisruptionBudget") b.WithAPIVersion("policy/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithKind(value string) *PodDisruptionBudgetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithAPIVersion(value string) *PodDisruptionBudgetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithName(value string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithGenerateName(value string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithNamespace(value string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithUID(value types.UID) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithResourceVersion(value string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithGeneration(value int64) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PodDisruptionBudgetApplyConfiguration) WithLabels(entries map[string]string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PodDisruptionBudgetApplyConfiguration) WithAnnotations(entries map[string]string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PodDisruptionBudgetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PodDisruptionBudgetApplyConfiguration) WithFinalizers(values ...string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PodDisruptionBudgetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithSpec(value *PodDisruptionBudgetSpecApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithStatus(value *PodDisruptionBudgetStatusApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PodDisruptionBudgetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1/poddisruptionbudgetspec.go000066400000000000000000000070641472614177300316340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( policyv1 "k8s.io/api/policy/v1" intstr "k8s.io/apimachinery/pkg/util/intstr" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodDisruptionBudgetSpecApplyConfiguration represents a declarative configuration of the PodDisruptionBudgetSpec type for use // with apply. type PodDisruptionBudgetSpecApplyConfiguration struct { MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` UnhealthyPodEvictionPolicy *policyv1.UnhealthyPodEvictionPolicyType `json:"unhealthyPodEvictionPolicy,omitempty"` } // PodDisruptionBudgetSpecApplyConfiguration constructs a declarative configuration of the PodDisruptionBudgetSpec type for use with // apply. func PodDisruptionBudgetSpec() *PodDisruptionBudgetSpecApplyConfiguration { return &PodDisruptionBudgetSpecApplyConfiguration{} } // WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinAvailable field is set to the value of the last call. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithMinAvailable(value intstr.IntOrString) *PodDisruptionBudgetSpecApplyConfiguration { b.MinAvailable = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *PodDisruptionBudgetSpecApplyConfiguration { b.Selector = value return b } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *PodDisruptionBudgetSpecApplyConfiguration { b.MaxUnavailable = &value return b } // WithUnhealthyPodEvictionPolicy sets the UnhealthyPodEvictionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UnhealthyPodEvictionPolicy field is set to the value of the last call. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithUnhealthyPodEvictionPolicy(value policyv1.UnhealthyPodEvictionPolicyType) *PodDisruptionBudgetSpecApplyConfiguration { b.UnhealthyPodEvictionPolicy = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go000066400000000000000000000127161472614177300322250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodDisruptionBudgetStatusApplyConfiguration represents a declarative configuration of the PodDisruptionBudgetStatus type for use // with apply. type PodDisruptionBudgetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` DisruptedPods map[string]v1.Time `json:"disruptedPods,omitempty"` DisruptionsAllowed *int32 `json:"disruptionsAllowed,omitempty"` CurrentHealthy *int32 `json:"currentHealthy,omitempty"` DesiredHealthy *int32 `json:"desiredHealthy,omitempty"` ExpectedPods *int32 `json:"expectedPods,omitempty"` Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } // PodDisruptionBudgetStatusApplyConfiguration constructs a declarative configuration of the PodDisruptionBudgetStatus type for use with // apply. func PodDisruptionBudgetStatus() *PodDisruptionBudgetStatusApplyConfiguration { return &PodDisruptionBudgetStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithObservedGeneration(value int64) *PodDisruptionBudgetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithDisruptedPods puts the entries into the DisruptedPods field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the DisruptedPods field, // overwriting an existing map entries in DisruptedPods field with the same key. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptedPods(entries map[string]v1.Time) *PodDisruptionBudgetStatusApplyConfiguration { if b.DisruptedPods == nil && len(entries) > 0 { b.DisruptedPods = make(map[string]v1.Time, len(entries)) } for k, v := range entries { b.DisruptedPods[k] = v } return b } // WithDisruptionsAllowed sets the DisruptionsAllowed field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DisruptionsAllowed field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptionsAllowed(value int32) *PodDisruptionBudgetStatusApplyConfiguration { b.DisruptionsAllowed = &value return b } // WithCurrentHealthy sets the CurrentHealthy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentHealthy field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithCurrentHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration { b.CurrentHealthy = &value return b } // WithDesiredHealthy sets the DesiredHealthy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredHealthy field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDesiredHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration { b.DesiredHealthy = &value return b } // WithExpectedPods sets the ExpectedPods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExpectedPods field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithExpectedPods(value int32) *PodDisruptionBudgetStatusApplyConfiguration { b.ExpectedPods = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *PodDisruptionBudgetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1beta1/000077500000000000000000000000001472614177300252425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1beta1/eviction.go000066400000000000000000000273741472614177300274260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // EvictionApplyConfiguration represents a declarative configuration of the Eviction type for use // with apply. type EvictionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` DeleteOptions *v1.DeleteOptionsApplyConfiguration `json:"deleteOptions,omitempty"` } // Eviction constructs a declarative configuration of the Eviction type for use with // apply. func Eviction(name, namespace string) *EvictionApplyConfiguration { b := &EvictionApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Eviction") b.WithAPIVersion("policy/v1beta1") return b } // ExtractEviction extracts the applied configuration owned by fieldManager from // eviction. If no managedFields are found in eviction for fieldManager, a // EvictionApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // eviction must be a unmodified Eviction API object that was retrieved from the Kubernetes API. // ExtractEviction provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractEviction(eviction *v1beta1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { return extractEviction(eviction, fieldManager, "") } // ExtractEvictionStatus is the same as ExtractEviction except // that it extracts the status subresource applied configuration. // Experimental! func ExtractEvictionStatus(eviction *v1beta1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { return extractEviction(eviction, fieldManager, "status") } func extractEviction(eviction *v1beta1.Eviction, fieldManager string, subresource string) (*EvictionApplyConfiguration, error) { b := &EvictionApplyConfiguration{} err := managedfields.ExtractInto(eviction, internal.Parser().Type("io.k8s.api.policy.v1beta1.Eviction"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(eviction.Name) b.WithNamespace(eviction.Namespace) b.WithKind("Eviction") b.WithAPIVersion("policy/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithKind(value string) *EvictionApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithAPIVersion(value string) *EvictionApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithName(value string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithGenerateName(value string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithNamespace(value string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithUID(value types.UID) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithResourceVersion(value string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithGeneration(value int64) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *EvictionApplyConfiguration) WithLabels(entries map[string]string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *EvictionApplyConfiguration) WithAnnotations(entries map[string]string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *EvictionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *EvictionApplyConfiguration) WithFinalizers(values ...string) *EvictionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *EvictionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithDeleteOptions sets the DeleteOptions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeleteOptions field is set to the value of the last call. func (b *EvictionApplyConfiguration) WithDeleteOptions(value *v1.DeleteOptionsApplyConfiguration) *EvictionApplyConfiguration { b.DeleteOptions = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *EvictionApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1beta1/poddisruptionbudget.go000066400000000000000000000321131472614177300316670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodDisruptionBudgetApplyConfiguration represents a declarative configuration of the PodDisruptionBudget type for use // with apply. type PodDisruptionBudgetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PodDisruptionBudgetSpecApplyConfiguration `json:"spec,omitempty"` Status *PodDisruptionBudgetStatusApplyConfiguration `json:"status,omitempty"` } // PodDisruptionBudget constructs a declarative configuration of the PodDisruptionBudget type for use with // apply. func PodDisruptionBudget(name, namespace string) *PodDisruptionBudgetApplyConfiguration { b := &PodDisruptionBudgetApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("PodDisruptionBudget") b.WithAPIVersion("policy/v1beta1") return b } // ExtractPodDisruptionBudget extracts the applied configuration owned by fieldManager from // podDisruptionBudget. If no managedFields are found in podDisruptionBudget for fieldManager, a // PodDisruptionBudgetApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // podDisruptionBudget must be a unmodified PodDisruptionBudget API object that was retrieved from the Kubernetes API. // ExtractPodDisruptionBudget provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPodDisruptionBudget(podDisruptionBudget *policyv1beta1.PodDisruptionBudget, fieldManager string) (*PodDisruptionBudgetApplyConfiguration, error) { return extractPodDisruptionBudget(podDisruptionBudget, fieldManager, "") } // ExtractPodDisruptionBudgetStatus is the same as ExtractPodDisruptionBudget except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPodDisruptionBudgetStatus(podDisruptionBudget *policyv1beta1.PodDisruptionBudget, fieldManager string) (*PodDisruptionBudgetApplyConfiguration, error) { return extractPodDisruptionBudget(podDisruptionBudget, fieldManager, "status") } func extractPodDisruptionBudget(podDisruptionBudget *policyv1beta1.PodDisruptionBudget, fieldManager string, subresource string) (*PodDisruptionBudgetApplyConfiguration, error) { b := &PodDisruptionBudgetApplyConfiguration{} err := managedfields.ExtractInto(podDisruptionBudget, internal.Parser().Type("io.k8s.api.policy.v1beta1.PodDisruptionBudget"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(podDisruptionBudget.Name) b.WithNamespace(podDisruptionBudget.Namespace) b.WithKind("PodDisruptionBudget") b.WithAPIVersion("policy/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithKind(value string) *PodDisruptionBudgetApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithAPIVersion(value string) *PodDisruptionBudgetApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithName(value string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithGenerateName(value string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithNamespace(value string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithUID(value types.UID) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithResourceVersion(value string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithGeneration(value int64) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PodDisruptionBudgetApplyConfiguration) WithLabels(entries map[string]string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PodDisruptionBudgetApplyConfiguration) WithAnnotations(entries map[string]string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PodDisruptionBudgetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PodDisruptionBudgetApplyConfiguration) WithFinalizers(values ...string) *PodDisruptionBudgetApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PodDisruptionBudgetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithSpec(value *PodDisruptionBudgetSpecApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PodDisruptionBudgetApplyConfiguration) WithStatus(value *PodDisruptionBudgetStatusApplyConfiguration) *PodDisruptionBudgetApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PodDisruptionBudgetApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go000066400000000000000000000070701472614177300325460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/policy/v1beta1" intstr "k8s.io/apimachinery/pkg/util/intstr" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodDisruptionBudgetSpecApplyConfiguration represents a declarative configuration of the PodDisruptionBudgetSpec type for use // with apply. type PodDisruptionBudgetSpecApplyConfiguration struct { MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` UnhealthyPodEvictionPolicy *v1beta1.UnhealthyPodEvictionPolicyType `json:"unhealthyPodEvictionPolicy,omitempty"` } // PodDisruptionBudgetSpecApplyConfiguration constructs a declarative configuration of the PodDisruptionBudgetSpec type for use with // apply. func PodDisruptionBudgetSpec() *PodDisruptionBudgetSpecApplyConfiguration { return &PodDisruptionBudgetSpecApplyConfiguration{} } // WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MinAvailable field is set to the value of the last call. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithMinAvailable(value intstr.IntOrString) *PodDisruptionBudgetSpecApplyConfiguration { b.MinAvailable = &value return b } // WithSelector sets the Selector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Selector field is set to the value of the last call. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *PodDisruptionBudgetSpecApplyConfiguration { b.Selector = value return b } // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaxUnavailable field is set to the value of the last call. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *PodDisruptionBudgetSpecApplyConfiguration { b.MaxUnavailable = &value return b } // WithUnhealthyPodEvictionPolicy sets the UnhealthyPodEvictionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UnhealthyPodEvictionPolicy field is set to the value of the last call. func (b *PodDisruptionBudgetSpecApplyConfiguration) WithUnhealthyPodEvictionPolicy(value v1beta1.UnhealthyPodEvictionPolicyType) *PodDisruptionBudgetSpecApplyConfiguration { b.UnhealthyPodEvictionPolicy = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/policy/v1beta1/poddisruptionbudgetstatus.go000066400000000000000000000127231472614177300331400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodDisruptionBudgetStatusApplyConfiguration represents a declarative configuration of the PodDisruptionBudgetStatus type for use // with apply. type PodDisruptionBudgetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` DisruptedPods map[string]v1.Time `json:"disruptedPods,omitempty"` DisruptionsAllowed *int32 `json:"disruptionsAllowed,omitempty"` CurrentHealthy *int32 `json:"currentHealthy,omitempty"` DesiredHealthy *int32 `json:"desiredHealthy,omitempty"` ExpectedPods *int32 `json:"expectedPods,omitempty"` Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } // PodDisruptionBudgetStatusApplyConfiguration constructs a declarative configuration of the PodDisruptionBudgetStatus type for use with // apply. func PodDisruptionBudgetStatus() *PodDisruptionBudgetStatusApplyConfiguration { return &PodDisruptionBudgetStatusApplyConfiguration{} } // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithObservedGeneration(value int64) *PodDisruptionBudgetStatusApplyConfiguration { b.ObservedGeneration = &value return b } // WithDisruptedPods puts the entries into the DisruptedPods field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the DisruptedPods field, // overwriting an existing map entries in DisruptedPods field with the same key. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptedPods(entries map[string]v1.Time) *PodDisruptionBudgetStatusApplyConfiguration { if b.DisruptedPods == nil && len(entries) > 0 { b.DisruptedPods = make(map[string]v1.Time, len(entries)) } for k, v := range entries { b.DisruptedPods[k] = v } return b } // WithDisruptionsAllowed sets the DisruptionsAllowed field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DisruptionsAllowed field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptionsAllowed(value int32) *PodDisruptionBudgetStatusApplyConfiguration { b.DisruptionsAllowed = &value return b } // WithCurrentHealthy sets the CurrentHealthy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CurrentHealthy field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithCurrentHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration { b.CurrentHealthy = &value return b } // WithDesiredHealthy sets the DesiredHealthy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DesiredHealthy field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDesiredHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration { b.DesiredHealthy = &value return b } // WithExpectedPods sets the ExpectedPods field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExpectedPods field is set to the value of the last call. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithExpectedPods(value int32) *PodDisruptionBudgetStatusApplyConfiguration { b.ExpectedPods = &value return b } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *PodDisruptionBudgetStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *PodDisruptionBudgetStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/000077500000000000000000000000001472614177300234075ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/000077500000000000000000000000001472614177300237355ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/aggregationrule.go000066400000000000000000000035351472614177300274510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // AggregationRuleApplyConfiguration represents a declarative configuration of the AggregationRule type for use // with apply. type AggregationRuleApplyConfiguration struct { ClusterRoleSelectors []v1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } // AggregationRuleApplyConfiguration constructs a declarative configuration of the AggregationRule type for use with // apply. func AggregationRule() *AggregationRuleApplyConfiguration { return &AggregationRuleApplyConfiguration{} } // WithClusterRoleSelectors adds the given value to the ClusterRoleSelectors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ClusterRoleSelectors field. func (b *AggregationRuleApplyConfiguration) WithClusterRoleSelectors(values ...*v1.LabelSelectorApplyConfiguration) *AggregationRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithClusterRoleSelectors") } b.ClusterRoleSelectors = append(b.ClusterRoleSelectors, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/clusterrole.go000066400000000000000000000310571472614177300266350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apirbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ClusterRoleApplyConfiguration represents a declarative configuration of the ClusterRole type for use // with apply. type ClusterRoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` } // ClusterRole constructs a declarative configuration of the ClusterRole type for use with // apply. func ClusterRole(name string) *ClusterRoleApplyConfiguration { b := &ClusterRoleApplyConfiguration{} b.WithName(name) b.WithKind("ClusterRole") b.WithAPIVersion("rbac.authorization.k8s.io/v1") return b } // ExtractClusterRole extracts the applied configuration owned by fieldManager from // clusterRole. If no managedFields are found in clusterRole for fieldManager, a // ClusterRoleApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // clusterRole must be a unmodified ClusterRole API object that was retrieved from the Kubernetes API. // ExtractClusterRole provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractClusterRole(clusterRole *apirbacv1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { return extractClusterRole(clusterRole, fieldManager, "") } // ExtractClusterRoleStatus is the same as ExtractClusterRole except // that it extracts the status subresource applied configuration. // Experimental! func ExtractClusterRoleStatus(clusterRole *apirbacv1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { return extractClusterRole(clusterRole, fieldManager, "status") } func extractClusterRole(clusterRole *apirbacv1.ClusterRole, fieldManager string, subresource string) (*ClusterRoleApplyConfiguration, error) { b := &ClusterRoleApplyConfiguration{} err := managedfields.ExtractInto(clusterRole, internal.Parser().Type("io.k8s.api.rbac.v1.ClusterRole"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(clusterRole.Name) b.WithKind("ClusterRole") b.WithAPIVersion("rbac.authorization.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithKind(value string) *ClusterRoleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithAPIVersion(value string) *ClusterRoleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithName(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithGenerateName(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithNamespace(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithUID(value types.UID) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithResourceVersion(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithGeneration(value int64) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ClusterRoleApplyConfiguration) WithLabels(entries map[string]string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterRoleApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ClusterRoleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ClusterRoleApplyConfiguration) WithFinalizers(values ...string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ClusterRoleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *ClusterRoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfiguration) *ClusterRoleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // WithAggregationRule sets the AggregationRule field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AggregationRule field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithAggregationRule(value *AggregationRuleApplyConfiguration) *ClusterRoleApplyConfiguration { b.AggregationRule = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterRoleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/clusterrolebinding.go000066400000000000000000000320131472614177300301610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apirbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ClusterRoleBindingApplyConfiguration represents a declarative configuration of the ClusterRoleBinding type for use // with apply. type ClusterRoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } // ClusterRoleBinding constructs a declarative configuration of the ClusterRoleBinding type for use with // apply. func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { b := &ClusterRoleBindingApplyConfiguration{} b.WithName(name) b.WithKind("ClusterRoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1") return b } // ExtractClusterRoleBinding extracts the applied configuration owned by fieldManager from // clusterRoleBinding. If no managedFields are found in clusterRoleBinding for fieldManager, a // ClusterRoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // clusterRoleBinding must be a unmodified ClusterRoleBinding API object that was retrieved from the Kubernetes API. // ExtractClusterRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractClusterRoleBinding(clusterRoleBinding *apirbacv1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "") } // ExtractClusterRoleBindingStatus is the same as ExtractClusterRoleBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractClusterRoleBindingStatus(clusterRoleBinding *apirbacv1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "status") } func extractClusterRoleBinding(clusterRoleBinding *apirbacv1.ClusterRoleBinding, fieldManager string, subresource string) (*ClusterRoleBindingApplyConfiguration, error) { b := &ClusterRoleBindingApplyConfiguration{} err := managedfields.ExtractInto(clusterRoleBinding, internal.Parser().Type("io.k8s.api.rbac.v1.ClusterRoleBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(clusterRoleBinding.Name) b.WithKind("ClusterRoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithKind(value string) *ClusterRoleBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithAPIVersion(value string) *ClusterRoleBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithName(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithGenerateName(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithNamespace(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithUID(value types.UID) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithResourceVersion(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithGeneration(value int64) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ClusterRoleBindingApplyConfiguration) WithLabels(entries map[string]string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterRoleBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ClusterRoleBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ClusterRoleBindingApplyConfiguration) WithFinalizers(values ...string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ClusterRoleBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *ClusterRoleBindingApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *ClusterRoleBindingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithRoleRef sets the RoleRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RoleRef field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfiguration) *ClusterRoleBindingApplyConfiguration { b.RoleRef = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterRoleBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/policyrule.go000066400000000000000000000072351472614177300264620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // PolicyRuleApplyConfiguration represents a declarative configuration of the PolicyRule type for use // with apply. type PolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` APIGroups []string `json:"apiGroups,omitempty"` Resources []string `json:"resources,omitempty"` ResourceNames []string `json:"resourceNames,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } // PolicyRuleApplyConfiguration constructs a declarative configuration of the PolicyRule type for use with // apply. func PolicyRule() *PolicyRuleApplyConfiguration { return &PolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *PolicyRuleApplyConfiguration) WithVerbs(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *PolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *PolicyRuleApplyConfiguration) WithResources(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithResourceNames adds the given value to the ResourceNames field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceNames field. func (b *PolicyRuleApplyConfiguration) WithResourceNames(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.ResourceNames = append(b.ResourceNames, values[i]) } return b } // WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceURLs field. func (b *PolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.NonResourceURLs = append(b.NonResourceURLs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/role.go000066400000000000000000000270631472614177300252350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apirbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RoleApplyConfiguration represents a declarative configuration of the Role type for use // with apply. type RoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } // Role constructs a declarative configuration of the Role type for use with // apply. func Role(name, namespace string) *RoleApplyConfiguration { b := &RoleApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Role") b.WithAPIVersion("rbac.authorization.k8s.io/v1") return b } // ExtractRole extracts the applied configuration owned by fieldManager from // role. If no managedFields are found in role for fieldManager, a // RoleApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // role must be a unmodified Role API object that was retrieved from the Kubernetes API. // ExtractRole provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRole(role *apirbacv1.Role, fieldManager string) (*RoleApplyConfiguration, error) { return extractRole(role, fieldManager, "") } // ExtractRoleStatus is the same as ExtractRole except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRoleStatus(role *apirbacv1.Role, fieldManager string) (*RoleApplyConfiguration, error) { return extractRole(role, fieldManager, "status") } func extractRole(role *apirbacv1.Role, fieldManager string, subresource string) (*RoleApplyConfiguration, error) { b := &RoleApplyConfiguration{} err := managedfields.ExtractInto(role, internal.Parser().Type("io.k8s.api.rbac.v1.Role"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(role.Name) b.WithNamespace(role.Namespace) b.WithKind("Role") b.WithAPIVersion("rbac.authorization.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleApplyConfiguration) WithKind(value string) *RoleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RoleApplyConfiguration) WithAPIVersion(value string) *RoleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleApplyConfiguration) WithName(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RoleApplyConfiguration) WithGenerateName(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RoleApplyConfiguration) WithNamespace(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RoleApplyConfiguration) WithUID(value types.UID) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RoleApplyConfiguration) WithResourceVersion(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RoleApplyConfiguration) WithGeneration(value int64) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RoleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RoleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RoleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RoleApplyConfiguration) WithLabels(entries map[string]string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RoleApplyConfiguration) WithAnnotations(entries map[string]string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RoleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RoleApplyConfiguration) WithFinalizers(values ...string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RoleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *RoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfiguration) *RoleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RoleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/rolebinding.go000066400000000000000000000311151472614177300265610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apirbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RoleBindingApplyConfiguration represents a declarative configuration of the RoleBinding type for use // with apply. type RoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } // RoleBinding constructs a declarative configuration of the RoleBinding type for use with // apply. func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { b := &RoleBindingApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("RoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1") return b } // ExtractRoleBinding extracts the applied configuration owned by fieldManager from // roleBinding. If no managedFields are found in roleBinding for fieldManager, a // RoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // roleBinding must be a unmodified RoleBinding API object that was retrieved from the Kubernetes API. // ExtractRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRoleBinding(roleBinding *apirbacv1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { return extractRoleBinding(roleBinding, fieldManager, "") } // ExtractRoleBindingStatus is the same as ExtractRoleBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRoleBindingStatus(roleBinding *apirbacv1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { return extractRoleBinding(roleBinding, fieldManager, "status") } func extractRoleBinding(roleBinding *apirbacv1.RoleBinding, fieldManager string, subresource string) (*RoleBindingApplyConfiguration, error) { b := &RoleBindingApplyConfiguration{} err := managedfields.ExtractInto(roleBinding, internal.Parser().Type("io.k8s.api.rbac.v1.RoleBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(roleBinding.Name) b.WithNamespace(roleBinding.Namespace) b.WithKind("RoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithKind(value string) *RoleBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithAPIVersion(value string) *RoleBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithName(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithGenerateName(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithNamespace(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithUID(value types.UID) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithResourceVersion(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithGeneration(value int64) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RoleBindingApplyConfiguration) WithLabels(entries map[string]string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RoleBindingApplyConfiguration) WithAnnotations(entries map[string]string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RoleBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RoleBindingApplyConfiguration) WithFinalizers(values ...string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RoleBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *RoleBindingApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *RoleBindingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithRoleRef sets the RoleRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RoleRef field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfiguration) *RoleBindingApplyConfiguration { b.RoleRef = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RoleBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/roleref.go000066400000000000000000000043541472614177300257300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // RoleRefApplyConfiguration represents a declarative configuration of the RoleRef type for use // with apply. type RoleRefApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` } // RoleRefApplyConfiguration constructs a declarative configuration of the RoleRef type for use with // apply. func RoleRef() *RoleRefApplyConfiguration { return &RoleRefApplyConfiguration{} } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithAPIGroup(value string) *RoleRefApplyConfiguration { b.APIGroup = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithKind(value string) *RoleRefApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithName(value string) *RoleRefApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1/subject.go000066400000000000000000000052671472614177300257350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *string `json:"kind,omitempty"` APIGroup *string `json:"apiGroup,omitempty"` Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` } // SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithKind(value string) *SubjectApplyConfiguration { b.Kind = &value return b } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithAPIGroup(value string) *SubjectApplyConfiguration { b.APIGroup = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithName(value string) *SubjectApplyConfiguration { b.Name = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithNamespace(value string) *SubjectApplyConfiguration { b.Namespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/000077500000000000000000000000001472614177300250245ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/aggregationrule.go000066400000000000000000000035431472614177300305370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // AggregationRuleApplyConfiguration represents a declarative configuration of the AggregationRule type for use // with apply. type AggregationRuleApplyConfiguration struct { ClusterRoleSelectors []v1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } // AggregationRuleApplyConfiguration constructs a declarative configuration of the AggregationRule type for use with // apply. func AggregationRule() *AggregationRuleApplyConfiguration { return &AggregationRuleApplyConfiguration{} } // WithClusterRoleSelectors adds the given value to the ClusterRoleSelectors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ClusterRoleSelectors field. func (b *AggregationRuleApplyConfiguration) WithClusterRoleSelectors(values ...*v1.LabelSelectorApplyConfiguration) *AggregationRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithClusterRoleSelectors") } b.ClusterRoleSelectors = append(b.ClusterRoleSelectors, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/clusterrole.go000066400000000000000000000311311472614177300277150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ClusterRoleApplyConfiguration represents a declarative configuration of the ClusterRole type for use // with apply. type ClusterRoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` } // ClusterRole constructs a declarative configuration of the ClusterRole type for use with // apply. func ClusterRole(name string) *ClusterRoleApplyConfiguration { b := &ClusterRoleApplyConfiguration{} b.WithName(name) b.WithKind("ClusterRole") b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") return b } // ExtractClusterRole extracts the applied configuration owned by fieldManager from // clusterRole. If no managedFields are found in clusterRole for fieldManager, a // ClusterRoleApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // clusterRole must be a unmodified ClusterRole API object that was retrieved from the Kubernetes API. // ExtractClusterRole provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractClusterRole(clusterRole *rbacv1alpha1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { return extractClusterRole(clusterRole, fieldManager, "") } // ExtractClusterRoleStatus is the same as ExtractClusterRole except // that it extracts the status subresource applied configuration. // Experimental! func ExtractClusterRoleStatus(clusterRole *rbacv1alpha1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { return extractClusterRole(clusterRole, fieldManager, "status") } func extractClusterRole(clusterRole *rbacv1alpha1.ClusterRole, fieldManager string, subresource string) (*ClusterRoleApplyConfiguration, error) { b := &ClusterRoleApplyConfiguration{} err := managedfields.ExtractInto(clusterRole, internal.Parser().Type("io.k8s.api.rbac.v1alpha1.ClusterRole"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(clusterRole.Name) b.WithKind("ClusterRole") b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithKind(value string) *ClusterRoleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithAPIVersion(value string) *ClusterRoleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithName(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithGenerateName(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithNamespace(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithUID(value types.UID) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithResourceVersion(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithGeneration(value int64) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ClusterRoleApplyConfiguration) WithLabels(entries map[string]string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterRoleApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ClusterRoleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ClusterRoleApplyConfiguration) WithFinalizers(values ...string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ClusterRoleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *ClusterRoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfiguration) *ClusterRoleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // WithAggregationRule sets the AggregationRule field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AggregationRule field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithAggregationRule(value *AggregationRuleApplyConfiguration) *ClusterRoleApplyConfiguration { b.AggregationRule = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterRoleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go000066400000000000000000000320651472614177300312570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ClusterRoleBindingApplyConfiguration represents a declarative configuration of the ClusterRoleBinding type for use // with apply. type ClusterRoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } // ClusterRoleBinding constructs a declarative configuration of the ClusterRoleBinding type for use with // apply. func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { b := &ClusterRoleBindingApplyConfiguration{} b.WithName(name) b.WithKind("ClusterRoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") return b } // ExtractClusterRoleBinding extracts the applied configuration owned by fieldManager from // clusterRoleBinding. If no managedFields are found in clusterRoleBinding for fieldManager, a // ClusterRoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // clusterRoleBinding must be a unmodified ClusterRoleBinding API object that was retrieved from the Kubernetes API. // ExtractClusterRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractClusterRoleBinding(clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "") } // ExtractClusterRoleBindingStatus is the same as ExtractClusterRoleBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractClusterRoleBindingStatus(clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "status") } func extractClusterRoleBinding(clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, fieldManager string, subresource string) (*ClusterRoleBindingApplyConfiguration, error) { b := &ClusterRoleBindingApplyConfiguration{} err := managedfields.ExtractInto(clusterRoleBinding, internal.Parser().Type("io.k8s.api.rbac.v1alpha1.ClusterRoleBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(clusterRoleBinding.Name) b.WithKind("ClusterRoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithKind(value string) *ClusterRoleBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithAPIVersion(value string) *ClusterRoleBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithName(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithGenerateName(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithNamespace(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithUID(value types.UID) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithResourceVersion(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithGeneration(value int64) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ClusterRoleBindingApplyConfiguration) WithLabels(entries map[string]string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterRoleBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ClusterRoleBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ClusterRoleBindingApplyConfiguration) WithFinalizers(values ...string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ClusterRoleBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *ClusterRoleBindingApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *ClusterRoleBindingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithRoleRef sets the RoleRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RoleRef field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfiguration) *ClusterRoleBindingApplyConfiguration { b.RoleRef = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterRoleBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/policyrule.go000066400000000000000000000072431472614177300275500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // PolicyRuleApplyConfiguration represents a declarative configuration of the PolicyRule type for use // with apply. type PolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` APIGroups []string `json:"apiGroups,omitempty"` Resources []string `json:"resources,omitempty"` ResourceNames []string `json:"resourceNames,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } // PolicyRuleApplyConfiguration constructs a declarative configuration of the PolicyRule type for use with // apply. func PolicyRule() *PolicyRuleApplyConfiguration { return &PolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *PolicyRuleApplyConfiguration) WithVerbs(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *PolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *PolicyRuleApplyConfiguration) WithResources(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithResourceNames adds the given value to the ResourceNames field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceNames field. func (b *PolicyRuleApplyConfiguration) WithResourceNames(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.ResourceNames = append(b.ResourceNames, values[i]) } return b } // WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceURLs field. func (b *PolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.NonResourceURLs = append(b.NonResourceURLs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/role.go000066400000000000000000000271351472614177300263240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RoleApplyConfiguration represents a declarative configuration of the Role type for use // with apply. type RoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } // Role constructs a declarative configuration of the Role type for use with // apply. func Role(name, namespace string) *RoleApplyConfiguration { b := &RoleApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Role") b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") return b } // ExtractRole extracts the applied configuration owned by fieldManager from // role. If no managedFields are found in role for fieldManager, a // RoleApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // role must be a unmodified Role API object that was retrieved from the Kubernetes API. // ExtractRole provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRole(role *rbacv1alpha1.Role, fieldManager string) (*RoleApplyConfiguration, error) { return extractRole(role, fieldManager, "") } // ExtractRoleStatus is the same as ExtractRole except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRoleStatus(role *rbacv1alpha1.Role, fieldManager string) (*RoleApplyConfiguration, error) { return extractRole(role, fieldManager, "status") } func extractRole(role *rbacv1alpha1.Role, fieldManager string, subresource string) (*RoleApplyConfiguration, error) { b := &RoleApplyConfiguration{} err := managedfields.ExtractInto(role, internal.Parser().Type("io.k8s.api.rbac.v1alpha1.Role"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(role.Name) b.WithNamespace(role.Namespace) b.WithKind("Role") b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleApplyConfiguration) WithKind(value string) *RoleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RoleApplyConfiguration) WithAPIVersion(value string) *RoleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleApplyConfiguration) WithName(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RoleApplyConfiguration) WithGenerateName(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RoleApplyConfiguration) WithNamespace(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RoleApplyConfiguration) WithUID(value types.UID) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RoleApplyConfiguration) WithResourceVersion(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RoleApplyConfiguration) WithGeneration(value int64) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RoleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RoleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RoleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RoleApplyConfiguration) WithLabels(entries map[string]string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RoleApplyConfiguration) WithAnnotations(entries map[string]string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RoleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RoleApplyConfiguration) WithFinalizers(values ...string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RoleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *RoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfiguration) *RoleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RoleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/rolebinding.go000066400000000000000000000311671472614177300276570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RoleBindingApplyConfiguration represents a declarative configuration of the RoleBinding type for use // with apply. type RoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } // RoleBinding constructs a declarative configuration of the RoleBinding type for use with // apply. func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { b := &RoleBindingApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("RoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") return b } // ExtractRoleBinding extracts the applied configuration owned by fieldManager from // roleBinding. If no managedFields are found in roleBinding for fieldManager, a // RoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // roleBinding must be a unmodified RoleBinding API object that was retrieved from the Kubernetes API. // ExtractRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRoleBinding(roleBinding *rbacv1alpha1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { return extractRoleBinding(roleBinding, fieldManager, "") } // ExtractRoleBindingStatus is the same as ExtractRoleBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRoleBindingStatus(roleBinding *rbacv1alpha1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { return extractRoleBinding(roleBinding, fieldManager, "status") } func extractRoleBinding(roleBinding *rbacv1alpha1.RoleBinding, fieldManager string, subresource string) (*RoleBindingApplyConfiguration, error) { b := &RoleBindingApplyConfiguration{} err := managedfields.ExtractInto(roleBinding, internal.Parser().Type("io.k8s.api.rbac.v1alpha1.RoleBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(roleBinding.Name) b.WithNamespace(roleBinding.Namespace) b.WithKind("RoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithKind(value string) *RoleBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithAPIVersion(value string) *RoleBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithName(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithGenerateName(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithNamespace(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithUID(value types.UID) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithResourceVersion(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithGeneration(value int64) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RoleBindingApplyConfiguration) WithLabels(entries map[string]string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RoleBindingApplyConfiguration) WithAnnotations(entries map[string]string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RoleBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RoleBindingApplyConfiguration) WithFinalizers(values ...string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RoleBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *RoleBindingApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *RoleBindingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithRoleRef sets the RoleRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RoleRef field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfiguration) *RoleBindingApplyConfiguration { b.RoleRef = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RoleBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/roleref.go000066400000000000000000000043621472614177300270160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // RoleRefApplyConfiguration represents a declarative configuration of the RoleRef type for use // with apply. type RoleRefApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` } // RoleRefApplyConfiguration constructs a declarative configuration of the RoleRef type for use with // apply. func RoleRef() *RoleRefApplyConfiguration { return &RoleRefApplyConfiguration{} } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithAPIGroup(value string) *RoleRefApplyConfiguration { b.APIGroup = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithKind(value string) *RoleRefApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithName(value string) *RoleRefApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1alpha1/subject.go000066400000000000000000000053151472614177300270160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *string `json:"kind,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` } // SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithKind(value string) *SubjectApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithAPIVersion(value string) *SubjectApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithName(value string) *SubjectApplyConfiguration { b.Name = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithNamespace(value string) *SubjectApplyConfiguration { b.Namespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/000077500000000000000000000000001472614177300246525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/aggregationrule.go000066400000000000000000000035421472614177300303640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // AggregationRuleApplyConfiguration represents a declarative configuration of the AggregationRule type for use // with apply. type AggregationRuleApplyConfiguration struct { ClusterRoleSelectors []v1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } // AggregationRuleApplyConfiguration constructs a declarative configuration of the AggregationRule type for use with // apply. func AggregationRule() *AggregationRuleApplyConfiguration { return &AggregationRuleApplyConfiguration{} } // WithClusterRoleSelectors adds the given value to the ClusterRoleSelectors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ClusterRoleSelectors field. func (b *AggregationRuleApplyConfiguration) WithClusterRoleSelectors(values ...*v1.LabelSelectorApplyConfiguration) *AggregationRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithClusterRoleSelectors") } b.ClusterRoleSelectors = append(b.ClusterRoleSelectors, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/clusterrole.go000066400000000000000000000311201472614177300275410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ClusterRoleApplyConfiguration represents a declarative configuration of the ClusterRole type for use // with apply. type ClusterRoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` } // ClusterRole constructs a declarative configuration of the ClusterRole type for use with // apply. func ClusterRole(name string) *ClusterRoleApplyConfiguration { b := &ClusterRoleApplyConfiguration{} b.WithName(name) b.WithKind("ClusterRole") b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") return b } // ExtractClusterRole extracts the applied configuration owned by fieldManager from // clusterRole. If no managedFields are found in clusterRole for fieldManager, a // ClusterRoleApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // clusterRole must be a unmodified ClusterRole API object that was retrieved from the Kubernetes API. // ExtractClusterRole provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractClusterRole(clusterRole *rbacv1beta1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { return extractClusterRole(clusterRole, fieldManager, "") } // ExtractClusterRoleStatus is the same as ExtractClusterRole except // that it extracts the status subresource applied configuration. // Experimental! func ExtractClusterRoleStatus(clusterRole *rbacv1beta1.ClusterRole, fieldManager string) (*ClusterRoleApplyConfiguration, error) { return extractClusterRole(clusterRole, fieldManager, "status") } func extractClusterRole(clusterRole *rbacv1beta1.ClusterRole, fieldManager string, subresource string) (*ClusterRoleApplyConfiguration, error) { b := &ClusterRoleApplyConfiguration{} err := managedfields.ExtractInto(clusterRole, internal.Parser().Type("io.k8s.api.rbac.v1beta1.ClusterRole"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(clusterRole.Name) b.WithKind("ClusterRole") b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithKind(value string) *ClusterRoleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithAPIVersion(value string) *ClusterRoleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithName(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithGenerateName(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithNamespace(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithUID(value types.UID) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithResourceVersion(value string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithGeneration(value int64) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ClusterRoleApplyConfiguration) WithLabels(entries map[string]string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterRoleApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ClusterRoleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ClusterRoleApplyConfiguration) WithFinalizers(values ...string) *ClusterRoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ClusterRoleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *ClusterRoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfiguration) *ClusterRoleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // WithAggregationRule sets the AggregationRule field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AggregationRule field is set to the value of the last call. func (b *ClusterRoleApplyConfiguration) WithAggregationRule(value *AggregationRuleApplyConfiguration) *ClusterRoleApplyConfiguration { b.AggregationRule = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterRoleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/clusterrolebinding.go000066400000000000000000000320541472614177300311030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ClusterRoleBindingApplyConfiguration represents a declarative configuration of the ClusterRoleBinding type for use // with apply. type ClusterRoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } // ClusterRoleBinding constructs a declarative configuration of the ClusterRoleBinding type for use with // apply. func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { b := &ClusterRoleBindingApplyConfiguration{} b.WithName(name) b.WithKind("ClusterRoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") return b } // ExtractClusterRoleBinding extracts the applied configuration owned by fieldManager from // clusterRoleBinding. If no managedFields are found in clusterRoleBinding for fieldManager, a // ClusterRoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // clusterRoleBinding must be a unmodified ClusterRoleBinding API object that was retrieved from the Kubernetes API. // ExtractClusterRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractClusterRoleBinding(clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "") } // ExtractClusterRoleBindingStatus is the same as ExtractClusterRoleBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractClusterRoleBindingStatus(clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, fieldManager string) (*ClusterRoleBindingApplyConfiguration, error) { return extractClusterRoleBinding(clusterRoleBinding, fieldManager, "status") } func extractClusterRoleBinding(clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, fieldManager string, subresource string) (*ClusterRoleBindingApplyConfiguration, error) { b := &ClusterRoleBindingApplyConfiguration{} err := managedfields.ExtractInto(clusterRoleBinding, internal.Parser().Type("io.k8s.api.rbac.v1beta1.ClusterRoleBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(clusterRoleBinding.Name) b.WithKind("ClusterRoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithKind(value string) *ClusterRoleBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithAPIVersion(value string) *ClusterRoleBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithName(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithGenerateName(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithNamespace(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithUID(value types.UID) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithResourceVersion(value string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithGeneration(value int64) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ClusterRoleBindingApplyConfiguration) WithLabels(entries map[string]string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterRoleBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ClusterRoleBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ClusterRoleBindingApplyConfiguration) WithFinalizers(values ...string) *ClusterRoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ClusterRoleBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *ClusterRoleBindingApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *ClusterRoleBindingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithRoleRef sets the RoleRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RoleRef field is set to the value of the last call. func (b *ClusterRoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfiguration) *ClusterRoleBindingApplyConfiguration { b.RoleRef = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterRoleBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/policyrule.go000066400000000000000000000072421472614177300273750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // PolicyRuleApplyConfiguration represents a declarative configuration of the PolicyRule type for use // with apply. type PolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` APIGroups []string `json:"apiGroups,omitempty"` Resources []string `json:"resources,omitempty"` ResourceNames []string `json:"resourceNames,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } // PolicyRuleApplyConfiguration constructs a declarative configuration of the PolicyRule type for use with // apply. func PolicyRule() *PolicyRuleApplyConfiguration { return &PolicyRuleApplyConfiguration{} } // WithVerbs adds the given value to the Verbs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Verbs field. func (b *PolicyRuleApplyConfiguration) WithVerbs(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.Verbs = append(b.Verbs, values[i]) } return b } // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the APIGroups field. func (b *PolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.APIGroups = append(b.APIGroups, values[i]) } return b } // WithResources adds the given value to the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Resources field. func (b *PolicyRuleApplyConfiguration) WithResources(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.Resources = append(b.Resources, values[i]) } return b } // WithResourceNames adds the given value to the ResourceNames field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceNames field. func (b *PolicyRuleApplyConfiguration) WithResourceNames(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.ResourceNames = append(b.ResourceNames, values[i]) } return b } // WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the NonResourceURLs field. func (b *PolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *PolicyRuleApplyConfiguration { for i := range values { b.NonResourceURLs = append(b.NonResourceURLs, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/role.go000066400000000000000000000271241472614177300261500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RoleApplyConfiguration represents a declarative configuration of the Role type for use // with apply. type RoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } // Role constructs a declarative configuration of the Role type for use with // apply. func Role(name, namespace string) *RoleApplyConfiguration { b := &RoleApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("Role") b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") return b } // ExtractRole extracts the applied configuration owned by fieldManager from // role. If no managedFields are found in role for fieldManager, a // RoleApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // role must be a unmodified Role API object that was retrieved from the Kubernetes API. // ExtractRole provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRole(role *rbacv1beta1.Role, fieldManager string) (*RoleApplyConfiguration, error) { return extractRole(role, fieldManager, "") } // ExtractRoleStatus is the same as ExtractRole except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRoleStatus(role *rbacv1beta1.Role, fieldManager string) (*RoleApplyConfiguration, error) { return extractRole(role, fieldManager, "status") } func extractRole(role *rbacv1beta1.Role, fieldManager string, subresource string) (*RoleApplyConfiguration, error) { b := &RoleApplyConfiguration{} err := managedfields.ExtractInto(role, internal.Parser().Type("io.k8s.api.rbac.v1beta1.Role"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(role.Name) b.WithNamespace(role.Namespace) b.WithKind("Role") b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleApplyConfiguration) WithKind(value string) *RoleApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RoleApplyConfiguration) WithAPIVersion(value string) *RoleApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleApplyConfiguration) WithName(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RoleApplyConfiguration) WithGenerateName(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RoleApplyConfiguration) WithNamespace(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RoleApplyConfiguration) WithUID(value types.UID) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RoleApplyConfiguration) WithResourceVersion(value string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RoleApplyConfiguration) WithGeneration(value int64) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RoleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RoleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RoleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RoleApplyConfiguration) WithLabels(entries map[string]string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RoleApplyConfiguration) WithAnnotations(entries map[string]string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RoleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RoleApplyConfiguration) WithFinalizers(values ...string) *RoleApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RoleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithRules adds the given value to the Rules field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Rules field. func (b *RoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfiguration) *RoleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRules") } b.Rules = append(b.Rules, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RoleApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/rolebinding.go000066400000000000000000000311561472614177300275030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RoleBindingApplyConfiguration represents a declarative configuration of the RoleBinding type for use // with apply. type RoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } // RoleBinding constructs a declarative configuration of the RoleBinding type for use with // apply. func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { b := &RoleBindingApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("RoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") return b } // ExtractRoleBinding extracts the applied configuration owned by fieldManager from // roleBinding. If no managedFields are found in roleBinding for fieldManager, a // RoleBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // roleBinding must be a unmodified RoleBinding API object that was retrieved from the Kubernetes API. // ExtractRoleBinding provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractRoleBinding(roleBinding *rbacv1beta1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { return extractRoleBinding(roleBinding, fieldManager, "") } // ExtractRoleBindingStatus is the same as ExtractRoleBinding except // that it extracts the status subresource applied configuration. // Experimental! func ExtractRoleBindingStatus(roleBinding *rbacv1beta1.RoleBinding, fieldManager string) (*RoleBindingApplyConfiguration, error) { return extractRoleBinding(roleBinding, fieldManager, "status") } func extractRoleBinding(roleBinding *rbacv1beta1.RoleBinding, fieldManager string, subresource string) (*RoleBindingApplyConfiguration, error) { b := &RoleBindingApplyConfiguration{} err := managedfields.ExtractInto(roleBinding, internal.Parser().Type("io.k8s.api.rbac.v1beta1.RoleBinding"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(roleBinding.Name) b.WithNamespace(roleBinding.Namespace) b.WithKind("RoleBinding") b.WithAPIVersion("rbac.authorization.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithKind(value string) *RoleBindingApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithAPIVersion(value string) *RoleBindingApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithName(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithGenerateName(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithNamespace(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithUID(value types.UID) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithResourceVersion(value string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithGeneration(value int64) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *RoleBindingApplyConfiguration) WithLabels(entries map[string]string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *RoleBindingApplyConfiguration) WithAnnotations(entries map[string]string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *RoleBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *RoleBindingApplyConfiguration) WithFinalizers(values ...string) *RoleBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *RoleBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSubjects adds the given value to the Subjects field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Subjects field. func (b *RoleBindingApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *RoleBindingApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSubjects") } b.Subjects = append(b.Subjects, *values[i]) } return b } // WithRoleRef sets the RoleRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RoleRef field is set to the value of the last call. func (b *RoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfiguration) *RoleBindingApplyConfiguration { b.RoleRef = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *RoleBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/roleref.go000066400000000000000000000043611472614177300266430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // RoleRefApplyConfiguration represents a declarative configuration of the RoleRef type for use // with apply. type RoleRefApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` Kind *string `json:"kind,omitempty"` Name *string `json:"name,omitempty"` } // RoleRefApplyConfiguration constructs a declarative configuration of the RoleRef type for use with // apply. func RoleRef() *RoleRefApplyConfiguration { return &RoleRefApplyConfiguration{} } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithAPIGroup(value string) *RoleRefApplyConfiguration { b.APIGroup = &value return b } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithKind(value string) *RoleRefApplyConfiguration { b.Kind = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *RoleRefApplyConfiguration) WithName(value string) *RoleRefApplyConfiguration { b.Name = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/rbac/v1beta1/subject.go000066400000000000000000000052741472614177300266500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *string `json:"kind,omitempty"` APIGroup *string `json:"apiGroup,omitempty"` Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` } // SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithKind(value string) *SubjectApplyConfiguration { b.Kind = &value return b } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithAPIGroup(value string) *SubjectApplyConfiguration { b.APIGroup = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithName(value string) *SubjectApplyConfiguration { b.Name = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *SubjectApplyConfiguration) WithNamespace(value string) *SubjectApplyConfiguration { b.Namespace = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/000077500000000000000000000000001472614177300243275ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/000077500000000000000000000000001472614177300257465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/allocationresult.go000066400000000000000000000052541472614177300316670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // AllocationResultApplyConfiguration represents a declarative configuration of the AllocationResult type for use // with apply. type AllocationResultApplyConfiguration struct { Devices *DeviceAllocationResultApplyConfiguration `json:"devices,omitempty"` NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` Controller *string `json:"controller,omitempty"` } // AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with // apply. func AllocationResult() *AllocationResultApplyConfiguration { return &AllocationResultApplyConfiguration{} } // WithDevices sets the Devices field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Devices field is set to the value of the last call. func (b *AllocationResultApplyConfiguration) WithDevices(value *DeviceAllocationResultApplyConfiguration) *AllocationResultApplyConfiguration { b.Devices = value return b } // WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeSelector field is set to the value of the last call. func (b *AllocationResultApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *AllocationResultApplyConfiguration { b.NodeSelector = value return b } // WithController sets the Controller field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Controller field is set to the value of the last call. func (b *AllocationResultApplyConfiguration) WithController(value string) *AllocationResultApplyConfiguration { b.Controller = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/basicdevice.go000066400000000000000000000053171472614177300305440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( v1alpha3 "k8s.io/api/resource/v1alpha3" resource "k8s.io/apimachinery/pkg/api/resource" ) // BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use // with apply. type BasicDeviceApplyConfiguration struct { Attributes map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"` Capacity map[v1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"` } // BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with // apply. func BasicDevice() *BasicDeviceApplyConfiguration { return &BasicDeviceApplyConfiguration{} } // WithAttributes puts the entries into the Attributes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Attributes field, // overwriting an existing map entries in Attributes field with the same key. func (b *BasicDeviceApplyConfiguration) WithAttributes(entries map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration) *BasicDeviceApplyConfiguration { if b.Attributes == nil && len(entries) > 0 { b.Attributes = make(map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration, len(entries)) } for k, v := range entries { b.Attributes[k] = v } return b } // WithCapacity puts the entries into the Capacity field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Capacity field, // overwriting an existing map entries in Capacity field with the same key. func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[v1alpha3.QualifiedName]resource.Quantity) *BasicDeviceApplyConfiguration { if b.Capacity == nil && len(entries) > 0 { b.Capacity = make(map[v1alpha3.QualifiedName]resource.Quantity, len(entries)) } for k, v := range entries { b.Capacity[k] = v } return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/celdeviceselector.go000066400000000000000000000030221472614177300317560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // CELDeviceSelectorApplyConfiguration represents a declarative configuration of the CELDeviceSelector type for use // with apply. type CELDeviceSelectorApplyConfiguration struct { Expression *string `json:"expression,omitempty"` } // CELDeviceSelectorApplyConfiguration constructs a declarative configuration of the CELDeviceSelector type for use with // apply. func CELDeviceSelector() *CELDeviceSelectorApplyConfiguration { return &CELDeviceSelectorApplyConfiguration{} } // WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Expression field is set to the value of the last call. func (b *CELDeviceSelectorApplyConfiguration) WithExpression(value string) *CELDeviceSelectorApplyConfiguration { b.Expression = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/device.go000066400000000000000000000035521472614177300275410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceApplyConfiguration represents a declarative configuration of the Device type for use // with apply. type DeviceApplyConfiguration struct { Name *string `json:"name,omitempty"` Basic *BasicDeviceApplyConfiguration `json:"basic,omitempty"` } // DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with // apply. func Device() *DeviceApplyConfiguration { return &DeviceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DeviceApplyConfiguration) WithName(value string) *DeviceApplyConfiguration { b.Name = &value return b } // WithBasic sets the Basic field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Basic field is set to the value of the last call. func (b *DeviceApplyConfiguration) WithBasic(value *BasicDeviceApplyConfiguration) *DeviceApplyConfiguration { b.Basic = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go000066400000000000000000000055551472614177300344040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( v1alpha3 "k8s.io/api/resource/v1alpha3" ) // DeviceAllocationConfigurationApplyConfiguration represents a declarative configuration of the DeviceAllocationConfiguration type for use // with apply. type DeviceAllocationConfigurationApplyConfiguration struct { Source *v1alpha3.AllocationConfigSource `json:"source,omitempty"` Requests []string `json:"requests,omitempty"` DeviceConfigurationApplyConfiguration `json:",inline"` } // DeviceAllocationConfigurationApplyConfiguration constructs a declarative configuration of the DeviceAllocationConfiguration type for use with // apply. func DeviceAllocationConfiguration() *DeviceAllocationConfigurationApplyConfiguration { return &DeviceAllocationConfigurationApplyConfiguration{} } // WithSource sets the Source field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Source field is set to the value of the last call. func (b *DeviceAllocationConfigurationApplyConfiguration) WithSource(value v1alpha3.AllocationConfigSource) *DeviceAllocationConfigurationApplyConfiguration { b.Source = &value return b } // WithRequests adds the given value to the Requests field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Requests field. func (b *DeviceAllocationConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceAllocationConfigurationApplyConfiguration { for i := range values { b.Requests = append(b.Requests, values[i]) } return b } // WithOpaque sets the Opaque field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Opaque field is set to the value of the last call. func (b *DeviceAllocationConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceAllocationConfigurationApplyConfiguration { b.Opaque = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceallocationresult.go000066400000000000000000000046771472614177300330570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceAllocationResultApplyConfiguration represents a declarative configuration of the DeviceAllocationResult type for use // with apply. type DeviceAllocationResultApplyConfiguration struct { Results []DeviceRequestAllocationResultApplyConfiguration `json:"results,omitempty"` Config []DeviceAllocationConfigurationApplyConfiguration `json:"config,omitempty"` } // DeviceAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceAllocationResult type for use with // apply. func DeviceAllocationResult() *DeviceAllocationResultApplyConfiguration { return &DeviceAllocationResultApplyConfiguration{} } // WithResults adds the given value to the Results field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Results field. func (b *DeviceAllocationResultApplyConfiguration) WithResults(values ...*DeviceRequestAllocationResultApplyConfiguration) *DeviceAllocationResultApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResults") } b.Results = append(b.Results, *values[i]) } return b } // WithConfig adds the given value to the Config field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Config field. func (b *DeviceAllocationResultApplyConfiguration) WithConfig(values ...*DeviceAllocationConfigurationApplyConfiguration) *DeviceAllocationResultApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConfig") } b.Config = append(b.Config, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceattribute.go000066400000000000000000000056141472614177300314660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceAttributeApplyConfiguration represents a declarative configuration of the DeviceAttribute type for use // with apply. type DeviceAttributeApplyConfiguration struct { IntValue *int64 `json:"int,omitempty"` BoolValue *bool `json:"bool,omitempty"` StringValue *string `json:"string,omitempty"` VersionValue *string `json:"version,omitempty"` } // DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with // apply. func DeviceAttribute() *DeviceAttributeApplyConfiguration { return &DeviceAttributeApplyConfiguration{} } // WithIntValue sets the IntValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the IntValue field is set to the value of the last call. func (b *DeviceAttributeApplyConfiguration) WithIntValue(value int64) *DeviceAttributeApplyConfiguration { b.IntValue = &value return b } // WithBoolValue sets the BoolValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BoolValue field is set to the value of the last call. func (b *DeviceAttributeApplyConfiguration) WithBoolValue(value bool) *DeviceAttributeApplyConfiguration { b.BoolValue = &value return b } // WithStringValue sets the StringValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StringValue field is set to the value of the last call. func (b *DeviceAttributeApplyConfiguration) WithStringValue(value string) *DeviceAttributeApplyConfiguration { b.StringValue = &value return b } // WithVersionValue sets the VersionValue field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VersionValue field is set to the value of the last call. func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *DeviceAttributeApplyConfiguration { b.VersionValue = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceclaim.go000066400000000000000000000057401472614177300305500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceClaimApplyConfiguration represents a declarative configuration of the DeviceClaim type for use // with apply. type DeviceClaimApplyConfiguration struct { Requests []DeviceRequestApplyConfiguration `json:"requests,omitempty"` Constraints []DeviceConstraintApplyConfiguration `json:"constraints,omitempty"` Config []DeviceClaimConfigurationApplyConfiguration `json:"config,omitempty"` } // DeviceClaimApplyConfiguration constructs a declarative configuration of the DeviceClaim type for use with // apply. func DeviceClaim() *DeviceClaimApplyConfiguration { return &DeviceClaimApplyConfiguration{} } // WithRequests adds the given value to the Requests field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Requests field. func (b *DeviceClaimApplyConfiguration) WithRequests(values ...*DeviceRequestApplyConfiguration) *DeviceClaimApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithRequests") } b.Requests = append(b.Requests, *values[i]) } return b } // WithConstraints adds the given value to the Constraints field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Constraints field. func (b *DeviceClaimApplyConfiguration) WithConstraints(values ...*DeviceConstraintApplyConfiguration) *DeviceClaimApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConstraints") } b.Constraints = append(b.Constraints, *values[i]) } return b } // WithConfig adds the given value to the Config field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Config field. func (b *DeviceClaimApplyConfiguration) WithConfig(values ...*DeviceClaimConfigurationApplyConfiguration) *DeviceClaimApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConfig") } b.Config = append(b.Config, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go000066400000000000000000000042641472614177300333400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceClaimConfigurationApplyConfiguration represents a declarative configuration of the DeviceClaimConfiguration type for use // with apply. type DeviceClaimConfigurationApplyConfiguration struct { Requests []string `json:"requests,omitempty"` DeviceConfigurationApplyConfiguration `json:",inline"` } // DeviceClaimConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClaimConfiguration type for use with // apply. func DeviceClaimConfiguration() *DeviceClaimConfigurationApplyConfiguration { return &DeviceClaimConfigurationApplyConfiguration{} } // WithRequests adds the given value to the Requests field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Requests field. func (b *DeviceClaimConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceClaimConfigurationApplyConfiguration { for i := range values { b.Requests = append(b.Requests, values[i]) } return b } // WithOpaque sets the Opaque field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Opaque field is set to the value of the last call. func (b *DeviceClaimConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClaimConfigurationApplyConfiguration { b.Opaque = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceclass.go000066400000000000000000000276221472614177300305730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // DeviceClassApplyConfiguration represents a declarative configuration of the DeviceClass type for use // with apply. type DeviceClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *DeviceClassSpecApplyConfiguration `json:"spec,omitempty"` } // DeviceClass constructs a declarative configuration of the DeviceClass type for use with // apply. func DeviceClass(name string) *DeviceClassApplyConfiguration { b := &DeviceClassApplyConfiguration{} b.WithName(name) b.WithKind("DeviceClass") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } // ExtractDeviceClass extracts the applied configuration owned by fieldManager from // deviceClass. If no managedFields are found in deviceClass for fieldManager, a // DeviceClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // deviceClass must be a unmodified DeviceClass API object that was retrieved from the Kubernetes API. // ExtractDeviceClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractDeviceClass(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) { return extractDeviceClass(deviceClass, fieldManager, "") } // ExtractDeviceClassStatus is the same as ExtractDeviceClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractDeviceClassStatus(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) { return extractDeviceClass(deviceClass, fieldManager, "status") } func extractDeviceClass(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string, subresource string) (*DeviceClassApplyConfiguration, error) { b := &DeviceClassApplyConfiguration{} err := managedfields.ExtractInto(deviceClass, internal.Parser().Type("io.k8s.api.resource.v1alpha3.DeviceClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(deviceClass.Name) b.WithKind("DeviceClass") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithKind(value string) *DeviceClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithAPIVersion(value string) *DeviceClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithName(value string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithGenerateName(value string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithNamespace(value string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithUID(value types.UID) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithResourceVersion(value string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithGeneration(value int64) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *DeviceClassApplyConfiguration) WithLabels(entries map[string]string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *DeviceClassApplyConfiguration) WithAnnotations(entries map[string]string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *DeviceClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *DeviceClassApplyConfiguration) WithFinalizers(values ...string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *DeviceClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *DeviceClassApplyConfiguration) WithSpec(value *DeviceClassSpecApplyConfiguration) *DeviceClassApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *DeviceClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go000066400000000000000000000031571472614177300333600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceClassConfigurationApplyConfiguration represents a declarative configuration of the DeviceClassConfiguration type for use // with apply. type DeviceClassConfigurationApplyConfiguration struct { DeviceConfigurationApplyConfiguration `json:",inline"` } // DeviceClassConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClassConfiguration type for use with // apply. func DeviceClassConfiguration() *DeviceClassConfigurationApplyConfiguration { return &DeviceClassConfigurationApplyConfiguration{} } // WithOpaque sets the Opaque field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Opaque field is set to the value of the last call. func (b *DeviceClassConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClassConfigurationApplyConfiguration { b.Opaque = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceclassspec.go000066400000000000000000000057341472614177300314460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use // with apply. type DeviceClassSpecApplyConfiguration struct { Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` SuitableNodes *v1.NodeSelectorApplyConfiguration `json:"suitableNodes,omitempty"` } // DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with // apply. func DeviceClassSpec() *DeviceClassSpecApplyConfiguration { return &DeviceClassSpecApplyConfiguration{} } // WithSelectors adds the given value to the Selectors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Selectors field. func (b *DeviceClassSpecApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSelectors") } b.Selectors = append(b.Selectors, *values[i]) } return b } // WithConfig adds the given value to the Config field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Config field. func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassConfigurationApplyConfiguration) *DeviceClassSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConfig") } b.Config = append(b.Config, *values[i]) } return b } // WithSuitableNodes sets the SuitableNodes field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SuitableNodes field is set to the value of the last call. func (b *DeviceClassSpecApplyConfiguration) WithSuitableNodes(value *v1.NodeSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration { b.SuitableNodes = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceconfiguration.go000066400000000000000000000031241472614177300323240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceConfigurationApplyConfiguration represents a declarative configuration of the DeviceConfiguration type for use // with apply. type DeviceConfigurationApplyConfiguration struct { Opaque *OpaqueDeviceConfigurationApplyConfiguration `json:"opaque,omitempty"` } // DeviceConfigurationApplyConfiguration constructs a declarative configuration of the DeviceConfiguration type for use with // apply. func DeviceConfiguration() *DeviceConfigurationApplyConfiguration { return &DeviceConfigurationApplyConfiguration{} } // WithOpaque sets the Opaque field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Opaque field is set to the value of the last call. func (b *DeviceConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceConfigurationApplyConfiguration { b.Opaque = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceconstraint.go000066400000000000000000000042651472614177300316500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( v1alpha3 "k8s.io/api/resource/v1alpha3" ) // DeviceConstraintApplyConfiguration represents a declarative configuration of the DeviceConstraint type for use // with apply. type DeviceConstraintApplyConfiguration struct { Requests []string `json:"requests,omitempty"` MatchAttribute *v1alpha3.FullyQualifiedName `json:"matchAttribute,omitempty"` } // DeviceConstraintApplyConfiguration constructs a declarative configuration of the DeviceConstraint type for use with // apply. func DeviceConstraint() *DeviceConstraintApplyConfiguration { return &DeviceConstraintApplyConfiguration{} } // WithRequests adds the given value to the Requests field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Requests field. func (b *DeviceConstraintApplyConfiguration) WithRequests(values ...string) *DeviceConstraintApplyConfiguration { for i := range values { b.Requests = append(b.Requests, values[i]) } return b } // WithMatchAttribute sets the MatchAttribute field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MatchAttribute field is set to the value of the last call. func (b *DeviceConstraintApplyConfiguration) WithMatchAttribute(value v1alpha3.FullyQualifiedName) *DeviceConstraintApplyConfiguration { b.MatchAttribute = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/devicerequest.go000066400000000000000000000104011472614177300311410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( resourcev1alpha3 "k8s.io/api/resource/v1alpha3" ) // DeviceRequestApplyConfiguration represents a declarative configuration of the DeviceRequest type for use // with apply. type DeviceRequestApplyConfiguration struct { Name *string `json:"name,omitempty"` DeviceClassName *string `json:"deviceClassName,omitempty"` Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` AllocationMode *resourcev1alpha3.DeviceAllocationMode `json:"allocationMode,omitempty"` Count *int64 `json:"count,omitempty"` AdminAccess *bool `json:"adminAccess,omitempty"` } // DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with // apply. func DeviceRequest() *DeviceRequestApplyConfiguration { return &DeviceRequestApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *DeviceRequestApplyConfiguration) WithName(value string) *DeviceRequestApplyConfiguration { b.Name = &value return b } // WithDeviceClassName sets the DeviceClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeviceClassName field is set to the value of the last call. func (b *DeviceRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceRequestApplyConfiguration { b.DeviceClassName = &value return b } // WithSelectors adds the given value to the Selectors field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Selectors field. func (b *DeviceRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceRequestApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithSelectors") } b.Selectors = append(b.Selectors, *values[i]) } return b } // WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllocationMode field is set to the value of the last call. func (b *DeviceRequestApplyConfiguration) WithAllocationMode(value resourcev1alpha3.DeviceAllocationMode) *DeviceRequestApplyConfiguration { b.AllocationMode = &value return b } // WithCount sets the Count field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Count field is set to the value of the last call. func (b *DeviceRequestApplyConfiguration) WithCount(value int64) *DeviceRequestApplyConfiguration { b.Count = &value return b } // WithAdminAccess sets the AdminAccess field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AdminAccess field is set to the value of the last call. func (b *DeviceRequestApplyConfiguration) WithAdminAccess(value bool) *DeviceRequestApplyConfiguration { b.AdminAccess = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go000066400000000000000000000060111472614177300344500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceRequestAllocationResultApplyConfiguration represents a declarative configuration of the DeviceRequestAllocationResult type for use // with apply. type DeviceRequestAllocationResultApplyConfiguration struct { Request *string `json:"request,omitempty"` Driver *string `json:"driver,omitempty"` Pool *string `json:"pool,omitempty"` Device *string `json:"device,omitempty"` } // DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with // apply. func DeviceRequestAllocationResult() *DeviceRequestAllocationResultApplyConfiguration { return &DeviceRequestAllocationResultApplyConfiguration{} } // WithRequest sets the Request field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Request field is set to the value of the last call. func (b *DeviceRequestAllocationResultApplyConfiguration) WithRequest(value string) *DeviceRequestAllocationResultApplyConfiguration { b.Request = &value return b } // WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Driver field is set to the value of the last call. func (b *DeviceRequestAllocationResultApplyConfiguration) WithDriver(value string) *DeviceRequestAllocationResultApplyConfiguration { b.Driver = &value return b } // WithPool sets the Pool field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Pool field is set to the value of the last call. func (b *DeviceRequestAllocationResultApplyConfiguration) WithPool(value string) *DeviceRequestAllocationResultApplyConfiguration { b.Pool = &value return b } // WithDevice sets the Device field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Device field is set to the value of the last call. func (b *DeviceRequestAllocationResultApplyConfiguration) WithDevice(value string) *DeviceRequestAllocationResultApplyConfiguration { b.Device = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/deviceselector.go000066400000000000000000000027751472614177300313100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // DeviceSelectorApplyConfiguration represents a declarative configuration of the DeviceSelector type for use // with apply. type DeviceSelectorApplyConfiguration struct { CEL *CELDeviceSelectorApplyConfiguration `json:"cel,omitempty"` } // DeviceSelectorApplyConfiguration constructs a declarative configuration of the DeviceSelector type for use with // apply. func DeviceSelector() *DeviceSelectorApplyConfiguration { return &DeviceSelectorApplyConfiguration{} } // WithCEL sets the CEL field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CEL field is set to the value of the last call. func (b *DeviceSelectorApplyConfiguration) WithCEL(value *CELDeviceSelectorApplyConfiguration) *DeviceSelectorApplyConfiguration { b.CEL = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/opaquedeviceconfiguration.go000066400000000000000000000042361472614177300335440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // OpaqueDeviceConfigurationApplyConfiguration represents a declarative configuration of the OpaqueDeviceConfiguration type for use // with apply. type OpaqueDeviceConfigurationApplyConfiguration struct { Driver *string `json:"driver,omitempty"` Parameters *runtime.RawExtension `json:"parameters,omitempty"` } // OpaqueDeviceConfigurationApplyConfiguration constructs a declarative configuration of the OpaqueDeviceConfiguration type for use with // apply. func OpaqueDeviceConfiguration() *OpaqueDeviceConfigurationApplyConfiguration { return &OpaqueDeviceConfigurationApplyConfiguration{} } // WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Driver field is set to the value of the last call. func (b *OpaqueDeviceConfigurationApplyConfiguration) WithDriver(value string) *OpaqueDeviceConfigurationApplyConfiguration { b.Driver = &value return b } // WithParameters sets the Parameters field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Parameters field is set to the value of the last call. func (b *OpaqueDeviceConfigurationApplyConfiguration) WithParameters(value runtime.RawExtension) *OpaqueDeviceConfigurationApplyConfiguration { b.Parameters = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/podschedulingcontext.go000066400000000000000000000323021472614177300325320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PodSchedulingContextApplyConfiguration represents a declarative configuration of the PodSchedulingContext type for use // with apply. type PodSchedulingContextApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PodSchedulingContextSpecApplyConfiguration `json:"spec,omitempty"` Status *PodSchedulingContextStatusApplyConfiguration `json:"status,omitempty"` } // PodSchedulingContext constructs a declarative configuration of the PodSchedulingContext type for use with // apply. func PodSchedulingContext(name, namespace string) *PodSchedulingContextApplyConfiguration { b := &PodSchedulingContextApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("PodSchedulingContext") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } // ExtractPodSchedulingContext extracts the applied configuration owned by fieldManager from // podSchedulingContext. If no managedFields are found in podSchedulingContext for fieldManager, a // PodSchedulingContextApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // podSchedulingContext must be a unmodified PodSchedulingContext API object that was retrieved from the Kubernetes API. // ExtractPodSchedulingContext provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPodSchedulingContext(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { return extractPodSchedulingContext(podSchedulingContext, fieldManager, "") } // ExtractPodSchedulingContextStatus is the same as ExtractPodSchedulingContext except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPodSchedulingContextStatus(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { return extractPodSchedulingContext(podSchedulingContext, fieldManager, "status") } func extractPodSchedulingContext(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string, subresource string) (*PodSchedulingContextApplyConfiguration, error) { b := &PodSchedulingContextApplyConfiguration{} err := managedfields.ExtractInto(podSchedulingContext, internal.Parser().Type("io.k8s.api.resource.v1alpha3.PodSchedulingContext"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(podSchedulingContext.Name) b.WithNamespace(podSchedulingContext.Namespace) b.WithKind("PodSchedulingContext") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithKind(value string) *PodSchedulingContextApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithAPIVersion(value string) *PodSchedulingContextApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithName(value string) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithGenerateName(value string) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithNamespace(value string) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithUID(value types.UID) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithResourceVersion(value string) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithGeneration(value int64) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PodSchedulingContextApplyConfiguration) WithLabels(entries map[string]string) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PodSchedulingContextApplyConfiguration) WithAnnotations(entries map[string]string) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PodSchedulingContextApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PodSchedulingContextApplyConfiguration) WithFinalizers(values ...string) *PodSchedulingContextApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PodSchedulingContextApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithSpec(value *PodSchedulingContextSpecApplyConfiguration) *PodSchedulingContextApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *PodSchedulingContextApplyConfiguration) WithStatus(value *PodSchedulingContextStatusApplyConfiguration) *PodSchedulingContextApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PodSchedulingContextApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/podschedulingcontextspec.go000066400000000000000000000043011472614177300334030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // PodSchedulingContextSpecApplyConfiguration represents a declarative configuration of the PodSchedulingContextSpec type for use // with apply. type PodSchedulingContextSpecApplyConfiguration struct { SelectedNode *string `json:"selectedNode,omitempty"` PotentialNodes []string `json:"potentialNodes,omitempty"` } // PodSchedulingContextSpecApplyConfiguration constructs a declarative configuration of the PodSchedulingContextSpec type for use with // apply. func PodSchedulingContextSpec() *PodSchedulingContextSpecApplyConfiguration { return &PodSchedulingContextSpecApplyConfiguration{} } // WithSelectedNode sets the SelectedNode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SelectedNode field is set to the value of the last call. func (b *PodSchedulingContextSpecApplyConfiguration) WithSelectedNode(value string) *PodSchedulingContextSpecApplyConfiguration { b.SelectedNode = &value return b } // WithPotentialNodes adds the given value to the PotentialNodes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the PotentialNodes field. func (b *PodSchedulingContextSpecApplyConfiguration) WithPotentialNodes(values ...string) *PodSchedulingContextSpecApplyConfiguration { for i := range values { b.PotentialNodes = append(b.PotentialNodes, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/podschedulingcontextstatus.go000066400000000000000000000035661472614177300340100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // PodSchedulingContextStatusApplyConfiguration represents a declarative configuration of the PodSchedulingContextStatus type for use // with apply. type PodSchedulingContextStatusApplyConfiguration struct { ResourceClaims []ResourceClaimSchedulingStatusApplyConfiguration `json:"resourceClaims,omitempty"` } // PodSchedulingContextStatusApplyConfiguration constructs a declarative configuration of the PodSchedulingContextStatus type for use with // apply. func PodSchedulingContextStatus() *PodSchedulingContextStatusApplyConfiguration { return &PodSchedulingContextStatusApplyConfiguration{} } // WithResourceClaims adds the given value to the ResourceClaims field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ResourceClaims field. func (b *PodSchedulingContextStatusApplyConfiguration) WithResourceClaims(values ...*ResourceClaimSchedulingStatusApplyConfiguration) *PodSchedulingContextStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithResourceClaims") } b.ResourceClaims = append(b.ResourceClaims, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceclaim.go000066400000000000000000000312221472614177300311320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ResourceClaimApplyConfiguration represents a declarative configuration of the ResourceClaim type for use // with apply. type ResourceClaimApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ResourceClaimSpecApplyConfiguration `json:"spec,omitempty"` Status *ResourceClaimStatusApplyConfiguration `json:"status,omitempty"` } // ResourceClaim constructs a declarative configuration of the ResourceClaim type for use with // apply. func ResourceClaim(name, namespace string) *ResourceClaimApplyConfiguration { b := &ResourceClaimApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceClaim") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } // ExtractResourceClaim extracts the applied configuration owned by fieldManager from // resourceClaim. If no managedFields are found in resourceClaim for fieldManager, a // ResourceClaimApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // resourceClaim must be a unmodified ResourceClaim API object that was retrieved from the Kubernetes API. // ExtractResourceClaim provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractResourceClaim(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { return extractResourceClaim(resourceClaim, fieldManager, "") } // ExtractResourceClaimStatus is the same as ExtractResourceClaim except // that it extracts the status subresource applied configuration. // Experimental! func ExtractResourceClaimStatus(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { return extractResourceClaim(resourceClaim, fieldManager, "status") } func extractResourceClaim(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string, subresource string) (*ResourceClaimApplyConfiguration, error) { b := &ResourceClaimApplyConfiguration{} err := managedfields.ExtractInto(resourceClaim, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClaim"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(resourceClaim.Name) b.WithNamespace(resourceClaim.Namespace) b.WithKind("ResourceClaim") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithKind(value string) *ResourceClaimApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithAPIVersion(value string) *ResourceClaimApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithName(value string) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithGenerateName(value string) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithNamespace(value string) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithUID(value types.UID) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithResourceVersion(value string) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithGeneration(value int64) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ResourceClaimApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ResourceClaimApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ResourceClaimApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ResourceClaimApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ResourceClaimApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithSpec(value *ResourceClaimSpecApplyConfiguration) *ResourceClaimApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *ResourceClaimApplyConfiguration) WithStatus(value *ResourceClaimStatusApplyConfiguration) *ResourceClaimApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ResourceClaimApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceclaimconsumerreference.go000066400000000000000000000061371472614177300345740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( types "k8s.io/apimachinery/pkg/types" ) // ResourceClaimConsumerReferenceApplyConfiguration represents a declarative configuration of the ResourceClaimConsumerReference type for use // with apply. type ResourceClaimConsumerReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` Resource *string `json:"resource,omitempty"` Name *string `json:"name,omitempty"` UID *types.UID `json:"uid,omitempty"` } // ResourceClaimConsumerReferenceApplyConfiguration constructs a declarative configuration of the ResourceClaimConsumerReference type for use with // apply. func ResourceClaimConsumerReference() *ResourceClaimConsumerReferenceApplyConfiguration { return &ResourceClaimConsumerReferenceApplyConfiguration{} } // WithAPIGroup sets the APIGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIGroup field is set to the value of the last call. func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithAPIGroup(value string) *ResourceClaimConsumerReferenceApplyConfiguration { b.APIGroup = &value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithResource(value string) *ResourceClaimConsumerReferenceApplyConfiguration { b.Resource = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithName(value string) *ResourceClaimConsumerReferenceApplyConfiguration { b.Name = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithUID(value types.UID) *ResourceClaimConsumerReferenceApplyConfiguration { b.UID = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceclaimschedulingstatus.go000066400000000000000000000043261472614177300344510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // ResourceClaimSchedulingStatusApplyConfiguration represents a declarative configuration of the ResourceClaimSchedulingStatus type for use // with apply. type ResourceClaimSchedulingStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` UnsuitableNodes []string `json:"unsuitableNodes,omitempty"` } // ResourceClaimSchedulingStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimSchedulingStatus type for use with // apply. func ResourceClaimSchedulingStatus() *ResourceClaimSchedulingStatusApplyConfiguration { return &ResourceClaimSchedulingStatusApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceClaimSchedulingStatusApplyConfiguration) WithName(value string) *ResourceClaimSchedulingStatusApplyConfiguration { b.Name = &value return b } // WithUnsuitableNodes adds the given value to the UnsuitableNodes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the UnsuitableNodes field. func (b *ResourceClaimSchedulingStatusApplyConfiguration) WithUnsuitableNodes(values ...string) *ResourceClaimSchedulingStatusApplyConfiguration { for i := range values { b.UnsuitableNodes = append(b.UnsuitableNodes, values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceclaimspec.go000066400000000000000000000040501472614177300320040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use // with apply. type ResourceClaimSpecApplyConfiguration struct { Devices *DeviceClaimApplyConfiguration `json:"devices,omitempty"` Controller *string `json:"controller,omitempty"` } // ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with // apply. func ResourceClaimSpec() *ResourceClaimSpecApplyConfiguration { return &ResourceClaimSpecApplyConfiguration{} } // WithDevices sets the Devices field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Devices field is set to the value of the last call. func (b *ResourceClaimSpecApplyConfiguration) WithDevices(value *DeviceClaimApplyConfiguration) *ResourceClaimSpecApplyConfiguration { b.Devices = value return b } // WithController sets the Controller field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Controller field is set to the value of the last call. func (b *ResourceClaimSpecApplyConfiguration) WithController(value string) *ResourceClaimSpecApplyConfiguration { b.Controller = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go000066400000000000000000000056671472614177300324140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // ResourceClaimStatusApplyConfiguration represents a declarative configuration of the ResourceClaimStatus type for use // with apply. type ResourceClaimStatusApplyConfiguration struct { Allocation *AllocationResultApplyConfiguration `json:"allocation,omitempty"` ReservedFor []ResourceClaimConsumerReferenceApplyConfiguration `json:"reservedFor,omitempty"` DeallocationRequested *bool `json:"deallocationRequested,omitempty"` } // ResourceClaimStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimStatus type for use with // apply. func ResourceClaimStatus() *ResourceClaimStatusApplyConfiguration { return &ResourceClaimStatusApplyConfiguration{} } // WithAllocation sets the Allocation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Allocation field is set to the value of the last call. func (b *ResourceClaimStatusApplyConfiguration) WithAllocation(value *AllocationResultApplyConfiguration) *ResourceClaimStatusApplyConfiguration { b.Allocation = value return b } // WithReservedFor adds the given value to the ReservedFor field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the ReservedFor field. func (b *ResourceClaimStatusApplyConfiguration) WithReservedFor(values ...*ResourceClaimConsumerReferenceApplyConfiguration) *ResourceClaimStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithReservedFor") } b.ReservedFor = append(b.ReservedFor, *values[i]) } return b } // WithDeallocationRequested sets the DeallocationRequested field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeallocationRequested field is set to the value of the last call. func (b *ResourceClaimStatusApplyConfiguration) WithDeallocationRequested(value bool) *ResourceClaimStatusApplyConfiguration { b.DeallocationRequested = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceclaimtemplate.go000066400000000000000000000313311472614177300326670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ResourceClaimTemplateApplyConfiguration represents a declarative configuration of the ResourceClaimTemplate type for use // with apply. type ResourceClaimTemplateApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ResourceClaimTemplateSpecApplyConfiguration `json:"spec,omitempty"` } // ResourceClaimTemplate constructs a declarative configuration of the ResourceClaimTemplate type for use with // apply. func ResourceClaimTemplate(name, namespace string) *ResourceClaimTemplateApplyConfiguration { b := &ResourceClaimTemplateApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceClaimTemplate") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } // ExtractResourceClaimTemplate extracts the applied configuration owned by fieldManager from // resourceClaimTemplate. If no managedFields are found in resourceClaimTemplate for fieldManager, a // ResourceClaimTemplateApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // resourceClaimTemplate must be a unmodified ResourceClaimTemplate API object that was retrieved from the Kubernetes API. // ExtractResourceClaimTemplate provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "") } // ExtractResourceClaimTemplateStatus is the same as ExtractResourceClaimTemplate except // that it extracts the status subresource applied configuration. // Experimental! func ExtractResourceClaimTemplateStatus(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "status") } func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string, subresource string) (*ResourceClaimTemplateApplyConfiguration, error) { b := &ResourceClaimTemplateApplyConfiguration{} err := managedfields.ExtractInto(resourceClaimTemplate, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClaimTemplate"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(resourceClaimTemplate.Name) b.WithNamespace(resourceClaimTemplate.Namespace) b.WithKind("ResourceClaimTemplate") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithKind(value string) *ResourceClaimTemplateApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithAPIVersion(value string) *ResourceClaimTemplateApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithName(value string) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithGenerateName(value string) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithNamespace(value string) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithUID(value types.UID) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithResourceVersion(value string) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithGeneration(value int64) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ResourceClaimTemplateApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ResourceClaimTemplateApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ResourceClaimTemplateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ResourceClaimTemplateApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimTemplateApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ResourceClaimTemplateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ResourceClaimTemplateApplyConfiguration) WithSpec(value *ResourceClaimTemplateSpecApplyConfiguration) *ResourceClaimTemplateApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ResourceClaimTemplateApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceclaimtemplatespec.go000066400000000000000000000226231472614177300335460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ResourceClaimTemplateSpecApplyConfiguration represents a declarative configuration of the ResourceClaimTemplateSpec type for use // with apply. type ResourceClaimTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ResourceClaimSpecApplyConfiguration `json:"spec,omitempty"` } // ResourceClaimTemplateSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimTemplateSpec type for use with // apply. func ResourceClaimTemplateSpec() *ResourceClaimTemplateSpecApplyConfiguration { return &ResourceClaimTemplateSpecApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithName(value string) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithGenerateName(value string) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithNamespace(value string) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithUID(value types.UID) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithResourceVersion(value string) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithGeneration(value int64) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimTemplateSpecApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ResourceClaimTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ResourceClaimTemplateSpecApplyConfiguration) WithSpec(value *ResourceClaimSpecApplyConfiguration) *ResourceClaimTemplateSpecApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ResourceClaimTemplateSpecApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourcepool.go000066400000000000000000000046641472614177300310300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 // ResourcePoolApplyConfiguration represents a declarative configuration of the ResourcePool type for use // with apply. type ResourcePoolApplyConfiguration struct { Name *string `json:"name,omitempty"` Generation *int64 `json:"generation,omitempty"` ResourceSliceCount *int64 `json:"resourceSliceCount,omitempty"` } // ResourcePoolApplyConfiguration constructs a declarative configuration of the ResourcePool type for use with // apply. func ResourcePool() *ResourcePoolApplyConfiguration { return &ResourcePoolApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourcePoolApplyConfiguration) WithName(value string) *ResourcePoolApplyConfiguration { b.Name = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ResourcePoolApplyConfiguration) WithGeneration(value int64) *ResourcePoolApplyConfiguration { b.Generation = &value return b } // WithResourceSliceCount sets the ResourceSliceCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceSliceCount field is set to the value of the last call. func (b *ResourcePoolApplyConfiguration) WithResourceSliceCount(value int64) *ResourcePoolApplyConfiguration { b.ResourceSliceCount = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceslice.go000066400000000000000000000300501472614177300311420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // ResourceSliceApplyConfiguration represents a declarative configuration of the ResourceSlice type for use // with apply. type ResourceSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ResourceSliceSpecApplyConfiguration `json:"spec,omitempty"` } // ResourceSlice constructs a declarative configuration of the ResourceSlice type for use with // apply. func ResourceSlice(name string) *ResourceSliceApplyConfiguration { b := &ResourceSliceApplyConfiguration{} b.WithName(name) b.WithKind("ResourceSlice") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } // ExtractResourceSlice extracts the applied configuration owned by fieldManager from // resourceSlice. If no managedFields are found in resourceSlice for fieldManager, a // ResourceSliceApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // resourceSlice must be a unmodified ResourceSlice API object that was retrieved from the Kubernetes API. // ExtractResourceSlice provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractResourceSlice(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { return extractResourceSlice(resourceSlice, fieldManager, "") } // ExtractResourceSliceStatus is the same as ExtractResourceSlice except // that it extracts the status subresource applied configuration. // Experimental! func ExtractResourceSliceStatus(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { return extractResourceSlice(resourceSlice, fieldManager, "status") } func extractResourceSlice(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string, subresource string) (*ResourceSliceApplyConfiguration, error) { b := &ResourceSliceApplyConfiguration{} err := managedfields.ExtractInto(resourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceSlice"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(resourceSlice.Name) b.WithKind("ResourceSlice") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithKind(value string) *ResourceSliceApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithAPIVersion(value string) *ResourceSliceApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithName(value string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithGenerateName(value string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithNamespace(value string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithUID(value types.UID) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithResourceVersion(value string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithGeneration(value int64) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *ResourceSliceApplyConfiguration) WithLabels(entries map[string]string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *ResourceSliceApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *ResourceSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *ResourceSliceApplyConfiguration) WithFinalizers(values ...string) *ResourceSliceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *ResourceSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *ResourceSliceApplyConfiguration) WithSpec(value *ResourceSliceSpecApplyConfiguration) *ResourceSliceApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *ResourceSliceApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/resource/v1alpha3/resourceslicespec.go000066400000000000000000000103441472614177300320210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha3 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use // with apply. type ResourceSliceSpecApplyConfiguration struct { Driver *string `json:"driver,omitempty"` Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"` NodeName *string `json:"nodeName,omitempty"` NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` AllNodes *bool `json:"allNodes,omitempty"` Devices []DeviceApplyConfiguration `json:"devices,omitempty"` } // ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with // apply. func ResourceSliceSpec() *ResourceSliceSpecApplyConfiguration { return &ResourceSliceSpecApplyConfiguration{} } // WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Driver field is set to the value of the last call. func (b *ResourceSliceSpecApplyConfiguration) WithDriver(value string) *ResourceSliceSpecApplyConfiguration { b.Driver = &value return b } // WithPool sets the Pool field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Pool field is set to the value of the last call. func (b *ResourceSliceSpecApplyConfiguration) WithPool(value *ResourcePoolApplyConfiguration) *ResourceSliceSpecApplyConfiguration { b.Pool = value return b } // WithNodeName sets the NodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeName field is set to the value of the last call. func (b *ResourceSliceSpecApplyConfiguration) WithNodeName(value string) *ResourceSliceSpecApplyConfiguration { b.NodeName = &value return b } // WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeSelector field is set to the value of the last call. func (b *ResourceSliceSpecApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *ResourceSliceSpecApplyConfiguration { b.NodeSelector = value return b } // WithAllNodes sets the AllNodes field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllNodes field is set to the value of the last call. func (b *ResourceSliceSpecApplyConfiguration) WithAllNodes(value bool) *ResourceSliceSpecApplyConfiguration { b.AllNodes = &value return b } // WithDevices adds the given value to the Devices field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Devices field. func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApplyConfiguration) *ResourceSliceSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithDevices") } b.Devices = append(b.Devices, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/scheduling/000077500000000000000000000000001472614177300246255ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/scheduling/v1/000077500000000000000000000000001472614177300251535ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/scheduling/v1/priorityclass.go000066400000000000000000000331141472614177300304130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" schedulingv1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PriorityClassApplyConfiguration represents a declarative configuration of the PriorityClass type for use // with apply. type PriorityClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Value *int32 `json:"value,omitempty"` GlobalDefault *bool `json:"globalDefault,omitempty"` Description *string `json:"description,omitempty"` PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` } // PriorityClass constructs a declarative configuration of the PriorityClass type for use with // apply. func PriorityClass(name string) *PriorityClassApplyConfiguration { b := &PriorityClassApplyConfiguration{} b.WithName(name) b.WithKind("PriorityClass") b.WithAPIVersion("scheduling.k8s.io/v1") return b } // ExtractPriorityClass extracts the applied configuration owned by fieldManager from // priorityClass. If no managedFields are found in priorityClass for fieldManager, a // PriorityClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API. // ExtractPriorityClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPriorityClass(priorityClass *schedulingv1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { return extractPriorityClass(priorityClass, fieldManager, "") } // ExtractPriorityClassStatus is the same as ExtractPriorityClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPriorityClassStatus(priorityClass *schedulingv1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { return extractPriorityClass(priorityClass, fieldManager, "status") } func extractPriorityClass(priorityClass *schedulingv1.PriorityClass, fieldManager string, subresource string) (*PriorityClassApplyConfiguration, error) { b := &PriorityClassApplyConfiguration{} err := managedfields.ExtractInto(priorityClass, internal.Parser().Type("io.k8s.api.scheduling.v1.PriorityClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(priorityClass.Name) b.WithKind("PriorityClass") b.WithAPIVersion("scheduling.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithKind(value string) *PriorityClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithAPIVersion(value string) *PriorityClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithName(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGenerateName(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithNamespace(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithUID(value types.UID) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithResourceVersion(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGeneration(value int64) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PriorityClassApplyConfiguration) WithLabels(entries map[string]string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PriorityClassApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PriorityClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PriorityClassApplyConfiguration) WithFinalizers(values ...string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PriorityClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithValue(value int32) *PriorityClassApplyConfiguration { b.Value = &value return b } // WithGlobalDefault sets the GlobalDefault field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GlobalDefault field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGlobalDefault(value bool) *PriorityClassApplyConfiguration { b.GlobalDefault = &value return b } // WithDescription sets the Description field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Description field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDescription(value string) *PriorityClassApplyConfiguration { b.Description = &value return b } // WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PreemptionPolicy field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithPreemptionPolicy(value corev1.PreemptionPolicy) *PriorityClassApplyConfiguration { b.PreemptionPolicy = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PriorityClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/scheduling/v1alpha1/000077500000000000000000000000001472614177300262425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/scheduling/v1alpha1/priorityclass.go000066400000000000000000000331321472614177300315020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( corev1 "k8s.io/api/core/v1" v1alpha1 "k8s.io/api/scheduling/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PriorityClassApplyConfiguration represents a declarative configuration of the PriorityClass type for use // with apply. type PriorityClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Value *int32 `json:"value,omitempty"` GlobalDefault *bool `json:"globalDefault,omitempty"` Description *string `json:"description,omitempty"` PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` } // PriorityClass constructs a declarative configuration of the PriorityClass type for use with // apply. func PriorityClass(name string) *PriorityClassApplyConfiguration { b := &PriorityClassApplyConfiguration{} b.WithName(name) b.WithKind("PriorityClass") b.WithAPIVersion("scheduling.k8s.io/v1alpha1") return b } // ExtractPriorityClass extracts the applied configuration owned by fieldManager from // priorityClass. If no managedFields are found in priorityClass for fieldManager, a // PriorityClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API. // ExtractPriorityClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPriorityClass(priorityClass *v1alpha1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { return extractPriorityClass(priorityClass, fieldManager, "") } // ExtractPriorityClassStatus is the same as ExtractPriorityClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPriorityClassStatus(priorityClass *v1alpha1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { return extractPriorityClass(priorityClass, fieldManager, "status") } func extractPriorityClass(priorityClass *v1alpha1.PriorityClass, fieldManager string, subresource string) (*PriorityClassApplyConfiguration, error) { b := &PriorityClassApplyConfiguration{} err := managedfields.ExtractInto(priorityClass, internal.Parser().Type("io.k8s.api.scheduling.v1alpha1.PriorityClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(priorityClass.Name) b.WithKind("PriorityClass") b.WithAPIVersion("scheduling.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithKind(value string) *PriorityClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithAPIVersion(value string) *PriorityClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithName(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGenerateName(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithNamespace(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithUID(value types.UID) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithResourceVersion(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGeneration(value int64) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PriorityClassApplyConfiguration) WithLabels(entries map[string]string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PriorityClassApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PriorityClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PriorityClassApplyConfiguration) WithFinalizers(values ...string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PriorityClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithValue(value int32) *PriorityClassApplyConfiguration { b.Value = &value return b } // WithGlobalDefault sets the GlobalDefault field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GlobalDefault field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGlobalDefault(value bool) *PriorityClassApplyConfiguration { b.GlobalDefault = &value return b } // WithDescription sets the Description field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Description field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDescription(value string) *PriorityClassApplyConfiguration { b.Description = &value return b } // WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PreemptionPolicy field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithPreemptionPolicy(value corev1.PreemptionPolicy) *PriorityClassApplyConfiguration { b.PreemptionPolicy = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PriorityClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/scheduling/v1beta1/000077500000000000000000000000001472614177300260705ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/scheduling/v1beta1/priorityclass.go000066400000000000000000000331211472614177300313260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( corev1 "k8s.io/api/core/v1" v1beta1 "k8s.io/api/scheduling/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // PriorityClassApplyConfiguration represents a declarative configuration of the PriorityClass type for use // with apply. type PriorityClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Value *int32 `json:"value,omitempty"` GlobalDefault *bool `json:"globalDefault,omitempty"` Description *string `json:"description,omitempty"` PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` } // PriorityClass constructs a declarative configuration of the PriorityClass type for use with // apply. func PriorityClass(name string) *PriorityClassApplyConfiguration { b := &PriorityClassApplyConfiguration{} b.WithName(name) b.WithKind("PriorityClass") b.WithAPIVersion("scheduling.k8s.io/v1beta1") return b } // ExtractPriorityClass extracts the applied configuration owned by fieldManager from // priorityClass. If no managedFields are found in priorityClass for fieldManager, a // PriorityClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API. // ExtractPriorityClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractPriorityClass(priorityClass *v1beta1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { return extractPriorityClass(priorityClass, fieldManager, "") } // ExtractPriorityClassStatus is the same as ExtractPriorityClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractPriorityClassStatus(priorityClass *v1beta1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) { return extractPriorityClass(priorityClass, fieldManager, "status") } func extractPriorityClass(priorityClass *v1beta1.PriorityClass, fieldManager string, subresource string) (*PriorityClassApplyConfiguration, error) { b := &PriorityClassApplyConfiguration{} err := managedfields.ExtractInto(priorityClass, internal.Parser().Type("io.k8s.api.scheduling.v1beta1.PriorityClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(priorityClass.Name) b.WithKind("PriorityClass") b.WithAPIVersion("scheduling.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithKind(value string) *PriorityClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithAPIVersion(value string) *PriorityClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithName(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGenerateName(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithNamespace(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithUID(value types.UID) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithResourceVersion(value string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGeneration(value int64) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *PriorityClassApplyConfiguration) WithLabels(entries map[string]string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *PriorityClassApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *PriorityClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *PriorityClassApplyConfiguration) WithFinalizers(values ...string) *PriorityClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *PriorityClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Value field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithValue(value int32) *PriorityClassApplyConfiguration { b.Value = &value return b } // WithGlobalDefault sets the GlobalDefault field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GlobalDefault field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithGlobalDefault(value bool) *PriorityClassApplyConfiguration { b.GlobalDefault = &value return b } // WithDescription sets the Description field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Description field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithDescription(value string) *PriorityClassApplyConfiguration { b.Description = &value return b } // WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PreemptionPolicy field is set to the value of the last call. func (b *PriorityClassApplyConfiguration) WithPreemptionPolicy(value corev1.PreemptionPolicy) *PriorityClassApplyConfiguration { b.PreemptionPolicy = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *PriorityClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/000077500000000000000000000000001472614177300241445ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/000077500000000000000000000000001472614177300244725ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/csidriver.go000066400000000000000000000273121472614177300270200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apistoragev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CSIDriverApplyConfiguration represents a declarative configuration of the CSIDriver type for use // with apply. type CSIDriverApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CSIDriverSpecApplyConfiguration `json:"spec,omitempty"` } // CSIDriver constructs a declarative configuration of the CSIDriver type for use with // apply. func CSIDriver(name string) *CSIDriverApplyConfiguration { b := &CSIDriverApplyConfiguration{} b.WithName(name) b.WithKind("CSIDriver") b.WithAPIVersion("storage.k8s.io/v1") return b } // ExtractCSIDriver extracts the applied configuration owned by fieldManager from // cSIDriver. If no managedFields are found in cSIDriver for fieldManager, a // CSIDriverApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cSIDriver must be a unmodified CSIDriver API object that was retrieved from the Kubernetes API. // ExtractCSIDriver provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCSIDriver(cSIDriver *apistoragev1.CSIDriver, fieldManager string) (*CSIDriverApplyConfiguration, error) { return extractCSIDriver(cSIDriver, fieldManager, "") } // ExtractCSIDriverStatus is the same as ExtractCSIDriver except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCSIDriverStatus(cSIDriver *apistoragev1.CSIDriver, fieldManager string) (*CSIDriverApplyConfiguration, error) { return extractCSIDriver(cSIDriver, fieldManager, "status") } func extractCSIDriver(cSIDriver *apistoragev1.CSIDriver, fieldManager string, subresource string) (*CSIDriverApplyConfiguration, error) { b := &CSIDriverApplyConfiguration{} err := managedfields.ExtractInto(cSIDriver, internal.Parser().Type("io.k8s.api.storage.v1.CSIDriver"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cSIDriver.Name) b.WithKind("CSIDriver") b.WithAPIVersion("storage.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithKind(value string) *CSIDriverApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithAPIVersion(value string) *CSIDriverApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithName(value string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithGenerateName(value string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithNamespace(value string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithUID(value types.UID) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithResourceVersion(value string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithGeneration(value int64) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CSIDriverApplyConfiguration) WithLabels(entries map[string]string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CSIDriverApplyConfiguration) WithAnnotations(entries map[string]string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CSIDriverApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CSIDriverApplyConfiguration) WithFinalizers(values ...string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CSIDriverApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithSpec(value *CSIDriverSpecApplyConfiguration) *CSIDriverApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CSIDriverApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/csidriverspec.go000066400000000000000000000130261472614177300276700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/storage/v1" ) // CSIDriverSpecApplyConfiguration represents a declarative configuration of the CSIDriverSpec type for use // with apply. type CSIDriverSpecApplyConfiguration struct { AttachRequired *bool `json:"attachRequired,omitempty"` PodInfoOnMount *bool `json:"podInfoOnMount,omitempty"` VolumeLifecycleModes []v1.VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty"` StorageCapacity *bool `json:"storageCapacity,omitempty"` FSGroupPolicy *v1.FSGroupPolicy `json:"fsGroupPolicy,omitempty"` TokenRequests []TokenRequestApplyConfiguration `json:"tokenRequests,omitempty"` RequiresRepublish *bool `json:"requiresRepublish,omitempty"` SELinuxMount *bool `json:"seLinuxMount,omitempty"` } // CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with // apply. func CSIDriverSpec() *CSIDriverSpecApplyConfiguration { return &CSIDriverSpecApplyConfiguration{} } // WithAttachRequired sets the AttachRequired field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AttachRequired field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithAttachRequired(value bool) *CSIDriverSpecApplyConfiguration { b.AttachRequired = &value return b } // WithPodInfoOnMount sets the PodInfoOnMount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodInfoOnMount field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithPodInfoOnMount(value bool) *CSIDriverSpecApplyConfiguration { b.PodInfoOnMount = &value return b } // WithVolumeLifecycleModes adds the given value to the VolumeLifecycleModes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeLifecycleModes field. func (b *CSIDriverSpecApplyConfiguration) WithVolumeLifecycleModes(values ...v1.VolumeLifecycleMode) *CSIDriverSpecApplyConfiguration { for i := range values { b.VolumeLifecycleModes = append(b.VolumeLifecycleModes, values[i]) } return b } // WithStorageCapacity sets the StorageCapacity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageCapacity field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithStorageCapacity(value bool) *CSIDriverSpecApplyConfiguration { b.StorageCapacity = &value return b } // WithFSGroupPolicy sets the FSGroupPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSGroupPolicy field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithFSGroupPolicy(value v1.FSGroupPolicy) *CSIDriverSpecApplyConfiguration { b.FSGroupPolicy = &value return b } // WithTokenRequests adds the given value to the TokenRequests field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TokenRequests field. func (b *CSIDriverSpecApplyConfiguration) WithTokenRequests(values ...*TokenRequestApplyConfiguration) *CSIDriverSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTokenRequests") } b.TokenRequests = append(b.TokenRequests, *values[i]) } return b } // WithRequiresRepublish sets the RequiresRepublish field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RequiresRepublish field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithRequiresRepublish(value bool) *CSIDriverSpecApplyConfiguration { b.RequiresRepublish = &value return b } // WithSELinuxMount sets the SELinuxMount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SELinuxMount field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithSELinuxMount(value bool) *CSIDriverSpecApplyConfiguration { b.SELinuxMount = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/csinode.go000066400000000000000000000270641472614177300264560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apistoragev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CSINodeApplyConfiguration represents a declarative configuration of the CSINode type for use // with apply. type CSINodeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CSINodeSpecApplyConfiguration `json:"spec,omitempty"` } // CSINode constructs a declarative configuration of the CSINode type for use with // apply. func CSINode(name string) *CSINodeApplyConfiguration { b := &CSINodeApplyConfiguration{} b.WithName(name) b.WithKind("CSINode") b.WithAPIVersion("storage.k8s.io/v1") return b } // ExtractCSINode extracts the applied configuration owned by fieldManager from // cSINode. If no managedFields are found in cSINode for fieldManager, a // CSINodeApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cSINode must be a unmodified CSINode API object that was retrieved from the Kubernetes API. // ExtractCSINode provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCSINode(cSINode *apistoragev1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { return extractCSINode(cSINode, fieldManager, "") } // ExtractCSINodeStatus is the same as ExtractCSINode except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCSINodeStatus(cSINode *apistoragev1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { return extractCSINode(cSINode, fieldManager, "status") } func extractCSINode(cSINode *apistoragev1.CSINode, fieldManager string, subresource string) (*CSINodeApplyConfiguration, error) { b := &CSINodeApplyConfiguration{} err := managedfields.ExtractInto(cSINode, internal.Parser().Type("io.k8s.api.storage.v1.CSINode"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cSINode.Name) b.WithKind("CSINode") b.WithAPIVersion("storage.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithKind(value string) *CSINodeApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithAPIVersion(value string) *CSINodeApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithName(value string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithGenerateName(value string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithNamespace(value string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithUID(value types.UID) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithResourceVersion(value string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithGeneration(value int64) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CSINodeApplyConfiguration) WithLabels(entries map[string]string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CSINodeApplyConfiguration) WithAnnotations(entries map[string]string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CSINodeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CSINodeApplyConfiguration) WithFinalizers(values ...string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CSINodeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithSpec(value *CSINodeSpecApplyConfiguration) *CSINodeApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CSINodeApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/csinodedriver.go000066400000000000000000000060661472614177300276710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CSINodeDriverApplyConfiguration represents a declarative configuration of the CSINodeDriver type for use // with apply. type CSINodeDriverApplyConfiguration struct { Name *string `json:"name,omitempty"` NodeID *string `json:"nodeID,omitempty"` TopologyKeys []string `json:"topologyKeys,omitempty"` Allocatable *VolumeNodeResourcesApplyConfiguration `json:"allocatable,omitempty"` } // CSINodeDriverApplyConfiguration constructs a declarative configuration of the CSINodeDriver type for use with // apply. func CSINodeDriver() *CSINodeDriverApplyConfiguration { return &CSINodeDriverApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSINodeDriverApplyConfiguration) WithName(value string) *CSINodeDriverApplyConfiguration { b.Name = &value return b } // WithNodeID sets the NodeID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeID field is set to the value of the last call. func (b *CSINodeDriverApplyConfiguration) WithNodeID(value string) *CSINodeDriverApplyConfiguration { b.NodeID = &value return b } // WithTopologyKeys adds the given value to the TopologyKeys field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TopologyKeys field. func (b *CSINodeDriverApplyConfiguration) WithTopologyKeys(values ...string) *CSINodeDriverApplyConfiguration { for i := range values { b.TopologyKeys = append(b.TopologyKeys, values[i]) } return b } // WithAllocatable sets the Allocatable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Allocatable field is set to the value of the last call. func (b *CSINodeDriverApplyConfiguration) WithAllocatable(value *VolumeNodeResourcesApplyConfiguration) *CSINodeDriverApplyConfiguration { b.Allocatable = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/csinodespec.go000066400000000000000000000031731472614177300273240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // CSINodeSpecApplyConfiguration represents a declarative configuration of the CSINodeSpec type for use // with apply. type CSINodeSpecApplyConfiguration struct { Drivers []CSINodeDriverApplyConfiguration `json:"drivers,omitempty"` } // CSINodeSpecApplyConfiguration constructs a declarative configuration of the CSINodeSpec type for use with // apply. func CSINodeSpec() *CSINodeSpecApplyConfiguration { return &CSINodeSpecApplyConfiguration{} } // WithDrivers adds the given value to the Drivers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Drivers field. func (b *CSINodeSpecApplyConfiguration) WithDrivers(values ...*CSINodeDriverApplyConfiguration) *CSINodeSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithDrivers") } b.Drivers = append(b.Drivers, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/csistoragecapacity.go000066400000000000000000000342511472614177300307070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( storagev1 "k8s.io/api/storage/v1" resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CSIStorageCapacityApplyConfiguration represents a declarative configuration of the CSIStorageCapacity type for use // with apply. type CSIStorageCapacityApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` NodeTopology *v1.LabelSelectorApplyConfiguration `json:"nodeTopology,omitempty"` StorageClassName *string `json:"storageClassName,omitempty"` Capacity *resource.Quantity `json:"capacity,omitempty"` MaximumVolumeSize *resource.Quantity `json:"maximumVolumeSize,omitempty"` } // CSIStorageCapacity constructs a declarative configuration of the CSIStorageCapacity type for use with // apply. func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfiguration { b := &CSIStorageCapacityApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("CSIStorageCapacity") b.WithAPIVersion("storage.k8s.io/v1") return b } // ExtractCSIStorageCapacity extracts the applied configuration owned by fieldManager from // cSIStorageCapacity. If no managedFields are found in cSIStorageCapacity for fieldManager, a // CSIStorageCapacityApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cSIStorageCapacity must be a unmodified CSIStorageCapacity API object that was retrieved from the Kubernetes API. // ExtractCSIStorageCapacity provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCSIStorageCapacity(cSIStorageCapacity *storagev1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "") } // ExtractCSIStorageCapacityStatus is the same as ExtractCSIStorageCapacity except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCSIStorageCapacityStatus(cSIStorageCapacity *storagev1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "status") } func extractCSIStorageCapacity(cSIStorageCapacity *storagev1.CSIStorageCapacity, fieldManager string, subresource string) (*CSIStorageCapacityApplyConfiguration, error) { b := &CSIStorageCapacityApplyConfiguration{} err := managedfields.ExtractInto(cSIStorageCapacity, internal.Parser().Type("io.k8s.api.storage.v1.CSIStorageCapacity"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cSIStorageCapacity.Name) b.WithNamespace(cSIStorageCapacity.Namespace) b.WithKind("CSIStorageCapacity") b.WithAPIVersion("storage.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithKind(value string) *CSIStorageCapacityApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithAPIVersion(value string) *CSIStorageCapacityApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithName(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithGenerateName(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithNamespace(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithUID(value types.UID) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithResourceVersion(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithGeneration(value int64) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CSIStorageCapacityApplyConfiguration) WithLabels(entries map[string]string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CSIStorageCapacityApplyConfiguration) WithAnnotations(entries map[string]string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CSIStorageCapacityApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CSIStorageCapacityApplyConfiguration) WithFinalizers(values ...string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CSIStorageCapacityApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithNodeTopology sets the NodeTopology field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeTopology field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithNodeTopology(value *v1.LabelSelectorApplyConfiguration) *CSIStorageCapacityApplyConfiguration { b.NodeTopology = value return b } // WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageClassName field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithStorageClassName(value string) *CSIStorageCapacityApplyConfiguration { b.StorageClassName = &value return b } // WithCapacity sets the Capacity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Capacity field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithCapacity(value resource.Quantity) *CSIStorageCapacityApplyConfiguration { b.Capacity = &value return b } // WithMaximumVolumeSize sets the MaximumVolumeSize field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaximumVolumeSize field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithMaximumVolumeSize(value resource.Quantity) *CSIStorageCapacityApplyConfiguration { b.MaximumVolumeSize = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CSIStorageCapacityApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/storageclass.go000066400000000000000000000400351472614177300275150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StorageClassApplyConfiguration represents a declarative configuration of the StorageClass type for use // with apply. type StorageClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Provisioner *string `json:"provisioner,omitempty"` Parameters map[string]string `json:"parameters,omitempty"` ReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty"` MountOptions []string `json:"mountOptions,omitempty"` AllowVolumeExpansion *bool `json:"allowVolumeExpansion,omitempty"` VolumeBindingMode *storagev1.VolumeBindingMode `json:"volumeBindingMode,omitempty"` AllowedTopologies []applyconfigurationscorev1.TopologySelectorTermApplyConfiguration `json:"allowedTopologies,omitempty"` } // StorageClass constructs a declarative configuration of the StorageClass type for use with // apply. func StorageClass(name string) *StorageClassApplyConfiguration { b := &StorageClassApplyConfiguration{} b.WithName(name) b.WithKind("StorageClass") b.WithAPIVersion("storage.k8s.io/v1") return b } // ExtractStorageClass extracts the applied configuration owned by fieldManager from // storageClass. If no managedFields are found in storageClass for fieldManager, a // StorageClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // storageClass must be a unmodified StorageClass API object that was retrieved from the Kubernetes API. // ExtractStorageClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractStorageClass(storageClass *storagev1.StorageClass, fieldManager string) (*StorageClassApplyConfiguration, error) { return extractStorageClass(storageClass, fieldManager, "") } // ExtractStorageClassStatus is the same as ExtractStorageClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractStorageClassStatus(storageClass *storagev1.StorageClass, fieldManager string) (*StorageClassApplyConfiguration, error) { return extractStorageClass(storageClass, fieldManager, "status") } func extractStorageClass(storageClass *storagev1.StorageClass, fieldManager string, subresource string) (*StorageClassApplyConfiguration, error) { b := &StorageClassApplyConfiguration{} err := managedfields.ExtractInto(storageClass, internal.Parser().Type("io.k8s.api.storage.v1.StorageClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(storageClass.Name) b.WithKind("StorageClass") b.WithAPIVersion("storage.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithKind(value string) *StorageClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithAPIVersion(value string) *StorageClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithName(value string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithGenerateName(value string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithNamespace(value string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithUID(value types.UID) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithResourceVersion(value string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithGeneration(value int64) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *StorageClassApplyConfiguration) WithLabels(entries map[string]string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *StorageClassApplyConfiguration) WithAnnotations(entries map[string]string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *StorageClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *StorageClassApplyConfiguration) WithFinalizers(values ...string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *StorageClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithProvisioner sets the Provisioner field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Provisioner field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithProvisioner(value string) *StorageClassApplyConfiguration { b.Provisioner = &value return b } // WithParameters puts the entries into the Parameters field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Parameters field, // overwriting an existing map entries in Parameters field with the same key. func (b *StorageClassApplyConfiguration) WithParameters(entries map[string]string) *StorageClassApplyConfiguration { if b.Parameters == nil && len(entries) > 0 { b.Parameters = make(map[string]string, len(entries)) } for k, v := range entries { b.Parameters[k] = v } return b } // WithReclaimPolicy sets the ReclaimPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReclaimPolicy field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithReclaimPolicy(value corev1.PersistentVolumeReclaimPolicy) *StorageClassApplyConfiguration { b.ReclaimPolicy = &value return b } // WithMountOptions adds the given value to the MountOptions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MountOptions field. func (b *StorageClassApplyConfiguration) WithMountOptions(values ...string) *StorageClassApplyConfiguration { for i := range values { b.MountOptions = append(b.MountOptions, values[i]) } return b } // WithAllowVolumeExpansion sets the AllowVolumeExpansion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllowVolumeExpansion field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithAllowVolumeExpansion(value bool) *StorageClassApplyConfiguration { b.AllowVolumeExpansion = &value return b } // WithVolumeBindingMode sets the VolumeBindingMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeBindingMode field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithVolumeBindingMode(value storagev1.VolumeBindingMode) *StorageClassApplyConfiguration { b.VolumeBindingMode = &value return b } // WithAllowedTopologies adds the given value to the AllowedTopologies field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AllowedTopologies field. func (b *StorageClassApplyConfiguration) WithAllowedTopologies(values ...*applyconfigurationscorev1.TopologySelectorTermApplyConfiguration) *StorageClassApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithAllowedTopologies") } b.AllowedTopologies = append(b.AllowedTopologies, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *StorageClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/tokenrequest.go000066400000000000000000000037361472614177300275630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // TokenRequestApplyConfiguration represents a declarative configuration of the TokenRequest type for use // with apply. type TokenRequestApplyConfiguration struct { Audience *string `json:"audience,omitempty"` ExpirationSeconds *int64 `json:"expirationSeconds,omitempty"` } // TokenRequestApplyConfiguration constructs a declarative configuration of the TokenRequest type for use with // apply. func TokenRequest() *TokenRequestApplyConfiguration { return &TokenRequestApplyConfiguration{} } // WithAudience sets the Audience field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Audience field is set to the value of the last call. func (b *TokenRequestApplyConfiguration) WithAudience(value string) *TokenRequestApplyConfiguration { b.Audience = &value return b } // WithExpirationSeconds sets the ExpirationSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExpirationSeconds field is set to the value of the last call. func (b *TokenRequestApplyConfiguration) WithExpirationSeconds(value int64) *TokenRequestApplyConfiguration { b.ExpirationSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/volumeattachment.go000066400000000000000000000313741472614177300304110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( apistoragev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // VolumeAttachmentApplyConfiguration represents a declarative configuration of the VolumeAttachment type for use // with apply. type VolumeAttachmentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *VolumeAttachmentSpecApplyConfiguration `json:"spec,omitempty"` Status *VolumeAttachmentStatusApplyConfiguration `json:"status,omitempty"` } // VolumeAttachment constructs a declarative configuration of the VolumeAttachment type for use with // apply. func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { b := &VolumeAttachmentApplyConfiguration{} b.WithName(name) b.WithKind("VolumeAttachment") b.WithAPIVersion("storage.k8s.io/v1") return b } // ExtractVolumeAttachment extracts the applied configuration owned by fieldManager from // volumeAttachment. If no managedFields are found in volumeAttachment for fieldManager, a // VolumeAttachmentApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // volumeAttachment must be a unmodified VolumeAttachment API object that was retrieved from the Kubernetes API. // ExtractVolumeAttachment provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractVolumeAttachment(volumeAttachment *apistoragev1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { return extractVolumeAttachment(volumeAttachment, fieldManager, "") } // ExtractVolumeAttachmentStatus is the same as ExtractVolumeAttachment except // that it extracts the status subresource applied configuration. // Experimental! func ExtractVolumeAttachmentStatus(volumeAttachment *apistoragev1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { return extractVolumeAttachment(volumeAttachment, fieldManager, "status") } func extractVolumeAttachment(volumeAttachment *apistoragev1.VolumeAttachment, fieldManager string, subresource string) (*VolumeAttachmentApplyConfiguration, error) { b := &VolumeAttachmentApplyConfiguration{} err := managedfields.ExtractInto(volumeAttachment, internal.Parser().Type("io.k8s.api.storage.v1.VolumeAttachment"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(volumeAttachment.Name) b.WithKind("VolumeAttachment") b.WithAPIVersion("storage.k8s.io/v1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithKind(value string) *VolumeAttachmentApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithAPIVersion(value string) *VolumeAttachmentApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithName(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithGenerateName(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithNamespace(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithUID(value types.UID) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithResourceVersion(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithGeneration(value int64) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *VolumeAttachmentApplyConfiguration) WithLabels(entries map[string]string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *VolumeAttachmentApplyConfiguration) WithAnnotations(entries map[string]string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *VolumeAttachmentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *VolumeAttachmentApplyConfiguration) WithFinalizers(values ...string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *VolumeAttachmentApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithSpec(value *VolumeAttachmentSpecApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithStatus(value *VolumeAttachmentStatusApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *VolumeAttachmentApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/volumeattachmentsource.go000066400000000000000000000045071472614177300316300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // VolumeAttachmentSourceApplyConfiguration represents a declarative configuration of the VolumeAttachmentSource type for use // with apply. type VolumeAttachmentSourceApplyConfiguration struct { PersistentVolumeName *string `json:"persistentVolumeName,omitempty"` InlineVolumeSpec *v1.PersistentVolumeSpecApplyConfiguration `json:"inlineVolumeSpec,omitempty"` } // VolumeAttachmentSourceApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSource type for use with // apply. func VolumeAttachmentSource() *VolumeAttachmentSourceApplyConfiguration { return &VolumeAttachmentSourceApplyConfiguration{} } // WithPersistentVolumeName sets the PersistentVolumeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeName field is set to the value of the last call. func (b *VolumeAttachmentSourceApplyConfiguration) WithPersistentVolumeName(value string) *VolumeAttachmentSourceApplyConfiguration { b.PersistentVolumeName = &value return b } // WithInlineVolumeSpec sets the InlineVolumeSpec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InlineVolumeSpec field is set to the value of the last call. func (b *VolumeAttachmentSourceApplyConfiguration) WithInlineVolumeSpec(value *v1.PersistentVolumeSpecApplyConfiguration) *VolumeAttachmentSourceApplyConfiguration { b.InlineVolumeSpec = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/volumeattachmentspec.go000066400000000000000000000051161472614177300312570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VolumeAttachmentSpecApplyConfiguration represents a declarative configuration of the VolumeAttachmentSpec type for use // with apply. type VolumeAttachmentSpecApplyConfiguration struct { Attacher *string `json:"attacher,omitempty"` Source *VolumeAttachmentSourceApplyConfiguration `json:"source,omitempty"` NodeName *string `json:"nodeName,omitempty"` } // VolumeAttachmentSpecApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSpec type for use with // apply. func VolumeAttachmentSpec() *VolumeAttachmentSpecApplyConfiguration { return &VolumeAttachmentSpecApplyConfiguration{} } // WithAttacher sets the Attacher field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Attacher field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithAttacher(value string) *VolumeAttachmentSpecApplyConfiguration { b.Attacher = &value return b } // WithSource sets the Source field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Source field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithSource(value *VolumeAttachmentSourceApplyConfiguration) *VolumeAttachmentSpecApplyConfiguration { b.Source = value return b } // WithNodeName sets the NodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeName field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithNodeName(value string) *VolumeAttachmentSpecApplyConfiguration { b.NodeName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/volumeattachmentstatus.go000066400000000000000000000067411472614177300316550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VolumeAttachmentStatusApplyConfiguration represents a declarative configuration of the VolumeAttachmentStatus type for use // with apply. type VolumeAttachmentStatusApplyConfiguration struct { Attached *bool `json:"attached,omitempty"` AttachmentMetadata map[string]string `json:"attachmentMetadata,omitempty"` AttachError *VolumeErrorApplyConfiguration `json:"attachError,omitempty"` DetachError *VolumeErrorApplyConfiguration `json:"detachError,omitempty"` } // VolumeAttachmentStatusApplyConfiguration constructs a declarative configuration of the VolumeAttachmentStatus type for use with // apply. func VolumeAttachmentStatus() *VolumeAttachmentStatusApplyConfiguration { return &VolumeAttachmentStatusApplyConfiguration{} } // WithAttached sets the Attached field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Attached field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttached(value bool) *VolumeAttachmentStatusApplyConfiguration { b.Attached = &value return b } // WithAttachmentMetadata puts the entries into the AttachmentMetadata field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the AttachmentMetadata field, // overwriting an existing map entries in AttachmentMetadata field with the same key. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttachmentMetadata(entries map[string]string) *VolumeAttachmentStatusApplyConfiguration { if b.AttachmentMetadata == nil && len(entries) > 0 { b.AttachmentMetadata = make(map[string]string, len(entries)) } for k, v := range entries { b.AttachmentMetadata[k] = v } return b } // WithAttachError sets the AttachError field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AttachError field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttachError(value *VolumeErrorApplyConfiguration) *VolumeAttachmentStatusApplyConfiguration { b.AttachError = value return b } // WithDetachError sets the DetachError field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DetachError field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithDetachError(value *VolumeErrorApplyConfiguration) *VolumeAttachmentStatusApplyConfiguration { b.DetachError = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/volumeerror.go000066400000000000000000000036451472614177300274120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { Time *v1.Time `json:"time,omitempty"` Message *string `json:"message,omitempty"` } // VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with // apply. func VolumeError() *VolumeErrorApplyConfiguration { return &VolumeErrorApplyConfiguration{} } // WithTime sets the Time field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Time field is set to the value of the last call. func (b *VolumeErrorApplyConfiguration) WithTime(value v1.Time) *VolumeErrorApplyConfiguration { b.Time = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *VolumeErrorApplyConfiguration) WithMessage(value string) *VolumeErrorApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1/volumenoderesources.go000066400000000000000000000027731472614177300311420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1 // VolumeNodeResourcesApplyConfiguration represents a declarative configuration of the VolumeNodeResources type for use // with apply. type VolumeNodeResourcesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` } // VolumeNodeResourcesApplyConfiguration constructs a declarative configuration of the VolumeNodeResources type for use with // apply. func VolumeNodeResources() *VolumeNodeResourcesApplyConfiguration { return &VolumeNodeResourcesApplyConfiguration{} } // WithCount sets the Count field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Count field is set to the value of the last call. func (b *VolumeNodeResourcesApplyConfiguration) WithCount(value int32) *VolumeNodeResourcesApplyConfiguration { b.Count = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1alpha1/000077500000000000000000000000001472614177300255615ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1alpha1/csistoragecapacity.go000066400000000000000000000343031472614177300317740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/storage/v1alpha1" resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CSIStorageCapacityApplyConfiguration represents a declarative configuration of the CSIStorageCapacity type for use // with apply. type CSIStorageCapacityApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` NodeTopology *v1.LabelSelectorApplyConfiguration `json:"nodeTopology,omitempty"` StorageClassName *string `json:"storageClassName,omitempty"` Capacity *resource.Quantity `json:"capacity,omitempty"` MaximumVolumeSize *resource.Quantity `json:"maximumVolumeSize,omitempty"` } // CSIStorageCapacity constructs a declarative configuration of the CSIStorageCapacity type for use with // apply. func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfiguration { b := &CSIStorageCapacityApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("CSIStorageCapacity") b.WithAPIVersion("storage.k8s.io/v1alpha1") return b } // ExtractCSIStorageCapacity extracts the applied configuration owned by fieldManager from // cSIStorageCapacity. If no managedFields are found in cSIStorageCapacity for fieldManager, a // CSIStorageCapacityApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cSIStorageCapacity must be a unmodified CSIStorageCapacity API object that was retrieved from the Kubernetes API. // ExtractCSIStorageCapacity provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCSIStorageCapacity(cSIStorageCapacity *v1alpha1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "") } // ExtractCSIStorageCapacityStatus is the same as ExtractCSIStorageCapacity except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCSIStorageCapacityStatus(cSIStorageCapacity *v1alpha1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "status") } func extractCSIStorageCapacity(cSIStorageCapacity *v1alpha1.CSIStorageCapacity, fieldManager string, subresource string) (*CSIStorageCapacityApplyConfiguration, error) { b := &CSIStorageCapacityApplyConfiguration{} err := managedfields.ExtractInto(cSIStorageCapacity, internal.Parser().Type("io.k8s.api.storage.v1alpha1.CSIStorageCapacity"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cSIStorageCapacity.Name) b.WithNamespace(cSIStorageCapacity.Namespace) b.WithKind("CSIStorageCapacity") b.WithAPIVersion("storage.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithKind(value string) *CSIStorageCapacityApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithAPIVersion(value string) *CSIStorageCapacityApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithName(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithGenerateName(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithNamespace(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithUID(value types.UID) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithResourceVersion(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithGeneration(value int64) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CSIStorageCapacityApplyConfiguration) WithLabels(entries map[string]string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CSIStorageCapacityApplyConfiguration) WithAnnotations(entries map[string]string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CSIStorageCapacityApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CSIStorageCapacityApplyConfiguration) WithFinalizers(values ...string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CSIStorageCapacityApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithNodeTopology sets the NodeTopology field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeTopology field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithNodeTopology(value *v1.LabelSelectorApplyConfiguration) *CSIStorageCapacityApplyConfiguration { b.NodeTopology = value return b } // WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageClassName field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithStorageClassName(value string) *CSIStorageCapacityApplyConfiguration { b.StorageClassName = &value return b } // WithCapacity sets the Capacity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Capacity field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithCapacity(value resource.Quantity) *CSIStorageCapacityApplyConfiguration { b.Capacity = &value return b } // WithMaximumVolumeSize sets the MaximumVolumeSize field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaximumVolumeSize field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithMaximumVolumeSize(value resource.Quantity) *CSIStorageCapacityApplyConfiguration { b.MaximumVolumeSize = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CSIStorageCapacityApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1alpha1/volumeattachment.go000066400000000000000000000314461472614177300315000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // VolumeAttachmentApplyConfiguration represents a declarative configuration of the VolumeAttachment type for use // with apply. type VolumeAttachmentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *VolumeAttachmentSpecApplyConfiguration `json:"spec,omitempty"` Status *VolumeAttachmentStatusApplyConfiguration `json:"status,omitempty"` } // VolumeAttachment constructs a declarative configuration of the VolumeAttachment type for use with // apply. func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { b := &VolumeAttachmentApplyConfiguration{} b.WithName(name) b.WithKind("VolumeAttachment") b.WithAPIVersion("storage.k8s.io/v1alpha1") return b } // ExtractVolumeAttachment extracts the applied configuration owned by fieldManager from // volumeAttachment. If no managedFields are found in volumeAttachment for fieldManager, a // VolumeAttachmentApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // volumeAttachment must be a unmodified VolumeAttachment API object that was retrieved from the Kubernetes API. // ExtractVolumeAttachment provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractVolumeAttachment(volumeAttachment *storagev1alpha1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { return extractVolumeAttachment(volumeAttachment, fieldManager, "") } // ExtractVolumeAttachmentStatus is the same as ExtractVolumeAttachment except // that it extracts the status subresource applied configuration. // Experimental! func ExtractVolumeAttachmentStatus(volumeAttachment *storagev1alpha1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { return extractVolumeAttachment(volumeAttachment, fieldManager, "status") } func extractVolumeAttachment(volumeAttachment *storagev1alpha1.VolumeAttachment, fieldManager string, subresource string) (*VolumeAttachmentApplyConfiguration, error) { b := &VolumeAttachmentApplyConfiguration{} err := managedfields.ExtractInto(volumeAttachment, internal.Parser().Type("io.k8s.api.storage.v1alpha1.VolumeAttachment"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(volumeAttachment.Name) b.WithKind("VolumeAttachment") b.WithAPIVersion("storage.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithKind(value string) *VolumeAttachmentApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithAPIVersion(value string) *VolumeAttachmentApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithName(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithGenerateName(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithNamespace(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithUID(value types.UID) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithResourceVersion(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithGeneration(value int64) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *VolumeAttachmentApplyConfiguration) WithLabels(entries map[string]string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *VolumeAttachmentApplyConfiguration) WithAnnotations(entries map[string]string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *VolumeAttachmentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *VolumeAttachmentApplyConfiguration) WithFinalizers(values ...string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *VolumeAttachmentApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithSpec(value *VolumeAttachmentSpecApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithStatus(value *VolumeAttachmentStatusApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *VolumeAttachmentApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1alpha1/volumeattachmentsource.go000066400000000000000000000045151472614177300327160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // VolumeAttachmentSourceApplyConfiguration represents a declarative configuration of the VolumeAttachmentSource type for use // with apply. type VolumeAttachmentSourceApplyConfiguration struct { PersistentVolumeName *string `json:"persistentVolumeName,omitempty"` InlineVolumeSpec *v1.PersistentVolumeSpecApplyConfiguration `json:"inlineVolumeSpec,omitempty"` } // VolumeAttachmentSourceApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSource type for use with // apply. func VolumeAttachmentSource() *VolumeAttachmentSourceApplyConfiguration { return &VolumeAttachmentSourceApplyConfiguration{} } // WithPersistentVolumeName sets the PersistentVolumeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeName field is set to the value of the last call. func (b *VolumeAttachmentSourceApplyConfiguration) WithPersistentVolumeName(value string) *VolumeAttachmentSourceApplyConfiguration { b.PersistentVolumeName = &value return b } // WithInlineVolumeSpec sets the InlineVolumeSpec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InlineVolumeSpec field is set to the value of the last call. func (b *VolumeAttachmentSourceApplyConfiguration) WithInlineVolumeSpec(value *v1.PersistentVolumeSpecApplyConfiguration) *VolumeAttachmentSourceApplyConfiguration { b.InlineVolumeSpec = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1alpha1/volumeattachmentspec.go000066400000000000000000000051241472614177300323450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // VolumeAttachmentSpecApplyConfiguration represents a declarative configuration of the VolumeAttachmentSpec type for use // with apply. type VolumeAttachmentSpecApplyConfiguration struct { Attacher *string `json:"attacher,omitempty"` Source *VolumeAttachmentSourceApplyConfiguration `json:"source,omitempty"` NodeName *string `json:"nodeName,omitempty"` } // VolumeAttachmentSpecApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSpec type for use with // apply. func VolumeAttachmentSpec() *VolumeAttachmentSpecApplyConfiguration { return &VolumeAttachmentSpecApplyConfiguration{} } // WithAttacher sets the Attacher field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Attacher field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithAttacher(value string) *VolumeAttachmentSpecApplyConfiguration { b.Attacher = &value return b } // WithSource sets the Source field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Source field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithSource(value *VolumeAttachmentSourceApplyConfiguration) *VolumeAttachmentSpecApplyConfiguration { b.Source = value return b } // WithNodeName sets the NodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeName field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithNodeName(value string) *VolumeAttachmentSpecApplyConfiguration { b.NodeName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1alpha1/volumeattachmentstatus.go000066400000000000000000000067471472614177300327520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // VolumeAttachmentStatusApplyConfiguration represents a declarative configuration of the VolumeAttachmentStatus type for use // with apply. type VolumeAttachmentStatusApplyConfiguration struct { Attached *bool `json:"attached,omitempty"` AttachmentMetadata map[string]string `json:"attachmentMetadata,omitempty"` AttachError *VolumeErrorApplyConfiguration `json:"attachError,omitempty"` DetachError *VolumeErrorApplyConfiguration `json:"detachError,omitempty"` } // VolumeAttachmentStatusApplyConfiguration constructs a declarative configuration of the VolumeAttachmentStatus type for use with // apply. func VolumeAttachmentStatus() *VolumeAttachmentStatusApplyConfiguration { return &VolumeAttachmentStatusApplyConfiguration{} } // WithAttached sets the Attached field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Attached field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttached(value bool) *VolumeAttachmentStatusApplyConfiguration { b.Attached = &value return b } // WithAttachmentMetadata puts the entries into the AttachmentMetadata field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the AttachmentMetadata field, // overwriting an existing map entries in AttachmentMetadata field with the same key. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttachmentMetadata(entries map[string]string) *VolumeAttachmentStatusApplyConfiguration { if b.AttachmentMetadata == nil && len(entries) > 0 { b.AttachmentMetadata = make(map[string]string, len(entries)) } for k, v := range entries { b.AttachmentMetadata[k] = v } return b } // WithAttachError sets the AttachError field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AttachError field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttachError(value *VolumeErrorApplyConfiguration) *VolumeAttachmentStatusApplyConfiguration { b.AttachError = value return b } // WithDetachError sets the DetachError field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DetachError field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithDetachError(value *VolumeErrorApplyConfiguration) *VolumeAttachmentStatusApplyConfiguration { b.DetachError = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1alpha1/volumeattributesclass.go000066400000000000000000000324671472614177300325700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // VolumeAttributesClassApplyConfiguration represents a declarative configuration of the VolumeAttributesClass type for use // with apply. type VolumeAttributesClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` DriverName *string `json:"driverName,omitempty"` Parameters map[string]string `json:"parameters,omitempty"` } // VolumeAttributesClass constructs a declarative configuration of the VolumeAttributesClass type for use with // apply. func VolumeAttributesClass(name string) *VolumeAttributesClassApplyConfiguration { b := &VolumeAttributesClassApplyConfiguration{} b.WithName(name) b.WithKind("VolumeAttributesClass") b.WithAPIVersion("storage.k8s.io/v1alpha1") return b } // ExtractVolumeAttributesClass extracts the applied configuration owned by fieldManager from // volumeAttributesClass. If no managedFields are found in volumeAttributesClass for fieldManager, a // VolumeAttributesClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // volumeAttributesClass must be a unmodified VolumeAttributesClass API object that was retrieved from the Kubernetes API. // ExtractVolumeAttributesClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractVolumeAttributesClass(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "") } // ExtractVolumeAttributesClassStatus is the same as ExtractVolumeAttributesClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractVolumeAttributesClassStatus(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "status") } func extractVolumeAttributesClass(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string, subresource string) (*VolumeAttributesClassApplyConfiguration, error) { b := &VolumeAttributesClassApplyConfiguration{} err := managedfields.ExtractInto(volumeAttributesClass, internal.Parser().Type("io.k8s.api.storage.v1alpha1.VolumeAttributesClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(volumeAttributesClass.Name) b.WithKind("VolumeAttributesClass") b.WithAPIVersion("storage.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithKind(value string) *VolumeAttributesClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithAPIVersion(value string) *VolumeAttributesClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithName(value string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithGenerateName(value string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithNamespace(value string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithUID(value types.UID) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithResourceVersion(value string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithGeneration(value int64) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *VolumeAttributesClassApplyConfiguration) WithLabels(entries map[string]string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *VolumeAttributesClassApplyConfiguration) WithAnnotations(entries map[string]string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *VolumeAttributesClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *VolumeAttributesClassApplyConfiguration) WithFinalizers(values ...string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *VolumeAttributesClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithDriverName sets the DriverName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DriverName field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithDriverName(value string) *VolumeAttributesClassApplyConfiguration { b.DriverName = &value return b } // WithParameters puts the entries into the Parameters field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Parameters field, // overwriting an existing map entries in Parameters field with the same key. func (b *VolumeAttributesClassApplyConfiguration) WithParameters(entries map[string]string) *VolumeAttributesClassApplyConfiguration { if b.Parameters == nil && len(entries) > 0 { b.Parameters = make(map[string]string, len(entries)) } for k, v := range entries { b.Parameters[k] = v } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *VolumeAttributesClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1alpha1/volumeerror.go000066400000000000000000000036531472614177300305000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { Time *v1.Time `json:"time,omitempty"` Message *string `json:"message,omitempty"` } // VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with // apply. func VolumeError() *VolumeErrorApplyConfiguration { return &VolumeErrorApplyConfiguration{} } // WithTime sets the Time field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Time field is set to the value of the last call. func (b *VolumeErrorApplyConfiguration) WithTime(value v1.Time) *VolumeErrorApplyConfiguration { b.Time = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *VolumeErrorApplyConfiguration) WithMessage(value string) *VolumeErrorApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/000077500000000000000000000000001472614177300254075ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/csidriver.go000066400000000000000000000273531472614177300277420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CSIDriverApplyConfiguration represents a declarative configuration of the CSIDriver type for use // with apply. type CSIDriverApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CSIDriverSpecApplyConfiguration `json:"spec,omitempty"` } // CSIDriver constructs a declarative configuration of the CSIDriver type for use with // apply. func CSIDriver(name string) *CSIDriverApplyConfiguration { b := &CSIDriverApplyConfiguration{} b.WithName(name) b.WithKind("CSIDriver") b.WithAPIVersion("storage.k8s.io/v1beta1") return b } // ExtractCSIDriver extracts the applied configuration owned by fieldManager from // cSIDriver. If no managedFields are found in cSIDriver for fieldManager, a // CSIDriverApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cSIDriver must be a unmodified CSIDriver API object that was retrieved from the Kubernetes API. // ExtractCSIDriver provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCSIDriver(cSIDriver *storagev1beta1.CSIDriver, fieldManager string) (*CSIDriverApplyConfiguration, error) { return extractCSIDriver(cSIDriver, fieldManager, "") } // ExtractCSIDriverStatus is the same as ExtractCSIDriver except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCSIDriverStatus(cSIDriver *storagev1beta1.CSIDriver, fieldManager string) (*CSIDriverApplyConfiguration, error) { return extractCSIDriver(cSIDriver, fieldManager, "status") } func extractCSIDriver(cSIDriver *storagev1beta1.CSIDriver, fieldManager string, subresource string) (*CSIDriverApplyConfiguration, error) { b := &CSIDriverApplyConfiguration{} err := managedfields.ExtractInto(cSIDriver, internal.Parser().Type("io.k8s.api.storage.v1beta1.CSIDriver"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cSIDriver.Name) b.WithKind("CSIDriver") b.WithAPIVersion("storage.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithKind(value string) *CSIDriverApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithAPIVersion(value string) *CSIDriverApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithName(value string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithGenerateName(value string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithNamespace(value string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithUID(value types.UID) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithResourceVersion(value string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithGeneration(value int64) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CSIDriverApplyConfiguration) WithLabels(entries map[string]string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CSIDriverApplyConfiguration) WithAnnotations(entries map[string]string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CSIDriverApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CSIDriverApplyConfiguration) WithFinalizers(values ...string) *CSIDriverApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CSIDriverApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *CSIDriverApplyConfiguration) WithSpec(value *CSIDriverSpecApplyConfiguration) *CSIDriverApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CSIDriverApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/csidriverspec.go000066400000000000000000000130571472614177300306110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" ) // CSIDriverSpecApplyConfiguration represents a declarative configuration of the CSIDriverSpec type for use // with apply. type CSIDriverSpecApplyConfiguration struct { AttachRequired *bool `json:"attachRequired,omitempty"` PodInfoOnMount *bool `json:"podInfoOnMount,omitempty"` VolumeLifecycleModes []v1beta1.VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty"` StorageCapacity *bool `json:"storageCapacity,omitempty"` FSGroupPolicy *v1beta1.FSGroupPolicy `json:"fsGroupPolicy,omitempty"` TokenRequests []TokenRequestApplyConfiguration `json:"tokenRequests,omitempty"` RequiresRepublish *bool `json:"requiresRepublish,omitempty"` SELinuxMount *bool `json:"seLinuxMount,omitempty"` } // CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with // apply. func CSIDriverSpec() *CSIDriverSpecApplyConfiguration { return &CSIDriverSpecApplyConfiguration{} } // WithAttachRequired sets the AttachRequired field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AttachRequired field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithAttachRequired(value bool) *CSIDriverSpecApplyConfiguration { b.AttachRequired = &value return b } // WithPodInfoOnMount sets the PodInfoOnMount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PodInfoOnMount field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithPodInfoOnMount(value bool) *CSIDriverSpecApplyConfiguration { b.PodInfoOnMount = &value return b } // WithVolumeLifecycleModes adds the given value to the VolumeLifecycleModes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeLifecycleModes field. func (b *CSIDriverSpecApplyConfiguration) WithVolumeLifecycleModes(values ...v1beta1.VolumeLifecycleMode) *CSIDriverSpecApplyConfiguration { for i := range values { b.VolumeLifecycleModes = append(b.VolumeLifecycleModes, values[i]) } return b } // WithStorageCapacity sets the StorageCapacity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageCapacity field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithStorageCapacity(value bool) *CSIDriverSpecApplyConfiguration { b.StorageCapacity = &value return b } // WithFSGroupPolicy sets the FSGroupPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSGroupPolicy field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithFSGroupPolicy(value v1beta1.FSGroupPolicy) *CSIDriverSpecApplyConfiguration { b.FSGroupPolicy = &value return b } // WithTokenRequests adds the given value to the TokenRequests field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TokenRequests field. func (b *CSIDriverSpecApplyConfiguration) WithTokenRequests(values ...*TokenRequestApplyConfiguration) *CSIDriverSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithTokenRequests") } b.TokenRequests = append(b.TokenRequests, *values[i]) } return b } // WithRequiresRepublish sets the RequiresRepublish field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RequiresRepublish field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithRequiresRepublish(value bool) *CSIDriverSpecApplyConfiguration { b.RequiresRepublish = &value return b } // WithSELinuxMount sets the SELinuxMount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SELinuxMount field is set to the value of the last call. func (b *CSIDriverSpecApplyConfiguration) WithSELinuxMount(value bool) *CSIDriverSpecApplyConfiguration { b.SELinuxMount = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/csinode.go000066400000000000000000000271251472614177300273710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CSINodeApplyConfiguration represents a declarative configuration of the CSINode type for use // with apply. type CSINodeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CSINodeSpecApplyConfiguration `json:"spec,omitempty"` } // CSINode constructs a declarative configuration of the CSINode type for use with // apply. func CSINode(name string) *CSINodeApplyConfiguration { b := &CSINodeApplyConfiguration{} b.WithName(name) b.WithKind("CSINode") b.WithAPIVersion("storage.k8s.io/v1beta1") return b } // ExtractCSINode extracts the applied configuration owned by fieldManager from // cSINode. If no managedFields are found in cSINode for fieldManager, a // CSINodeApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cSINode must be a unmodified CSINode API object that was retrieved from the Kubernetes API. // ExtractCSINode provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCSINode(cSINode *storagev1beta1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { return extractCSINode(cSINode, fieldManager, "") } // ExtractCSINodeStatus is the same as ExtractCSINode except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCSINodeStatus(cSINode *storagev1beta1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { return extractCSINode(cSINode, fieldManager, "status") } func extractCSINode(cSINode *storagev1beta1.CSINode, fieldManager string, subresource string) (*CSINodeApplyConfiguration, error) { b := &CSINodeApplyConfiguration{} err := managedfields.ExtractInto(cSINode, internal.Parser().Type("io.k8s.api.storage.v1beta1.CSINode"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cSINode.Name) b.WithKind("CSINode") b.WithAPIVersion("storage.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithKind(value string) *CSINodeApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithAPIVersion(value string) *CSINodeApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithName(value string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithGenerateName(value string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithNamespace(value string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithUID(value types.UID) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithResourceVersion(value string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithGeneration(value int64) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CSINodeApplyConfiguration) WithLabels(entries map[string]string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CSINodeApplyConfiguration) WithAnnotations(entries map[string]string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CSINodeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CSINodeApplyConfiguration) WithFinalizers(values ...string) *CSINodeApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CSINodeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *CSINodeApplyConfiguration) WithSpec(value *CSINodeSpecApplyConfiguration) *CSINodeApplyConfiguration { b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CSINodeApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/csinodedriver.go000066400000000000000000000060731472614177300306040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // CSINodeDriverApplyConfiguration represents a declarative configuration of the CSINodeDriver type for use // with apply. type CSINodeDriverApplyConfiguration struct { Name *string `json:"name,omitempty"` NodeID *string `json:"nodeID,omitempty"` TopologyKeys []string `json:"topologyKeys,omitempty"` Allocatable *VolumeNodeResourcesApplyConfiguration `json:"allocatable,omitempty"` } // CSINodeDriverApplyConfiguration constructs a declarative configuration of the CSINodeDriver type for use with // apply. func CSINodeDriver() *CSINodeDriverApplyConfiguration { return &CSINodeDriverApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSINodeDriverApplyConfiguration) WithName(value string) *CSINodeDriverApplyConfiguration { b.Name = &value return b } // WithNodeID sets the NodeID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeID field is set to the value of the last call. func (b *CSINodeDriverApplyConfiguration) WithNodeID(value string) *CSINodeDriverApplyConfiguration { b.NodeID = &value return b } // WithTopologyKeys adds the given value to the TopologyKeys field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the TopologyKeys field. func (b *CSINodeDriverApplyConfiguration) WithTopologyKeys(values ...string) *CSINodeDriverApplyConfiguration { for i := range values { b.TopologyKeys = append(b.TopologyKeys, values[i]) } return b } // WithAllocatable sets the Allocatable field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Allocatable field is set to the value of the last call. func (b *CSINodeDriverApplyConfiguration) WithAllocatable(value *VolumeNodeResourcesApplyConfiguration) *CSINodeDriverApplyConfiguration { b.Allocatable = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/csinodespec.go000066400000000000000000000032001472614177300302300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // CSINodeSpecApplyConfiguration represents a declarative configuration of the CSINodeSpec type for use // with apply. type CSINodeSpecApplyConfiguration struct { Drivers []CSINodeDriverApplyConfiguration `json:"drivers,omitempty"` } // CSINodeSpecApplyConfiguration constructs a declarative configuration of the CSINodeSpec type for use with // apply. func CSINodeSpec() *CSINodeSpecApplyConfiguration { return &CSINodeSpecApplyConfiguration{} } // WithDrivers adds the given value to the Drivers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Drivers field. func (b *CSINodeSpecApplyConfiguration) WithDrivers(values ...*CSINodeDriverApplyConfiguration) *CSINodeSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithDrivers") } b.Drivers = append(b.Drivers, *values[i]) } return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/csistoragecapacity.go000066400000000000000000000342721472614177300316270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // CSIStorageCapacityApplyConfiguration represents a declarative configuration of the CSIStorageCapacity type for use // with apply. type CSIStorageCapacityApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` NodeTopology *v1.LabelSelectorApplyConfiguration `json:"nodeTopology,omitempty"` StorageClassName *string `json:"storageClassName,omitempty"` Capacity *resource.Quantity `json:"capacity,omitempty"` MaximumVolumeSize *resource.Quantity `json:"maximumVolumeSize,omitempty"` } // CSIStorageCapacity constructs a declarative configuration of the CSIStorageCapacity type for use with // apply. func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfiguration { b := &CSIStorageCapacityApplyConfiguration{} b.WithName(name) b.WithNamespace(namespace) b.WithKind("CSIStorageCapacity") b.WithAPIVersion("storage.k8s.io/v1beta1") return b } // ExtractCSIStorageCapacity extracts the applied configuration owned by fieldManager from // cSIStorageCapacity. If no managedFields are found in cSIStorageCapacity for fieldManager, a // CSIStorageCapacityApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // cSIStorageCapacity must be a unmodified CSIStorageCapacity API object that was retrieved from the Kubernetes API. // ExtractCSIStorageCapacity provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractCSIStorageCapacity(cSIStorageCapacity *v1beta1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "") } // ExtractCSIStorageCapacityStatus is the same as ExtractCSIStorageCapacity except // that it extracts the status subresource applied configuration. // Experimental! func ExtractCSIStorageCapacityStatus(cSIStorageCapacity *v1beta1.CSIStorageCapacity, fieldManager string) (*CSIStorageCapacityApplyConfiguration, error) { return extractCSIStorageCapacity(cSIStorageCapacity, fieldManager, "status") } func extractCSIStorageCapacity(cSIStorageCapacity *v1beta1.CSIStorageCapacity, fieldManager string, subresource string) (*CSIStorageCapacityApplyConfiguration, error) { b := &CSIStorageCapacityApplyConfiguration{} err := managedfields.ExtractInto(cSIStorageCapacity, internal.Parser().Type("io.k8s.api.storage.v1beta1.CSIStorageCapacity"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(cSIStorageCapacity.Name) b.WithNamespace(cSIStorageCapacity.Namespace) b.WithKind("CSIStorageCapacity") b.WithAPIVersion("storage.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithKind(value string) *CSIStorageCapacityApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithAPIVersion(value string) *CSIStorageCapacityApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithName(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithGenerateName(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithNamespace(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithUID(value types.UID) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithResourceVersion(value string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithGeneration(value int64) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *CSIStorageCapacityApplyConfiguration) WithLabels(entries map[string]string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *CSIStorageCapacityApplyConfiguration) WithAnnotations(entries map[string]string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *CSIStorageCapacityApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *CSIStorageCapacityApplyConfiguration) WithFinalizers(values ...string) *CSIStorageCapacityApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *CSIStorageCapacityApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithNodeTopology sets the NodeTopology field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeTopology field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithNodeTopology(value *v1.LabelSelectorApplyConfiguration) *CSIStorageCapacityApplyConfiguration { b.NodeTopology = value return b } // WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the StorageClassName field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithStorageClassName(value string) *CSIStorageCapacityApplyConfiguration { b.StorageClassName = &value return b } // WithCapacity sets the Capacity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Capacity field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithCapacity(value resource.Quantity) *CSIStorageCapacityApplyConfiguration { b.Capacity = &value return b } // WithMaximumVolumeSize sets the MaximumVolumeSize field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the MaximumVolumeSize field is set to the value of the last call. func (b *CSIStorageCapacityApplyConfiguration) WithMaximumVolumeSize(value resource.Quantity) *CSIStorageCapacityApplyConfiguration { b.MaximumVolumeSize = &value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *CSIStorageCapacityApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/storageclass.go000066400000000000000000000400541472614177300304330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( corev1 "k8s.io/api/core/v1" v1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StorageClassApplyConfiguration represents a declarative configuration of the StorageClass type for use // with apply. type StorageClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Provisioner *string `json:"provisioner,omitempty"` Parameters map[string]string `json:"parameters,omitempty"` ReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty"` MountOptions []string `json:"mountOptions,omitempty"` AllowVolumeExpansion *bool `json:"allowVolumeExpansion,omitempty"` VolumeBindingMode *v1beta1.VolumeBindingMode `json:"volumeBindingMode,omitempty"` AllowedTopologies []applyconfigurationscorev1.TopologySelectorTermApplyConfiguration `json:"allowedTopologies,omitempty"` } // StorageClass constructs a declarative configuration of the StorageClass type for use with // apply. func StorageClass(name string) *StorageClassApplyConfiguration { b := &StorageClassApplyConfiguration{} b.WithName(name) b.WithKind("StorageClass") b.WithAPIVersion("storage.k8s.io/v1beta1") return b } // ExtractStorageClass extracts the applied configuration owned by fieldManager from // storageClass. If no managedFields are found in storageClass for fieldManager, a // StorageClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // storageClass must be a unmodified StorageClass API object that was retrieved from the Kubernetes API. // ExtractStorageClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractStorageClass(storageClass *v1beta1.StorageClass, fieldManager string) (*StorageClassApplyConfiguration, error) { return extractStorageClass(storageClass, fieldManager, "") } // ExtractStorageClassStatus is the same as ExtractStorageClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractStorageClassStatus(storageClass *v1beta1.StorageClass, fieldManager string) (*StorageClassApplyConfiguration, error) { return extractStorageClass(storageClass, fieldManager, "status") } func extractStorageClass(storageClass *v1beta1.StorageClass, fieldManager string, subresource string) (*StorageClassApplyConfiguration, error) { b := &StorageClassApplyConfiguration{} err := managedfields.ExtractInto(storageClass, internal.Parser().Type("io.k8s.api.storage.v1beta1.StorageClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(storageClass.Name) b.WithKind("StorageClass") b.WithAPIVersion("storage.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithKind(value string) *StorageClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithAPIVersion(value string) *StorageClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithName(value string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithGenerateName(value string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithNamespace(value string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithUID(value types.UID) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithResourceVersion(value string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithGeneration(value int64) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *StorageClassApplyConfiguration) WithLabels(entries map[string]string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *StorageClassApplyConfiguration) WithAnnotations(entries map[string]string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *StorageClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *StorageClassApplyConfiguration) WithFinalizers(values ...string) *StorageClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *StorageClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithProvisioner sets the Provisioner field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Provisioner field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithProvisioner(value string) *StorageClassApplyConfiguration { b.Provisioner = &value return b } // WithParameters puts the entries into the Parameters field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Parameters field, // overwriting an existing map entries in Parameters field with the same key. func (b *StorageClassApplyConfiguration) WithParameters(entries map[string]string) *StorageClassApplyConfiguration { if b.Parameters == nil && len(entries) > 0 { b.Parameters = make(map[string]string, len(entries)) } for k, v := range entries { b.Parameters[k] = v } return b } // WithReclaimPolicy sets the ReclaimPolicy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ReclaimPolicy field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithReclaimPolicy(value corev1.PersistentVolumeReclaimPolicy) *StorageClassApplyConfiguration { b.ReclaimPolicy = &value return b } // WithMountOptions adds the given value to the MountOptions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MountOptions field. func (b *StorageClassApplyConfiguration) WithMountOptions(values ...string) *StorageClassApplyConfiguration { for i := range values { b.MountOptions = append(b.MountOptions, values[i]) } return b } // WithAllowVolumeExpansion sets the AllowVolumeExpansion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllowVolumeExpansion field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithAllowVolumeExpansion(value bool) *StorageClassApplyConfiguration { b.AllowVolumeExpansion = &value return b } // WithVolumeBindingMode sets the VolumeBindingMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VolumeBindingMode field is set to the value of the last call. func (b *StorageClassApplyConfiguration) WithVolumeBindingMode(value v1beta1.VolumeBindingMode) *StorageClassApplyConfiguration { b.VolumeBindingMode = &value return b } // WithAllowedTopologies adds the given value to the AllowedTopologies field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the AllowedTopologies field. func (b *StorageClassApplyConfiguration) WithAllowedTopologies(values ...*applyconfigurationscorev1.TopologySelectorTermApplyConfiguration) *StorageClassApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithAllowedTopologies") } b.AllowedTopologies = append(b.AllowedTopologies, *values[i]) } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *StorageClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/tokenrequest.go000066400000000000000000000037431472614177300304760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // TokenRequestApplyConfiguration represents a declarative configuration of the TokenRequest type for use // with apply. type TokenRequestApplyConfiguration struct { Audience *string `json:"audience,omitempty"` ExpirationSeconds *int64 `json:"expirationSeconds,omitempty"` } // TokenRequestApplyConfiguration constructs a declarative configuration of the TokenRequest type for use with // apply. func TokenRequest() *TokenRequestApplyConfiguration { return &TokenRequestApplyConfiguration{} } // WithAudience sets the Audience field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Audience field is set to the value of the last call. func (b *TokenRequestApplyConfiguration) WithAudience(value string) *TokenRequestApplyConfiguration { b.Audience = &value return b } // WithExpirationSeconds sets the ExpirationSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ExpirationSeconds field is set to the value of the last call. func (b *TokenRequestApplyConfiguration) WithExpirationSeconds(value int64) *TokenRequestApplyConfiguration { b.ExpirationSeconds = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/volumeattachment.go000066400000000000000000000314351472614177300313240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // VolumeAttachmentApplyConfiguration represents a declarative configuration of the VolumeAttachment type for use // with apply. type VolumeAttachmentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *VolumeAttachmentSpecApplyConfiguration `json:"spec,omitempty"` Status *VolumeAttachmentStatusApplyConfiguration `json:"status,omitempty"` } // VolumeAttachment constructs a declarative configuration of the VolumeAttachment type for use with // apply. func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { b := &VolumeAttachmentApplyConfiguration{} b.WithName(name) b.WithKind("VolumeAttachment") b.WithAPIVersion("storage.k8s.io/v1beta1") return b } // ExtractVolumeAttachment extracts the applied configuration owned by fieldManager from // volumeAttachment. If no managedFields are found in volumeAttachment for fieldManager, a // VolumeAttachmentApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // volumeAttachment must be a unmodified VolumeAttachment API object that was retrieved from the Kubernetes API. // ExtractVolumeAttachment provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractVolumeAttachment(volumeAttachment *storagev1beta1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { return extractVolumeAttachment(volumeAttachment, fieldManager, "") } // ExtractVolumeAttachmentStatus is the same as ExtractVolumeAttachment except // that it extracts the status subresource applied configuration. // Experimental! func ExtractVolumeAttachmentStatus(volumeAttachment *storagev1beta1.VolumeAttachment, fieldManager string) (*VolumeAttachmentApplyConfiguration, error) { return extractVolumeAttachment(volumeAttachment, fieldManager, "status") } func extractVolumeAttachment(volumeAttachment *storagev1beta1.VolumeAttachment, fieldManager string, subresource string) (*VolumeAttachmentApplyConfiguration, error) { b := &VolumeAttachmentApplyConfiguration{} err := managedfields.ExtractInto(volumeAttachment, internal.Parser().Type("io.k8s.api.storage.v1beta1.VolumeAttachment"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(volumeAttachment.Name) b.WithKind("VolumeAttachment") b.WithAPIVersion("storage.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithKind(value string) *VolumeAttachmentApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithAPIVersion(value string) *VolumeAttachmentApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithName(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithGenerateName(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithNamespace(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithUID(value types.UID) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithResourceVersion(value string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithGeneration(value int64) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *VolumeAttachmentApplyConfiguration) WithLabels(entries map[string]string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *VolumeAttachmentApplyConfiguration) WithAnnotations(entries map[string]string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *VolumeAttachmentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *VolumeAttachmentApplyConfiguration) WithFinalizers(values ...string) *VolumeAttachmentApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *VolumeAttachmentApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithSpec(value *VolumeAttachmentSpecApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *VolumeAttachmentApplyConfiguration) WithStatus(value *VolumeAttachmentStatusApplyConfiguration) *VolumeAttachmentApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *VolumeAttachmentApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/volumeattachmentsource.go000066400000000000000000000045141472614177300325430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // VolumeAttachmentSourceApplyConfiguration represents a declarative configuration of the VolumeAttachmentSource type for use // with apply. type VolumeAttachmentSourceApplyConfiguration struct { PersistentVolumeName *string `json:"persistentVolumeName,omitempty"` InlineVolumeSpec *v1.PersistentVolumeSpecApplyConfiguration `json:"inlineVolumeSpec,omitempty"` } // VolumeAttachmentSourceApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSource type for use with // apply. func VolumeAttachmentSource() *VolumeAttachmentSourceApplyConfiguration { return &VolumeAttachmentSourceApplyConfiguration{} } // WithPersistentVolumeName sets the PersistentVolumeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the PersistentVolumeName field is set to the value of the last call. func (b *VolumeAttachmentSourceApplyConfiguration) WithPersistentVolumeName(value string) *VolumeAttachmentSourceApplyConfiguration { b.PersistentVolumeName = &value return b } // WithInlineVolumeSpec sets the InlineVolumeSpec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InlineVolumeSpec field is set to the value of the last call. func (b *VolumeAttachmentSourceApplyConfiguration) WithInlineVolumeSpec(value *v1.PersistentVolumeSpecApplyConfiguration) *VolumeAttachmentSourceApplyConfiguration { b.InlineVolumeSpec = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/volumeattachmentspec.go000066400000000000000000000051231472614177300321720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // VolumeAttachmentSpecApplyConfiguration represents a declarative configuration of the VolumeAttachmentSpec type for use // with apply. type VolumeAttachmentSpecApplyConfiguration struct { Attacher *string `json:"attacher,omitempty"` Source *VolumeAttachmentSourceApplyConfiguration `json:"source,omitempty"` NodeName *string `json:"nodeName,omitempty"` } // VolumeAttachmentSpecApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSpec type for use with // apply. func VolumeAttachmentSpec() *VolumeAttachmentSpecApplyConfiguration { return &VolumeAttachmentSpecApplyConfiguration{} } // WithAttacher sets the Attacher field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Attacher field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithAttacher(value string) *VolumeAttachmentSpecApplyConfiguration { b.Attacher = &value return b } // WithSource sets the Source field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Source field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithSource(value *VolumeAttachmentSourceApplyConfiguration) *VolumeAttachmentSpecApplyConfiguration { b.Source = value return b } // WithNodeName sets the NodeName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeName field is set to the value of the last call. func (b *VolumeAttachmentSpecApplyConfiguration) WithNodeName(value string) *VolumeAttachmentSpecApplyConfiguration { b.NodeName = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/volumeattachmentstatus.go000066400000000000000000000067461472614177300325770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // VolumeAttachmentStatusApplyConfiguration represents a declarative configuration of the VolumeAttachmentStatus type for use // with apply. type VolumeAttachmentStatusApplyConfiguration struct { Attached *bool `json:"attached,omitempty"` AttachmentMetadata map[string]string `json:"attachmentMetadata,omitempty"` AttachError *VolumeErrorApplyConfiguration `json:"attachError,omitempty"` DetachError *VolumeErrorApplyConfiguration `json:"detachError,omitempty"` } // VolumeAttachmentStatusApplyConfiguration constructs a declarative configuration of the VolumeAttachmentStatus type for use with // apply. func VolumeAttachmentStatus() *VolumeAttachmentStatusApplyConfiguration { return &VolumeAttachmentStatusApplyConfiguration{} } // WithAttached sets the Attached field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Attached field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttached(value bool) *VolumeAttachmentStatusApplyConfiguration { b.Attached = &value return b } // WithAttachmentMetadata puts the entries into the AttachmentMetadata field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the AttachmentMetadata field, // overwriting an existing map entries in AttachmentMetadata field with the same key. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttachmentMetadata(entries map[string]string) *VolumeAttachmentStatusApplyConfiguration { if b.AttachmentMetadata == nil && len(entries) > 0 { b.AttachmentMetadata = make(map[string]string, len(entries)) } for k, v := range entries { b.AttachmentMetadata[k] = v } return b } // WithAttachError sets the AttachError field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AttachError field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithAttachError(value *VolumeErrorApplyConfiguration) *VolumeAttachmentStatusApplyConfiguration { b.AttachError = value return b } // WithDetachError sets the DetachError field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DetachError field is set to the value of the last call. func (b *VolumeAttachmentStatusApplyConfiguration) WithDetachError(value *VolumeErrorApplyConfiguration) *VolumeAttachmentStatusApplyConfiguration { b.DetachError = value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/volumeattributesclass.go000066400000000000000000000324561472614177300324140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // VolumeAttributesClassApplyConfiguration represents a declarative configuration of the VolumeAttributesClass type for use // with apply. type VolumeAttributesClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` DriverName *string `json:"driverName,omitempty"` Parameters map[string]string `json:"parameters,omitempty"` } // VolumeAttributesClass constructs a declarative configuration of the VolumeAttributesClass type for use with // apply. func VolumeAttributesClass(name string) *VolumeAttributesClassApplyConfiguration { b := &VolumeAttributesClassApplyConfiguration{} b.WithName(name) b.WithKind("VolumeAttributesClass") b.WithAPIVersion("storage.k8s.io/v1beta1") return b } // ExtractVolumeAttributesClass extracts the applied configuration owned by fieldManager from // volumeAttributesClass. If no managedFields are found in volumeAttributesClass for fieldManager, a // VolumeAttributesClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // volumeAttributesClass must be a unmodified VolumeAttributesClass API object that was retrieved from the Kubernetes API. // ExtractVolumeAttributesClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractVolumeAttributesClass(volumeAttributesClass *v1beta1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "") } // ExtractVolumeAttributesClassStatus is the same as ExtractVolumeAttributesClass except // that it extracts the status subresource applied configuration. // Experimental! func ExtractVolumeAttributesClassStatus(volumeAttributesClass *v1beta1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "status") } func extractVolumeAttributesClass(volumeAttributesClass *v1beta1.VolumeAttributesClass, fieldManager string, subresource string) (*VolumeAttributesClassApplyConfiguration, error) { b := &VolumeAttributesClassApplyConfiguration{} err := managedfields.ExtractInto(volumeAttributesClass, internal.Parser().Type("io.k8s.api.storage.v1beta1.VolumeAttributesClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(volumeAttributesClass.Name) b.WithKind("VolumeAttributesClass") b.WithAPIVersion("storage.k8s.io/v1beta1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithKind(value string) *VolumeAttributesClassApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithAPIVersion(value string) *VolumeAttributesClassApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithName(value string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithGenerateName(value string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithNamespace(value string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithUID(value types.UID) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithResourceVersion(value string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithGeneration(value int64) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *VolumeAttributesClassApplyConfiguration) WithLabels(entries map[string]string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *VolumeAttributesClassApplyConfiguration) WithAnnotations(entries map[string]string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *VolumeAttributesClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *VolumeAttributesClassApplyConfiguration) WithFinalizers(values ...string) *VolumeAttributesClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *VolumeAttributesClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithDriverName sets the DriverName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DriverName field is set to the value of the last call. func (b *VolumeAttributesClassApplyConfiguration) WithDriverName(value string) *VolumeAttributesClassApplyConfiguration { b.DriverName = &value return b } // WithParameters puts the entries into the Parameters field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Parameters field, // overwriting an existing map entries in Parameters field with the same key. func (b *VolumeAttributesClassApplyConfiguration) WithParameters(entries map[string]string) *VolumeAttributesClassApplyConfiguration { if b.Parameters == nil && len(entries) > 0 { b.Parameters = make(map[string]string, len(entries)) } for k, v := range entries { b.Parameters[k] = v } return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *VolumeAttributesClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/volumeerror.go000066400000000000000000000036521472614177300303250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { Time *v1.Time `json:"time,omitempty"` Message *string `json:"message,omitempty"` } // VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with // apply. func VolumeError() *VolumeErrorApplyConfiguration { return &VolumeErrorApplyConfiguration{} } // WithTime sets the Time field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Time field is set to the value of the last call. func (b *VolumeErrorApplyConfiguration) WithTime(value v1.Time) *VolumeErrorApplyConfiguration { b.Time = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *VolumeErrorApplyConfiguration) WithMessage(value string) *VolumeErrorApplyConfiguration { b.Message = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storage/v1beta1/volumenoderesources.go000066400000000000000000000030001472614177300320370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1beta1 // VolumeNodeResourcesApplyConfiguration represents a declarative configuration of the VolumeNodeResources type for use // with apply. type VolumeNodeResourcesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` } // VolumeNodeResourcesApplyConfiguration constructs a declarative configuration of the VolumeNodeResources type for use with // apply. func VolumeNodeResources() *VolumeNodeResourcesApplyConfiguration { return &VolumeNodeResourcesApplyConfiguration{} } // WithCount sets the Count field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Count field is set to the value of the last call. func (b *VolumeNodeResourcesApplyConfiguration) WithCount(value int32) *VolumeNodeResourcesApplyConfiguration { b.Count = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storagemigration/000077500000000000000000000000001472614177300260565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storagemigration/v1alpha1/000077500000000000000000000000001472614177300274735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go000066400000000000000000000047001472614177300343350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // GroupVersionResourceApplyConfiguration represents a declarative configuration of the GroupVersionResource type for use // with apply. type GroupVersionResourceApplyConfiguration struct { Group *string `json:"group,omitempty"` Version *string `json:"version,omitempty"` Resource *string `json:"resource,omitempty"` } // GroupVersionResourceApplyConfiguration constructs a declarative configuration of the GroupVersionResource type for use with // apply. func GroupVersionResource() *GroupVersionResourceApplyConfiguration { return &GroupVersionResourceApplyConfiguration{} } // WithGroup sets the Group field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *GroupVersionResourceApplyConfiguration) WithGroup(value string) *GroupVersionResourceApplyConfiguration { b.Group = &value return b } // WithVersion sets the Version field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Version field is set to the value of the last call. func (b *GroupVersionResourceApplyConfiguration) WithVersion(value string) *GroupVersionResourceApplyConfiguration { b.Version = &value return b } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *GroupVersionResourceApplyConfiguration) WithResource(value string) *GroupVersionResourceApplyConfiguration { b.Resource = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go000066400000000000000000000072421472614177300337270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/api/core/v1" v1alpha1 "k8s.io/api/storagemigration/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // MigrationConditionApplyConfiguration represents a declarative configuration of the MigrationCondition type for use // with apply. type MigrationConditionApplyConfiguration struct { Type *v1alpha1.MigrationConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } // MigrationConditionApplyConfiguration constructs a declarative configuration of the MigrationCondition type for use with // apply. func MigrationCondition() *MigrationConditionApplyConfiguration { return &MigrationConditionApplyConfiguration{} } // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. func (b *MigrationConditionApplyConfiguration) WithType(value v1alpha1.MigrationConditionType) *MigrationConditionApplyConfiguration { b.Type = &value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *MigrationConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *MigrationConditionApplyConfiguration { b.Status = &value return b } // WithLastUpdateTime sets the LastUpdateTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastUpdateTime field is set to the value of the last call. func (b *MigrationConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *MigrationConditionApplyConfiguration { b.LastUpdateTime = &value return b } // WithReason sets the Reason field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Reason field is set to the value of the last call. func (b *MigrationConditionApplyConfiguration) WithReason(value string) *MigrationConditionApplyConfiguration { b.Reason = &value return b } // WithMessage sets the Message field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Message field is set to the value of the last call. func (b *MigrationConditionApplyConfiguration) WithMessage(value string) *MigrationConditionApplyConfiguration { b.Message = &value return b } storageversionmigration.go000066400000000000000000000326271472614177300347410ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storagemigration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 import ( storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" internal "k8s.io/client-go/applyconfigurations/internal" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // StorageVersionMigrationApplyConfiguration represents a declarative configuration of the StorageVersionMigration type for use // with apply. type StorageVersionMigrationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *StorageVersionMigrationSpecApplyConfiguration `json:"spec,omitempty"` Status *StorageVersionMigrationStatusApplyConfiguration `json:"status,omitempty"` } // StorageVersionMigration constructs a declarative configuration of the StorageVersionMigration type for use with // apply. func StorageVersionMigration(name string) *StorageVersionMigrationApplyConfiguration { b := &StorageVersionMigrationApplyConfiguration{} b.WithName(name) b.WithKind("StorageVersionMigration") b.WithAPIVersion("storagemigration.k8s.io/v1alpha1") return b } // ExtractStorageVersionMigration extracts the applied configuration owned by fieldManager from // storageVersionMigration. If no managedFields are found in storageVersionMigration for fieldManager, a // StorageVersionMigrationApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. // storageVersionMigration must be a unmodified StorageVersionMigration API object that was retrieved from the Kubernetes API. // ExtractStorageVersionMigration provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! func ExtractStorageVersionMigration(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string) (*StorageVersionMigrationApplyConfiguration, error) { return extractStorageVersionMigration(storageVersionMigration, fieldManager, "") } // ExtractStorageVersionMigrationStatus is the same as ExtractStorageVersionMigration except // that it extracts the status subresource applied configuration. // Experimental! func ExtractStorageVersionMigrationStatus(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string) (*StorageVersionMigrationApplyConfiguration, error) { return extractStorageVersionMigration(storageVersionMigration, fieldManager, "status") } func extractStorageVersionMigration(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string, subresource string) (*StorageVersionMigrationApplyConfiguration, error) { b := &StorageVersionMigrationApplyConfiguration{} err := managedfields.ExtractInto(storageVersionMigration, internal.Parser().Type("io.k8s.api.storagemigration.v1alpha1.StorageVersionMigration"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(storageVersionMigration.Name) b.WithKind("StorageVersionMigration") b.WithAPIVersion("storagemigration.k8s.io/v1alpha1") return b, nil } // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithKind(value string) *StorageVersionMigrationApplyConfiguration { b.Kind = &value return b } // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithAPIVersion(value string) *StorageVersionMigrationApplyConfiguration { b.APIVersion = &value return b } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithName(value string) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b } // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithGenerateName(value string) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithNamespace(value string) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b } // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithUID(value types.UID) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithResourceVersion(value string) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b } // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithGeneration(value int64) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b } // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b } // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b } // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b } // WithLabels puts the entries into the Labels field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. func (b *StorageVersionMigrationApplyConfiguration) WithLabels(entries map[string]string) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) } for k, v := range entries { b.Labels[k] = v } return b } // WithAnnotations puts the entries into the Annotations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. func (b *StorageVersionMigrationApplyConfiguration) WithAnnotations(entries map[string]string) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { b.Annotations[k] = v } return b } // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. func (b *StorageVersionMigrationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { panic("nil value passed to WithOwnerReferences") } b.OwnerReferences = append(b.OwnerReferences, *values[i]) } return b } // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. func (b *StorageVersionMigrationApplyConfiguration) WithFinalizers(values ...string) *StorageVersionMigrationApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) } return b } func (b *StorageVersionMigrationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithSpec(value *StorageVersionMigrationSpecApplyConfiguration) *StorageVersionMigrationApplyConfiguration { b.Spec = value return b } // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. func (b *StorageVersionMigrationApplyConfiguration) WithStatus(value *StorageVersionMigrationStatusApplyConfiguration) *StorageVersionMigrationApplyConfiguration { b.Status = value return b } // GetName retrieves the value of the Name field in the declarative configuration. func (b *StorageVersionMigrationApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } storageversionmigrationspec.go000066400000000000000000000043311472614177300356030ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storagemigration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // StorageVersionMigrationSpecApplyConfiguration represents a declarative configuration of the StorageVersionMigrationSpec type for use // with apply. type StorageVersionMigrationSpecApplyConfiguration struct { Resource *GroupVersionResourceApplyConfiguration `json:"resource,omitempty"` ContinueToken *string `json:"continueToken,omitempty"` } // StorageVersionMigrationSpecApplyConfiguration constructs a declarative configuration of the StorageVersionMigrationSpec type for use with // apply. func StorageVersionMigrationSpec() *StorageVersionMigrationSpecApplyConfiguration { return &StorageVersionMigrationSpecApplyConfiguration{} } // WithResource sets the Resource field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *StorageVersionMigrationSpecApplyConfiguration) WithResource(value *GroupVersionResourceApplyConfiguration) *StorageVersionMigrationSpecApplyConfiguration { b.Resource = value return b } // WithContinueToken sets the ContinueToken field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ContinueToken field is set to the value of the last call. func (b *StorageVersionMigrationSpecApplyConfiguration) WithContinueToken(value string) *StorageVersionMigrationSpecApplyConfiguration { b.ContinueToken = &value return b } storageversionmigrationstatus.go000066400000000000000000000046341472614177300362020ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/applyconfigurations/storagemigration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package v1alpha1 // StorageVersionMigrationStatusApplyConfiguration represents a declarative configuration of the StorageVersionMigrationStatus type for use // with apply. type StorageVersionMigrationStatusApplyConfiguration struct { Conditions []MigrationConditionApplyConfiguration `json:"conditions,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` } // StorageVersionMigrationStatusApplyConfiguration constructs a declarative configuration of the StorageVersionMigrationStatus type for use with // apply. func StorageVersionMigrationStatus() *StorageVersionMigrationStatusApplyConfiguration { return &StorageVersionMigrationStatusApplyConfiguration{} } // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. func (b *StorageVersionMigrationStatusApplyConfiguration) WithConditions(values ...*MigrationConditionApplyConfiguration) *StorageVersionMigrationStatusApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithConditions") } b.Conditions = append(b.Conditions, *values[i]) } return b } // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *StorageVersionMigrationStatusApplyConfiguration) WithResourceVersion(value string) *StorageVersionMigrationStatusApplyConfiguration { b.ResourceVersion = &value return b } kubernetes-client-go-a2dfcab/applyconfigurations/utils.go000066400000000000000000003462011472614177300241750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. package applyconfigurations import ( v1 "k8s.io/api/admissionregistration/v1" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1beta1 "k8s.io/api/admissionregistration/v1beta1" apiserverinternalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" v1beta2 "k8s.io/api/apps/v1beta2" autoscalingv1 "k8s.io/api/autoscaling/v1" v2 "k8s.io/api/autoscaling/v2" v2beta1 "k8s.io/api/autoscaling/v2beta1" v2beta2 "k8s.io/api/autoscaling/v2beta2" batchv1 "k8s.io/api/batch/v1" batchv1beta1 "k8s.io/api/batch/v1beta1" certificatesv1 "k8s.io/api/certificates/v1" certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" flowcontrolv1 "k8s.io/api/flowcontrol/v1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" v1beta3 "k8s.io/api/flowcontrol/v1beta3" imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1" networkingv1 "k8s.io/api/networking/v1" networkingv1alpha1 "k8s.io/api/networking/v1alpha1" networkingv1beta1 "k8s.io/api/networking/v1beta1" nodev1 "k8s.io/api/node/v1" nodev1alpha1 "k8s.io/api/node/v1alpha1" nodev1beta1 "k8s.io/api/node/v1beta1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" v1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" applyconfigurationsapiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1" applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsappsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" autoscalingv2 "k8s.io/client-go/applyconfigurations/autoscaling/v2" autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1" autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2" applyconfigurationsbatchv1 "k8s.io/client-go/applyconfigurations/batch/v1" applyconfigurationsbatchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1" applyconfigurationscertificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" applyconfigurationscertificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1" applyconfigurationscertificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" applyconfigurationscoordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" applyconfigurationscoordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1" applyconfigurationscoordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" applyconfigurationsdiscoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1" applyconfigurationsdiscoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1" applyconfigurationseventsv1 "k8s.io/client-go/applyconfigurations/events/v1" applyconfigurationseventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1" applyconfigurationsextensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" applyconfigurationsflowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" applyconfigurationsflowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" applyconfigurationsflowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" applyconfigurationsimagepolicyv1alpha1 "k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1" internal "k8s.io/client-go/applyconfigurations/internal" applyconfigurationsmetav1 "k8s.io/client-go/applyconfigurations/meta/v1" applyconfigurationsnetworkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" applyconfigurationsnetworkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" applyconfigurationsnetworkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" applyconfigurationsnodev1 "k8s.io/client-go/applyconfigurations/node/v1" applyconfigurationsnodev1alpha1 "k8s.io/client-go/applyconfigurations/node/v1alpha1" applyconfigurationsnodev1beta1 "k8s.io/client-go/applyconfigurations/node/v1beta1" applyconfigurationspolicyv1 "k8s.io/client-go/applyconfigurations/policy/v1" applyconfigurationspolicyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" applyconfigurationsrbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" applyconfigurationsrbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" applyconfigurationsrbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" applyconfigurationsschedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" applyconfigurationsschedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" applyconfigurationsstoragev1 "k8s.io/client-go/applyconfigurations/storage/v1" applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" applyconfigurationsstoragev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" applyconfigurationsstoragemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" testing "k8s.io/client-go/testing" ) // ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no // apply configuration type exists for the given GroupVersionKind. func ForKind(kind schema.GroupVersionKind) interface{} { switch kind { // Group=admissionregistration.k8s.io, Version=v1 case v1.SchemeGroupVersion.WithKind("AuditAnnotation"): return &admissionregistrationv1.AuditAnnotationApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ExpressionWarning"): return &admissionregistrationv1.ExpressionWarningApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MatchCondition"): return &admissionregistrationv1.MatchConditionApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MatchResources"): return &admissionregistrationv1.MatchResourcesApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MutatingWebhook"): return &admissionregistrationv1.MutatingWebhookApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"): return &admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"): return &admissionregistrationv1.NamedRuleWithOperationsApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ParamKind"): return &admissionregistrationv1.ParamKindApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ParamRef"): return &admissionregistrationv1.ParamRefApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("Rule"): return &admissionregistrationv1.RuleApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("RuleWithOperations"): return &admissionregistrationv1.RuleWithOperationsApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ServiceReference"): return &admissionregistrationv1.ServiceReferenceApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("TypeChecking"): return &admissionregistrationv1.TypeCheckingApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"): return &admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"): return &admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBindingSpec"): return &admissionregistrationv1.ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicySpec"): return &admissionregistrationv1.ValidatingAdmissionPolicySpecApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyStatus"): return &admissionregistrationv1.ValidatingAdmissionPolicyStatusApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingWebhook"): return &admissionregistrationv1.ValidatingWebhookApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"): return &admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("Validation"): return &admissionregistrationv1.ValidationApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("Variable"): return &admissionregistrationv1.VariableApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("WebhookClientConfig"): return &admissionregistrationv1.WebhookClientConfigApplyConfiguration{} // Group=admissionregistration.k8s.io, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithKind("AuditAnnotation"): return &admissionregistrationv1alpha1.AuditAnnotationApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ExpressionWarning"): return &admissionregistrationv1alpha1.ExpressionWarningApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("MatchCondition"): return &admissionregistrationv1alpha1.MatchConditionApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("MatchResources"): return &admissionregistrationv1alpha1.MatchResourcesApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"): return &admissionregistrationv1alpha1.NamedRuleWithOperationsApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ParamKind"): return &admissionregistrationv1alpha1.ParamKindApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ParamRef"): return &admissionregistrationv1alpha1.ParamRefApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("TypeChecking"): return &admissionregistrationv1alpha1.TypeCheckingApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"): return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"): return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBindingSpec"): return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicySpec"): return &admissionregistrationv1alpha1.ValidatingAdmissionPolicySpecApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyStatus"): return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("Validation"): return &admissionregistrationv1alpha1.ValidationApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("Variable"): return &admissionregistrationv1alpha1.VariableApplyConfiguration{} // Group=admissionregistration.k8s.io, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithKind("AuditAnnotation"): return &admissionregistrationv1beta1.AuditAnnotationApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ExpressionWarning"): return &admissionregistrationv1beta1.ExpressionWarningApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("MatchCondition"): return &admissionregistrationv1beta1.MatchConditionApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("MatchResources"): return &admissionregistrationv1beta1.MatchResourcesApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("MutatingWebhook"): return &admissionregistrationv1beta1.MutatingWebhookApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"): return &admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"): return &admissionregistrationv1beta1.NamedRuleWithOperationsApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ParamKind"): return &admissionregistrationv1beta1.ParamKindApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ParamRef"): return &admissionregistrationv1beta1.ParamRefApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ServiceReference"): return &admissionregistrationv1beta1.ServiceReferenceApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("TypeChecking"): return &admissionregistrationv1beta1.TypeCheckingApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"): return &admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"): return &admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBindingSpec"): return &admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicySpec"): return &admissionregistrationv1beta1.ValidatingAdmissionPolicySpecApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyStatus"): return &admissionregistrationv1beta1.ValidatingAdmissionPolicyStatusApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ValidatingWebhook"): return &admissionregistrationv1beta1.ValidatingWebhookApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"): return &admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("Validation"): return &admissionregistrationv1beta1.ValidationApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("Variable"): return &admissionregistrationv1beta1.VariableApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("WebhookClientConfig"): return &admissionregistrationv1beta1.WebhookClientConfigApplyConfiguration{} // Group=apps, Version=v1 case appsv1.SchemeGroupVersion.WithKind("ControllerRevision"): return &applyconfigurationsappsv1.ControllerRevisionApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DaemonSet"): return &applyconfigurationsappsv1.DaemonSetApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DaemonSetCondition"): return &applyconfigurationsappsv1.DaemonSetConditionApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DaemonSetSpec"): return &applyconfigurationsappsv1.DaemonSetSpecApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DaemonSetStatus"): return &applyconfigurationsappsv1.DaemonSetStatusApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DaemonSetUpdateStrategy"): return &applyconfigurationsappsv1.DaemonSetUpdateStrategyApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("Deployment"): return &applyconfigurationsappsv1.DeploymentApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DeploymentCondition"): return &applyconfigurationsappsv1.DeploymentConditionApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DeploymentSpec"): return &applyconfigurationsappsv1.DeploymentSpecApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DeploymentStatus"): return &applyconfigurationsappsv1.DeploymentStatusApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("DeploymentStrategy"): return &applyconfigurationsappsv1.DeploymentStrategyApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("ReplicaSet"): return &applyconfigurationsappsv1.ReplicaSetApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("ReplicaSetCondition"): return &applyconfigurationsappsv1.ReplicaSetConditionApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("ReplicaSetSpec"): return &applyconfigurationsappsv1.ReplicaSetSpecApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("ReplicaSetStatus"): return &applyconfigurationsappsv1.ReplicaSetStatusApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("RollingUpdateDaemonSet"): return &applyconfigurationsappsv1.RollingUpdateDaemonSetApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("RollingUpdateDeployment"): return &applyconfigurationsappsv1.RollingUpdateDeploymentApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("RollingUpdateStatefulSetStrategy"): return &applyconfigurationsappsv1.RollingUpdateStatefulSetStrategyApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("StatefulSet"): return &applyconfigurationsappsv1.StatefulSetApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("StatefulSetCondition"): return &applyconfigurationsappsv1.StatefulSetConditionApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("StatefulSetOrdinals"): return &applyconfigurationsappsv1.StatefulSetOrdinalsApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("StatefulSetPersistentVolumeClaimRetentionPolicy"): return &applyconfigurationsappsv1.StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("StatefulSetSpec"): return &applyconfigurationsappsv1.StatefulSetSpecApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("StatefulSetStatus"): return &applyconfigurationsappsv1.StatefulSetStatusApplyConfiguration{} case appsv1.SchemeGroupVersion.WithKind("StatefulSetUpdateStrategy"): return &applyconfigurationsappsv1.StatefulSetUpdateStrategyApplyConfiguration{} // Group=apps, Version=v1beta1 case appsv1beta1.SchemeGroupVersion.WithKind("ControllerRevision"): return &applyconfigurationsappsv1beta1.ControllerRevisionApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("Deployment"): return &applyconfigurationsappsv1beta1.DeploymentApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("DeploymentCondition"): return &applyconfigurationsappsv1beta1.DeploymentConditionApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("DeploymentSpec"): return &applyconfigurationsappsv1beta1.DeploymentSpecApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("DeploymentStatus"): return &applyconfigurationsappsv1beta1.DeploymentStatusApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("DeploymentStrategy"): return &applyconfigurationsappsv1beta1.DeploymentStrategyApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("RollbackConfig"): return &applyconfigurationsappsv1beta1.RollbackConfigApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("RollingUpdateDeployment"): return &applyconfigurationsappsv1beta1.RollingUpdateDeploymentApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("RollingUpdateStatefulSetStrategy"): return &applyconfigurationsappsv1beta1.RollingUpdateStatefulSetStrategyApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSet"): return &applyconfigurationsappsv1beta1.StatefulSetApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetCondition"): return &applyconfigurationsappsv1beta1.StatefulSetConditionApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetOrdinals"): return &applyconfigurationsappsv1beta1.StatefulSetOrdinalsApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetPersistentVolumeClaimRetentionPolicy"): return &applyconfigurationsappsv1beta1.StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetSpec"): return &applyconfigurationsappsv1beta1.StatefulSetSpecApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetStatus"): return &applyconfigurationsappsv1beta1.StatefulSetStatusApplyConfiguration{} case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetUpdateStrategy"): return &applyconfigurationsappsv1beta1.StatefulSetUpdateStrategyApplyConfiguration{} // Group=apps, Version=v1beta2 case v1beta2.SchemeGroupVersion.WithKind("ControllerRevision"): return &appsv1beta2.ControllerRevisionApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DaemonSet"): return &appsv1beta2.DaemonSetApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DaemonSetCondition"): return &appsv1beta2.DaemonSetConditionApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DaemonSetSpec"): return &appsv1beta2.DaemonSetSpecApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DaemonSetStatus"): return &appsv1beta2.DaemonSetStatusApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DaemonSetUpdateStrategy"): return &appsv1beta2.DaemonSetUpdateStrategyApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("Deployment"): return &appsv1beta2.DeploymentApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DeploymentCondition"): return &appsv1beta2.DeploymentConditionApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DeploymentSpec"): return &appsv1beta2.DeploymentSpecApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DeploymentStatus"): return &appsv1beta2.DeploymentStatusApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("DeploymentStrategy"): return &appsv1beta2.DeploymentStrategyApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("ReplicaSet"): return &appsv1beta2.ReplicaSetApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("ReplicaSetCondition"): return &appsv1beta2.ReplicaSetConditionApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("ReplicaSetSpec"): return &appsv1beta2.ReplicaSetSpecApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("ReplicaSetStatus"): return &appsv1beta2.ReplicaSetStatusApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("RollingUpdateDaemonSet"): return &appsv1beta2.RollingUpdateDaemonSetApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("RollingUpdateDeployment"): return &appsv1beta2.RollingUpdateDeploymentApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("RollingUpdateStatefulSetStrategy"): return &appsv1beta2.RollingUpdateStatefulSetStrategyApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("Scale"): return &appsv1beta2.ScaleApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("StatefulSet"): return &appsv1beta2.StatefulSetApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("StatefulSetCondition"): return &appsv1beta2.StatefulSetConditionApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("StatefulSetOrdinals"): return &appsv1beta2.StatefulSetOrdinalsApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("StatefulSetPersistentVolumeClaimRetentionPolicy"): return &appsv1beta2.StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("StatefulSetSpec"): return &appsv1beta2.StatefulSetSpecApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("StatefulSetStatus"): return &appsv1beta2.StatefulSetStatusApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("StatefulSetUpdateStrategy"): return &appsv1beta2.StatefulSetUpdateStrategyApplyConfiguration{} // Group=autoscaling, Version=v1 case autoscalingv1.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): return &applyconfigurationsautoscalingv1.CrossVersionObjectReferenceApplyConfiguration{} case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerApplyConfiguration{} case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerSpecApplyConfiguration{} case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerStatusApplyConfiguration{} case autoscalingv1.SchemeGroupVersion.WithKind("Scale"): return &applyconfigurationsautoscalingv1.ScaleApplyConfiguration{} case autoscalingv1.SchemeGroupVersion.WithKind("ScaleSpec"): return &applyconfigurationsautoscalingv1.ScaleSpecApplyConfiguration{} case autoscalingv1.SchemeGroupVersion.WithKind("ScaleStatus"): return &applyconfigurationsautoscalingv1.ScaleStatusApplyConfiguration{} // Group=autoscaling, Version=v2 case v2.SchemeGroupVersion.WithKind("ContainerResourceMetricSource"): return &autoscalingv2.ContainerResourceMetricSourceApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("ContainerResourceMetricStatus"): return &autoscalingv2.ContainerResourceMetricStatusApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): return &autoscalingv2.CrossVersionObjectReferenceApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("ExternalMetricSource"): return &autoscalingv2.ExternalMetricSourceApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("ExternalMetricStatus"): return &autoscalingv2.ExternalMetricStatusApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): return &autoscalingv2.HorizontalPodAutoscalerApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerBehavior"): return &autoscalingv2.HorizontalPodAutoscalerBehaviorApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerCondition"): return &autoscalingv2.HorizontalPodAutoscalerConditionApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): return &autoscalingv2.HorizontalPodAutoscalerSpecApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): return &autoscalingv2.HorizontalPodAutoscalerStatusApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("HPAScalingPolicy"): return &autoscalingv2.HPAScalingPolicyApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("HPAScalingRules"): return &autoscalingv2.HPAScalingRulesApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("MetricIdentifier"): return &autoscalingv2.MetricIdentifierApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("MetricSpec"): return &autoscalingv2.MetricSpecApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("MetricStatus"): return &autoscalingv2.MetricStatusApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("MetricTarget"): return &autoscalingv2.MetricTargetApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("MetricValueStatus"): return &autoscalingv2.MetricValueStatusApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("ObjectMetricSource"): return &autoscalingv2.ObjectMetricSourceApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("ObjectMetricStatus"): return &autoscalingv2.ObjectMetricStatusApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("PodsMetricSource"): return &autoscalingv2.PodsMetricSourceApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("PodsMetricStatus"): return &autoscalingv2.PodsMetricStatusApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("ResourceMetricSource"): return &autoscalingv2.ResourceMetricSourceApplyConfiguration{} case v2.SchemeGroupVersion.WithKind("ResourceMetricStatus"): return &autoscalingv2.ResourceMetricStatusApplyConfiguration{} // Group=autoscaling, Version=v2beta1 case v2beta1.SchemeGroupVersion.WithKind("ContainerResourceMetricSource"): return &autoscalingv2beta1.ContainerResourceMetricSourceApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("ContainerResourceMetricStatus"): return &autoscalingv2beta1.ContainerResourceMetricStatusApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): return &autoscalingv2beta1.CrossVersionObjectReferenceApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("ExternalMetricSource"): return &autoscalingv2beta1.ExternalMetricSourceApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("ExternalMetricStatus"): return &autoscalingv2beta1.ExternalMetricStatusApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): return &autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerCondition"): return &autoscalingv2beta1.HorizontalPodAutoscalerConditionApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): return &autoscalingv2beta1.HorizontalPodAutoscalerSpecApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): return &autoscalingv2beta1.HorizontalPodAutoscalerStatusApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("MetricSpec"): return &autoscalingv2beta1.MetricSpecApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("MetricStatus"): return &autoscalingv2beta1.MetricStatusApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("ObjectMetricSource"): return &autoscalingv2beta1.ObjectMetricSourceApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("ObjectMetricStatus"): return &autoscalingv2beta1.ObjectMetricStatusApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("PodsMetricSource"): return &autoscalingv2beta1.PodsMetricSourceApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("PodsMetricStatus"): return &autoscalingv2beta1.PodsMetricStatusApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("ResourceMetricSource"): return &autoscalingv2beta1.ResourceMetricSourceApplyConfiguration{} case v2beta1.SchemeGroupVersion.WithKind("ResourceMetricStatus"): return &autoscalingv2beta1.ResourceMetricStatusApplyConfiguration{} // Group=autoscaling, Version=v2beta2 case v2beta2.SchemeGroupVersion.WithKind("ContainerResourceMetricSource"): return &autoscalingv2beta2.ContainerResourceMetricSourceApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("ContainerResourceMetricStatus"): return &autoscalingv2beta2.ContainerResourceMetricStatusApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): return &autoscalingv2beta2.CrossVersionObjectReferenceApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("ExternalMetricSource"): return &autoscalingv2beta2.ExternalMetricSourceApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("ExternalMetricStatus"): return &autoscalingv2beta2.ExternalMetricStatusApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): return &autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerBehavior"): return &autoscalingv2beta2.HorizontalPodAutoscalerBehaviorApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerCondition"): return &autoscalingv2beta2.HorizontalPodAutoscalerConditionApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): return &autoscalingv2beta2.HorizontalPodAutoscalerSpecApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): return &autoscalingv2beta2.HorizontalPodAutoscalerStatusApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("HPAScalingPolicy"): return &autoscalingv2beta2.HPAScalingPolicyApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("HPAScalingRules"): return &autoscalingv2beta2.HPAScalingRulesApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("MetricIdentifier"): return &autoscalingv2beta2.MetricIdentifierApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("MetricSpec"): return &autoscalingv2beta2.MetricSpecApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("MetricStatus"): return &autoscalingv2beta2.MetricStatusApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("MetricTarget"): return &autoscalingv2beta2.MetricTargetApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("MetricValueStatus"): return &autoscalingv2beta2.MetricValueStatusApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("ObjectMetricSource"): return &autoscalingv2beta2.ObjectMetricSourceApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("ObjectMetricStatus"): return &autoscalingv2beta2.ObjectMetricStatusApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("PodsMetricSource"): return &autoscalingv2beta2.PodsMetricSourceApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("PodsMetricStatus"): return &autoscalingv2beta2.PodsMetricStatusApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("ResourceMetricSource"): return &autoscalingv2beta2.ResourceMetricSourceApplyConfiguration{} case v2beta2.SchemeGroupVersion.WithKind("ResourceMetricStatus"): return &autoscalingv2beta2.ResourceMetricStatusApplyConfiguration{} // Group=batch, Version=v1 case batchv1.SchemeGroupVersion.WithKind("CronJob"): return &applyconfigurationsbatchv1.CronJobApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("CronJobSpec"): return &applyconfigurationsbatchv1.CronJobSpecApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("CronJobStatus"): return &applyconfigurationsbatchv1.CronJobStatusApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("Job"): return &applyconfigurationsbatchv1.JobApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("JobCondition"): return &applyconfigurationsbatchv1.JobConditionApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("JobSpec"): return &applyconfigurationsbatchv1.JobSpecApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("JobStatus"): return &applyconfigurationsbatchv1.JobStatusApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("JobTemplateSpec"): return &applyconfigurationsbatchv1.JobTemplateSpecApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicy"): return &applyconfigurationsbatchv1.PodFailurePolicyApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicyOnExitCodesRequirement"): return &applyconfigurationsbatchv1.PodFailurePolicyOnExitCodesRequirementApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicyOnPodConditionsPattern"): return &applyconfigurationsbatchv1.PodFailurePolicyOnPodConditionsPatternApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicyRule"): return &applyconfigurationsbatchv1.PodFailurePolicyRuleApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("SuccessPolicy"): return &applyconfigurationsbatchv1.SuccessPolicyApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("SuccessPolicyRule"): return &applyconfigurationsbatchv1.SuccessPolicyRuleApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("UncountedTerminatedPods"): return &applyconfigurationsbatchv1.UncountedTerminatedPodsApplyConfiguration{} // Group=batch, Version=v1beta1 case batchv1beta1.SchemeGroupVersion.WithKind("CronJob"): return &applyconfigurationsbatchv1beta1.CronJobApplyConfiguration{} case batchv1beta1.SchemeGroupVersion.WithKind("CronJobSpec"): return &applyconfigurationsbatchv1beta1.CronJobSpecApplyConfiguration{} case batchv1beta1.SchemeGroupVersion.WithKind("CronJobStatus"): return &applyconfigurationsbatchv1beta1.CronJobStatusApplyConfiguration{} case batchv1beta1.SchemeGroupVersion.WithKind("JobTemplateSpec"): return &applyconfigurationsbatchv1beta1.JobTemplateSpecApplyConfiguration{} // Group=certificates.k8s.io, Version=v1 case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequest"): return &applyconfigurationscertificatesv1.CertificateSigningRequestApplyConfiguration{} case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequestCondition"): return &applyconfigurationscertificatesv1.CertificateSigningRequestConditionApplyConfiguration{} case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequestSpec"): return &applyconfigurationscertificatesv1.CertificateSigningRequestSpecApplyConfiguration{} case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequestStatus"): return &applyconfigurationscertificatesv1.CertificateSigningRequestStatusApplyConfiguration{} // Group=certificates.k8s.io, Version=v1alpha1 case certificatesv1alpha1.SchemeGroupVersion.WithKind("ClusterTrustBundle"): return &applyconfigurationscertificatesv1alpha1.ClusterTrustBundleApplyConfiguration{} case certificatesv1alpha1.SchemeGroupVersion.WithKind("ClusterTrustBundleSpec"): return &applyconfigurationscertificatesv1alpha1.ClusterTrustBundleSpecApplyConfiguration{} // Group=certificates.k8s.io, Version=v1beta1 case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequest"): return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestApplyConfiguration{} case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestCondition"): return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestConditionApplyConfiguration{} case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestSpec"): return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestSpecApplyConfiguration{} case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestStatus"): return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestStatusApplyConfiguration{} // Group=coordination.k8s.io, Version=v1 case coordinationv1.SchemeGroupVersion.WithKind("Lease"): return &applyconfigurationscoordinationv1.LeaseApplyConfiguration{} case coordinationv1.SchemeGroupVersion.WithKind("LeaseSpec"): return &applyconfigurationscoordinationv1.LeaseSpecApplyConfiguration{} // Group=coordination.k8s.io, Version=v1alpha1 case coordinationv1alpha1.SchemeGroupVersion.WithKind("LeaseCandidate"): return &applyconfigurationscoordinationv1alpha1.LeaseCandidateApplyConfiguration{} case coordinationv1alpha1.SchemeGroupVersion.WithKind("LeaseCandidateSpec"): return &applyconfigurationscoordinationv1alpha1.LeaseCandidateSpecApplyConfiguration{} // Group=coordination.k8s.io, Version=v1beta1 case coordinationv1beta1.SchemeGroupVersion.WithKind("Lease"): return &applyconfigurationscoordinationv1beta1.LeaseApplyConfiguration{} case coordinationv1beta1.SchemeGroupVersion.WithKind("LeaseSpec"): return &applyconfigurationscoordinationv1beta1.LeaseSpecApplyConfiguration{} // Group=core, Version=v1 case corev1.SchemeGroupVersion.WithKind("Affinity"): return &applyconfigurationscorev1.AffinityApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("AppArmorProfile"): return &applyconfigurationscorev1.AppArmorProfileApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("AttachedVolume"): return &applyconfigurationscorev1.AttachedVolumeApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("AWSElasticBlockStoreVolumeSource"): return &applyconfigurationscorev1.AWSElasticBlockStoreVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("AzureDiskVolumeSource"): return &applyconfigurationscorev1.AzureDiskVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("AzureFilePersistentVolumeSource"): return &applyconfigurationscorev1.AzureFilePersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("AzureFileVolumeSource"): return &applyconfigurationscorev1.AzureFileVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Capabilities"): return &applyconfigurationscorev1.CapabilitiesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CephFSPersistentVolumeSource"): return &applyconfigurationscorev1.CephFSPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CephFSVolumeSource"): return &applyconfigurationscorev1.CephFSVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CinderPersistentVolumeSource"): return &applyconfigurationscorev1.CinderPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CinderVolumeSource"): return &applyconfigurationscorev1.CinderVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ClientIPConfig"): return &applyconfigurationscorev1.ClientIPConfigApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ClusterTrustBundleProjection"): return &applyconfigurationscorev1.ClusterTrustBundleProjectionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ComponentCondition"): return &applyconfigurationscorev1.ComponentConditionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ComponentStatus"): return &applyconfigurationscorev1.ComponentStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ConfigMap"): return &applyconfigurationscorev1.ConfigMapApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ConfigMapEnvSource"): return &applyconfigurationscorev1.ConfigMapEnvSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ConfigMapKeySelector"): return &applyconfigurationscorev1.ConfigMapKeySelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ConfigMapNodeConfigSource"): return &applyconfigurationscorev1.ConfigMapNodeConfigSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ConfigMapProjection"): return &applyconfigurationscorev1.ConfigMapProjectionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ConfigMapVolumeSource"): return &applyconfigurationscorev1.ConfigMapVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Container"): return &applyconfigurationscorev1.ContainerApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerImage"): return &applyconfigurationscorev1.ContainerImageApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerPort"): return &applyconfigurationscorev1.ContainerPortApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerResizePolicy"): return &applyconfigurationscorev1.ContainerResizePolicyApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerState"): return &applyconfigurationscorev1.ContainerStateApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerStateRunning"): return &applyconfigurationscorev1.ContainerStateRunningApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerStateTerminated"): return &applyconfigurationscorev1.ContainerStateTerminatedApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerStateWaiting"): return &applyconfigurationscorev1.ContainerStateWaitingApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerStatus"): return &applyconfigurationscorev1.ContainerStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerUser"): return &applyconfigurationscorev1.ContainerUserApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CSIPersistentVolumeSource"): return &applyconfigurationscorev1.CSIPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CSIVolumeSource"): return &applyconfigurationscorev1.CSIVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("DaemonEndpoint"): return &applyconfigurationscorev1.DaemonEndpointApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("DownwardAPIProjection"): return &applyconfigurationscorev1.DownwardAPIProjectionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("DownwardAPIVolumeFile"): return &applyconfigurationscorev1.DownwardAPIVolumeFileApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("DownwardAPIVolumeSource"): return &applyconfigurationscorev1.DownwardAPIVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EmptyDirVolumeSource"): return &applyconfigurationscorev1.EmptyDirVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EndpointAddress"): return &applyconfigurationscorev1.EndpointAddressApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EndpointPort"): return &applyconfigurationscorev1.EndpointPortApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Endpoints"): return &applyconfigurationscorev1.EndpointsApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EndpointSubset"): return &applyconfigurationscorev1.EndpointSubsetApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EnvFromSource"): return &applyconfigurationscorev1.EnvFromSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EnvVar"): return &applyconfigurationscorev1.EnvVarApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EnvVarSource"): return &applyconfigurationscorev1.EnvVarSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EphemeralContainer"): return &applyconfigurationscorev1.EphemeralContainerApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EphemeralContainerCommon"): return &applyconfigurationscorev1.EphemeralContainerCommonApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EphemeralVolumeSource"): return &applyconfigurationscorev1.EphemeralVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Event"): return &applyconfigurationscorev1.EventApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EventSeries"): return &applyconfigurationscorev1.EventSeriesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EventSource"): return &applyconfigurationscorev1.EventSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ExecAction"): return &applyconfigurationscorev1.ExecActionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("FCVolumeSource"): return &applyconfigurationscorev1.FCVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("FlexPersistentVolumeSource"): return &applyconfigurationscorev1.FlexPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("FlexVolumeSource"): return &applyconfigurationscorev1.FlexVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("FlockerVolumeSource"): return &applyconfigurationscorev1.FlockerVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("GCEPersistentDiskVolumeSource"): return &applyconfigurationscorev1.GCEPersistentDiskVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("GitRepoVolumeSource"): return &applyconfigurationscorev1.GitRepoVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("GlusterfsPersistentVolumeSource"): return &applyconfigurationscorev1.GlusterfsPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("GlusterfsVolumeSource"): return &applyconfigurationscorev1.GlusterfsVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("GRPCAction"): return &applyconfigurationscorev1.GRPCActionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("HostAlias"): return &applyconfigurationscorev1.HostAliasApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("HostIP"): return &applyconfigurationscorev1.HostIPApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("HostPathVolumeSource"): return &applyconfigurationscorev1.HostPathVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("HTTPGetAction"): return &applyconfigurationscorev1.HTTPGetActionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("HTTPHeader"): return &applyconfigurationscorev1.HTTPHeaderApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ImageVolumeSource"): return &applyconfigurationscorev1.ImageVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ISCSIPersistentVolumeSource"): return &applyconfigurationscorev1.ISCSIPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ISCSIVolumeSource"): return &applyconfigurationscorev1.ISCSIVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("KeyToPath"): return &applyconfigurationscorev1.KeyToPathApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Lifecycle"): return &applyconfigurationscorev1.LifecycleApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LifecycleHandler"): return &applyconfigurationscorev1.LifecycleHandlerApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LimitRange"): return &applyconfigurationscorev1.LimitRangeApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LimitRangeItem"): return &applyconfigurationscorev1.LimitRangeItemApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LimitRangeSpec"): return &applyconfigurationscorev1.LimitRangeSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LinuxContainerUser"): return &applyconfigurationscorev1.LinuxContainerUserApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LoadBalancerIngress"): return &applyconfigurationscorev1.LoadBalancerIngressApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LoadBalancerStatus"): return &applyconfigurationscorev1.LoadBalancerStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LocalObjectReference"): return &applyconfigurationscorev1.LocalObjectReferenceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LocalVolumeSource"): return &applyconfigurationscorev1.LocalVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ModifyVolumeStatus"): return &applyconfigurationscorev1.ModifyVolumeStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Namespace"): return &applyconfigurationscorev1.NamespaceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NamespaceCondition"): return &applyconfigurationscorev1.NamespaceConditionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NamespaceSpec"): return &applyconfigurationscorev1.NamespaceSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NamespaceStatus"): return &applyconfigurationscorev1.NamespaceStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NFSVolumeSource"): return &applyconfigurationscorev1.NFSVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Node"): return &applyconfigurationscorev1.NodeApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeAddress"): return &applyconfigurationscorev1.NodeAddressApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeAffinity"): return &applyconfigurationscorev1.NodeAffinityApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeCondition"): return &applyconfigurationscorev1.NodeConditionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeConfigSource"): return &applyconfigurationscorev1.NodeConfigSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeConfigStatus"): return &applyconfigurationscorev1.NodeConfigStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeDaemonEndpoints"): return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeFeatures"): return &applyconfigurationscorev1.NodeFeaturesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandler"): return &applyconfigurationscorev1.NodeRuntimeHandlerApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandlerFeatures"): return &applyconfigurationscorev1.NodeRuntimeHandlerFeaturesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelector"): return &applyconfigurationscorev1.NodeSelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelectorRequirement"): return &applyconfigurationscorev1.NodeSelectorRequirementApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSelectorTerm"): return &applyconfigurationscorev1.NodeSelectorTermApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSpec"): return &applyconfigurationscorev1.NodeSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeStatus"): return &applyconfigurationscorev1.NodeStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSystemInfo"): return &applyconfigurationscorev1.NodeSystemInfoApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ObjectFieldSelector"): return &applyconfigurationscorev1.ObjectFieldSelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ObjectReference"): return &applyconfigurationscorev1.ObjectReferenceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolume"): return &applyconfigurationscorev1.PersistentVolumeApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaim"): return &applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimCondition"): return &applyconfigurationscorev1.PersistentVolumeClaimConditionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimSpec"): return &applyconfigurationscorev1.PersistentVolumeClaimSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimStatus"): return &applyconfigurationscorev1.PersistentVolumeClaimStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimTemplate"): return &applyconfigurationscorev1.PersistentVolumeClaimTemplateApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimVolumeSource"): return &applyconfigurationscorev1.PersistentVolumeClaimVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeSource"): return &applyconfigurationscorev1.PersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeSpec"): return &applyconfigurationscorev1.PersistentVolumeSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PersistentVolumeStatus"): return &applyconfigurationscorev1.PersistentVolumeStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PhotonPersistentDiskVolumeSource"): return &applyconfigurationscorev1.PhotonPersistentDiskVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Pod"): return &applyconfigurationscorev1.PodApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodAffinity"): return &applyconfigurationscorev1.PodAffinityApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodAffinityTerm"): return &applyconfigurationscorev1.PodAffinityTermApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodAntiAffinity"): return &applyconfigurationscorev1.PodAntiAffinityApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodCondition"): return &applyconfigurationscorev1.PodConditionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodDNSConfig"): return &applyconfigurationscorev1.PodDNSConfigApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodDNSConfigOption"): return &applyconfigurationscorev1.PodDNSConfigOptionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodIP"): return &applyconfigurationscorev1.PodIPApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodOS"): return &applyconfigurationscorev1.PodOSApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodReadinessGate"): return &applyconfigurationscorev1.PodReadinessGateApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodResourceClaim"): return &applyconfigurationscorev1.PodResourceClaimApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodResourceClaimStatus"): return &applyconfigurationscorev1.PodResourceClaimStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodSchedulingGate"): return &applyconfigurationscorev1.PodSchedulingGateApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodSecurityContext"): return &applyconfigurationscorev1.PodSecurityContextApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodSpec"): return &applyconfigurationscorev1.PodSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodStatus"): return &applyconfigurationscorev1.PodStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodTemplate"): return &applyconfigurationscorev1.PodTemplateApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodTemplateSpec"): return &applyconfigurationscorev1.PodTemplateSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PortStatus"): return &applyconfigurationscorev1.PortStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PortworxVolumeSource"): return &applyconfigurationscorev1.PortworxVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PreferredSchedulingTerm"): return &applyconfigurationscorev1.PreferredSchedulingTermApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Probe"): return &applyconfigurationscorev1.ProbeApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ProbeHandler"): return &applyconfigurationscorev1.ProbeHandlerApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ProjectedVolumeSource"): return &applyconfigurationscorev1.ProjectedVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("QuobyteVolumeSource"): return &applyconfigurationscorev1.QuobyteVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("RBDPersistentVolumeSource"): return &applyconfigurationscorev1.RBDPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("RBDVolumeSource"): return &applyconfigurationscorev1.RBDVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ReplicationController"): return &applyconfigurationscorev1.ReplicationControllerApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ReplicationControllerCondition"): return &applyconfigurationscorev1.ReplicationControllerConditionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ReplicationControllerSpec"): return &applyconfigurationscorev1.ReplicationControllerSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ReplicationControllerStatus"): return &applyconfigurationscorev1.ReplicationControllerStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceClaim"): return &applyconfigurationscorev1.ResourceClaimApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceFieldSelector"): return &applyconfigurationscorev1.ResourceFieldSelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceHealth"): return &applyconfigurationscorev1.ResourceHealthApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceQuota"): return &applyconfigurationscorev1.ResourceQuotaApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceQuotaSpec"): return &applyconfigurationscorev1.ResourceQuotaSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceQuotaStatus"): return &applyconfigurationscorev1.ResourceQuotaStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceRequirements"): return &applyconfigurationscorev1.ResourceRequirementsApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceStatus"): return &applyconfigurationscorev1.ResourceStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ScaleIOPersistentVolumeSource"): return &applyconfigurationscorev1.ScaleIOPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ScaleIOVolumeSource"): return &applyconfigurationscorev1.ScaleIOVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ScopedResourceSelectorRequirement"): return &applyconfigurationscorev1.ScopedResourceSelectorRequirementApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ScopeSelector"): return &applyconfigurationscorev1.ScopeSelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SeccompProfile"): return &applyconfigurationscorev1.SeccompProfileApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Secret"): return &applyconfigurationscorev1.SecretApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SecretEnvSource"): return &applyconfigurationscorev1.SecretEnvSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SecretKeySelector"): return &applyconfigurationscorev1.SecretKeySelectorApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SecretProjection"): return &applyconfigurationscorev1.SecretProjectionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SecretReference"): return &applyconfigurationscorev1.SecretReferenceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SecretVolumeSource"): return &applyconfigurationscorev1.SecretVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SecurityContext"): return &applyconfigurationscorev1.SecurityContextApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SELinuxOptions"): return &applyconfigurationscorev1.SELinuxOptionsApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Service"): return &applyconfigurationscorev1.ServiceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ServiceAccount"): return &applyconfigurationscorev1.ServiceAccountApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ServiceAccountTokenProjection"): return &applyconfigurationscorev1.ServiceAccountTokenProjectionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ServicePort"): return &applyconfigurationscorev1.ServicePortApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ServiceSpec"): return &applyconfigurationscorev1.ServiceSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ServiceStatus"): return &applyconfigurationscorev1.ServiceStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SessionAffinityConfig"): return &applyconfigurationscorev1.SessionAffinityConfigApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("SleepAction"): return &applyconfigurationscorev1.SleepActionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("StorageOSPersistentVolumeSource"): return &applyconfigurationscorev1.StorageOSPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("StorageOSVolumeSource"): return &applyconfigurationscorev1.StorageOSVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Sysctl"): return &applyconfigurationscorev1.SysctlApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Taint"): return &applyconfigurationscorev1.TaintApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("TCPSocketAction"): return &applyconfigurationscorev1.TCPSocketActionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Toleration"): return &applyconfigurationscorev1.TolerationApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("TopologySelectorLabelRequirement"): return &applyconfigurationscorev1.TopologySelectorLabelRequirementApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("TopologySelectorTerm"): return &applyconfigurationscorev1.TopologySelectorTermApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("TopologySpreadConstraint"): return &applyconfigurationscorev1.TopologySpreadConstraintApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("TypedLocalObjectReference"): return &applyconfigurationscorev1.TypedLocalObjectReferenceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("TypedObjectReference"): return &applyconfigurationscorev1.TypedObjectReferenceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("Volume"): return &applyconfigurationscorev1.VolumeApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeDevice"): return &applyconfigurationscorev1.VolumeDeviceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeMount"): return &applyconfigurationscorev1.VolumeMountApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeMountStatus"): return &applyconfigurationscorev1.VolumeMountStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeNodeAffinity"): return &applyconfigurationscorev1.VolumeNodeAffinityApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeProjection"): return &applyconfigurationscorev1.VolumeProjectionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeResourceRequirements"): return &applyconfigurationscorev1.VolumeResourceRequirementsApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeSource"): return &applyconfigurationscorev1.VolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VsphereVirtualDiskVolumeSource"): return &applyconfigurationscorev1.VsphereVirtualDiskVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("WeightedPodAffinityTerm"): return &applyconfigurationscorev1.WeightedPodAffinityTermApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("WindowsSecurityContextOptions"): return &applyconfigurationscorev1.WindowsSecurityContextOptionsApplyConfiguration{} // Group=discovery.k8s.io, Version=v1 case discoveryv1.SchemeGroupVersion.WithKind("Endpoint"): return &applyconfigurationsdiscoveryv1.EndpointApplyConfiguration{} case discoveryv1.SchemeGroupVersion.WithKind("EndpointConditions"): return &applyconfigurationsdiscoveryv1.EndpointConditionsApplyConfiguration{} case discoveryv1.SchemeGroupVersion.WithKind("EndpointHints"): return &applyconfigurationsdiscoveryv1.EndpointHintsApplyConfiguration{} case discoveryv1.SchemeGroupVersion.WithKind("EndpointPort"): return &applyconfigurationsdiscoveryv1.EndpointPortApplyConfiguration{} case discoveryv1.SchemeGroupVersion.WithKind("EndpointSlice"): return &applyconfigurationsdiscoveryv1.EndpointSliceApplyConfiguration{} case discoveryv1.SchemeGroupVersion.WithKind("ForZone"): return &applyconfigurationsdiscoveryv1.ForZoneApplyConfiguration{} // Group=discovery.k8s.io, Version=v1beta1 case discoveryv1beta1.SchemeGroupVersion.WithKind("Endpoint"): return &applyconfigurationsdiscoveryv1beta1.EndpointApplyConfiguration{} case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointConditions"): return &applyconfigurationsdiscoveryv1beta1.EndpointConditionsApplyConfiguration{} case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointHints"): return &applyconfigurationsdiscoveryv1beta1.EndpointHintsApplyConfiguration{} case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointPort"): return &applyconfigurationsdiscoveryv1beta1.EndpointPortApplyConfiguration{} case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointSlice"): return &applyconfigurationsdiscoveryv1beta1.EndpointSliceApplyConfiguration{} case discoveryv1beta1.SchemeGroupVersion.WithKind("ForZone"): return &applyconfigurationsdiscoveryv1beta1.ForZoneApplyConfiguration{} // Group=events.k8s.io, Version=v1 case eventsv1.SchemeGroupVersion.WithKind("Event"): return &applyconfigurationseventsv1.EventApplyConfiguration{} case eventsv1.SchemeGroupVersion.WithKind("EventSeries"): return &applyconfigurationseventsv1.EventSeriesApplyConfiguration{} // Group=events.k8s.io, Version=v1beta1 case eventsv1beta1.SchemeGroupVersion.WithKind("Event"): return &applyconfigurationseventsv1beta1.EventApplyConfiguration{} case eventsv1beta1.SchemeGroupVersion.WithKind("EventSeries"): return &applyconfigurationseventsv1beta1.EventSeriesApplyConfiguration{} // Group=extensions, Version=v1beta1 case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSet"): return &applyconfigurationsextensionsv1beta1.DaemonSetApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSetCondition"): return &applyconfigurationsextensionsv1beta1.DaemonSetConditionApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSetSpec"): return &applyconfigurationsextensionsv1beta1.DaemonSetSpecApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSetStatus"): return &applyconfigurationsextensionsv1beta1.DaemonSetStatusApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSetUpdateStrategy"): return &applyconfigurationsextensionsv1beta1.DaemonSetUpdateStrategyApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("Deployment"): return &applyconfigurationsextensionsv1beta1.DeploymentApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("DeploymentCondition"): return &applyconfigurationsextensionsv1beta1.DeploymentConditionApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("DeploymentSpec"): return &applyconfigurationsextensionsv1beta1.DeploymentSpecApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("DeploymentStatus"): return &applyconfigurationsextensionsv1beta1.DeploymentStatusApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("DeploymentStrategy"): return &applyconfigurationsextensionsv1beta1.DeploymentStrategyApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("HTTPIngressPath"): return &applyconfigurationsextensionsv1beta1.HTTPIngressPathApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("HTTPIngressRuleValue"): return &applyconfigurationsextensionsv1beta1.HTTPIngressRuleValueApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("Ingress"): return &applyconfigurationsextensionsv1beta1.IngressApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressBackend"): return &applyconfigurationsextensionsv1beta1.IngressBackendApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressLoadBalancerIngress"): return &applyconfigurationsextensionsv1beta1.IngressLoadBalancerIngressApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressLoadBalancerStatus"): return &applyconfigurationsextensionsv1beta1.IngressLoadBalancerStatusApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressPortStatus"): return &applyconfigurationsextensionsv1beta1.IngressPortStatusApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressRule"): return &applyconfigurationsextensionsv1beta1.IngressRuleApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressRuleValue"): return &applyconfigurationsextensionsv1beta1.IngressRuleValueApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressSpec"): return &applyconfigurationsextensionsv1beta1.IngressSpecApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressStatus"): return &applyconfigurationsextensionsv1beta1.IngressStatusApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressTLS"): return &applyconfigurationsextensionsv1beta1.IngressTLSApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("IPBlock"): return &applyconfigurationsextensionsv1beta1.IPBlockApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicy"): return &applyconfigurationsextensionsv1beta1.NetworkPolicyApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicyEgressRule"): return &applyconfigurationsextensionsv1beta1.NetworkPolicyEgressRuleApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicyIngressRule"): return &applyconfigurationsextensionsv1beta1.NetworkPolicyIngressRuleApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicyPeer"): return &applyconfigurationsextensionsv1beta1.NetworkPolicyPeerApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicyPort"): return &applyconfigurationsextensionsv1beta1.NetworkPolicyPortApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicySpec"): return &applyconfigurationsextensionsv1beta1.NetworkPolicySpecApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSet"): return &applyconfigurationsextensionsv1beta1.ReplicaSetApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSetCondition"): return &applyconfigurationsextensionsv1beta1.ReplicaSetConditionApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSetSpec"): return &applyconfigurationsextensionsv1beta1.ReplicaSetSpecApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSetStatus"): return &applyconfigurationsextensionsv1beta1.ReplicaSetStatusApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("RollbackConfig"): return &applyconfigurationsextensionsv1beta1.RollbackConfigApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("RollingUpdateDaemonSet"): return &applyconfigurationsextensionsv1beta1.RollingUpdateDaemonSetApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("RollingUpdateDeployment"): return &applyconfigurationsextensionsv1beta1.RollingUpdateDeploymentApplyConfiguration{} case extensionsv1beta1.SchemeGroupVersion.WithKind("Scale"): return &applyconfigurationsextensionsv1beta1.ScaleApplyConfiguration{} // Group=flowcontrol.apiserver.k8s.io, Version=v1 case flowcontrolv1.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1.ExemptPriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): return &applyconfigurationsflowcontrolv1.FlowDistinguisherMethodApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchema"): return &applyconfigurationsflowcontrolv1.FlowSchemaApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaCondition"): return &applyconfigurationsflowcontrolv1.FlowSchemaConditionApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaSpec"): return &applyconfigurationsflowcontrolv1.FlowSchemaSpecApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaStatus"): return &applyconfigurationsflowcontrolv1.FlowSchemaStatusApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("GroupSubject"): return &applyconfigurationsflowcontrolv1.GroupSubjectApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1.LimitedPriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("LimitResponse"): return &applyconfigurationsflowcontrolv1.LimitResponseApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): return &applyconfigurationsflowcontrolv1.NonResourcePolicyRuleApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): return &applyconfigurationsflowcontrolv1.PolicyRulesWithSubjectsApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationConditionApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationReferenceApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationSpecApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationStatusApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("QueuingConfiguration"): return &applyconfigurationsflowcontrolv1.QueuingConfigurationApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("ResourcePolicyRule"): return &applyconfigurationsflowcontrolv1.ResourcePolicyRuleApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("ServiceAccountSubject"): return &applyconfigurationsflowcontrolv1.ServiceAccountSubjectApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("Subject"): return &applyconfigurationsflowcontrolv1.SubjectApplyConfiguration{} case flowcontrolv1.SchemeGroupVersion.WithKind("UserSubject"): return &applyconfigurationsflowcontrolv1.UserSubjectApplyConfiguration{} // Group=flowcontrol.apiserver.k8s.io, Version=v1beta1 case flowcontrolv1beta1.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1beta1.ExemptPriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): return &applyconfigurationsflowcontrolv1beta1.FlowDistinguisherMethodApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowSchema"): return &applyconfigurationsflowcontrolv1beta1.FlowSchemaApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowSchemaCondition"): return &applyconfigurationsflowcontrolv1beta1.FlowSchemaConditionApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowSchemaSpec"): return &applyconfigurationsflowcontrolv1beta1.FlowSchemaSpecApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowSchemaStatus"): return &applyconfigurationsflowcontrolv1beta1.FlowSchemaStatusApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("GroupSubject"): return &applyconfigurationsflowcontrolv1beta1.GroupSubjectApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1beta1.LimitedPriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("LimitResponse"): return &applyconfigurationsflowcontrolv1beta1.LimitResponseApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): return &applyconfigurationsflowcontrolv1beta1.NonResourcePolicyRuleApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): return &applyconfigurationsflowcontrolv1beta1.PolicyRulesWithSubjectsApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationConditionApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationReferenceApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationSpecApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationStatusApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("QueuingConfiguration"): return &applyconfigurationsflowcontrolv1beta1.QueuingConfigurationApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("ResourcePolicyRule"): return &applyconfigurationsflowcontrolv1beta1.ResourcePolicyRuleApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("ServiceAccountSubject"): return &applyconfigurationsflowcontrolv1beta1.ServiceAccountSubjectApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("Subject"): return &applyconfigurationsflowcontrolv1beta1.SubjectApplyConfiguration{} case flowcontrolv1beta1.SchemeGroupVersion.WithKind("UserSubject"): return &applyconfigurationsflowcontrolv1beta1.UserSubjectApplyConfiguration{} // Group=flowcontrol.apiserver.k8s.io, Version=v1beta2 case flowcontrolv1beta2.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1beta2.ExemptPriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): return &applyconfigurationsflowcontrolv1beta2.FlowDistinguisherMethodApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchema"): return &applyconfigurationsflowcontrolv1beta2.FlowSchemaApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaCondition"): return &applyconfigurationsflowcontrolv1beta2.FlowSchemaConditionApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaSpec"): return &applyconfigurationsflowcontrolv1beta2.FlowSchemaSpecApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaStatus"): return &applyconfigurationsflowcontrolv1beta2.FlowSchemaStatusApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("GroupSubject"): return &applyconfigurationsflowcontrolv1beta2.GroupSubjectApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1beta2.LimitedPriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("LimitResponse"): return &applyconfigurationsflowcontrolv1beta2.LimitResponseApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): return &applyconfigurationsflowcontrolv1beta2.NonResourcePolicyRuleApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): return &applyconfigurationsflowcontrolv1beta2.PolicyRulesWithSubjectsApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationConditionApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationReferenceApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationSpecApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationStatusApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("QueuingConfiguration"): return &applyconfigurationsflowcontrolv1beta2.QueuingConfigurationApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("ResourcePolicyRule"): return &applyconfigurationsflowcontrolv1beta2.ResourcePolicyRuleApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("ServiceAccountSubject"): return &applyconfigurationsflowcontrolv1beta2.ServiceAccountSubjectApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("Subject"): return &applyconfigurationsflowcontrolv1beta2.SubjectApplyConfiguration{} case flowcontrolv1beta2.SchemeGroupVersion.WithKind("UserSubject"): return &applyconfigurationsflowcontrolv1beta2.UserSubjectApplyConfiguration{} // Group=flowcontrol.apiserver.k8s.io, Version=v1beta3 case v1beta3.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): return &flowcontrolv1beta3.ExemptPriorityLevelConfigurationApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): return &flowcontrolv1beta3.FlowDistinguisherMethodApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("FlowSchema"): return &flowcontrolv1beta3.FlowSchemaApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("FlowSchemaCondition"): return &flowcontrolv1beta3.FlowSchemaConditionApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("FlowSchemaSpec"): return &flowcontrolv1beta3.FlowSchemaSpecApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("FlowSchemaStatus"): return &flowcontrolv1beta3.FlowSchemaStatusApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("GroupSubject"): return &flowcontrolv1beta3.GroupSubjectApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): return &flowcontrolv1beta3.LimitedPriorityLevelConfigurationApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("LimitResponse"): return &flowcontrolv1beta3.LimitResponseApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): return &flowcontrolv1beta3.NonResourcePolicyRuleApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): return &flowcontrolv1beta3.PolicyRulesWithSubjectsApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): return &flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): return &flowcontrolv1beta3.PriorityLevelConfigurationConditionApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): return &flowcontrolv1beta3.PriorityLevelConfigurationReferenceApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): return &flowcontrolv1beta3.PriorityLevelConfigurationSpecApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): return &flowcontrolv1beta3.PriorityLevelConfigurationStatusApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("QueuingConfiguration"): return &flowcontrolv1beta3.QueuingConfigurationApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("ResourcePolicyRule"): return &flowcontrolv1beta3.ResourcePolicyRuleApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("ServiceAccountSubject"): return &flowcontrolv1beta3.ServiceAccountSubjectApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("Subject"): return &flowcontrolv1beta3.SubjectApplyConfiguration{} case v1beta3.SchemeGroupVersion.WithKind("UserSubject"): return &flowcontrolv1beta3.UserSubjectApplyConfiguration{} // Group=imagepolicy.k8s.io, Version=v1alpha1 case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReview"): return &applyconfigurationsimagepolicyv1alpha1.ImageReviewApplyConfiguration{} case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReviewContainerSpec"): return &applyconfigurationsimagepolicyv1alpha1.ImageReviewContainerSpecApplyConfiguration{} case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReviewSpec"): return &applyconfigurationsimagepolicyv1alpha1.ImageReviewSpecApplyConfiguration{} case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReviewStatus"): return &applyconfigurationsimagepolicyv1alpha1.ImageReviewStatusApplyConfiguration{} // Group=internal.apiserver.k8s.io, Version=v1alpha1 case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("ServerStorageVersion"): return &applyconfigurationsapiserverinternalv1alpha1.ServerStorageVersionApplyConfiguration{} case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("StorageVersion"): return &applyconfigurationsapiserverinternalv1alpha1.StorageVersionApplyConfiguration{} case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("StorageVersionCondition"): return &applyconfigurationsapiserverinternalv1alpha1.StorageVersionConditionApplyConfiguration{} case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("StorageVersionStatus"): return &applyconfigurationsapiserverinternalv1alpha1.StorageVersionStatusApplyConfiguration{} // Group=meta.k8s.io, Version=v1 case metav1.SchemeGroupVersion.WithKind("Condition"): return &applyconfigurationsmetav1.ConditionApplyConfiguration{} case metav1.SchemeGroupVersion.WithKind("DeleteOptions"): return &applyconfigurationsmetav1.DeleteOptionsApplyConfiguration{} case metav1.SchemeGroupVersion.WithKind("LabelSelector"): return &applyconfigurationsmetav1.LabelSelectorApplyConfiguration{} case metav1.SchemeGroupVersion.WithKind("LabelSelectorRequirement"): return &applyconfigurationsmetav1.LabelSelectorRequirementApplyConfiguration{} case metav1.SchemeGroupVersion.WithKind("ManagedFieldsEntry"): return &applyconfigurationsmetav1.ManagedFieldsEntryApplyConfiguration{} case metav1.SchemeGroupVersion.WithKind("ObjectMeta"): return &applyconfigurationsmetav1.ObjectMetaApplyConfiguration{} case metav1.SchemeGroupVersion.WithKind("OwnerReference"): return &applyconfigurationsmetav1.OwnerReferenceApplyConfiguration{} case metav1.SchemeGroupVersion.WithKind("Preconditions"): return &applyconfigurationsmetav1.PreconditionsApplyConfiguration{} case metav1.SchemeGroupVersion.WithKind("TypeMeta"): return &applyconfigurationsmetav1.TypeMetaApplyConfiguration{} // Group=networking.k8s.io, Version=v1 case networkingv1.SchemeGroupVersion.WithKind("HTTPIngressPath"): return &applyconfigurationsnetworkingv1.HTTPIngressPathApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("HTTPIngressRuleValue"): return &applyconfigurationsnetworkingv1.HTTPIngressRuleValueApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("Ingress"): return &applyconfigurationsnetworkingv1.IngressApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressBackend"): return &applyconfigurationsnetworkingv1.IngressBackendApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressClass"): return &applyconfigurationsnetworkingv1.IngressClassApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressClassParametersReference"): return &applyconfigurationsnetworkingv1.IngressClassParametersReferenceApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressClassSpec"): return &applyconfigurationsnetworkingv1.IngressClassSpecApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressLoadBalancerIngress"): return &applyconfigurationsnetworkingv1.IngressLoadBalancerIngressApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressLoadBalancerStatus"): return &applyconfigurationsnetworkingv1.IngressLoadBalancerStatusApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressPortStatus"): return &applyconfigurationsnetworkingv1.IngressPortStatusApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressRule"): return &applyconfigurationsnetworkingv1.IngressRuleApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressRuleValue"): return &applyconfigurationsnetworkingv1.IngressRuleValueApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressServiceBackend"): return &applyconfigurationsnetworkingv1.IngressServiceBackendApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressSpec"): return &applyconfigurationsnetworkingv1.IngressSpecApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressStatus"): return &applyconfigurationsnetworkingv1.IngressStatusApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressTLS"): return &applyconfigurationsnetworkingv1.IngressTLSApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IPBlock"): return &applyconfigurationsnetworkingv1.IPBlockApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicy"): return &applyconfigurationsnetworkingv1.NetworkPolicyApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicyEgressRule"): return &applyconfigurationsnetworkingv1.NetworkPolicyEgressRuleApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicyIngressRule"): return &applyconfigurationsnetworkingv1.NetworkPolicyIngressRuleApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicyPeer"): return &applyconfigurationsnetworkingv1.NetworkPolicyPeerApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicyPort"): return &applyconfigurationsnetworkingv1.NetworkPolicyPortApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicySpec"): return &applyconfigurationsnetworkingv1.NetworkPolicySpecApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("ServiceBackendPort"): return &applyconfigurationsnetworkingv1.ServiceBackendPortApplyConfiguration{} // Group=networking.k8s.io, Version=v1alpha1 case networkingv1alpha1.SchemeGroupVersion.WithKind("IPAddress"): return &applyconfigurationsnetworkingv1alpha1.IPAddressApplyConfiguration{} case networkingv1alpha1.SchemeGroupVersion.WithKind("IPAddressSpec"): return &applyconfigurationsnetworkingv1alpha1.IPAddressSpecApplyConfiguration{} case networkingv1alpha1.SchemeGroupVersion.WithKind("ParentReference"): return &applyconfigurationsnetworkingv1alpha1.ParentReferenceApplyConfiguration{} case networkingv1alpha1.SchemeGroupVersion.WithKind("ServiceCIDR"): return &applyconfigurationsnetworkingv1alpha1.ServiceCIDRApplyConfiguration{} case networkingv1alpha1.SchemeGroupVersion.WithKind("ServiceCIDRSpec"): return &applyconfigurationsnetworkingv1alpha1.ServiceCIDRSpecApplyConfiguration{} case networkingv1alpha1.SchemeGroupVersion.WithKind("ServiceCIDRStatus"): return &applyconfigurationsnetworkingv1alpha1.ServiceCIDRStatusApplyConfiguration{} // Group=networking.k8s.io, Version=v1beta1 case networkingv1beta1.SchemeGroupVersion.WithKind("HTTPIngressPath"): return &applyconfigurationsnetworkingv1beta1.HTTPIngressPathApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("HTTPIngressRuleValue"): return &applyconfigurationsnetworkingv1beta1.HTTPIngressRuleValueApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("Ingress"): return &applyconfigurationsnetworkingv1beta1.IngressApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressBackend"): return &applyconfigurationsnetworkingv1beta1.IngressBackendApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClass"): return &applyconfigurationsnetworkingv1beta1.IngressClassApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClassParametersReference"): return &applyconfigurationsnetworkingv1beta1.IngressClassParametersReferenceApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClassSpec"): return &applyconfigurationsnetworkingv1beta1.IngressClassSpecApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressLoadBalancerIngress"): return &applyconfigurationsnetworkingv1beta1.IngressLoadBalancerIngressApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressLoadBalancerStatus"): return &applyconfigurationsnetworkingv1beta1.IngressLoadBalancerStatusApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressPortStatus"): return &applyconfigurationsnetworkingv1beta1.IngressPortStatusApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressRule"): return &applyconfigurationsnetworkingv1beta1.IngressRuleApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressRuleValue"): return &applyconfigurationsnetworkingv1beta1.IngressRuleValueApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressSpec"): return &applyconfigurationsnetworkingv1beta1.IngressSpecApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressStatus"): return &applyconfigurationsnetworkingv1beta1.IngressStatusApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressTLS"): return &applyconfigurationsnetworkingv1beta1.IngressTLSApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IPAddress"): return &applyconfigurationsnetworkingv1beta1.IPAddressApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IPAddressSpec"): return &applyconfigurationsnetworkingv1beta1.IPAddressSpecApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("ParentReference"): return &applyconfigurationsnetworkingv1beta1.ParentReferenceApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDR"): return &applyconfigurationsnetworkingv1beta1.ServiceCIDRApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDRSpec"): return &applyconfigurationsnetworkingv1beta1.ServiceCIDRSpecApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDRStatus"): return &applyconfigurationsnetworkingv1beta1.ServiceCIDRStatusApplyConfiguration{} // Group=node.k8s.io, Version=v1 case nodev1.SchemeGroupVersion.WithKind("Overhead"): return &applyconfigurationsnodev1.OverheadApplyConfiguration{} case nodev1.SchemeGroupVersion.WithKind("RuntimeClass"): return &applyconfigurationsnodev1.RuntimeClassApplyConfiguration{} case nodev1.SchemeGroupVersion.WithKind("Scheduling"): return &applyconfigurationsnodev1.SchedulingApplyConfiguration{} // Group=node.k8s.io, Version=v1alpha1 case nodev1alpha1.SchemeGroupVersion.WithKind("Overhead"): return &applyconfigurationsnodev1alpha1.OverheadApplyConfiguration{} case nodev1alpha1.SchemeGroupVersion.WithKind("RuntimeClass"): return &applyconfigurationsnodev1alpha1.RuntimeClassApplyConfiguration{} case nodev1alpha1.SchemeGroupVersion.WithKind("RuntimeClassSpec"): return &applyconfigurationsnodev1alpha1.RuntimeClassSpecApplyConfiguration{} case nodev1alpha1.SchemeGroupVersion.WithKind("Scheduling"): return &applyconfigurationsnodev1alpha1.SchedulingApplyConfiguration{} // Group=node.k8s.io, Version=v1beta1 case nodev1beta1.SchemeGroupVersion.WithKind("Overhead"): return &applyconfigurationsnodev1beta1.OverheadApplyConfiguration{} case nodev1beta1.SchemeGroupVersion.WithKind("RuntimeClass"): return &applyconfigurationsnodev1beta1.RuntimeClassApplyConfiguration{} case nodev1beta1.SchemeGroupVersion.WithKind("Scheduling"): return &applyconfigurationsnodev1beta1.SchedulingApplyConfiguration{} // Group=policy, Version=v1 case policyv1.SchemeGroupVersion.WithKind("Eviction"): return &applyconfigurationspolicyv1.EvictionApplyConfiguration{} case policyv1.SchemeGroupVersion.WithKind("PodDisruptionBudget"): return &applyconfigurationspolicyv1.PodDisruptionBudgetApplyConfiguration{} case policyv1.SchemeGroupVersion.WithKind("PodDisruptionBudgetSpec"): return &applyconfigurationspolicyv1.PodDisruptionBudgetSpecApplyConfiguration{} case policyv1.SchemeGroupVersion.WithKind("PodDisruptionBudgetStatus"): return &applyconfigurationspolicyv1.PodDisruptionBudgetStatusApplyConfiguration{} // Group=policy, Version=v1beta1 case policyv1beta1.SchemeGroupVersion.WithKind("Eviction"): return &applyconfigurationspolicyv1beta1.EvictionApplyConfiguration{} case policyv1beta1.SchemeGroupVersion.WithKind("PodDisruptionBudget"): return &applyconfigurationspolicyv1beta1.PodDisruptionBudgetApplyConfiguration{} case policyv1beta1.SchemeGroupVersion.WithKind("PodDisruptionBudgetSpec"): return &applyconfigurationspolicyv1beta1.PodDisruptionBudgetSpecApplyConfiguration{} case policyv1beta1.SchemeGroupVersion.WithKind("PodDisruptionBudgetStatus"): return &applyconfigurationspolicyv1beta1.PodDisruptionBudgetStatusApplyConfiguration{} // Group=rbac.authorization.k8s.io, Version=v1 case rbacv1.SchemeGroupVersion.WithKind("AggregationRule"): return &applyconfigurationsrbacv1.AggregationRuleApplyConfiguration{} case rbacv1.SchemeGroupVersion.WithKind("ClusterRole"): return &applyconfigurationsrbacv1.ClusterRoleApplyConfiguration{} case rbacv1.SchemeGroupVersion.WithKind("ClusterRoleBinding"): return &applyconfigurationsrbacv1.ClusterRoleBindingApplyConfiguration{} case rbacv1.SchemeGroupVersion.WithKind("PolicyRule"): return &applyconfigurationsrbacv1.PolicyRuleApplyConfiguration{} case rbacv1.SchemeGroupVersion.WithKind("Role"): return &applyconfigurationsrbacv1.RoleApplyConfiguration{} case rbacv1.SchemeGroupVersion.WithKind("RoleBinding"): return &applyconfigurationsrbacv1.RoleBindingApplyConfiguration{} case rbacv1.SchemeGroupVersion.WithKind("RoleRef"): return &applyconfigurationsrbacv1.RoleRefApplyConfiguration{} case rbacv1.SchemeGroupVersion.WithKind("Subject"): return &applyconfigurationsrbacv1.SubjectApplyConfiguration{} // Group=rbac.authorization.k8s.io, Version=v1alpha1 case rbacv1alpha1.SchemeGroupVersion.WithKind("AggregationRule"): return &applyconfigurationsrbacv1alpha1.AggregationRuleApplyConfiguration{} case rbacv1alpha1.SchemeGroupVersion.WithKind("ClusterRole"): return &applyconfigurationsrbacv1alpha1.ClusterRoleApplyConfiguration{} case rbacv1alpha1.SchemeGroupVersion.WithKind("ClusterRoleBinding"): return &applyconfigurationsrbacv1alpha1.ClusterRoleBindingApplyConfiguration{} case rbacv1alpha1.SchemeGroupVersion.WithKind("PolicyRule"): return &applyconfigurationsrbacv1alpha1.PolicyRuleApplyConfiguration{} case rbacv1alpha1.SchemeGroupVersion.WithKind("Role"): return &applyconfigurationsrbacv1alpha1.RoleApplyConfiguration{} case rbacv1alpha1.SchemeGroupVersion.WithKind("RoleBinding"): return &applyconfigurationsrbacv1alpha1.RoleBindingApplyConfiguration{} case rbacv1alpha1.SchemeGroupVersion.WithKind("RoleRef"): return &applyconfigurationsrbacv1alpha1.RoleRefApplyConfiguration{} case rbacv1alpha1.SchemeGroupVersion.WithKind("Subject"): return &applyconfigurationsrbacv1alpha1.SubjectApplyConfiguration{} // Group=rbac.authorization.k8s.io, Version=v1beta1 case rbacv1beta1.SchemeGroupVersion.WithKind("AggregationRule"): return &applyconfigurationsrbacv1beta1.AggregationRuleApplyConfiguration{} case rbacv1beta1.SchemeGroupVersion.WithKind("ClusterRole"): return &applyconfigurationsrbacv1beta1.ClusterRoleApplyConfiguration{} case rbacv1beta1.SchemeGroupVersion.WithKind("ClusterRoleBinding"): return &applyconfigurationsrbacv1beta1.ClusterRoleBindingApplyConfiguration{} case rbacv1beta1.SchemeGroupVersion.WithKind("PolicyRule"): return &applyconfigurationsrbacv1beta1.PolicyRuleApplyConfiguration{} case rbacv1beta1.SchemeGroupVersion.WithKind("Role"): return &applyconfigurationsrbacv1beta1.RoleApplyConfiguration{} case rbacv1beta1.SchemeGroupVersion.WithKind("RoleBinding"): return &applyconfigurationsrbacv1beta1.RoleBindingApplyConfiguration{} case rbacv1beta1.SchemeGroupVersion.WithKind("RoleRef"): return &applyconfigurationsrbacv1beta1.RoleRefApplyConfiguration{} case rbacv1beta1.SchemeGroupVersion.WithKind("Subject"): return &applyconfigurationsrbacv1beta1.SubjectApplyConfiguration{} // Group=resource.k8s.io, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithKind("AllocationResult"): return &resourcev1alpha3.AllocationResultApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("BasicDevice"): return &resourcev1alpha3.BasicDeviceApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("CELDeviceSelector"): return &resourcev1alpha3.CELDeviceSelectorApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("Device"): return &resourcev1alpha3.DeviceApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"): return &resourcev1alpha3.DeviceAllocationConfigurationApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationResult"): return &resourcev1alpha3.DeviceAllocationResultApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceAttribute"): return &resourcev1alpha3.DeviceAttributeApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceClaim"): return &resourcev1alpha3.DeviceClaimApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceClaimConfiguration"): return &resourcev1alpha3.DeviceClaimConfigurationApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceClass"): return &resourcev1alpha3.DeviceClassApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceClassConfiguration"): return &resourcev1alpha3.DeviceClassConfigurationApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceClassSpec"): return &resourcev1alpha3.DeviceClassSpecApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceConfiguration"): return &resourcev1alpha3.DeviceConfigurationApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceConstraint"): return &resourcev1alpha3.DeviceConstraintApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequest"): return &resourcev1alpha3.DeviceRequestApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): return &resourcev1alpha3.DeviceRequestAllocationResultApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceSelector"): return &resourcev1alpha3.DeviceSelectorApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): return &resourcev1alpha3.OpaqueDeviceConfigurationApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext"): return &resourcev1alpha3.PodSchedulingContextApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): return &resourcev1alpha3.PodSchedulingContextSpecApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextStatus"): return &resourcev1alpha3.PodSchedulingContextStatusApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim"): return &resourcev1alpha3.ResourceClaimApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"): return &resourcev1alpha3.ResourceClaimConsumerReferenceApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"): return &resourcev1alpha3.ResourceClaimSchedulingStatusApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSpec"): return &resourcev1alpha3.ResourceClaimSpecApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimStatus"): return &resourcev1alpha3.ResourceClaimStatusApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplate"): return &resourcev1alpha3.ResourceClaimTemplateApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"): return &resourcev1alpha3.ResourceClaimTemplateSpecApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourcePool"): return &resourcev1alpha3.ResourcePoolApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice"): return &resourcev1alpha3.ResourceSliceApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceSliceSpec"): return &resourcev1alpha3.ResourceSliceSpecApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"): return &applyconfigurationsschedulingv1.PriorityClassApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1alpha1 case schedulingv1alpha1.SchemeGroupVersion.WithKind("PriorityClass"): return &applyconfigurationsschedulingv1alpha1.PriorityClassApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1beta1 case schedulingv1beta1.SchemeGroupVersion.WithKind("PriorityClass"): return &applyconfigurationsschedulingv1beta1.PriorityClassApplyConfiguration{} // Group=storage.k8s.io, Version=v1 case storagev1.SchemeGroupVersion.WithKind("CSIDriver"): return &applyconfigurationsstoragev1.CSIDriverApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("CSIDriverSpec"): return &applyconfigurationsstoragev1.CSIDriverSpecApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("CSINode"): return &applyconfigurationsstoragev1.CSINodeApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("CSINodeDriver"): return &applyconfigurationsstoragev1.CSINodeDriverApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("CSINodeSpec"): return &applyconfigurationsstoragev1.CSINodeSpecApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("CSIStorageCapacity"): return &applyconfigurationsstoragev1.CSIStorageCapacityApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("StorageClass"): return &applyconfigurationsstoragev1.StorageClassApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("TokenRequest"): return &applyconfigurationsstoragev1.TokenRequestApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("VolumeAttachment"): return &applyconfigurationsstoragev1.VolumeAttachmentApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("VolumeAttachmentSource"): return &applyconfigurationsstoragev1.VolumeAttachmentSourceApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("VolumeAttachmentSpec"): return &applyconfigurationsstoragev1.VolumeAttachmentSpecApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("VolumeAttachmentStatus"): return &applyconfigurationsstoragev1.VolumeAttachmentStatusApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("VolumeError"): return &applyconfigurationsstoragev1.VolumeErrorApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("VolumeNodeResources"): return &applyconfigurationsstoragev1.VolumeNodeResourcesApplyConfiguration{} // Group=storage.k8s.io, Version=v1alpha1 case storagev1alpha1.SchemeGroupVersion.WithKind("CSIStorageCapacity"): return &applyconfigurationsstoragev1alpha1.CSIStorageCapacityApplyConfiguration{} case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttachment"): return &applyconfigurationsstoragev1alpha1.VolumeAttachmentApplyConfiguration{} case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttachmentSource"): return &applyconfigurationsstoragev1alpha1.VolumeAttachmentSourceApplyConfiguration{} case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttachmentSpec"): return &applyconfigurationsstoragev1alpha1.VolumeAttachmentSpecApplyConfiguration{} case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttachmentStatus"): return &applyconfigurationsstoragev1alpha1.VolumeAttachmentStatusApplyConfiguration{} case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttributesClass"): return &applyconfigurationsstoragev1alpha1.VolumeAttributesClassApplyConfiguration{} case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeError"): return &applyconfigurationsstoragev1alpha1.VolumeErrorApplyConfiguration{} // Group=storage.k8s.io, Version=v1beta1 case storagev1beta1.SchemeGroupVersion.WithKind("CSIDriver"): return &applyconfigurationsstoragev1beta1.CSIDriverApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("CSIDriverSpec"): return &applyconfigurationsstoragev1beta1.CSIDriverSpecApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("CSINode"): return &applyconfigurationsstoragev1beta1.CSINodeApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("CSINodeDriver"): return &applyconfigurationsstoragev1beta1.CSINodeDriverApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("CSINodeSpec"): return &applyconfigurationsstoragev1beta1.CSINodeSpecApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("CSIStorageCapacity"): return &applyconfigurationsstoragev1beta1.CSIStorageCapacityApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("StorageClass"): return &applyconfigurationsstoragev1beta1.StorageClassApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("TokenRequest"): return &applyconfigurationsstoragev1beta1.TokenRequestApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachment"): return &applyconfigurationsstoragev1beta1.VolumeAttachmentApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachmentSource"): return &applyconfigurationsstoragev1beta1.VolumeAttachmentSourceApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachmentSpec"): return &applyconfigurationsstoragev1beta1.VolumeAttachmentSpecApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachmentStatus"): return &applyconfigurationsstoragev1beta1.VolumeAttachmentStatusApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttributesClass"): return &applyconfigurationsstoragev1beta1.VolumeAttributesClassApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeError"): return &applyconfigurationsstoragev1beta1.VolumeErrorApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeNodeResources"): return &applyconfigurationsstoragev1beta1.VolumeNodeResourcesApplyConfiguration{} // Group=storagemigration.k8s.io, Version=v1alpha1 case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("GroupVersionResource"): return &applyconfigurationsstoragemigrationv1alpha1.GroupVersionResourceApplyConfiguration{} case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("MigrationCondition"): return &applyconfigurationsstoragemigrationv1alpha1.MigrationConditionApplyConfiguration{} case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigration"): return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationApplyConfiguration{} case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigrationSpec"): return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationSpecApplyConfiguration{} case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigrationStatus"): return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationStatusApplyConfiguration{} } return nil } func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} } kubernetes-client-go-a2dfcab/code-of-conduct.md000066400000000000000000000002241472614177300216710ustar00rootroot00000000000000# Kubernetes Community Code of Conduct Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) kubernetes-client-go-a2dfcab/discovery/000077500000000000000000000000001472614177300204075ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/discovery/aggregated_discovery.go000066400000000000000000000256501472614177300251270ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package discovery import ( "fmt" apidiscovery "k8s.io/api/apidiscovery/v2" apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) // StaleGroupVersionError encasulates failed GroupVersion marked "stale" // in the returned AggregatedDiscovery format. type StaleGroupVersionError struct { gv schema.GroupVersion } func (s StaleGroupVersionError) Error() string { return fmt.Sprintf("stale GroupVersion discovery: %v", s.gv) } // SplitGroupsAndResources transforms "aggregated" discovery top-level structure into // the previous "unaggregated" discovery groups and resources. func SplitGroupsAndResources(aggregatedGroups apidiscovery.APIGroupDiscoveryList) ( *metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error) { // Aggregated group list will contain the entirety of discovery, including // groups, versions, and resources. GroupVersions marked "stale" are failed. groups := []*metav1.APIGroup{} failedGVs := map[schema.GroupVersion]error{} resourcesByGV := map[schema.GroupVersion]*metav1.APIResourceList{} for _, aggGroup := range aggregatedGroups.Items { group, resources, failed := convertAPIGroup(aggGroup) groups = append(groups, group) for gv, resourceList := range resources { resourcesByGV[gv] = resourceList } for gv, err := range failed { failedGVs[gv] = err } } // Transform slice of groups to group list before returning. groupList := &metav1.APIGroupList{} groupList.Groups = make([]metav1.APIGroup, 0, len(groups)) for _, group := range groups { groupList.Groups = append(groupList.Groups, *group) } return groupList, resourcesByGV, failedGVs } // convertAPIGroup tranforms an "aggregated" APIGroupDiscovery to an "legacy" APIGroup, // also returning the map of APIResourceList for resources within GroupVersions. func convertAPIGroup(g apidiscovery.APIGroupDiscovery) ( *metav1.APIGroup, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error) { // Iterate through versions to convert to group and resources. group := &metav1.APIGroup{} gvResources := map[schema.GroupVersion]*metav1.APIResourceList{} failedGVs := map[schema.GroupVersion]error{} group.Name = g.ObjectMeta.Name for _, v := range g.Versions { gv := schema.GroupVersion{Group: g.Name, Version: v.Version} if v.Freshness == apidiscovery.DiscoveryFreshnessStale { failedGVs[gv] = StaleGroupVersionError{gv: gv} continue } version := metav1.GroupVersionForDiscovery{} version.GroupVersion = gv.String() version.Version = v.Version group.Versions = append(group.Versions, version) // PreferredVersion is first non-stale Version if group.PreferredVersion == (metav1.GroupVersionForDiscovery{}) { group.PreferredVersion = version } resourceList := &metav1.APIResourceList{} resourceList.GroupVersion = gv.String() for _, r := range v.Resources { resource, err := convertAPIResource(r) if err == nil { resourceList.APIResources = append(resourceList.APIResources, resource) } // Subresources field in new format get transformed into full APIResources. // It is possible a partial result with an error was returned to be used // as the parent resource for the subresource. for _, subresource := range r.Subresources { sr, err := convertAPISubresource(resource, subresource) if err == nil { resourceList.APIResources = append(resourceList.APIResources, sr) } } } gvResources[gv] = resourceList } return group, gvResources, failedGVs } var emptyKind = metav1.GroupVersionKind{} // convertAPIResource tranforms a APIResourceDiscovery to an APIResource. We are // resilient to missing GVK, since this resource might be the parent resource // for a subresource. If the parent is missing a GVK, it is not returned in // discovery, and the subresource MUST have the GVK. func convertAPIResource(in apidiscovery.APIResourceDiscovery) (metav1.APIResource, error) { result := metav1.APIResource{ Name: in.Resource, SingularName: in.SingularResource, Namespaced: in.Scope == apidiscovery.ScopeNamespace, Verbs: in.Verbs, ShortNames: in.ShortNames, Categories: in.Categories, } var err error if in.ResponseKind != nil && (*in.ResponseKind) != emptyKind { result.Group = in.ResponseKind.Group result.Version = in.ResponseKind.Version result.Kind = in.ResponseKind.Kind } else { err = fmt.Errorf("discovery resource %s missing GVK", in.Resource) } // Can return partial result with error, which can be the parent for a // subresource. Do not add this result to the returned discovery resources. return result, err } // convertAPISubresource tranforms a APISubresourceDiscovery to an APIResource. func convertAPISubresource(parent metav1.APIResource, in apidiscovery.APISubresourceDiscovery) (metav1.APIResource, error) { result := metav1.APIResource{} if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind { return result, fmt.Errorf("subresource %s/%s missing GVK", parent.Name, in.Subresource) } result.Name = fmt.Sprintf("%s/%s", parent.Name, in.Subresource) result.SingularName = parent.SingularName result.Namespaced = parent.Namespaced result.Group = in.ResponseKind.Group result.Version = in.ResponseKind.Version result.Kind = in.ResponseKind.Kind result.Verbs = in.Verbs return result, nil } // Please note the functions below will be removed in v1.33. They facilitate conversion // between the deprecated type apidiscoveryv2beta1.APIGroupDiscoveryList. // SplitGroupsAndResourcesV2Beta1 transforms "aggregated" discovery top-level structure into // the previous "unaggregated" discovery groups and resources. // Deprecated: Please use SplitGroupsAndResources func SplitGroupsAndResourcesV2Beta1(aggregatedGroups apidiscoveryv2beta1.APIGroupDiscoveryList) ( *metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error) { // Aggregated group list will contain the entirety of discovery, including // groups, versions, and resources. GroupVersions marked "stale" are failed. groups := []*metav1.APIGroup{} failedGVs := map[schema.GroupVersion]error{} resourcesByGV := map[schema.GroupVersion]*metav1.APIResourceList{} for _, aggGroup := range aggregatedGroups.Items { group, resources, failed := convertAPIGroupv2beta1(aggGroup) groups = append(groups, group) for gv, resourceList := range resources { resourcesByGV[gv] = resourceList } for gv, err := range failed { failedGVs[gv] = err } } // Transform slice of groups to group list before returning. groupList := &metav1.APIGroupList{} groupList.Groups = make([]metav1.APIGroup, 0, len(groups)) for _, group := range groups { groupList.Groups = append(groupList.Groups, *group) } return groupList, resourcesByGV, failedGVs } // convertAPIGroupv2beta1 tranforms an "aggregated" APIGroupDiscovery to an "legacy" APIGroup, // also returning the map of APIResourceList for resources within GroupVersions. func convertAPIGroupv2beta1(g apidiscoveryv2beta1.APIGroupDiscovery) ( *metav1.APIGroup, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error) { // Iterate through versions to convert to group and resources. group := &metav1.APIGroup{} gvResources := map[schema.GroupVersion]*metav1.APIResourceList{} failedGVs := map[schema.GroupVersion]error{} group.Name = g.ObjectMeta.Name for _, v := range g.Versions { gv := schema.GroupVersion{Group: g.Name, Version: v.Version} if v.Freshness == apidiscoveryv2beta1.DiscoveryFreshnessStale { failedGVs[gv] = StaleGroupVersionError{gv: gv} continue } version := metav1.GroupVersionForDiscovery{} version.GroupVersion = gv.String() version.Version = v.Version group.Versions = append(group.Versions, version) // PreferredVersion is first non-stale Version if group.PreferredVersion == (metav1.GroupVersionForDiscovery{}) { group.PreferredVersion = version } resourceList := &metav1.APIResourceList{} resourceList.GroupVersion = gv.String() for _, r := range v.Resources { resource, err := convertAPIResourcev2beta1(r) if err == nil { resourceList.APIResources = append(resourceList.APIResources, resource) } // Subresources field in new format get transformed into full APIResources. // It is possible a partial result with an error was returned to be used // as the parent resource for the subresource. for _, subresource := range r.Subresources { sr, err := convertAPISubresourcev2beta1(resource, subresource) if err == nil { resourceList.APIResources = append(resourceList.APIResources, sr) } } } gvResources[gv] = resourceList } return group, gvResources, failedGVs } // convertAPIResource tranforms a APIResourceDiscovery to an APIResource. We are // resilient to missing GVK, since this resource might be the parent resource // for a subresource. If the parent is missing a GVK, it is not returned in // discovery, and the subresource MUST have the GVK. func convertAPIResourcev2beta1(in apidiscoveryv2beta1.APIResourceDiscovery) (metav1.APIResource, error) { result := metav1.APIResource{ Name: in.Resource, SingularName: in.SingularResource, Namespaced: in.Scope == apidiscoveryv2beta1.ScopeNamespace, Verbs: in.Verbs, ShortNames: in.ShortNames, Categories: in.Categories, } // Can return partial result with error, which can be the parent for a // subresource. Do not add this result to the returned discovery resources. if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind { return result, fmt.Errorf("discovery resource %s missing GVK", in.Resource) } result.Group = in.ResponseKind.Group result.Version = in.ResponseKind.Version result.Kind = in.ResponseKind.Kind return result, nil } // convertAPISubresource tranforms a APISubresourceDiscovery to an APIResource. func convertAPISubresourcev2beta1(parent metav1.APIResource, in apidiscoveryv2beta1.APISubresourceDiscovery) (metav1.APIResource, error) { result := metav1.APIResource{} if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind { return result, fmt.Errorf("subresource %s/%s missing GVK", parent.Name, in.Subresource) } result.Name = fmt.Sprintf("%s/%s", parent.Name, in.Subresource) result.SingularName = parent.SingularName result.Namespaced = parent.Namespaced result.Group = in.ResponseKind.Group result.Version = in.ResponseKind.Version result.Kind = in.ResponseKind.Kind result.Verbs = in.Verbs return result, nil } kubernetes-client-go-a2dfcab/discovery/aggregated_discovery_test.go000066400000000000000000001466621472614177300261750ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package discovery import ( "testing" "github.com/stretchr/testify/assert" apidiscovery "k8s.io/api/apidiscovery/v2" apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) func TestSplitGroupsAndResources(t *testing.T) { tests := []struct { name string agg apidiscovery.APIGroupDiscoveryList expectedGroups metav1.APIGroupList expectedGVResources map[schema.GroupVersion]*metav1.APIResourceList expectedFailedGVs map[schema.GroupVersion]error }{ { name: "Aggregated discovery: core/v1 group and pod resource", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "", Version: "v1"}: { GroupVersion: "v1", APIResources: []metav1.APIResource{ { Name: "pods", Namespaced: true, Group: "", Version: "v1", Kind: "Pod", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/2 versions/1 resources at /apis", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v2", Version: "v2", }, { GroupVersion: "apps/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v2", Version: "v2", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", }, }, }, {Group: "apps", Version: "v2"}: { GroupVersion: "apps/v2", APIResources: []metav1.APIResource{ { Name: "deployments", Namespaced: true, Group: "apps", Version: "v2", Kind: "Deployment", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery: 1 group/2 resources at /api, 1 group/2 resources at /apis", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "v1", Version: "v1", }, }, { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "", Version: "v1"}: { GroupVersion: "v1", APIResources: []metav1.APIResource{ { Name: "pods", Namespaced: true, Group: "", Version: "v1", Kind: "Pod", }, { Name: "services", Namespaced: true, Group: "", Version: "v1", Kind: "Service", }, }, }, {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", }, { Name: "statefulsets", Namespaced: true, Group: "apps", Version: "v1", Kind: "StatefulSet", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery: multiple groups with cluster-scoped resources", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "namespaces", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Namespace", }, Scope: apidiscovery.ScopeCluster, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "rbac.authorization.k8s.io", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "roles", ResponseKind: &metav1.GroupVersionKind{ Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "Role", }, Scope: apidiscovery.ScopeCluster, }, { Resource: "clusterroles", ResponseKind: &metav1.GroupVersionKind{ Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRole", }, Scope: apidiscovery.ScopeCluster, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "v1", Version: "v1", }, }, { Name: "rbac.authorization.k8s.io", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "rbac.authorization.k8s.io/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "rbac.authorization.k8s.io/v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "", Version: "v1"}: { GroupVersion: "v1", APIResources: []metav1.APIResource{ { Name: "pods", Namespaced: true, Group: "", Version: "v1", Kind: "Pod", }, { Name: "namespaces", Namespaced: false, Group: "", Version: "v1", Kind: "Namespace", }, }, }, {Group: "rbac.authorization.k8s.io", Version: "v1"}: { GroupVersion: "rbac.authorization.k8s.io/v1", APIResources: []metav1.APIResource{ { Name: "roles", Namespaced: false, Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "Role", }, { Name: "clusterroles", Namespaced: false, Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRole", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery with single subresource", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, SingularResource: "deployment", ShortNames: []string{"deploy"}, Verbs: []string{"parentverb1", "parentverb2", "parentverb3", "parentverb4"}, Categories: []string{"all", "testcategory"}, Subresources: []apidiscovery.APISubresourceDiscovery{ { Subresource: "scale", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Verbs: []string{"get", "patch", "update"}, }, }, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", Verbs: []string{"parentverb1", "parentverb2", "parentverb3", "parentverb4"}, ShortNames: []string{"deploy"}, Categories: []string{"all", "testcategory"}, }, { Name: "deployments/scale", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", Verbs: []string{"get", "patch", "update"}, }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery with single subresource and parent missing GVK", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "external.metrics.k8s.io", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { // resilient to nil GVK for parent Resource: "*", Scope: apidiscovery.ScopeNamespace, SingularResource: "", Subresources: []apidiscovery.APISubresourceDiscovery{ { Subresource: "other-external-metric", ResponseKind: &metav1.GroupVersionKind{ Kind: "MetricValueList", }, Verbs: []string{"get"}, }, }, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "external.metrics.k8s.io", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "external.metrics.k8s.io/v1beta1", Version: "v1beta1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "external.metrics.k8s.io/v1beta1", Version: "v1beta1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "external.metrics.k8s.io", Version: "v1beta1"}: { GroupVersion: "external.metrics.k8s.io/v1beta1", APIResources: []metav1.APIResource{ // Since parent GVK was nil, it is NOT returned--only the subresource. { Name: "*/other-external-metric", SingularName: "", Namespaced: true, Group: "", Version: "", Kind: "MetricValueList", Verbs: []string{"get"}, }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery with single subresource and parent empty GVK", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "external.metrics.k8s.io", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { // resilient to empty GVK for parent Resource: "*", Scope: apidiscovery.ScopeNamespace, SingularResource: "", ResponseKind: &metav1.GroupVersionKind{}, Subresources: []apidiscovery.APISubresourceDiscovery{ { Subresource: "other-external-metric", ResponseKind: &metav1.GroupVersionKind{ Kind: "MetricValueList", }, Verbs: []string{"get"}, }, }, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "external.metrics.k8s.io", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "external.metrics.k8s.io/v1beta1", Version: "v1beta1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "external.metrics.k8s.io/v1beta1", Version: "v1beta1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "external.metrics.k8s.io", Version: "v1beta1"}: { GroupVersion: "external.metrics.k8s.io/v1beta1", APIResources: []metav1.APIResource{ // Since parent GVK was nil, it is NOT returned--only the subresource. { Name: "*/other-external-metric", SingularName: "", Namespaced: true, Group: "", Version: "", Kind: "MetricValueList", Verbs: []string{"get"}, }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery with multiple subresources", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, SingularResource: "deployment", Subresources: []apidiscovery.APISubresourceDiscovery{ { Subresource: "scale", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Verbs: []string{"get", "patch", "update"}, }, { Subresource: "status", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Verbs: []string{"get", "patch", "update"}, }, }, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", }, { Name: "deployments/scale", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", Verbs: []string{"get", "patch", "update"}, }, { Name: "deployments/status", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", Verbs: []string{"get", "patch", "update"}, }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery: single failed GV at /api", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, }, }, }, }, // Single core Group/Version is stale, so no Version within Group. expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{{Name: ""}}, }, // Single core Group/Version is stale, so there are no expected resources. expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{}, expectedFailedGVs: map[schema.GroupVersion]error{ {Group: "", Version: "v1"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "", Version: "v1"}}, }, }, { name: "Aggregated discovery: single failed GV at /apis", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSets", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, }, }, }, }, // Single apps/v1 Group/Version is stale, so no Version within Group. expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{{Name: "apps"}}, }, // Single apps/v1 Group/Version is stale, so there are no expected resources. expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{}, expectedFailedGVs: map[schema.GroupVersion]error{ {Group: "apps", Version: "v1"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "apps", Version: "v1"}}, }, }, { name: "Aggregated discovery: 1 group/2 versions/1 failed GV at /apis", agg: apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ // Stale v2 should report failed GV. { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "daemonsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "DaemonSets", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, // Only apps/v1 is non-stale expected Group/Version expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v1", Version: "v1", }, }, // PreferredVersion must be apps/v1 PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v1", Version: "v1", }, }, }, }, // Only apps/v1 resources expected. expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{ {Group: "apps", Version: "v2"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "apps", Version: "v2"}}, }, }, } for _, test := range tests { apiGroups, resourcesByGV, failedGVs := SplitGroupsAndResources(test.agg) assert.Equal(t, test.expectedFailedGVs, failedGVs) assert.Equal(t, test.expectedGroups, *apiGroups) assert.Equal(t, test.expectedGVResources, resourcesByGV) } } // Duplicated from test above. Remove after 1.33 func TestSplitGroupsAndResourcesV2Beta1(t *testing.T) { tests := []struct { name string agg apidiscoveryv2beta1.APIGroupDiscoveryList expectedGroups metav1.APIGroupList expectedGVResources map[schema.GroupVersion]*metav1.APIResourceList expectedFailedGVs map[schema.GroupVersion]error }{ { name: "Aggregated discovery: core/v1 group and pod resource", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "", Version: "v1"}: { GroupVersion: "v1", APIResources: []metav1.APIResource{ { Name: "pods", Namespaced: true, Group: "", Version: "v1", Kind: "Pod", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/2 versions/1 resources at /apis", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v2", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v2", Version: "v2", }, { GroupVersion: "apps/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v2", Version: "v2", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", }, }, }, {Group: "apps", Version: "v2"}: { GroupVersion: "apps/v2", APIResources: []metav1.APIResource{ { Name: "deployments", Namespaced: true, Group: "apps", Version: "v2", Kind: "Deployment", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery: 1 group/2 resources at /api, 1 group/2 resources at /apis", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "v1", Version: "v1", }, }, { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "", Version: "v1"}: { GroupVersion: "v1", APIResources: []metav1.APIResource{ { Name: "pods", Namespaced: true, Group: "", Version: "v1", Kind: "Pod", }, { Name: "services", Namespaced: true, Group: "", Version: "v1", Kind: "Service", }, }, }, {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", }, { Name: "statefulsets", Namespaced: true, Group: "apps", Version: "v1", Kind: "StatefulSet", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery: multiple groups with cluster-scoped resources", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "namespaces", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Namespace", }, Scope: apidiscoveryv2beta1.ScopeCluster, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "rbac.authorization.k8s.io", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "roles", ResponseKind: &metav1.GroupVersionKind{ Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "Role", }, Scope: apidiscoveryv2beta1.ScopeCluster, }, { Resource: "clusterroles", ResponseKind: &metav1.GroupVersionKind{ Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRole", }, Scope: apidiscoveryv2beta1.ScopeCluster, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "v1", Version: "v1", }, }, { Name: "rbac.authorization.k8s.io", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "rbac.authorization.k8s.io/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "rbac.authorization.k8s.io/v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "", Version: "v1"}: { GroupVersion: "v1", APIResources: []metav1.APIResource{ { Name: "pods", Namespaced: true, Group: "", Version: "v1", Kind: "Pod", }, { Name: "namespaces", Namespaced: false, Group: "", Version: "v1", Kind: "Namespace", }, }, }, {Group: "rbac.authorization.k8s.io", Version: "v1"}: { GroupVersion: "rbac.authorization.k8s.io/v1", APIResources: []metav1.APIResource{ { Name: "roles", Namespaced: false, Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "Role", }, { Name: "clusterroles", Namespaced: false, Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRole", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery with single subresource", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, SingularResource: "deployment", ShortNames: []string{"deploy"}, Verbs: []string{"parentverb1", "parentverb2", "parentverb3", "parentverb4"}, Categories: []string{"all", "testcategory"}, Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{ { Subresource: "scale", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Verbs: []string{"get", "patch", "update"}, }, }, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", Verbs: []string{"parentverb1", "parentverb2", "parentverb3", "parentverb4"}, ShortNames: []string{"deploy"}, Categories: []string{"all", "testcategory"}, }, { Name: "deployments/scale", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", Verbs: []string{"get", "patch", "update"}, }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery with single subresource and parent missing GVK", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "external.metrics.k8s.io", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1beta1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { // resilient to nil GVK for parent Resource: "*", Scope: apidiscoveryv2beta1.ScopeNamespace, SingularResource: "", Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{ { Subresource: "other-external-metric", ResponseKind: &metav1.GroupVersionKind{ Kind: "MetricValueList", }, Verbs: []string{"get"}, }, }, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "external.metrics.k8s.io", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "external.metrics.k8s.io/v1beta1", Version: "v1beta1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "external.metrics.k8s.io/v1beta1", Version: "v1beta1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "external.metrics.k8s.io", Version: "v1beta1"}: { GroupVersion: "external.metrics.k8s.io/v1beta1", APIResources: []metav1.APIResource{ // Since parent GVK was nil, it is NOT returned--only the subresource. { Name: "*/other-external-metric", SingularName: "", Namespaced: true, Group: "", Version: "", Kind: "MetricValueList", Verbs: []string{"get"}, }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery with single subresource and parent empty GVK", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "external.metrics.k8s.io", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1beta1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { // resilient to empty GVK for parent Resource: "*", Scope: apidiscoveryv2beta1.ScopeNamespace, SingularResource: "", ResponseKind: &metav1.GroupVersionKind{}, Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{ { Subresource: "other-external-metric", ResponseKind: &metav1.GroupVersionKind{ Kind: "MetricValueList", }, Verbs: []string{"get"}, }, }, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "external.metrics.k8s.io", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "external.metrics.k8s.io/v1beta1", Version: "v1beta1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "external.metrics.k8s.io/v1beta1", Version: "v1beta1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "external.metrics.k8s.io", Version: "v1beta1"}: { GroupVersion: "external.metrics.k8s.io/v1beta1", APIResources: []metav1.APIResource{ // Since parent GVK was nil, it is NOT returned--only the subresource. { Name: "*/other-external-metric", SingularName: "", Namespaced: true, Group: "", Version: "", Kind: "MetricValueList", Verbs: []string{"get"}, }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery with multiple subresources", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, SingularResource: "deployment", Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{ { Subresource: "scale", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Verbs: []string{"get", "patch", "update"}, }, { Subresource: "status", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Verbs: []string{"get", "patch", "update"}, }, }, }, }, }, }, }, }, }, expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v1", Version: "v1", }, }, }, }, expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", }, { Name: "deployments/scale", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", Verbs: []string{"get", "patch", "update"}, }, { Name: "deployments/status", SingularName: "deployment", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", Verbs: []string{"get", "patch", "update"}, }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{}, }, { name: "Aggregated discovery: single failed GV at /api", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, }, }, }, }, }, // Single core Group/Version is stale, so no Version within Group. expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{{Name: ""}}, }, // Single core Group/Version is stale, so there are no expected resources. expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{}, expectedFailedGVs: map[schema.GroupVersion]error{ {Group: "", Version: "v1"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "", Version: "v1"}}, }, }, { name: "Aggregated discovery: single failed GV at /apis", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSets", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, }, }, }, }, }, // Single apps/v1 Group/Version is stale, so no Version within Group. expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{{Name: "apps"}}, }, // Single apps/v1 Group/Version is stale, so there are no expected resources. expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{}, expectedFailedGVs: map[schema.GroupVersion]error{ {Group: "apps", Version: "v1"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "apps", Version: "v1"}}, }, }, { name: "Aggregated discovery: 1 group/2 versions/1 failed GV at /apis", agg: apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ // Stale v2 should report failed GV. { Version: "v2", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "daemonsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "DaemonSets", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, }, { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, // Only apps/v1 is non-stale expected Group/Version expectedGroups: metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "apps/v1", Version: "v1", }, }, // PreferredVersion must be apps/v1 PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "apps/v1", Version: "v1", }, }, }, }, // Only apps/v1 resources expected. expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{ {Group: "apps", Version: "v1"}: { GroupVersion: "apps/v1", APIResources: []metav1.APIResource{ { Name: "deployments", Namespaced: true, Group: "apps", Version: "v1", Kind: "Deployment", }, }, }, }, expectedFailedGVs: map[schema.GroupVersion]error{ {Group: "apps", Version: "v2"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "apps", Version: "v2"}}, }, }, } for _, test := range tests { apiGroups, resourcesByGV, failedGVs := SplitGroupsAndResourcesV2Beta1(test.agg) assert.Equal(t, test.expectedFailedGVs, failedGVs) assert.Equal(t, test.expectedGroups, *apiGroups) assert.Equal(t, test.expectedGVResources, resourcesByGV) } } kubernetes-client-go-a2dfcab/discovery/cached/000077500000000000000000000000001472614177300216165ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/discovery/cached/disk/000077500000000000000000000000001472614177300225505ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/discovery/cached/disk/cached_discovery.go000066400000000000000000000255001472614177300263770ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package disk import ( "errors" "io" "net/http" "os" "path/filepath" "sync" "time" openapi_v2 "github.com/google/gnostic-models/openapiv2" "k8s.io/klog/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/discovery" "k8s.io/client-go/discovery/cached/memory" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/openapi" cachedopenapi "k8s.io/client-go/openapi/cached" restclient "k8s.io/client-go/rest" ) // CachedDiscoveryClient implements the functions that discovery server-supported API groups, // versions and resources. type CachedDiscoveryClient struct { delegate discovery.DiscoveryInterface // cacheDirectory is the directory where discovery docs are held. It must be unique per host:port combination to work well. cacheDirectory string // ttl is how long the cache should be considered valid ttl time.Duration // mutex protects the variables below mutex sync.Mutex // ourFiles are all filenames of cache files created by this process ourFiles map[string]struct{} // invalidated is true if all cache files should be ignored that are not ours (e.g. after Invalidate() was called) invalidated bool // fresh is true if all used cache files were ours fresh bool // caching openapi v3 client which wraps the delegate's client openapiClient openapi.Client } var _ discovery.CachedDiscoveryInterface = &CachedDiscoveryClient{} // ServerResourcesForGroupVersion returns the supported resources for a group and version. func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { filename := filepath.Join(d.cacheDirectory, groupVersion, "serverresources.json") cachedBytes, err := d.getCachedFile(filename) // don't fail on errors, we either don't have a file or won't be able to run the cached check. Either way we can fallback. if err == nil { cachedResources := &metav1.APIResourceList{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedResources); err == nil { klog.V(10).Infof("returning cached discovery info from %v", filename) return cachedResources, nil } } liveResources, err := d.delegate.ServerResourcesForGroupVersion(groupVersion) if err != nil { klog.V(3).Infof("skipped caching discovery info due to %v", err) return liveResources, err } if liveResources == nil || len(liveResources.APIResources) == 0 { klog.V(3).Infof("skipped caching discovery info, no resources found") return liveResources, err } if err := d.writeCachedFile(filename, liveResources); err != nil { klog.V(1).Infof("failed to write cache to %v due to %v", filename, err) } return liveResources, nil } // ServerGroupsAndResources returns the supported groups and resources for all groups and versions. func (d *CachedDiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { return discovery.ServerGroupsAndResources(d) } // ServerGroups returns the supported groups, with information like supported versions and the // preferred version. func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { filename := filepath.Join(d.cacheDirectory, "servergroups.json") cachedBytes, err := d.getCachedFile(filename) // don't fail on errors, we either don't have a file or won't be able to run the cached check. Either way we can fallback. if err == nil { cachedGroups := &metav1.APIGroupList{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedGroups); err == nil { klog.V(10).Infof("returning cached discovery info from %v", filename) return cachedGroups, nil } } liveGroups, err := d.delegate.ServerGroups() if err != nil { klog.V(3).Infof("skipped caching discovery info due to %v", err) return liveGroups, err } if liveGroups == nil || len(liveGroups.Groups) == 0 { klog.V(3).Infof("skipped caching discovery info, no groups found") return liveGroups, err } if err := d.writeCachedFile(filename, liveGroups); err != nil { klog.V(1).Infof("failed to write cache to %v due to %v", filename, err) } return liveGroups, nil } func (d *CachedDiscoveryClient) getCachedFile(filename string) ([]byte, error) { // after invalidation ignore cache files not created by this process d.mutex.Lock() _, ourFile := d.ourFiles[filename] if d.invalidated && !ourFile { d.mutex.Unlock() return nil, errors.New("cache invalidated") } d.mutex.Unlock() file, err := os.Open(filename) if err != nil { return nil, err } defer file.Close() fileInfo, err := file.Stat() if err != nil { return nil, err } if time.Now().After(fileInfo.ModTime().Add(d.ttl)) { return nil, errors.New("cache expired") } // the cache is present and its valid. Try to read and use it. cachedBytes, err := io.ReadAll(file) if err != nil { return nil, err } d.mutex.Lock() defer d.mutex.Unlock() d.fresh = d.fresh && ourFile return cachedBytes, nil } func (d *CachedDiscoveryClient) writeCachedFile(filename string, obj runtime.Object) error { if err := os.MkdirAll(filepath.Dir(filename), 0750); err != nil { return err } bytes, err := runtime.Encode(scheme.Codecs.LegacyCodec(), obj) if err != nil { return err } f, err := os.CreateTemp(filepath.Dir(filename), filepath.Base(filename)+".") if err != nil { return err } defer os.Remove(f.Name()) _, err = f.Write(bytes) if err != nil { return err } err = os.Chmod(f.Name(), 0660) if err != nil { return err } name := f.Name() err = f.Close() if err != nil { return err } // atomic rename d.mutex.Lock() defer d.mutex.Unlock() err = os.Rename(name, filename) if err == nil { d.ourFiles[filename] = struct{}{} } return err } // RESTClient returns a RESTClient that is used to communicate with API server // by this client implementation. func (d *CachedDiscoveryClient) RESTClient() restclient.Interface { return d.delegate.RESTClient() } // ServerPreferredResources returns the supported resources with the version preferred by the // server. func (d *CachedDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { return discovery.ServerPreferredResources(d) } // ServerPreferredNamespacedResources returns the supported namespaced resources with the // version preferred by the server. func (d *CachedDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { return discovery.ServerPreferredNamespacedResources(d) } // ServerVersion retrieves and parses the server's version (git version). func (d *CachedDiscoveryClient) ServerVersion() (*version.Info, error) { return d.delegate.ServerVersion() } // OpenAPISchema retrieves and parses the swagger API schema the server supports. func (d *CachedDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { return d.delegate.OpenAPISchema() } // OpenAPIV3 retrieves and parses the OpenAPIV3 specs exposed by the server func (d *CachedDiscoveryClient) OpenAPIV3() openapi.Client { // Must take lock since Invalidate call may modify openapiClient d.mutex.Lock() defer d.mutex.Unlock() if d.openapiClient == nil { // Delegate is discovery client created with special HTTP client which // respects E-Tag cache responses to serve cache from disk. d.openapiClient = cachedopenapi.NewClient(d.delegate.OpenAPIV3()) } return d.openapiClient } // Fresh is supposed to tell the caller whether or not to retry if the cache // fails to find something (false = retry, true = no need to retry). func (d *CachedDiscoveryClient) Fresh() bool { d.mutex.Lock() defer d.mutex.Unlock() return d.fresh } // Invalidate enforces that no cached data is used in the future that is older than the current time. func (d *CachedDiscoveryClient) Invalidate() { d.mutex.Lock() defer d.mutex.Unlock() d.ourFiles = map[string]struct{}{} d.fresh = true d.invalidated = true d.openapiClient = nil if ad, ok := d.delegate.(discovery.CachedDiscoveryInterface); ok { ad.Invalidate() } } // WithLegacy returns current cached discovery client; // current client does not support legacy-only discovery. func (d *CachedDiscoveryClient) WithLegacy() discovery.DiscoveryInterface { return d } // NewCachedDiscoveryClientForConfig creates a new DiscoveryClient for the given config, and wraps // the created client in a CachedDiscoveryClient. The provided configuration is updated with a // custom transport that understands cache responses. // We receive two distinct cache directories for now, in order to preserve old behavior // which makes use of the --cache-dir flag value for storing cache data from the CacheRoundTripper, // and makes use of the hardcoded destination (~/.kube/cache/discovery/...) for storing // CachedDiscoveryClient cache data. If httpCacheDir is empty, the restconfig's transport will not // be updated with a roundtripper that understands cache responses. // If discoveryCacheDir is empty, cached server resource data will be looked up in the current directory. func NewCachedDiscoveryClientForConfig(config *restclient.Config, discoveryCacheDir, httpCacheDir string, ttl time.Duration) (*CachedDiscoveryClient, error) { if len(httpCacheDir) > 0 { // update the given restconfig with a custom roundtripper that // understands how to handle cache responses. config = restclient.CopyConfig(config) config.Wrap(func(rt http.RoundTripper) http.RoundTripper { return newCacheRoundTripper(httpCacheDir, rt) }) } discoveryClient, err := discovery.NewDiscoveryClientForConfig(config) if err != nil { return nil, err } // The delegate caches the discovery groups and resources (memcache). "ServerGroups", // which usually only returns (and caches) the groups, can now store the resources as // well if the server supports the newer aggregated discovery format. return newCachedDiscoveryClient(memory.NewMemCacheClient(discoveryClient), discoveryCacheDir, ttl), nil } // NewCachedDiscoveryClient creates a new DiscoveryClient. cacheDirectory is the directory where discovery docs are held. It must be unique per host:port combination to work well. func newCachedDiscoveryClient(delegate discovery.DiscoveryInterface, cacheDirectory string, ttl time.Duration) *CachedDiscoveryClient { return &CachedDiscoveryClient{ delegate: delegate, cacheDirectory: cacheDirectory, ttl: ttl, ourFiles: map[string]struct{}{}, fresh: true, } } kubernetes-client-go-a2dfcab/discovery/cached/disk/cached_discovery_test.go000066400000000000000000000562561472614177300274520ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package disk import ( "encoding/json" "net/http" "net/http/httptest" "os" "path/filepath" "strings" "testing" "time" openapi_v2 "github.com/google/gnostic-models/openapiv2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" apidiscovery "k8s.io/api/apidiscovery/v2" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/discovery" "k8s.io/client-go/openapi" restclient "k8s.io/client-go/rest" "k8s.io/client-go/rest/fake" testutil "k8s.io/client-go/util/testing" ) func TestCachedDiscoveryClient_Fresh(t *testing.T) { assert := assert.New(t) d, err := os.MkdirTemp("", "") assert.NoError(err) defer os.RemoveAll(d) c := fakeDiscoveryClient{} cdc := newCachedDiscoveryClient(&c, d, 60*time.Second) assert.True(cdc.Fresh(), "should be fresh after creation") cdc.ServerGroups() assert.True(cdc.Fresh(), "should be fresh after groups call without cache") assert.Equal(c.groupCalls, 1) cdc.ServerGroups() assert.True(cdc.Fresh(), "should be fresh after another groups call") assert.Equal(c.groupCalls, 1) cdc.ServerGroupsAndResources() assert.True(cdc.Fresh(), "should be fresh after resources call") assert.Equal(c.resourceCalls, 1) cdc.ServerGroupsAndResources() assert.True(cdc.Fresh(), "should be fresh after another resources call") assert.Equal(c.resourceCalls, 1) cdc = newCachedDiscoveryClient(&c, d, 60*time.Second) cdc.ServerGroups() assert.False(cdc.Fresh(), "should NOT be fresh after recreation with existing groups cache") assert.Equal(c.groupCalls, 1) cdc.ServerGroupsAndResources() assert.False(cdc.Fresh(), "should NOT be fresh after recreation with existing resources cache") assert.Equal(c.resourceCalls, 1) cdc.Invalidate() assert.True(cdc.Fresh(), "should be fresh after cache invalidation") cdc.ServerGroupsAndResources() assert.True(cdc.Fresh(), "should ignore existing resources cache after invalidation") assert.Equal(c.resourceCalls, 2) } func TestNewCachedDiscoveryClient_TTL(t *testing.T) { assert := assert.New(t) d, err := os.MkdirTemp("", "") assert.NoError(err) defer os.RemoveAll(d) c := fakeDiscoveryClient{} cdc := newCachedDiscoveryClient(&c, d, 1*time.Nanosecond) cdc.ServerGroups() assert.Equal(c.groupCalls, 1) time.Sleep(1 * time.Second) cdc.ServerGroups() assert.Equal(c.groupCalls, 2) } func TestNewCachedDiscoveryClient_PathPerm(t *testing.T) { assert := assert.New(t) d, err := os.MkdirTemp("", "") assert.NoError(err) os.RemoveAll(d) defer os.RemoveAll(d) c := fakeDiscoveryClient{} cdc := newCachedDiscoveryClient(&c, d, 1*time.Nanosecond) cdc.ServerGroups() err = filepath.Walk(d, func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() { assert.Equal(os.FileMode(0750), info.Mode().Perm()) } else { assert.Equal(os.FileMode(0660), info.Mode().Perm()) } return nil }) assert.NoError(err) } // Tests that schema instances returned by openapi cached and returned after // successive calls func TestOpenAPIDiskCache(t *testing.T) { // Create discovery cache dir (unused) discoCache, err := os.MkdirTemp("", "test-cached-discovery-client-disco-*") require.NoError(t, err) os.RemoveAll(discoCache) defer os.RemoveAll(discoCache) // Create http cache dir httpCache, err := os.MkdirTemp("", "test-cached-discovery-client-http-*") require.NoError(t, err) os.RemoveAll(httpCache) defer os.RemoveAll(httpCache) // Start test OpenAPI server fakeServer, err := testutil.NewFakeOpenAPIV3Server("../../testdata") require.NoError(t, err) defer fakeServer.HttpServer.Close() require.NotEmpty(t, fakeServer.ServedDocuments) client, err := NewCachedDiscoveryClientForConfig( &restclient.Config{Host: fakeServer.HttpServer.URL}, discoCache, httpCache, 1*time.Nanosecond, ) require.NoError(t, err) openapiClient := client.OpenAPIV3() // Ensure initial Paths call hits server _, err = openapiClient.Paths() require.NoError(t, err) assert.Equal(t, 1, fakeServer.RequestCounters["/openapi/v3"]) // Ensure Paths call does hits server again // This is expected since openapiClient is the same instance, so Paths() // should be cached in memory. paths, err := openapiClient.Paths() require.NoError(t, err) assert.Equal(t, 1, fakeServer.RequestCounters["/openapi/v3"]) require.NotEmpty(t, paths) contentTypes := []string{ runtime.ContentTypeJSON, openapi.ContentTypeOpenAPIV3PB, } for _, contentType := range contentTypes { t.Run(contentType, func(t *testing.T) { // Reset all counters (cant just reset to nil since reference is shared) for k := range fakeServer.RequestCounters { delete(fakeServer.RequestCounters, k) } i := 0 for k, v := range paths { i++ _, err = v.Schema(contentType) assert.NoError(t, err) path := "/openapi/v3/" + strings.TrimPrefix(k, "/") assert.Equal(t, 1, fakeServer.RequestCounters[path]) // Ensure schema call is served from memory _, err = v.Schema(contentType) assert.NoError(t, err) assert.Equal(t, 1, fakeServer.RequestCounters[path]) client.Invalidate() // Refetch the schema from a new openapi client to try to force a new // http request newPaths, err := client.OpenAPIV3().Paths() if !assert.NoError(t, err) { continue } // Ensure schema call is still served from disk _, err = newPaths[k].Schema(contentType) assert.NoError(t, err) assert.Equal(t, 1, fakeServer.RequestCounters[path]) } }) } } // Tests function "ServerGroups" when the "unaggregated" discovery is returned. func TestCachedDiscoveryClientUnaggregatedServerGroups(t *testing.T) { tests := []struct { name string corev1 *metav1.APIVersions apis *metav1.APIGroupList expectedGroupNames []string expectedGroupVersions []string }{ { name: "Legacy discovery format: 1 version at /api, 1 group at /apis", corev1: &metav1.APIVersions{ Versions: []string{ "v1", }, }, apis: &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, }, }, expectedGroupNames: []string{"", "extensions"}, expectedGroupVersions: []string{"v1", "extensions/v1beta1"}, }, { name: "Legacy discovery format: 1 version at /api, 2 groups/1 version at /apis", corev1: &metav1.APIVersions{ Versions: []string{ "v1", }, }, apis: &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "apps/v1"}, }, }, { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, }, }, expectedGroupNames: []string{"", "apps", "extensions"}, expectedGroupVersions: []string{"v1", "apps/v1", "extensions/v1beta1"}, }, { name: "Legacy discovery format: 1 version at /api, 2 groups/2 versions at /apis", corev1: &metav1.APIVersions{ Versions: []string{ "v1", }, }, apis: &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "batch", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "batch/v1"}, }, }, { Name: "batch", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "batch/v1beta1"}, }, }, { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1alpha1"}, }, }, }, }, expectedGroupNames: []string{ "", "batch", "extensions", }, expectedGroupVersions: []string{ "v1", "batch/v1", "batch/v1beta1", "extensions/v1beta1", "extensions/v1alpha1", }, }, } for _, test := range tests { // Create discovery cache dir discoCache, err := os.MkdirTemp("", "test-cached-discovery-client-disco-*") require.NoError(t, err) os.RemoveAll(discoCache) defer os.RemoveAll(discoCache) // Create http cache dir (unused) httpCache, err := os.MkdirTemp("", "test-cached-discovery-client-http-*") require.NoError(t, err) os.RemoveAll(httpCache) defer os.RemoveAll(httpCache) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var body interface{} switch req.URL.Path { case "/api": body = test.corev1 case "/apis": body = test.apis default: w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(body) require.NoError(t, err) // Content-type is "unaggregated" discovery format -- no resources returned. w.Header().Set("Content-Type", discovery.AcceptV1) w.WriteHeader(http.StatusOK) w.Write(output) })) defer server.Close() client, err := NewCachedDiscoveryClientForConfig( &restclient.Config{Host: server.URL}, discoCache, httpCache, 1*time.Nanosecond, ) require.NoError(t, err) apiGroupList, err := client.ServerGroups() require.NoError(t, err) // Discovery groups cached in servergroups.json file. numFound, err := numFilesFound(discoCache, "servergroups.json") assert.NoError(t, err) assert.Equal(t, 1, numFound, "%s: expected 1 discovery cache file servergroups.json found, got %d", test.name, numFound) // Test expected groups returned by server groups. expectedGroupNames := sets.NewString(test.expectedGroupNames...) actualGroupNames := sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) // Test the expected group versions for the aggregated discovery is correct. expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) actualGroupVersions := sets.NewString(groupVersionsFromGroups(apiGroupList)...) assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), "%s: Expected group/versions (%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) } } // Aggregated discovery format returned func TestCachedDiscoveryClientAggregatedServerGroups(t *testing.T) { tests := []struct { name string corev1 *apidiscovery.APIGroupDiscoveryList apis *apidiscovery.APIGroupDiscoveryList expectedGroupNames []string expectedGroupVersions []string expectedPreferredVersions []string }{ { name: "Aggregated cached discovery: 1 group/1 version at /api, 1 group/1 version at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedPreferredVersions: []string{"v1", "apps/v1"}, }, { name: "Aggregated discovery: 1 group/1 version at /api, 1 group/2 versions at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ // v2 is preferred since it is first { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1", "apps/v2"}, expectedPreferredVersions: []string{"v1", "apps/v2"}, }, { name: "Aggregated discovery: /api returns nothing, 2 groups at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{}, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ // v1 is preferred since it is first { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"apps", "batch"}, expectedGroupVersions: []string{"apps/v1", "batch/v1", "batch/v1beta1"}, expectedPreferredVersions: []string{"apps/v1", "batch/v1"}, }, } for _, test := range tests { // Create discovery cache dir discoCache, err := os.MkdirTemp("", "test-cached-discovery-client-disco-*") require.NoError(t, err) os.RemoveAll(discoCache) defer os.RemoveAll(discoCache) // Create http cache dir (unused) httpCache, err := os.MkdirTemp("", "test-cached-discovery-client-http-*") require.NoError(t, err) os.RemoveAll(httpCache) defer os.RemoveAll(httpCache) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1 case "/apis": agg = test.apis default: w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(agg) if err != nil { t.Fatalf("unexpected encoding error: %v", err) return } // Content-type is "aggregated" discovery format. w.Header().Set("Content-Type", discovery.AcceptV2) w.WriteHeader(http.StatusOK) w.Write(output) })) defer server.Close() client, err := NewCachedDiscoveryClientForConfig( &restclient.Config{Host: server.URL}, discoCache, httpCache, 1*time.Nanosecond, ) require.NoError(t, err) apiGroupList, err := client.ServerGroups() require.NoError(t, err) // Discovery groups cached in servergroups.json file. numFound, err := numFilesFound(discoCache, "servergroups.json") assert.NoError(t, err) assert.Equal(t, 1, numFound, "%s: expected 1 discovery cache file servergroups.json found, got %d", test.name, numFound) // Test expected groups returned by server groups. expectedGroupNames := sets.NewString(test.expectedGroupNames...) actualGroupNames := sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) // Test the expected group versions for the aggregated discovery is correct. expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) actualGroupVersions := sets.NewString(groupVersionsFromGroups(apiGroupList)...) assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), "%s: Expected group/versions (%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) // Test the groups preferred version is correct. expectedPreferredVersions := sets.NewString(test.expectedPreferredVersions...) actualPreferredVersions := sets.NewString(preferredVersionsFromList(apiGroupList)...) assert.True(t, expectedPreferredVersions.Equal(actualPreferredVersions), "%s: Expected preferred group/version (%s), got (%s)", test.name, expectedPreferredVersions.List(), actualPreferredVersions.List()) } } func numFilesFound(dir string, filename string) (int, error) { numFound := 0 err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.Name() == filename { numFound++ } return nil }) if err != nil { return 0, err } return numFound, nil } type fakeDiscoveryClient struct { groupCalls int resourceCalls int versionCalls int openAPICalls int serverResourcesHandler func() ([]*metav1.APIResourceList, error) } var _ discovery.DiscoveryInterface = &fakeDiscoveryClient{} func (c *fakeDiscoveryClient) RESTClient() restclient.Interface { return &fake.RESTClient{} } func (c *fakeDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { c.groupCalls = c.groupCalls + 1 return c.serverGroups() } func (c *fakeDiscoveryClient) serverGroups() (*metav1.APIGroupList, error) { return &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "a", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "a/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "a/v1", Version: "v1", }, }, }, }, nil } func (c *fakeDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { c.resourceCalls = c.resourceCalls + 1 if groupVersion == "a/v1" { return &metav1.APIResourceList{APIResources: []metav1.APIResource{{Name: "widgets", Kind: "Widget"}}}, nil } return nil, errors.NewNotFound(schema.GroupResource{}, "") } func (c *fakeDiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { c.resourceCalls = c.resourceCalls + 1 gs, _ := c.serverGroups() resultGroups := []*metav1.APIGroup{} for i := range gs.Groups { resultGroups = append(resultGroups, &gs.Groups[i]) } if c.serverResourcesHandler != nil { rs, err := c.serverResourcesHandler() return resultGroups, rs, err } return resultGroups, []*metav1.APIResourceList{}, nil } func (c *fakeDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { c.resourceCalls = c.resourceCalls + 1 return nil, nil } func (c *fakeDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { c.resourceCalls = c.resourceCalls + 1 return nil, nil } func (c *fakeDiscoveryClient) ServerVersion() (*version.Info, error) { c.versionCalls = c.versionCalls + 1 return &version.Info{}, nil } func (c *fakeDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { c.openAPICalls = c.openAPICalls + 1 return &openapi_v2.Document{}, nil } func (d *fakeDiscoveryClient) OpenAPIV3() openapi.Client { panic("unimplemented") } func (d *fakeDiscoveryClient) WithLegacy() discovery.DiscoveryInterface { panic("unimplemented") } func groupNamesFromList(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { result = append(result, group.Name) } return result } func preferredVersionsFromList(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { preferredGV := group.PreferredVersion.GroupVersion result = append(result, preferredGV) } return result } func groupVersionsFromGroups(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { for _, version := range group.Versions { result = append(result, version.GroupVersion) } } return result } kubernetes-client-go-a2dfcab/discovery/cached/disk/round_tripper.go000066400000000000000000000075471472614177300260100ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package disk import ( "bytes" "crypto/sha256" "fmt" "net/http" "os" "path/filepath" "github.com/gregjones/httpcache" "github.com/peterbourgon/diskv" "k8s.io/klog/v2" ) type cacheRoundTripper struct { rt *httpcache.Transport } // newCacheRoundTripper creates a roundtripper that reads the ETag on // response headers and send the If-None-Match header on subsequent // corresponding requests. func newCacheRoundTripper(cacheDir string, rt http.RoundTripper) http.RoundTripper { d := diskv.New(diskv.Options{ PathPerm: os.FileMode(0750), FilePerm: os.FileMode(0660), BasePath: cacheDir, TempDir: filepath.Join(cacheDir, ".diskv-temp"), }) t := httpcache.NewTransport(&sumDiskCache{disk: d}) t.Transport = rt return &cacheRoundTripper{rt: t} } func (rt *cacheRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { return rt.rt.RoundTrip(req) } func (rt *cacheRoundTripper) CancelRequest(req *http.Request) { type canceler interface { CancelRequest(*http.Request) } if cr, ok := rt.rt.Transport.(canceler); ok { cr.CancelRequest(req) } else { klog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport) } } func (rt *cacheRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt.Transport } // A sumDiskCache is a cache backend for github.com/gregjones/httpcache. It is // similar to httpcache's diskcache package, but uses SHA256 sums to ensure // cache integrity at read time rather than fsyncing each cache entry to // increase the likelihood they will be persisted at write time. This avoids // significant performance degradation on MacOS. // // See https://github.com/kubernetes/kubernetes/issues/110753 for more. type sumDiskCache struct { disk *diskv.Diskv } // Get the requested key from the cache on disk. If Get encounters an error, or // the returned value is not a SHA256 sum followed by bytes with a matching // checksum it will return false to indicate a cache miss. func (c *sumDiskCache) Get(key string) ([]byte, bool) { b, err := c.disk.Read(sanitize(key)) if err != nil || len(b) < sha256.Size { return []byte{}, false } response := b[sha256.Size:] want := b[:sha256.Size] // The first 32 bytes of the file should be the SHA256 sum. got := sha256.Sum256(response) if !bytes.Equal(want, got[:]) { return []byte{}, false } return response, true } // Set writes the response to a file on disk. The filename will be the SHA256 // sum of the key. The file will contain a SHA256 sum of the response bytes, // followed by said response bytes. func (c *sumDiskCache) Set(key string, response []byte) { s := sha256.Sum256(response) _ = c.disk.Write(sanitize(key), append(s[:], response...)) // Nothing we can do with this error. } func (c *sumDiskCache) Delete(key string) { _ = c.disk.Erase(sanitize(key)) // Nothing we can do with this error. } // Sanitize an httpcache key such that it can be used as a diskv key, which must // be a valid filename. The httpcache key will either be the requested URL (if // the request method was GET) or " " for other methods, per the // httpcache.cacheKey function. func sanitize(key string) string { // These keys are not sensitive. We use sha256 to avoid a (potentially // malicious) collision causing the wrong cache data to be written or // accessed. return fmt.Sprintf("%x", sha256.Sum256([]byte(key))) } kubernetes-client-go-a2dfcab/discovery/cached/disk/round_tripper_test.go000066400000000000000000000175201472614177300270370ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package disk import ( "bytes" "crypto/sha256" "io" "net/http" "net/url" "os" "path/filepath" "testing" "github.com/peterbourgon/diskv" "github.com/stretchr/testify/assert" ) // copied from k8s.io/client-go/transport/round_trippers_test.go type testRoundTripper struct { Request *http.Request Response *http.Response Err error } func (rt *testRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { rt.Request = req return rt.Response, rt.Err } func BenchmarkDiskCache(b *testing.B) { cacheDir, err := os.MkdirTemp("", "cache-rt") if err != nil { b.Fatal(err) } defer os.RemoveAll(cacheDir) d := diskv.New(diskv.Options{ PathPerm: os.FileMode(0750), FilePerm: os.FileMode(0660), BasePath: cacheDir, TempDir: filepath.Join(cacheDir, ".diskv-temp"), }) k := "localhost:8080/apis/batch/v1.json" v, err := os.ReadFile("../../testdata/apis/batch/v1.json") if err != nil { b.Fatal(err) } c := sumDiskCache{disk: d} for n := 0; n < b.N; n++ { c.Set(k, v) c.Get(k) c.Delete(k) } } func TestCacheRoundTripper(t *testing.T) { rt := &testRoundTripper{} cacheDir, err := os.MkdirTemp("", "cache-rt") defer os.RemoveAll(cacheDir) if err != nil { t.Fatal(err) } cache := newCacheRoundTripper(cacheDir, rt) // First call, caches the response req := &http.Request{ Method: http.MethodGet, URL: &url.URL{Host: "localhost"}, } rt.Response = &http.Response{ Header: http.Header{"ETag": []string{`"123456"`}}, Body: io.NopCloser(bytes.NewReader([]byte("Content"))), StatusCode: http.StatusOK, } resp, err := cache.RoundTrip(req) if err != nil { t.Fatal(err) } content, err := io.ReadAll(resp.Body) if err != nil { t.Fatal(err) } if string(content) != "Content" { t.Errorf(`Expected Body to be "Content", got %q`, string(content)) } // Second call, returns cached response req = &http.Request{ Method: http.MethodGet, URL: &url.URL{Host: "localhost"}, } rt.Response = &http.Response{ StatusCode: http.StatusNotModified, Body: io.NopCloser(bytes.NewReader([]byte("Other Content"))), } resp, err = cache.RoundTrip(req) if err != nil { t.Fatal(err) } // Read body and make sure we have the initial content content, err = io.ReadAll(resp.Body) resp.Body.Close() if err != nil { t.Fatal(err) } if string(content) != "Content" { t.Errorf("Invalid content read from cache %q", string(content)) } } func TestCacheRoundTripperPathPerm(t *testing.T) { assert := assert.New(t) rt := &testRoundTripper{} cacheDir, err := os.MkdirTemp("", "cache-rt") os.RemoveAll(cacheDir) defer os.RemoveAll(cacheDir) if err != nil { t.Fatal(err) } cache := newCacheRoundTripper(cacheDir, rt) // First call, caches the response req := &http.Request{ Method: http.MethodGet, URL: &url.URL{Host: "localhost"}, } rt.Response = &http.Response{ Header: http.Header{"ETag": []string{`"123456"`}}, Body: io.NopCloser(bytes.NewReader([]byte("Content"))), StatusCode: http.StatusOK, } resp, err := cache.RoundTrip(req) if err != nil { t.Fatal(err) } content, err := io.ReadAll(resp.Body) if err != nil { t.Fatal(err) } if string(content) != "Content" { t.Errorf(`Expected Body to be "Content", got %q`, string(content)) } err = filepath.Walk(cacheDir, func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() { assert.Equal(os.FileMode(0750), info.Mode().Perm()) } else { assert.Equal(os.FileMode(0660), info.Mode().Perm()) } return nil }) assert.NoError(err) } func TestSumDiskCache(t *testing.T) { assert := assert.New(t) // Ensure that we'll return a cache miss if the backing file doesn't exist. t.Run("NoSuchKey", func(t *testing.T) { cacheDir, err := os.MkdirTemp("", "cache-test") if err != nil { t.Fatal(err) } defer os.RemoveAll(cacheDir) d := diskv.New(diskv.Options{BasePath: cacheDir, TempDir: filepath.Join(cacheDir, ".diskv-temp")}) c := &sumDiskCache{disk: d} key := "testing" got, ok := c.Get(key) assert.False(ok) assert.Equal([]byte{}, got) }) // Ensure that we'll return a cache miss if the backing file is empty. t.Run("EmptyFile", func(t *testing.T) { cacheDir, err := os.MkdirTemp("", "cache-test") if err != nil { t.Fatal(err) } defer os.RemoveAll(cacheDir) d := diskv.New(diskv.Options{BasePath: cacheDir, TempDir: filepath.Join(cacheDir, ".diskv-temp")}) c := &sumDiskCache{disk: d} key := "testing" f, err := os.Create(filepath.Join(cacheDir, sanitize(key))) if err != nil { t.Fatal(err) } f.Close() got, ok := c.Get(key) assert.False(ok) assert.Equal([]byte{}, got) }) // Ensure that we'll return a cache miss if the backing has an invalid // checksum. t.Run("InvalidChecksum", func(t *testing.T) { cacheDir, err := os.MkdirTemp("", "cache-test") if err != nil { t.Fatal(err) } defer os.RemoveAll(cacheDir) d := diskv.New(diskv.Options{BasePath: cacheDir, TempDir: filepath.Join(cacheDir, ".diskv-temp")}) c := &sumDiskCache{disk: d} key := "testing" value := []byte("testing") mismatchedValue := []byte("testink") sum := sha256.Sum256(value) // Create a file with the sum of 'value' followed by the bytes of // 'mismatchedValue'. f, err := os.Create(filepath.Join(cacheDir, sanitize(key))) if err != nil { t.Fatal(err) } f.Write(sum[:]) f.Write(mismatchedValue) f.Close() // The mismatched checksum should result in a cache miss. got, ok := c.Get(key) assert.False(ok) assert.Equal([]byte{}, got) }) // Ensure that our disk cache will happily cache over the top of an existing // value. We depend on this behaviour to recover from corrupted cache // entries. When Get detects a bad checksum it will return a cache miss. // This should cause httpcache to fall back to its underlying transport and // to subsequently cache the new value, overwriting the corrupt one. t.Run("OverwriteExistingKey", func(t *testing.T) { cacheDir, err := os.MkdirTemp("", "cache-test") if err != nil { t.Fatal(err) } defer os.RemoveAll(cacheDir) d := diskv.New(diskv.Options{BasePath: cacheDir, TempDir: filepath.Join(cacheDir, ".diskv-temp")}) c := &sumDiskCache{disk: d} key := "testing" value := []byte("cool value!") // Write a value. c.Set(key, value) got, ok := c.Get(key) // Ensure we can read back what we wrote. assert.True(ok) assert.Equal(value, got) differentValue := []byte("I'm different!") // Write a different value. c.Set(key, differentValue) got, ok = c.Get(key) // Ensure we can read back the different value. assert.True(ok) assert.Equal(differentValue, got) }) // Ensure that deleting a key does in fact delete it. t.Run("DeleteKey", func(t *testing.T) { cacheDir, err := os.MkdirTemp("", "cache-test") if err != nil { t.Fatal(err) } defer os.RemoveAll(cacheDir) d := diskv.New(diskv.Options{BasePath: cacheDir, TempDir: filepath.Join(cacheDir, ".diskv-temp")}) c := &sumDiskCache{disk: d} key := "testing" value := []byte("coolValue") c.Set(key, value) // Ensure we successfully set the value. got, ok := c.Get(key) assert.True(ok) assert.Equal(value, got) c.Delete(key) // Ensure the value is gone. got, ok = c.Get(key) assert.False(ok) assert.Equal([]byte{}, got) // Ensure that deleting a non-existent value is a no-op. c.Delete(key) }) } kubernetes-client-go-a2dfcab/discovery/cached/legacy.go000066400000000000000000000017651472614177300234220ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package memory import ( "k8s.io/client-go/discovery" "k8s.io/client-go/discovery/cached/memory" ) // NewMemCacheClient is DEPRECATED. Use memory.NewMemCacheClient directly. func NewMemCacheClient(delegate discovery.DiscoveryInterface) discovery.CachedDiscoveryInterface { return memory.NewMemCacheClient(delegate) } // ErrCacheNotFound is DEPRECATED. Use memory.ErrCacheNotFound directly. var ErrCacheNotFound = memory.ErrCacheNotFound kubernetes-client-go-a2dfcab/discovery/cached/memory/000077500000000000000000000000001472614177300231265ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/discovery/cached/memory/memcache.go000066400000000000000000000240071472614177300252220ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package memory import ( "errors" "fmt" "sync" "syscall" openapi_v2 "github.com/google/gnostic-models/openapiv2" errorsutil "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/discovery" "k8s.io/client-go/openapi" cachedopenapi "k8s.io/client-go/openapi/cached" restclient "k8s.io/client-go/rest" "k8s.io/klog/v2" ) type cacheEntry struct { resourceList *metav1.APIResourceList err error } // memCacheClient can Invalidate() to stay up-to-date with discovery // information. // // TODO: Switch to a watch interface. Right now it will poll after each // Invalidate() call. type memCacheClient struct { delegate discovery.DiscoveryInterface lock sync.RWMutex groupToServerResources map[string]*cacheEntry groupList *metav1.APIGroupList cacheValid bool openapiClient openapi.Client receivedAggregatedDiscovery bool } // Error Constants var ( ErrCacheNotFound = errors.New("not found") ) // Server returning empty ResourceList for Group/Version. type emptyResponseError struct { gv string } func (e *emptyResponseError) Error() string { return fmt.Sprintf("received empty response for: %s", e.gv) } var _ discovery.CachedDiscoveryInterface = &memCacheClient{} // isTransientConnectionError checks whether given error is "Connection refused" or // "Connection reset" error which usually means that apiserver is temporarily // unavailable. func isTransientConnectionError(err error) bool { var errno syscall.Errno if errors.As(err, &errno) { return errno == syscall.ECONNREFUSED || errno == syscall.ECONNRESET } return false } func isTransientError(err error) bool { if isTransientConnectionError(err) { return true } if t, ok := err.(errorsutil.APIStatus); ok && t.Status().Code >= 500 { return true } return errorsutil.IsTooManyRequests(err) } // ServerResourcesForGroupVersion returns the supported resources for a group and version. func (d *memCacheClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { d.lock.Lock() defer d.lock.Unlock() if !d.cacheValid { if err := d.refreshLocked(); err != nil { return nil, err } } cachedVal, ok := d.groupToServerResources[groupVersion] if !ok { return nil, ErrCacheNotFound } if cachedVal.err != nil && isTransientError(cachedVal.err) { r, err := d.serverResourcesForGroupVersion(groupVersion) if err != nil { // Don't log "empty response" as an error; it is a common response for metrics. if _, emptyErr := err.(*emptyResponseError); emptyErr { // Log at same verbosity as disk cache. klog.V(3).Infof("%v", err) } else { utilruntime.HandleError(fmt.Errorf("couldn't get resource list for %v: %v", groupVersion, err)) } } cachedVal = &cacheEntry{r, err} d.groupToServerResources[groupVersion] = cachedVal } return cachedVal.resourceList, cachedVal.err } // ServerGroupsAndResources returns the groups and supported resources for all groups and versions. func (d *memCacheClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { return discovery.ServerGroupsAndResources(d) } // GroupsAndMaybeResources returns the list of APIGroups, and possibly the map of group/version // to resources. The returned groups will never be nil, but the resources map can be nil // if there are no cached resources. func (d *memCacheClient) GroupsAndMaybeResources() (*metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) { d.lock.Lock() defer d.lock.Unlock() if !d.cacheValid { if err := d.refreshLocked(); err != nil { return nil, nil, nil, err } } // Build the resourceList from the cache? var resourcesMap map[schema.GroupVersion]*metav1.APIResourceList var failedGVs map[schema.GroupVersion]error if d.receivedAggregatedDiscovery && len(d.groupToServerResources) > 0 { resourcesMap = map[schema.GroupVersion]*metav1.APIResourceList{} failedGVs = map[schema.GroupVersion]error{} for gv, cacheEntry := range d.groupToServerResources { groupVersion, err := schema.ParseGroupVersion(gv) if err != nil { return nil, nil, nil, fmt.Errorf("failed to parse group version (%v): %v", gv, err) } if cacheEntry.err != nil { failedGVs[groupVersion] = cacheEntry.err } else { resourcesMap[groupVersion] = cacheEntry.resourceList } } } return d.groupList, resourcesMap, failedGVs, nil } func (d *memCacheClient) ServerGroups() (*metav1.APIGroupList, error) { groups, _, _, err := d.GroupsAndMaybeResources() if err != nil { return nil, err } return groups, nil } func (d *memCacheClient) RESTClient() restclient.Interface { return d.delegate.RESTClient() } func (d *memCacheClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { return discovery.ServerPreferredResources(d) } func (d *memCacheClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { return discovery.ServerPreferredNamespacedResources(d) } func (d *memCacheClient) ServerVersion() (*version.Info, error) { return d.delegate.ServerVersion() } func (d *memCacheClient) OpenAPISchema() (*openapi_v2.Document, error) { return d.delegate.OpenAPISchema() } func (d *memCacheClient) OpenAPIV3() openapi.Client { // Must take lock since Invalidate call may modify openapiClient d.lock.Lock() defer d.lock.Unlock() if d.openapiClient == nil { d.openapiClient = cachedopenapi.NewClient(d.delegate.OpenAPIV3()) } return d.openapiClient } func (d *memCacheClient) Fresh() bool { d.lock.RLock() defer d.lock.RUnlock() // Return whether the cache is populated at all. It is still possible that // a single entry is missing due to transient errors and the attempt to read // that entry will trigger retry. return d.cacheValid } // Invalidate enforces that no cached data that is older than the current time // is used. func (d *memCacheClient) Invalidate() { d.lock.Lock() defer d.lock.Unlock() d.cacheValid = false d.groupToServerResources = nil d.groupList = nil d.openapiClient = nil d.receivedAggregatedDiscovery = false if ad, ok := d.delegate.(discovery.CachedDiscoveryInterface); ok { ad.Invalidate() } } // refreshLocked refreshes the state of cache. The caller must hold d.lock for // writing. func (d *memCacheClient) refreshLocked() error { // TODO: Could this multiplicative set of calls be replaced by a single call // to ServerResources? If it's possible for more than one resulting // APIResourceList to have the same GroupVersion, the lists would need merged. var gl *metav1.APIGroupList var err error if ad, ok := d.delegate.(discovery.AggregatedDiscoveryInterface); ok { var resources map[schema.GroupVersion]*metav1.APIResourceList var failedGVs map[schema.GroupVersion]error gl, resources, failedGVs, err = ad.GroupsAndMaybeResources() if resources != nil && err == nil { // Cache the resources. d.groupToServerResources = map[string]*cacheEntry{} d.groupList = gl for gv, resources := range resources { d.groupToServerResources[gv.String()] = &cacheEntry{resources, nil} } // Cache GroupVersion discovery errors for gv, err := range failedGVs { d.groupToServerResources[gv.String()] = &cacheEntry{nil, err} } d.receivedAggregatedDiscovery = true d.cacheValid = true return nil } } else { gl, err = d.delegate.ServerGroups() } if err != nil || len(gl.Groups) == 0 { utilruntime.HandleError(fmt.Errorf("couldn't get current server API group list: %v", err)) return err } wg := &sync.WaitGroup{} resultLock := &sync.Mutex{} rl := map[string]*cacheEntry{} for _, g := range gl.Groups { for _, v := range g.Versions { gv := v.GroupVersion wg.Add(1) go func() { defer wg.Done() defer utilruntime.HandleCrash() r, err := d.serverResourcesForGroupVersion(gv) if err != nil { // Don't log "empty response" as an error; it is a common response for metrics. if _, emptyErr := err.(*emptyResponseError); emptyErr { // Log at same verbosity as disk cache. klog.V(3).Infof("%v", err) } else { utilruntime.HandleError(fmt.Errorf("couldn't get resource list for %v: %v", gv, err)) } } resultLock.Lock() defer resultLock.Unlock() rl[gv] = &cacheEntry{r, err} }() } } wg.Wait() d.groupToServerResources, d.groupList = rl, gl d.cacheValid = true return nil } func (d *memCacheClient) serverResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { r, err := d.delegate.ServerResourcesForGroupVersion(groupVersion) if err != nil { return r, err } if len(r.APIResources) == 0 { return r, &emptyResponseError{gv: groupVersion} } return r, nil } // WithLegacy returns current memory-cached discovery client; // current client does not support legacy-only discovery. func (d *memCacheClient) WithLegacy() discovery.DiscoveryInterface { return d } // NewMemCacheClient creates a new CachedDiscoveryInterface which caches // discovery information in memory and will stay up-to-date if Invalidate is // called with regularity. // // NOTE: The client will NOT resort to live lookups on cache misses. func NewMemCacheClient(delegate discovery.DiscoveryInterface) discovery.CachedDiscoveryInterface { return &memCacheClient{ delegate: delegate, groupToServerResources: map[string]*cacheEntry{}, receivedAggregatedDiscovery: false, } } kubernetes-client-go-a2dfcab/discovery/cached/memory/memcache_test.go000066400000000000000000001254121472614177300262630ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package memory import ( "encoding/json" "errors" "fmt" "net/http" "net/http/httptest" "reflect" "sync" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" apidiscovery "k8s.io/api/apidiscovery/v2" errorsutil "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/discovery" "k8s.io/client-go/discovery/fake" "k8s.io/client-go/openapi" "k8s.io/client-go/rest" testutil "k8s.io/client-go/util/testing" ) type resourceMapEntry struct { list *metav1.APIResourceList err error } type fakeDiscovery struct { *fake.FakeDiscovery lock sync.Mutex groupList *metav1.APIGroupList groupListErr error resourceMap map[string]*resourceMapEntry } func (c *fakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { c.lock.Lock() defer c.lock.Unlock() if rl, ok := c.resourceMap[groupVersion]; ok { return rl.list, rl.err } return nil, errors.New("doesn't exist") } func (c *fakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) { c.lock.Lock() defer c.lock.Unlock() if c.groupList == nil { return nil, errors.New("doesn't exist") } return c.groupList, c.groupListErr } func TestClient(t *testing.T) { fake := &fakeDiscovery{ groupList: &metav1.APIGroupList{ Groups: []metav1.APIGroup{{ Name: "astronomy", Versions: []metav1.GroupVersionForDiscovery{{ GroupVersion: "astronomy/v8beta1", Version: "v8beta1", }}, }}, }, resourceMap: map[string]*resourceMapEntry{ "astronomy/v8beta1": { list: &metav1.APIResourceList{ GroupVersion: "astronomy/v8beta1", APIResources: []metav1.APIResource{{ Name: "dwarfplanets", SingularName: "dwarfplanet", Namespaced: true, Kind: "DwarfPlanet", ShortNames: []string{"dp"}, }}, }, }, }, } c := NewMemCacheClient(fake) if c.Fresh() { t.Errorf("Expected not fresh.") } g, err := c.ServerGroups() if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := fake.groupList, g; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } if !c.Fresh() { t.Errorf("Expected fresh.") } c.Invalidate() if c.Fresh() { t.Errorf("Expected not fresh.") } g, err = c.ServerGroups() if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := fake.groupList, g; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } if !c.Fresh() { t.Errorf("Expected fresh.") } r, err := c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := fake.resourceMap["astronomy/v8beta1"].list, r; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } fake.lock.Lock() fake.resourceMap = map[string]*resourceMapEntry{ "astronomy/v8beta1": { list: &metav1.APIResourceList{ GroupVersion: "astronomy/v8beta1", APIResources: []metav1.APIResource{{ Name: "stars", SingularName: "star", Namespaced: true, Kind: "Star", ShortNames: []string{"s"}, }}, }, }, } fake.lock.Unlock() c.Invalidate() r, err = c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := fake.resourceMap["astronomy/v8beta1"].list, r; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } func TestServerGroupsFails(t *testing.T) { fake := &fakeDiscovery{ groupList: &metav1.APIGroupList{ Groups: []metav1.APIGroup{{ Name: "astronomy", Versions: []metav1.GroupVersionForDiscovery{{ GroupVersion: "astronomy/v8beta1", Version: "v8beta1", }}, }}, }, groupListErr: errors.New("some error"), resourceMap: map[string]*resourceMapEntry{ "astronomy/v8beta1": { list: &metav1.APIResourceList{ GroupVersion: "astronomy/v8beta1", APIResources: []metav1.APIResource{{ Name: "dwarfplanets", SingularName: "dwarfplanet", Namespaced: true, Kind: "DwarfPlanet", ShortNames: []string{"dp"}, }}, }, }, }, } c := NewMemCacheClient(fake) if c.Fresh() { t.Errorf("Expected not fresh.") } _, err := c.ServerGroups() if err == nil { t.Errorf("Expected error") } if c.Fresh() { t.Errorf("Expected not fresh.") } fake.lock.Lock() fake.groupListErr = nil fake.lock.Unlock() r, err := c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := fake.resourceMap["astronomy/v8beta1"].list, r; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } if !c.Fresh() { t.Errorf("Expected not fresh.") } } func TestPartialPermanentFailure(t *testing.T) { fake := &fakeDiscovery{ groupList: &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "astronomy", Versions: []metav1.GroupVersionForDiscovery{{ GroupVersion: "astronomy/v8beta1", Version: "v8beta1", }}, }, { Name: "astronomy2", Versions: []metav1.GroupVersionForDiscovery{{ GroupVersion: "astronomy2/v8beta1", Version: "v8beta1", }}, }, }, }, resourceMap: map[string]*resourceMapEntry{ "astronomy/v8beta1": { err: errors.New("some permanent error"), }, "astronomy2/v8beta1": { list: &metav1.APIResourceList{ GroupVersion: "astronomy2/v8beta1", APIResources: []metav1.APIResource{{ Name: "dwarfplanets", SingularName: "dwarfplanet", Namespaced: true, Kind: "DwarfPlanet", ShortNames: []string{"dp"}, }}, }, }, }, } c := NewMemCacheClient(fake) if c.Fresh() { t.Errorf("Expected not fresh.") } r, err := c.ServerResourcesForGroupVersion("astronomy2/v8beta1") if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := fake.resourceMap["astronomy2/v8beta1"].list, r; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } _, err = c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err == nil { t.Errorf("Expected error, got nil") } fake.lock.Lock() fake.resourceMap["astronomy/v8beta1"] = &resourceMapEntry{ list: &metav1.APIResourceList{ GroupVersion: "astronomy/v8beta1", APIResources: []metav1.APIResource{{ Name: "dwarfplanets", SingularName: "dwarfplanet", Namespaced: true, Kind: "DwarfPlanet", ShortNames: []string{"dp"}, }}, }, err: nil, } fake.lock.Unlock() // We don't retry permanent errors, so it should fail. _, err = c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err == nil { t.Errorf("Expected error, got nil") } c.Invalidate() // After Invalidate, we should retry. r, err = c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := fake.resourceMap["astronomy/v8beta1"].list, r; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } func TestPartialRetryableFailure(t *testing.T) { fake := &fakeDiscovery{ groupList: &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "astronomy", Versions: []metav1.GroupVersionForDiscovery{{ GroupVersion: "astronomy/v8beta1", Version: "v8beta1", }}, }, { Name: "astronomy2", Versions: []metav1.GroupVersionForDiscovery{{ GroupVersion: "astronomy2/v8beta1", Version: "v8beta1", }}, }, }, }, resourceMap: map[string]*resourceMapEntry{ "astronomy/v8beta1": { err: &errorsutil.StatusError{ ErrStatus: metav1.Status{ Message: "Some retryable error", Code: int32(http.StatusServiceUnavailable), Reason: metav1.StatusReasonServiceUnavailable, }, }, }, "astronomy2/v8beta1": { list: &metav1.APIResourceList{ GroupVersion: "astronomy2/v8beta1", APIResources: []metav1.APIResource{{ Name: "dwarfplanets", SingularName: "dwarfplanet", Namespaced: true, Kind: "DwarfPlanet", ShortNames: []string{"dp"}, }}, }, }, }, } c := NewMemCacheClient(fake) if c.Fresh() { t.Errorf("Expected not fresh.") } r, err := c.ServerResourcesForGroupVersion("astronomy2/v8beta1") if err != nil { t.Errorf("Unexpected error: %v", err) } if e, a := fake.resourceMap["astronomy2/v8beta1"].list, r; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } _, err = c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err == nil { t.Errorf("Expected error, got nil") } fake.lock.Lock() fake.resourceMap["astronomy/v8beta1"] = &resourceMapEntry{ list: &metav1.APIResourceList{ GroupVersion: "astronomy/v8beta1", APIResources: []metav1.APIResource{{ Name: "dwarfplanets", SingularName: "dwarfplanet", Namespaced: true, Kind: "DwarfPlanet", ShortNames: []string{"dp"}, }}, }, err: nil, } fake.lock.Unlock() // We should retry retryable error even without Invalidate() being called, // so no error is expected. r, err = c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err != nil { t.Errorf("Expected no error, got %v", err) } if e, a := fake.resourceMap["astronomy/v8beta1"].list, r; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } // Check that the last result was cached and we don't retry further. fake.lock.Lock() fake.resourceMap["astronomy/v8beta1"].err = errors.New("some permanent error") fake.lock.Unlock() r, err = c.ServerResourcesForGroupVersion("astronomy/v8beta1") if err != nil { t.Errorf("Expected no error, got %v", err) } if e, a := fake.resourceMap["astronomy/v8beta1"].list, r; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } // Tests that schema instances returned by openapi cached and returned after // successive calls func TestOpenAPIMemCache(t *testing.T) { fakeServer, err := testutil.NewFakeOpenAPIV3Server("../../testdata") require.NoError(t, err) defer fakeServer.HttpServer.Close() require.NotEmpty(t, fakeServer.ServedDocuments) client := NewMemCacheClient( discovery.NewDiscoveryClientForConfigOrDie( &rest.Config{Host: fakeServer.HttpServer.URL}, ), ) openapiClient := client.OpenAPIV3() paths, err := openapiClient.Paths() require.NoError(t, err) contentTypes := []string{ runtime.ContentTypeJSON, openapi.ContentTypeOpenAPIV3PB, } for _, contentType := range contentTypes { t.Run(contentType, func(t *testing.T) { for k, v := range paths { original, err := v.Schema(contentType) if !assert.NoError(t, err) { continue } pathsAgain, err := openapiClient.Paths() if !assert.NoError(t, err) { continue } schemaAgain, err := pathsAgain[k].Schema(contentType) if !assert.NoError(t, err) { continue } assert.True(t, reflect.ValueOf(paths).Pointer() == reflect.ValueOf(pathsAgain).Pointer()) assert.True(t, reflect.ValueOf(original).Pointer() == reflect.ValueOf(schemaAgain).Pointer()) // Invalidate and try again. This time pointers should not be equal client.Invalidate() pathsAgain, err = client.OpenAPIV3().Paths() if !assert.NoError(t, err) { continue } schemaAgain, err = pathsAgain[k].Schema(contentType) if !assert.NoError(t, err) { continue } assert.True(t, reflect.ValueOf(paths).Pointer() != reflect.ValueOf(pathsAgain).Pointer()) assert.True(t, reflect.ValueOf(original).Pointer() != reflect.ValueOf(schemaAgain).Pointer()) assert.Equal(t, original, schemaAgain) } }) } } // Tests function "GroupsAndMaybeResources" when the "unaggregated" discovery is returned. func TestMemCacheGroupsAndMaybeResources(t *testing.T) { tests := []struct { name string corev1 *metav1.APIVersions apis *metav1.APIGroupList expectedGroupNames []string expectedGroupVersions []string }{ { name: "Legacy discovery format: 1 version at /api, 1 group at /apis", corev1: &metav1.APIVersions{ Versions: []string{ "v1", }, }, apis: &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, }, }, expectedGroupNames: []string{"", "extensions"}, expectedGroupVersions: []string{"v1", "extensions/v1beta1"}, }, { name: "Legacy discovery format: 1 version at /api, 2 groups/1 version at /apis", corev1: &metav1.APIVersions{ Versions: []string{ "v1", }, }, apis: &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "apps/v1"}, }, }, { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, }, }, expectedGroupNames: []string{"", "apps", "extensions"}, expectedGroupVersions: []string{"v1", "apps/v1", "extensions/v1beta1"}, }, { name: "Legacy discovery format: 1 version at /api, 2 groups/2 versions at /apis", corev1: &metav1.APIVersions{ Versions: []string{ "v1", }, }, apis: &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "batch", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "batch/v1"}, }, }, { Name: "batch", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "batch/v1beta1"}, }, }, { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1alpha1"}, }, }, }, }, expectedGroupNames: []string{ "", "batch", "extensions", }, expectedGroupVersions: []string{ "v1", "batch/v1", "batch/v1beta1", "extensions/v1beta1", "extensions/v1alpha1", }, }, } for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var body interface{} switch req.URL.Path { case "/api": body = test.corev1 case "/apis": body = test.apis default: w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(body) require.NoError(t, err) // Content-type is "unaggregated" discovery format -- no resources returned. w.Header().Set("Content-Type", discovery.AcceptV1) w.WriteHeader(http.StatusOK) w.Write(output) })) defer server.Close() client := discovery.NewDiscoveryClientForConfigOrDie(&rest.Config{Host: server.URL}) memClient := memCacheClient{ delegate: client, groupToServerResources: map[string]*cacheEntry{}, } assert.False(t, memClient.Fresh()) apiGroupList, resourcesMap, failedGVs, err := memClient.GroupsAndMaybeResources() require.NoError(t, err) // "Unaggregated" discovery always returns nil for resources. assert.Nil(t, resourcesMap) assert.Emptyf(t, failedGVs, "expected empty failed GroupVersions, got (%d)", len(failedGVs)) assert.False(t, memClient.receivedAggregatedDiscovery) assert.True(t, memClient.Fresh()) // Test the expected groups are returned for the aggregated format. expectedGroupNames := sets.NewString(test.expectedGroupNames...) actualGroupNames := sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) // Test the expected group versions for the aggregated discovery is correct. expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) actualGroupVersions := sets.NewString(groupVersionsFromGroups(apiGroupList)...) assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), "%s: Expected group/versions (%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) // Invalidate the cache and retrieve the server groups and resources again. memClient.Invalidate() assert.False(t, memClient.Fresh()) apiGroupList, resourcesMap, _, err = memClient.GroupsAndMaybeResources() require.NoError(t, err) assert.Nil(t, resourcesMap) assert.False(t, memClient.receivedAggregatedDiscovery) // Test the expected groups are returned for the aggregated format. actualGroupNames = sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected after invalidation groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) } } // Tests function "GroupsAndMaybeResources" when the "aggregated" discovery is returned. func TestAggregatedMemCacheGroupsAndMaybeResources(t *testing.T) { tests := []struct { name string corev1 *apidiscovery.APIGroupDiscoveryList apis *apidiscovery.APIGroupDiscoveryList expectedGroupNames []string expectedGroupVersions []string expectedGVKs []string expectedFailedGVs []string }{ { name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/1 resources at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ "/v1/Pod", "apps/v1/Deployment", }, expectedFailedGVs: []string{}, }, { name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/2 versions/1 resources/1 stale GV at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { // Stale Version is not included in discovery. Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ "/v1/Pod", "apps/v1/Deployment", }, expectedFailedGVs: []string{"apps/v2"}, }, { name: "Aggregated discovery: 1 group/2 resources at /api, 1 group/2 resources at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ "/v1/Pod", "/v1/Service", "apps/v1/Deployment", "apps/v1/StatefulSet", }, expectedFailedGVs: []string{}, }, { name: "Aggregated discovery: 1 group/2 resources at /api, 2 group/2 resources/1 stale GV at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { // Stale version is not included in discovery. Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1beta1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1beta1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps", "batch"}, expectedGroupVersions: []string{"v1", "apps/v1", "batch/v1"}, expectedGVKs: []string{ "/v1/Pod", "/v1/Service", "apps/v1/Deployment", "apps/v1/StatefulSet", "batch/v1/Job", "batch/v1/CronJob", }, expectedFailedGVs: []string{"apps/v1beta1"}, }, { name: "Aggregated discovery: /api returns nothing, 2 groups/2 resources/2 stale GV at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{}, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ // Statel "v1" Version is not included in discovery. { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, { Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1beta1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1beta1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { // Stale Version is not included in discovery. Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, }, }, }, }, expectedGroupNames: []string{"apps", "batch"}, expectedGroupVersions: []string{"apps/v1beta1", "batch/v1"}, expectedGVKs: []string{ "apps/v1beta1/Deployment", "apps/v1beta1/StatefulSet", "batch/v1/Job", "batch/v1/CronJob", }, expectedFailedGVs: []string{"apps/v1", "batch/v1beta1"}, }, } for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1 case "/apis": agg = test.apis default: w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(agg) require.NoError(t, err) // Content-type is "aggregated" discovery format. w.Header().Set("Content-Type", discovery.AcceptV2) w.WriteHeader(http.StatusOK) w.Write(output) })) defer server.Close() client := discovery.NewDiscoveryClientForConfigOrDie(&rest.Config{Host: server.URL}) memClient := memCacheClient{ delegate: client, groupToServerResources: map[string]*cacheEntry{}, } assert.False(t, memClient.Fresh()) apiGroupList, resourcesMap, failedGVs, err := memClient.GroupsAndMaybeResources() require.NoError(t, err) assert.True(t, memClient.receivedAggregatedDiscovery) assert.True(t, memClient.Fresh()) // Test the expected groups are returned for the aggregated format. expectedGroupNames := sets.NewString(test.expectedGroupNames...) actualGroupNames := sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) // Test the expected group versions for the aggregated discovery is correct. expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) actualGroupVersions := sets.NewString(groupVersionsFromGroups(apiGroupList)...) assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), "%s: Expected group/versions (%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) // Test the resources are correct. expectedGVKs := sets.NewString(test.expectedGVKs...) resources := []*metav1.APIResourceList{} for _, resourceList := range resourcesMap { resources = append(resources, resourceList) } actualGVKs := sets.NewString(groupVersionKinds(resources)...) assert.True(t, expectedGVKs.Equal(actualGVKs), "%s: Expected GVKs (%s), got (%s)", test.name, expectedGVKs.List(), actualGVKs.List()) // Test the returned failed GroupVersions are correct. expectedFailedGVs := sets.NewString(test.expectedFailedGVs...) actualFailedGVs := sets.NewString(failedGroupVersions(failedGVs)...) assert.True(t, expectedFailedGVs.Equal(actualFailedGVs), "%s: Expected Failed GroupVersions (%s), got (%s)", test.name, expectedFailedGVs.List(), actualFailedGVs.List()) // Invalidate the cache and retrieve the server groups again. memClient.Invalidate() assert.False(t, memClient.Fresh()) apiGroupList, _, _, err = memClient.GroupsAndMaybeResources() require.NoError(t, err) // Test the expected groups are returned for the aggregated format. actualGroupNames = sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected after invalidation groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) } } // Tests function "ServerGroups" when the "aggregated" discovery is returned. func TestMemCacheAggregatedServerGroups(t *testing.T) { tests := []struct { name string corev1 *apidiscovery.APIGroupDiscoveryList apis *apidiscovery.APIGroupDiscoveryList expectedGroupNames []string expectedGroupVersions []string expectedPreferredVersions []string }{ { name: "Aggregated discovery: 1 group/1 version at /api, 1 group/1 version at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedPreferredVersions: []string{"v1", "apps/v1"}, }, { name: "Aggregated discovery: 1 group/1 version at /api, 1 group/2 versions at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ // v2 is preferred since it is first { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1", "apps/v2"}, expectedPreferredVersions: []string{"v1", "apps/v2"}, }, { name: "Aggregated discovery: /api returns nothing, 2 groups at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{}, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ // v1 is preferred since it is first { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"apps", "batch"}, expectedGroupVersions: []string{"apps/v1", "batch/v1", "batch/v1beta1"}, expectedPreferredVersions: []string{"apps/v1", "batch/v1"}, }, } for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1 case "/apis": agg = test.apis default: w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(agg) require.NoError(t, err) // Content-type is "aggregated" discovery format. w.Header().Set("Content-Type", discovery.AcceptV2Beta1) w.WriteHeader(http.StatusOK) w.Write(output) })) defer server.Close() client := discovery.NewDiscoveryClientForConfigOrDie(&rest.Config{Host: server.URL}) memCacheClient := NewMemCacheClient(client) assert.False(t, memCacheClient.Fresh()) apiGroupList, err := memCacheClient.ServerGroups() require.NoError(t, err) assert.True(t, memCacheClient.Fresh()) // Test the expected groups are returned for the aggregated format. expectedGroupNames := sets.NewString(test.expectedGroupNames...) actualGroupNames := sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) // Test the expected group versions for the aggregated discovery is correct. expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) actualGroupVersions := sets.NewString(groupVersionsFromGroups(apiGroupList)...) assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), "%s: Expected group/versions (%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) // Test the groups preferred version is correct. expectedPreferredVersions := sets.NewString(test.expectedPreferredVersions...) actualPreferredVersions := sets.NewString(preferredVersionsFromList(apiGroupList)...) assert.True(t, expectedPreferredVersions.Equal(actualPreferredVersions), "%s: Expected preferred group/version (%s), got (%s)", test.name, expectedPreferredVersions.List(), actualPreferredVersions.List()) // Invalidate the cache and retrieve the server groups again. memCacheClient.Invalidate() assert.False(t, memCacheClient.Fresh()) apiGroupList, err = memCacheClient.ServerGroups() require.NoError(t, err) // Test the expected groups are returned for the aggregated format. actualGroupNames = sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected after invalidation groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) } } func groupNamesFromList(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { result = append(result, group.Name) } return result } func preferredVersionsFromList(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { preferredGV := group.PreferredVersion.GroupVersion result = append(result, preferredGV) } return result } func groupVersionsFromGroups(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { for _, version := range group.Versions { result = append(result, version.GroupVersion) } } return result } func groupVersionKinds(resources []*metav1.APIResourceList) []string { result := []string{} for _, resourceList := range resources { for _, resource := range resourceList.APIResources { gvk := fmt.Sprintf("%s/%s/%s", resource.Group, resource.Version, resource.Kind) result = append(result, gvk) } } return result } func failedGroupVersions(gvs map[schema.GroupVersion]error) []string { result := []string{} for gv := range gvs { result = append(result, gv.String()) } return result } kubernetes-client-go-a2dfcab/discovery/discovery_client.go000066400000000000000000000727331472614177300243170ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package discovery import ( "context" "encoding/json" goerrors "errors" "fmt" "mime" "net/http" "net/url" "sort" "strings" "sync" "time" //nolint:staticcheck // SA1019 Keep using module since it's still being maintained and the api of google.golang.org/protobuf/proto differs "github.com/golang/protobuf/proto" openapi_v2 "github.com/google/gnostic-models/openapiv2" apidiscoveryv2 "k8s.io/api/apidiscovery/v2" apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/openapi" restclient "k8s.io/client-go/rest" ) const ( // defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. CustomResourceDefinitions). defaultRetries = 2 // protobuf mime type openAPIV2mimePb = "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" // defaultTimeout is the maximum amount of time per request when no timeout has been set on a RESTClient. // Defaults to 32s in order to have a distinguishable length of time, relative to other timeouts that exist. defaultTimeout = 32 * time.Second // defaultBurst is the default burst to be used with the discovery client's token bucket rate limiter defaultBurst = 300 AcceptV1 = runtime.ContentTypeJSON // Aggregated discovery content-type (v2beta1). NOTE: content-type parameters // MUST be ordered (g, v, as) for server in "Accept" header (BUT we are resilient // to ordering when comparing returned values in "Content-Type" header). AcceptV2Beta1 = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList" AcceptV2 = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList" // Prioritize aggregated discovery by placing first in the order of discovery accept types. acceptDiscoveryFormats = AcceptV2 + "," + AcceptV2Beta1 + "," + AcceptV1 ) // Aggregated discovery content-type GVK. var v2Beta1GVK = schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2beta1", Kind: "APIGroupDiscoveryList"} var v2GVK = schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2", Kind: "APIGroupDiscoveryList"} // DiscoveryInterface holds the methods that discover server-supported API groups, // versions and resources. type DiscoveryInterface interface { RESTClient() restclient.Interface ServerGroupsInterface ServerResourcesInterface ServerVersionInterface OpenAPISchemaInterface OpenAPIV3SchemaInterface // Returns copy of current discovery client that will only // receive the legacy discovery format, or pointer to current // discovery client if it does not support legacy-only discovery. WithLegacy() DiscoveryInterface } // AggregatedDiscoveryInterface extends DiscoveryInterface to include a method to possibly // return discovery resources along with the discovery groups, which is what the newer // aggregated discovery format does (APIGroupDiscoveryList). type AggregatedDiscoveryInterface interface { DiscoveryInterface GroupsAndMaybeResources() (*metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) } // CachedDiscoveryInterface is a DiscoveryInterface with cache invalidation and freshness. // Note that If the ServerResourcesForGroupVersion method returns a cache miss // error, the user needs to explicitly call Invalidate to clear the cache, // otherwise the same cache miss error will be returned next time. type CachedDiscoveryInterface interface { DiscoveryInterface // Fresh is supposed to tell the caller whether or not to retry if the cache // fails to find something (false = retry, true = no need to retry). // // TODO: this needs to be revisited, this interface can't be locked properly // and doesn't make a lot of sense. Fresh() bool // Invalidate enforces that no cached data that is older than the current time // is used. Invalidate() } // ServerGroupsInterface has methods for obtaining supported groups on the API server type ServerGroupsInterface interface { // ServerGroups returns the supported groups, with information like supported versions and the // preferred version. ServerGroups() (*metav1.APIGroupList, error) } // ServerResourcesInterface has methods for obtaining supported resources on the API server type ServerResourcesInterface interface { // ServerResourcesForGroupVersion returns the supported resources for a group and version. ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) // ServerGroupsAndResources returns the supported groups and resources for all groups and versions. // // The returned group and resource lists might be non-nil with partial results even in the // case of non-nil error. ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) // ServerPreferredResources returns the supported resources with the version preferred by the // server. // // The returned group and resource lists might be non-nil with partial results even in the // case of non-nil error. ServerPreferredResources() ([]*metav1.APIResourceList, error) // ServerPreferredNamespacedResources returns the supported namespaced resources with the // version preferred by the server. // // The returned resource list might be non-nil with partial results even in the case of // non-nil error. ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) } // ServerVersionInterface has a method for retrieving the server's version. type ServerVersionInterface interface { // ServerVersion retrieves and parses the server's version (git version). ServerVersion() (*version.Info, error) } // OpenAPISchemaInterface has a method to retrieve the open API schema. type OpenAPISchemaInterface interface { // OpenAPISchema retrieves and parses the swagger API schema the server supports. OpenAPISchema() (*openapi_v2.Document, error) } type OpenAPIV3SchemaInterface interface { OpenAPIV3() openapi.Client } // DiscoveryClient implements the functions that discover server-supported API groups, // versions and resources. type DiscoveryClient struct { restClient restclient.Interface LegacyPrefix string // Forces the client to request only "unaggregated" (legacy) discovery. UseLegacyDiscovery bool } var _ AggregatedDiscoveryInterface = &DiscoveryClient{} // Convert metav1.APIVersions to metav1.APIGroup. APIVersions is used by legacy v1, so // group would be "". func apiVersionsToAPIGroup(apiVersions *metav1.APIVersions) (apiGroup metav1.APIGroup) { groupVersions := []metav1.GroupVersionForDiscovery{} for _, version := range apiVersions.Versions { groupVersion := metav1.GroupVersionForDiscovery{ GroupVersion: version, Version: version, } groupVersions = append(groupVersions, groupVersion) } apiGroup.Versions = groupVersions // There should be only one groupVersion returned at /api apiGroup.PreferredVersion = groupVersions[0] return } // GroupsAndMaybeResources returns the discovery groups, and (if new aggregated // discovery format) the resources keyed by group/version. Merges discovery groups // and resources from /api and /apis (either aggregated or not). Legacy groups // must be ordered first. The server will either return both endpoints (/api, /apis) // as aggregated discovery format or legacy format. For safety, resources will only // be returned if both endpoints returned resources. Returned "failedGVs" can be // empty, but will only be nil in the case an error is returned. func (d *DiscoveryClient) GroupsAndMaybeResources() ( *metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) { // Legacy group ordered first (there is only one -- core/v1 group). Returned groups must // be non-nil, but it could be empty. Returned resources, apiResources map could be nil. groups, resources, failedGVs, err := d.downloadLegacy() if err != nil { return nil, nil, nil, err } // Discovery groups and (possibly) resources downloaded from /apis. apiGroups, apiResources, failedApisGVs, aerr := d.downloadAPIs() if aerr != nil { return nil, nil, nil, aerr } // Merge apis groups into the legacy groups. for _, group := range apiGroups.Groups { groups.Groups = append(groups.Groups, group) } // For safety, only return resources if both endpoints returned resources. if resources != nil && apiResources != nil { for gv, resourceList := range apiResources { resources[gv] = resourceList } } else if resources != nil { resources = nil } // Merge failed GroupVersions from /api and /apis for gv, err := range failedApisGVs { failedGVs[gv] = err } return groups, resources, failedGVs, err } // downloadLegacy returns the discovery groups and possibly resources // for the legacy v1 GVR at /api, or an error if one occurred. It is // possible for the resource map to be nil if the server returned // the unaggregated discovery. Returned "failedGVs" can be empty, but // will only be nil in the case of a returned error. func (d *DiscoveryClient) downloadLegacy() ( *metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) { accept := acceptDiscoveryFormats if d.UseLegacyDiscovery { accept = AcceptV1 } var responseContentType string body, err := d.restClient.Get(). AbsPath("/api"). SetHeader("Accept", accept). Do(context.TODO()). ContentType(&responseContentType). Raw() apiGroupList := &metav1.APIGroupList{} failedGVs := map[schema.GroupVersion]error{} if err != nil { // Tolerate 404, since aggregated api servers can return it. if errors.IsNotFound(err) { // Return empty structures and no error. emptyGVMap := map[schema.GroupVersion]*metav1.APIResourceList{} return apiGroupList, emptyGVMap, failedGVs, nil } else { return nil, nil, nil, err } } var resourcesByGV map[schema.GroupVersion]*metav1.APIResourceList // Based on the content-type server responded with: aggregated or unaggregated. if isGVK, _ := ContentTypeIsGVK(responseContentType, v2GVK); isGVK { var aggregatedDiscovery apidiscoveryv2.APIGroupDiscoveryList err = json.Unmarshal(body, &aggregatedDiscovery) if err != nil { return nil, nil, nil, err } apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResources(aggregatedDiscovery) } else if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK { var aggregatedDiscovery apidiscoveryv2beta1.APIGroupDiscoveryList err = json.Unmarshal(body, &aggregatedDiscovery) if err != nil { return nil, nil, nil, err } apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResourcesV2Beta1(aggregatedDiscovery) } else { // Default is unaggregated discovery v1. var v metav1.APIVersions err = json.Unmarshal(body, &v) if err != nil { return nil, nil, nil, err } apiGroup := metav1.APIGroup{} if len(v.Versions) != 0 { apiGroup = apiVersionsToAPIGroup(&v) } apiGroupList.Groups = []metav1.APIGroup{apiGroup} } return apiGroupList, resourcesByGV, failedGVs, nil } // downloadAPIs returns the discovery groups and (if aggregated format) the // discovery resources. The returned groups will always exist, but the // resources map may be nil. Returned "failedGVs" can be empty, but will // only be nil in the case of a returned error. func (d *DiscoveryClient) downloadAPIs() ( *metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) { accept := acceptDiscoveryFormats if d.UseLegacyDiscovery { accept = AcceptV1 } var responseContentType string body, err := d.restClient.Get(). AbsPath("/apis"). SetHeader("Accept", accept). Do(context.TODO()). ContentType(&responseContentType). Raw() if err != nil { return nil, nil, nil, err } apiGroupList := &metav1.APIGroupList{} failedGVs := map[schema.GroupVersion]error{} var resourcesByGV map[schema.GroupVersion]*metav1.APIResourceList // Based on the content-type server responded with: aggregated or unaggregated. if isGVK, _ := ContentTypeIsGVK(responseContentType, v2GVK); isGVK { var aggregatedDiscovery apidiscoveryv2.APIGroupDiscoveryList err = json.Unmarshal(body, &aggregatedDiscovery) if err != nil { return nil, nil, nil, err } apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResources(aggregatedDiscovery) } else if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK { var aggregatedDiscovery apidiscoveryv2beta1.APIGroupDiscoveryList err = json.Unmarshal(body, &aggregatedDiscovery) if err != nil { return nil, nil, nil, err } apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResourcesV2Beta1(aggregatedDiscovery) } else { // Default is unaggregated discovery v1. err = json.Unmarshal(body, apiGroupList) if err != nil { return nil, nil, nil, err } } return apiGroupList, resourcesByGV, failedGVs, nil } // ContentTypeIsGVK checks of the content-type string is both // "application/json" and matches the provided GVK. An error // is returned if the content type string is malformed. // NOTE: This function is resilient to the ordering of the // content-type parameters, as well as parameters added by // intermediaries such as proxies or gateways. Examples: // // ("application/json; g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList", {apidiscovery.k8s.io, v2beta1, APIGroupDiscoveryList}) = (true, nil) // ("application/json; as=APIGroupDiscoveryList;v=v2beta1;g=apidiscovery.k8s.io", {apidiscovery.k8s.io, v2beta1, APIGroupDiscoveryList}) = (true, nil) // ("application/json; as=APIGroupDiscoveryList;v=v2beta1;g=apidiscovery.k8s.io;charset=utf-8", {apidiscovery.k8s.io, v2beta1, APIGroupDiscoveryList}) = (true, nil) // ("application/json", any GVK) = (false, nil) // ("application/json; charset=UTF-8", any GVK) = (false, nil) // ("malformed content type string", any GVK) = (false, error) func ContentTypeIsGVK(contentType string, gvk schema.GroupVersionKind) (bool, error) { base, params, err := mime.ParseMediaType(contentType) if err != nil { return false, err } gvkMatch := runtime.ContentTypeJSON == base && params["g"] == gvk.Group && params["v"] == gvk.Version && params["as"] == gvk.Kind return gvkMatch, nil } // ServerGroups returns the supported groups, with information like supported versions and the // preferred version. func (d *DiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { groups, _, _, err := d.GroupsAndMaybeResources() if err != nil { return nil, err } return groups, nil } // ServerResourcesForGroupVersion returns the supported resources for a group and version. func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (resources *metav1.APIResourceList, err error) { url := url.URL{} if len(groupVersion) == 0 { return nil, fmt.Errorf("groupVersion shouldn't be empty") } if len(d.LegacyPrefix) > 0 && groupVersion == "v1" { url.Path = d.LegacyPrefix + "/" + groupVersion } else { url.Path = "/apis/" + groupVersion } resources = &metav1.APIResourceList{ GroupVersion: groupVersion, } err = d.restClient.Get().AbsPath(url.String()).Do(context.TODO()).Into(resources) if err != nil { // Tolerate core/v1 not found response by returning empty resource list; // this probably should not happen. But we should verify all callers are // not depending on this toleration before removal. if groupVersion == "v1" && errors.IsNotFound(err) { return resources, nil } return nil, err } return resources, nil } // ServerGroupsAndResources returns the supported resources for all groups and versions. func (d *DiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { return withRetries(defaultRetries, func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { return ServerGroupsAndResources(d) }) } // ErrGroupDiscoveryFailed is returned if one or more API groups fail to load. type ErrGroupDiscoveryFailed struct { // Groups is a list of the groups that failed to load and the error cause Groups map[schema.GroupVersion]error } // Error implements the error interface func (e *ErrGroupDiscoveryFailed) Error() string { var groups []string for k, v := range e.Groups { groups = append(groups, fmt.Sprintf("%s: %v", k, v)) } sort.Strings(groups) return fmt.Sprintf("unable to retrieve the complete list of server APIs: %s", strings.Join(groups, ", ")) } // Is makes it possible for the callers to use `errors.Is(` helper on errors wrapped with ErrGroupDiscoveryFailed error. func (e *ErrGroupDiscoveryFailed) Is(target error) bool { _, ok := target.(*ErrGroupDiscoveryFailed) return ok } // IsGroupDiscoveryFailedError returns true if the provided error indicates the server was unable to discover // a complete list of APIs for the client to use. func IsGroupDiscoveryFailedError(err error) bool { _, ok := err.(*ErrGroupDiscoveryFailed) return err != nil && ok } // GroupDiscoveryFailedErrorGroups returns true if the error is an ErrGroupDiscoveryFailed error, // along with the map of group versions that failed discovery. func GroupDiscoveryFailedErrorGroups(err error) (map[schema.GroupVersion]error, bool) { var groupDiscoveryError *ErrGroupDiscoveryFailed if err != nil && goerrors.As(err, &groupDiscoveryError) { return groupDiscoveryError.Groups, true } return nil, false } func ServerGroupsAndResources(d DiscoveryInterface) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { var sgs *metav1.APIGroupList var resources []*metav1.APIResourceList var failedGVs map[schema.GroupVersion]error var err error // If the passed discovery object implements the wider AggregatedDiscoveryInterface, // then attempt to retrieve aggregated discovery with both groups and the resources. if ad, ok := d.(AggregatedDiscoveryInterface); ok { var resourcesByGV map[schema.GroupVersion]*metav1.APIResourceList sgs, resourcesByGV, failedGVs, err = ad.GroupsAndMaybeResources() for _, resourceList := range resourcesByGV { resources = append(resources, resourceList) } } else { sgs, err = d.ServerGroups() } if sgs == nil { return nil, nil, err } resultGroups := []*metav1.APIGroup{} for i := range sgs.Groups { resultGroups = append(resultGroups, &sgs.Groups[i]) } // resources is non-nil if aggregated discovery succeeded. if resources != nil { // Any stale Group/Versions returned by aggregated discovery // must be surfaced to the caller as failed Group/Versions. var ferr error if len(failedGVs) > 0 { ferr = &ErrGroupDiscoveryFailed{Groups: failedGVs} } return resultGroups, resources, ferr } groupVersionResources, failedGroups := fetchGroupVersionResources(d, sgs) // order results by group/version discovery order result := []*metav1.APIResourceList{} for _, apiGroup := range sgs.Groups { for _, version := range apiGroup.Versions { gv := schema.GroupVersion{Group: apiGroup.Name, Version: version.Version} if resources, ok := groupVersionResources[gv]; ok { result = append(result, resources) } } } if len(failedGroups) == 0 { return resultGroups, result, nil } return resultGroups, result, &ErrGroupDiscoveryFailed{Groups: failedGroups} } // ServerPreferredResources uses the provided discovery interface to look up preferred resources func ServerPreferredResources(d DiscoveryInterface) ([]*metav1.APIResourceList, error) { var serverGroupList *metav1.APIGroupList var failedGroups map[schema.GroupVersion]error var groupVersionResources map[schema.GroupVersion]*metav1.APIResourceList var err error // If the passed discovery object implements the wider AggregatedDiscoveryInterface, // then it is attempt to retrieve both the groups and the resources. "failedGroups" // are Group/Versions returned as stale in AggregatedDiscovery format. ad, ok := d.(AggregatedDiscoveryInterface) if ok { serverGroupList, groupVersionResources, failedGroups, err = ad.GroupsAndMaybeResources() } else { serverGroupList, err = d.ServerGroups() } if err != nil { return nil, err } // Non-aggregated discovery must fetch resources from Groups. if groupVersionResources == nil { groupVersionResources, failedGroups = fetchGroupVersionResources(d, serverGroupList) } result := []*metav1.APIResourceList{} grVersions := map[schema.GroupResource]string{} // selected version of a GroupResource grAPIResources := map[schema.GroupResource]*metav1.APIResource{} // selected APIResource for a GroupResource gvAPIResourceLists := map[schema.GroupVersion]*metav1.APIResourceList{} // blueprint for a APIResourceList for later grouping for _, apiGroup := range serverGroupList.Groups { for _, version := range apiGroup.Versions { groupVersion := schema.GroupVersion{Group: apiGroup.Name, Version: version.Version} apiResourceList, ok := groupVersionResources[groupVersion] if !ok { continue } // create empty list which is filled later in another loop emptyAPIResourceList := metav1.APIResourceList{ GroupVersion: version.GroupVersion, } gvAPIResourceLists[groupVersion] = &emptyAPIResourceList result = append(result, &emptyAPIResourceList) for i := range apiResourceList.APIResources { apiResource := &apiResourceList.APIResources[i] if strings.Contains(apiResource.Name, "/") { continue } gv := schema.GroupResource{Group: apiGroup.Name, Resource: apiResource.Name} if _, ok := grAPIResources[gv]; ok && version.Version != apiGroup.PreferredVersion.Version { // only override with preferred version continue } grVersions[gv] = version.Version grAPIResources[gv] = apiResource } } } // group selected APIResources according to GroupVersion into APIResourceLists for groupResource, apiResource := range grAPIResources { version := grVersions[groupResource] groupVersion := schema.GroupVersion{Group: groupResource.Group, Version: version} apiResourceList := gvAPIResourceLists[groupVersion] apiResourceList.APIResources = append(apiResourceList.APIResources, *apiResource) } if len(failedGroups) == 0 { return result, nil } return result, &ErrGroupDiscoveryFailed{Groups: failedGroups} } // fetchServerResourcesForGroupVersions uses the discovery client to fetch the resources for the specified groups in parallel. func fetchGroupVersionResources(d DiscoveryInterface, apiGroups *metav1.APIGroupList) (map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error) { groupVersionResources := make(map[schema.GroupVersion]*metav1.APIResourceList) failedGroups := make(map[schema.GroupVersion]error) wg := &sync.WaitGroup{} resultLock := &sync.Mutex{} for _, apiGroup := range apiGroups.Groups { for _, version := range apiGroup.Versions { groupVersion := schema.GroupVersion{Group: apiGroup.Name, Version: version.Version} wg.Add(1) go func() { defer wg.Done() defer utilruntime.HandleCrash() apiResourceList, err := d.ServerResourcesForGroupVersion(groupVersion.String()) // lock to record results resultLock.Lock() defer resultLock.Unlock() if err != nil { // TODO: maybe restrict this to NotFound errors failedGroups[groupVersion] = err } if apiResourceList != nil { // even in case of error, some fallback might have been returned groupVersionResources[groupVersion] = apiResourceList } }() } } wg.Wait() return groupVersionResources, failedGroups } // ServerPreferredResources returns the supported resources with the version preferred by the // server. func (d *DiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { _, rs, err := withRetries(defaultRetries, func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { rs, err := ServerPreferredResources(d) return nil, rs, err }) return rs, err } // ServerPreferredNamespacedResources returns the supported namespaced resources with the // version preferred by the server. func (d *DiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { return ServerPreferredNamespacedResources(d) } // ServerPreferredNamespacedResources uses the provided discovery interface to look up preferred namespaced resources func ServerPreferredNamespacedResources(d DiscoveryInterface) ([]*metav1.APIResourceList, error) { all, err := ServerPreferredResources(d) return FilteredBy(ResourcePredicateFunc(func(groupVersion string, r *metav1.APIResource) bool { return r.Namespaced }), all), err } // ServerVersion retrieves and parses the server's version (git version). func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { body, err := d.restClient.Get().AbsPath("/version").Do(context.TODO()).Raw() if err != nil { return nil, err } var info version.Info err = json.Unmarshal(body, &info) if err != nil { return nil, fmt.Errorf("unable to parse the server version: %v", err) } return &info, nil } // OpenAPISchema fetches the open api v2 schema using a rest client and parses the proto. func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", openAPIV2mimePb).Do(context.TODO()).Raw() if err != nil { return nil, err } document := &openapi_v2.Document{} err = proto.Unmarshal(data, document) if err != nil { return nil, err } return document, nil } func (d *DiscoveryClient) OpenAPIV3() openapi.Client { return openapi.NewClient(d.restClient) } // WithLegacy returns copy of current discovery client that will only // receive the legacy discovery format. func (d *DiscoveryClient) WithLegacy() DiscoveryInterface { client := *d client.UseLegacyDiscovery = true return &client } // withRetries retries the given recovery function in case the groups supported by the server change after ServerGroup() returns. func withRetries(maxRetries int, f func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { var result []*metav1.APIResourceList var resultGroups []*metav1.APIGroup var err error for i := 0; i < maxRetries; i++ { resultGroups, result, err = f() if err == nil { return resultGroups, result, nil } if _, ok := err.(*ErrGroupDiscoveryFailed); !ok { return nil, nil, err } } return resultGroups, result, err } func setDiscoveryDefaults(config *restclient.Config) error { config.APIPath = "" config.GroupVersion = nil if config.Timeout == 0 { config.Timeout = defaultTimeout } // if a burst limit is not already configured if config.Burst == 0 { // discovery is expected to be bursty, increase the default burst // to accommodate looking up resource info for many API groups. // matches burst set by ConfigFlags#ToDiscoveryClient(). // see https://issue.k8s.io/86149 config.Burst = defaultBurst } codec := runtime.NoopEncoder{Decoder: scheme.Codecs.UniversalDecoder()} config.NegotiatedSerializer = serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: codec}) if len(config.UserAgent) == 0 { config.UserAgent = restclient.DefaultKubernetesUserAgent() } return nil } // NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. This client // can be used to discover supported resources in the API server. // NewDiscoveryClientForConfig is equivalent to NewDiscoveryClientForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewDiscoveryClientForConfig(c *restclient.Config) (*DiscoveryClient, error) { config := *c if err := setDiscoveryDefaults(&config); err != nil { return nil, err } httpClient, err := restclient.HTTPClientFor(&config) if err != nil { return nil, err } return NewDiscoveryClientForConfigAndClient(&config, httpClient) } // NewDiscoveryClientForConfigAndClient creates a new DiscoveryClient for the given config. This client // can be used to discover supported resources in the API server. // Note the http client provided takes precedence over the configured transport values. func NewDiscoveryClientForConfigAndClient(c *restclient.Config, httpClient *http.Client) (*DiscoveryClient, error) { config := *c if err := setDiscoveryDefaults(&config); err != nil { return nil, err } client, err := restclient.UnversionedRESTClientForConfigAndClient(&config, httpClient) return &DiscoveryClient{restClient: client, LegacyPrefix: "/api", UseLegacyDiscovery: false}, err } // NewDiscoveryClientForConfigOrDie creates a new DiscoveryClient for the given config. If // there is an error, it panics. func NewDiscoveryClientForConfigOrDie(c *restclient.Config) *DiscoveryClient { client, err := NewDiscoveryClientForConfig(c) if err != nil { panic(err) } return client } // NewDiscoveryClient returns a new DiscoveryClient for the given RESTClient. func NewDiscoveryClient(c restclient.Interface) *DiscoveryClient { return &DiscoveryClient{restClient: c, LegacyPrefix: "/api", UseLegacyDiscovery: false} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (d *DiscoveryClient) RESTClient() restclient.Interface { if d == nil { return nil } return d.restClient } kubernetes-client-go-a2dfcab/discovery/discovery_client_test.go000066400000000000000000002757251472614177300253640ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package discovery import ( "encoding/json" "fmt" "net/http" "net/http/httptest" "reflect" "testing" "time" "github.com/gogo/protobuf/proto" openapi_v2 "github.com/google/gnostic-models/openapiv2" openapi_v3 "github.com/google/gnostic-models/openapiv3" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" golangproto "google.golang.org/protobuf/proto" apidiscovery "k8s.io/api/apidiscovery/v2" apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/openapi" restclient "k8s.io/client-go/rest" testutil "k8s.io/client-go/util/testing" "k8s.io/kube-openapi/pkg/spec3" ) func TestGetServerVersion(t *testing.T) { expect := version.Info{ Major: "foo", Minor: "bar", GitCommit: "baz", } server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { output, err := json.Marshal(expect) if err != nil { t.Errorf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) got, err := client.ServerVersion() if err != nil { t.Fatalf("unexpected encoding error: %v", err) } if e, a := expect, *got; !reflect.DeepEqual(e, a) { t.Errorf("expected %v, got %v", e, a) } } func TestGetServerGroupsWithV1Server(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var obj interface{} switch req.URL.Path { case "/api": obj = &metav1.APIVersions{ Versions: []string{ "v1", }, } case "/apis": obj = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, }, } default: w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(obj) if err != nil { t.Fatalf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) apiGroupList, err := client.ServerGroups() if err != nil { t.Fatalf("unexpected error: %v", err) } groupVersions := metav1.ExtractGroupVersions(apiGroupList) if !reflect.DeepEqual(groupVersions, []string{"v1", "extensions/v1beta1"}) { t.Errorf("expected: %q, got: %q", []string{"v1", "extensions/v1beta1"}, groupVersions) } } func TestDiscoveryToleratesMissingCoreGroup(t *testing.T) { // Discovery tolerates 404 from /api. Aggregated api servers can do this. server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var obj interface{} switch req.URL.Path { case "/api": w.WriteHeader(http.StatusNotFound) case "/apis": obj = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, }, } } output, err := json.Marshal(obj) if err != nil { t.Fatalf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) // ServerGroups should not return an error even if server returns 404 at /api. apiGroupList, err := client.ServerGroups() if err != nil { t.Fatalf("unexpected error: %v", err) } groupVersions := metav1.ExtractGroupVersions(apiGroupList) if !reflect.DeepEqual(groupVersions, []string{"extensions/v1beta1"}) { t.Errorf("expected: %q, got: %q", []string{"extensions/v1beta1"}, groupVersions) } } func TestDiscoveryFailsWhenNonCoreGroupsMissing(t *testing.T) { // Discovery fails when /apis returns 404. server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var obj interface{} switch req.URL.Path { case "/api": obj = &metav1.APIVersions{ Versions: []string{ "v1", }, } case "/apis": w.WriteHeader(http.StatusNotFound) } output, err := json.Marshal(obj) if err != nil { t.Fatalf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) _, err := client.ServerGroups() if err == nil { t.Fatal("expected error, received none") } } func TestGetServerGroupsWithBrokenServer(t *testing.T) { // 404 Not Found errors because discovery at /apis returns an error. // 403 Forbidden errors because discovery at both /api and /apis returns error. for _, statusCode := range []int{http.StatusNotFound, http.StatusForbidden} { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { w.WriteHeader(statusCode) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) _, err := client.ServerGroups() if err == nil { t.Fatal("expected error, received none") } } } func TestTimeoutIsSet(t *testing.T) { cfg := &restclient.Config{} setDiscoveryDefaults(cfg) assert.Equal(t, defaultTimeout, cfg.Timeout) } func TestGetServerResourcesForGroupVersion(t *testing.T) { stable := metav1.APIResourceList{ GroupVersion: "v1", APIResources: []metav1.APIResource{ {Name: "pods", Namespaced: true, Kind: "Pod"}, {Name: "services", Namespaced: true, Kind: "Service"}, {Name: "namespaces", Namespaced: false, Kind: "Namespace"}, }, } beta := metav1.APIResourceList{ GroupVersion: "extensions/v1beta1", APIResources: []metav1.APIResource{ {Name: "deployments", Namespaced: true, Kind: "Deployment"}, {Name: "ingresses", Namespaced: true, Kind: "Ingress"}, {Name: "jobs", Namespaced: true, Kind: "Job"}, }, } beta2 := metav1.APIResourceList{ GroupVersion: "extensions/v1beta2", APIResources: []metav1.APIResource{ {Name: "deployments", Namespaced: true, Kind: "Deployment"}, {Name: "ingresses", Namespaced: true, Kind: "Ingress"}, {Name: "jobs", Namespaced: true, Kind: "Job"}, }, } extensionsbeta3 := metav1.APIResourceList{GroupVersion: "extensions/v1beta3", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} extensionsbeta4 := metav1.APIResourceList{GroupVersion: "extensions/v1beta4", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} extensionsbeta5 := metav1.APIResourceList{GroupVersion: "extensions/v1beta5", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} extensionsbeta6 := metav1.APIResourceList{GroupVersion: "extensions/v1beta6", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} extensionsbeta7 := metav1.APIResourceList{GroupVersion: "extensions/v1beta7", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} extensionsbeta8 := metav1.APIResourceList{GroupVersion: "extensions/v1beta8", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} extensionsbeta9 := metav1.APIResourceList{GroupVersion: "extensions/v1beta9", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} extensionsbeta10 := metav1.APIResourceList{GroupVersion: "extensions/v1beta10", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta1 := metav1.APIResourceList{GroupVersion: "apps/v1beta1", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta2 := metav1.APIResourceList{GroupVersion: "apps/v1beta2", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta3 := metav1.APIResourceList{GroupVersion: "apps/v1beta3", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta4 := metav1.APIResourceList{GroupVersion: "apps/v1beta4", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta5 := metav1.APIResourceList{GroupVersion: "apps/v1beta5", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta6 := metav1.APIResourceList{GroupVersion: "apps/v1beta6", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta7 := metav1.APIResourceList{GroupVersion: "apps/v1beta7", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta8 := metav1.APIResourceList{GroupVersion: "apps/v1beta8", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta9 := metav1.APIResourceList{GroupVersion: "apps/v1beta9", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} appsbeta10 := metav1.APIResourceList{GroupVersion: "apps/v1beta10", APIResources: []metav1.APIResource{{Name: "deployments", Namespaced: true, Kind: "Deployment"}}} tests := []struct { resourcesList *metav1.APIResourceList path string request string expectErr bool }{ { resourcesList: &stable, path: "/api/v1", request: "v1", expectErr: false, }, { resourcesList: &beta, path: "/apis/extensions/v1beta1", request: "extensions/v1beta1", expectErr: false, }, { resourcesList: &stable, path: "/api/v1", request: "foobar", expectErr: true, }, } server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var list interface{} switch req.URL.Path { case "/api/v1": list = &stable case "/apis/extensions/v1beta1": list = &beta case "/apis/extensions/v1beta2": list = &beta2 case "/apis/extensions/v1beta3": list = &extensionsbeta3 case "/apis/extensions/v1beta4": list = &extensionsbeta4 case "/apis/extensions/v1beta5": list = &extensionsbeta5 case "/apis/extensions/v1beta6": list = &extensionsbeta6 case "/apis/extensions/v1beta7": list = &extensionsbeta7 case "/apis/extensions/v1beta8": list = &extensionsbeta8 case "/apis/extensions/v1beta9": list = &extensionsbeta9 case "/apis/extensions/v1beta10": list = &extensionsbeta10 case "/apis/apps/v1beta1": list = &appsbeta1 case "/apis/apps/v1beta2": list = &appsbeta2 case "/apis/apps/v1beta3": list = &appsbeta3 case "/apis/apps/v1beta4": list = &appsbeta4 case "/apis/apps/v1beta5": list = &appsbeta5 case "/apis/apps/v1beta6": list = &appsbeta6 case "/apis/apps/v1beta7": list = &appsbeta7 case "/apis/apps/v1beta8": list = &appsbeta8 case "/apis/apps/v1beta9": list = &appsbeta9 case "/apis/apps/v1beta10": list = &appsbeta10 case "/api": list = &metav1.APIVersions{ Versions: []string{ "v1", }, } case "/apis": list = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "apps", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "apps/v1beta1", Version: "v1beta1"}, {GroupVersion: "apps/v1beta2", Version: "v1beta2"}, {GroupVersion: "apps/v1beta3", Version: "v1beta3"}, {GroupVersion: "apps/v1beta4", Version: "v1beta4"}, {GroupVersion: "apps/v1beta5", Version: "v1beta5"}, {GroupVersion: "apps/v1beta6", Version: "v1beta6"}, {GroupVersion: "apps/v1beta7", Version: "v1beta7"}, {GroupVersion: "apps/v1beta8", Version: "v1beta8"}, {GroupVersion: "apps/v1beta9", Version: "v1beta9"}, {GroupVersion: "apps/v1beta10", Version: "v1beta10"}, }, }, { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1", Version: "v1beta1"}, {GroupVersion: "extensions/v1beta2", Version: "v1beta2"}, {GroupVersion: "extensions/v1beta3", Version: "v1beta3"}, {GroupVersion: "extensions/v1beta4", Version: "v1beta4"}, {GroupVersion: "extensions/v1beta5", Version: "v1beta5"}, {GroupVersion: "extensions/v1beta6", Version: "v1beta6"}, {GroupVersion: "extensions/v1beta7", Version: "v1beta7"}, {GroupVersion: "extensions/v1beta8", Version: "v1beta8"}, {GroupVersion: "extensions/v1beta9", Version: "v1beta9"}, {GroupVersion: "extensions/v1beta10", Version: "v1beta10"}, }, }, }, } default: t.Logf("unexpected request: %s", req.URL.Path) w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(list) if err != nil { t.Errorf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() for _, test := range tests { client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) got, err := client.ServerResourcesForGroupVersion(test.request) if test.expectErr { if err == nil { t.Error("unexpected non-error") } continue } if err != nil { t.Errorf("unexpected error: %v", err) continue } if !reflect.DeepEqual(got, test.resourcesList) { t.Errorf("expected:\n%v\ngot:\n%v\n", test.resourcesList, got) } } client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) start := time.Now() _, serverResources, err := client.ServerGroupsAndResources() if err != nil { t.Errorf("unexpected error: %v", err) } end := time.Now() if d := end.Sub(start); d > time.Second { t.Errorf("took too long to perform discovery: %s", d) } serverGroupVersions := groupVersions(serverResources) expectedGroupVersions := []string{ "v1", "apps/v1beta1", "apps/v1beta2", "apps/v1beta3", "apps/v1beta4", "apps/v1beta5", "apps/v1beta6", "apps/v1beta7", "apps/v1beta8", "apps/v1beta9", "apps/v1beta10", "extensions/v1beta1", "extensions/v1beta2", "extensions/v1beta3", "extensions/v1beta4", "extensions/v1beta5", "extensions/v1beta6", "extensions/v1beta7", "extensions/v1beta8", "extensions/v1beta9", "extensions/v1beta10", } if !reflect.DeepEqual(expectedGroupVersions, serverGroupVersions) { t.Errorf("unexpected group versions: %v", cmp.Diff(expectedGroupVersions, serverGroupVersions)) } } func returnedOpenAPI() *openapi_v2.Document { return &openapi_v2.Document{ Definitions: &openapi_v2.Definitions{ AdditionalProperties: []*openapi_v2.NamedSchema{ { Name: "fake.type.1", Value: &openapi_v2.Schema{ Properties: &openapi_v2.Properties{ AdditionalProperties: []*openapi_v2.NamedSchema{ { Name: "count", Value: &openapi_v2.Schema{ Type: &openapi_v2.TypeItem{ Value: []string{"integer"}, }, }, }, }, }, }, }, { Name: "fake.type.2", Value: &openapi_v2.Schema{ Properties: &openapi_v2.Properties{ AdditionalProperties: []*openapi_v2.NamedSchema{ { Name: "count", Value: &openapi_v2.Schema{ Type: &openapi_v2.TypeItem{ Value: []string{"array"}, }, Items: &openapi_v2.ItemsItem{ Schema: []*openapi_v2.Schema{ { Type: &openapi_v2.TypeItem{ Value: []string{"string"}, }, }, }, }, }, }, }, }, }, }, }, }, } } func openapiSchemaFakeServer(t *testing.T) (*httptest.Server, error) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { if req.URL.Path != "/openapi/v2" { errMsg := fmt.Sprintf("Unexpected url %v", req.URL) w.WriteHeader(http.StatusNotFound) w.Write([]byte(errMsg)) t.Errorf("testing should fail as %s", errMsg) return } if req.Method != "GET" { errMsg := fmt.Sprintf("Unexpected method %v", req.Method) w.WriteHeader(http.StatusMethodNotAllowed) w.Write([]byte(errMsg)) t.Errorf("testing should fail as %s", errMsg) return } decipherableFormat := req.Header.Get("Accept") if decipherableFormat != "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" { errMsg := fmt.Sprintf("Unexpected accept mime type %v", decipherableFormat) w.WriteHeader(http.StatusUnsupportedMediaType) w.Write([]byte(errMsg)) t.Errorf("testing should fail as %s", errMsg) return } output, err := proto.Marshal(returnedOpenAPI()) if err != nil { errMsg := fmt.Sprintf("Unexpected marshal error: %v", err) w.WriteHeader(http.StatusInternalServerError) w.Write([]byte(errMsg)) t.Errorf("testing should fail as %s", errMsg) return } w.WriteHeader(http.StatusOK) w.Write(output) })) return server, nil } func openapiV3SchemaFakeServer(t *testing.T) (*httptest.Server, map[string]*spec3.OpenAPI, error) { res, err := testutil.NewFakeOpenAPIV3Server("testdata") if err != nil { return nil, nil, err } return res.HttpServer, res.ServedDocuments, nil } func TestGetOpenAPISchema(t *testing.T) { server, err := openapiSchemaFakeServer(t) if err != nil { t.Errorf("unexpected error starting fake server: %v", err) } defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) got, err := client.OpenAPISchema() if err != nil { t.Fatalf("unexpected error getting openapi: %v", err) } if e, a := returnedOpenAPI(), got; !golangproto.Equal(e, a) { t.Errorf("expected \n%v, got \n%v", e, a) } } func TestGetOpenAPISchemaV3(t *testing.T) { server, testV3Specs, err := openapiV3SchemaFakeServer(t) if err != nil { t.Errorf("unexpected error starting fake server: %v", err) } defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) openapiClient := client.OpenAPIV3() paths, err := openapiClient.Paths() if err != nil { t.Fatalf("unexpected error getting openapi: %v", err) } contentTypes := []string{ runtime.ContentTypeJSON, openapi.ContentTypeOpenAPIV3PB, } for _, contentType := range contentTypes { t.Run(contentType, func(t *testing.T) { for k, v := range paths { actual, err := v.Schema(contentType) if err != nil { t.Fatal(err) } expected := testV3Specs[k] switch contentType { case runtime.ContentTypeJSON: var actualSpec spec3.OpenAPI if err := json.Unmarshal(actual, &actualSpec); err != nil { t.Fatal(err) } // Cannot use DeepEqual directly due to differences in how // default key is being handled in gnostic vs kube-openapi // Our test server parses the files in directly as gnostic // which retains empty maps/lists, etc. require.EqualValues(t, expected, &actualSpec) case openapi.ContentTypeOpenAPIV3PB: // Convert to JSON then to gnostic then to PB for comparison expectedJSON, err := json.Marshal(expected) if err != nil { t.Fatal(err) } expectedGnostic, err := openapi_v3.ParseDocument(expectedJSON) if err != nil { t.Fatal(err) } expectedPB, err := golangproto.Marshal(expectedGnostic) if err != nil { t.Fatal(err) } if !reflect.DeepEqual(expectedPB, actual) { t.Fatalf("expected equal values: %v", cmp.Diff(expectedPB, actual)) } default: panic(fmt.Errorf("unrecognized content type: %v", contentType)) } // Ensure that fetching schema once again does not return same instance actualAgain, err := v.Schema(contentType) if err != nil { t.Fatal(err) } if reflect.ValueOf(actual).Pointer() == reflect.ValueOf(actualAgain).Pointer() { t.Fatal("expected schema not to be cached") } } }) } } func TestServerPreferredResources(t *testing.T) { stable := metav1.APIResourceList{ GroupVersion: "v1", APIResources: []metav1.APIResource{ {Name: "pods", Namespaced: true, Kind: "Pod"}, {Name: "services", Namespaced: true, Kind: "Service"}, {Name: "namespaces", Namespaced: false, Kind: "Namespace"}, }, } tests := []struct { resourcesList []*metav1.APIResourceList response func(w http.ResponseWriter, req *http.Request) expectErr func(err error) bool }{ { resourcesList: []*metav1.APIResourceList{&stable}, expectErr: IsGroupDiscoveryFailedError, response: func(w http.ResponseWriter, req *http.Request) { var list interface{} switch req.URL.Path { case "/apis/extensions/v1beta1": w.WriteHeader(http.StatusInternalServerError) return case "/api/v1": list = &stable case "/api": list = &metav1.APIVersions{ Versions: []string{ "v1", }, } case "/apis": list = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, }, } default: t.Logf("unexpected request: %s", req.URL.Path) w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(list) if err != nil { t.Errorf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write(output) }, }, { resourcesList: nil, expectErr: IsGroupDiscoveryFailedError, response: func(w http.ResponseWriter, req *http.Request) { var list interface{} switch req.URL.Path { case "/apis/extensions/v1beta1": w.WriteHeader(http.StatusInternalServerError) return case "/api/v1": w.WriteHeader(http.StatusInternalServerError) case "/api": list = &metav1.APIVersions{ Versions: []string{ "v1", }, } case "/apis": list = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1"}, }, }, }, } default: t.Logf("unexpected request: %s", req.URL.Path) w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(list) if err != nil { t.Errorf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write(output) }, }, } for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(test.response)) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) resources, err := client.ServerPreferredResources() if test.expectErr != nil { if err == nil { t.Error("unexpected non-error") } continue } if err != nil { t.Errorf("unexpected error: %v", err) continue } got, err := GroupVersionResources(resources) if err != nil { t.Errorf("unexpected error: %v", err) continue } expected, _ := GroupVersionResources(test.resourcesList) if !reflect.DeepEqual(got, expected) { t.Errorf("expected:\n%v\ngot:\n%v\n", test.resourcesList, got) } server.Close() } } func TestServerPreferredResourcesRetries(t *testing.T) { stable := metav1.APIResourceList{ GroupVersion: "v1", APIResources: []metav1.APIResource{ {Name: "pods", Namespaced: true, Kind: "Pod"}, }, } beta := metav1.APIResourceList{ GroupVersion: "extensions/v1", APIResources: []metav1.APIResource{ {Name: "deployments", Namespaced: true, Kind: "Deployment"}, }, } response := func(numErrors int) http.HandlerFunc { var i = 0 return func(w http.ResponseWriter, req *http.Request) { var list interface{} switch req.URL.Path { case "/apis/extensions/v1beta1": if i < numErrors { i++ w.WriteHeader(http.StatusInternalServerError) return } list = &beta case "/api/v1": list = &stable case "/api": list = &metav1.APIVersions{ Versions: []string{ "v1", }, } case "/apis": list = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "extensions/v1beta1", Version: "v1beta1"}, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "extensions/v1beta1", Version: "v1beta1", }, }, }, } default: t.Logf("unexpected request: %s", req.URL.Path) w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(list) if err != nil { t.Errorf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write(output) } } tests := []struct { responseErrors int expectResources int expectedError func(err error) bool }{ { responseErrors: 1, expectResources: 2, expectedError: func(err error) bool { return err == nil }, }, { responseErrors: 2, expectResources: 1, expectedError: IsGroupDiscoveryFailedError, }, } for i, tc := range tests { server := httptest.NewServer(http.HandlerFunc(response(tc.responseErrors))) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) resources, err := client.ServerPreferredResources() if !tc.expectedError(err) { t.Errorf("case %d: unexpected error: %v", i, err) } got, err := GroupVersionResources(resources) if err != nil { t.Errorf("case %d: unexpected error: %v", i, err) } if len(got) != tc.expectResources { t.Errorf("case %d: expect %d resources, got %#v", i, tc.expectResources, got) } server.Close() } } func TestServerPreferredNamespacedResources(t *testing.T) { stable := metav1.APIResourceList{ GroupVersion: "v1", APIResources: []metav1.APIResource{ {Name: "pods", Namespaced: true, Kind: "Pod"}, {Name: "services", Namespaced: true, Kind: "Service"}, {Name: "namespaces", Namespaced: false, Kind: "Namespace"}, }, } batchv1 := metav1.APIResourceList{ GroupVersion: "batch/v1", APIResources: []metav1.APIResource{ {Name: "jobs", Namespaced: true, Kind: "Job"}, }, } batchv2alpha1 := metav1.APIResourceList{ GroupVersion: "batch/v2alpha1", APIResources: []metav1.APIResource{ {Name: "jobs", Namespaced: true, Kind: "Job"}, {Name: "cronjobs", Namespaced: true, Kind: "CronJob"}, }, } batchv3alpha1 := metav1.APIResourceList{ GroupVersion: "batch/v3alpha1", APIResources: []metav1.APIResource{ {Name: "jobs", Namespaced: true, Kind: "Job"}, {Name: "cronjobs", Namespaced: true, Kind: "CronJob"}, }, } tests := []struct { response func(w http.ResponseWriter, req *http.Request) expected map[schema.GroupVersionResource]struct{} }{ { // Combines discovery for /api and /apis. response: func(w http.ResponseWriter, req *http.Request) { var list interface{} switch req.URL.Path { case "/api": list = &metav1.APIVersions{ Versions: []string{ "v1", }, } case "/api/v1": list = &stable case "/apis": list = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "batch", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "batch/v1", Version: "v1"}, }, PreferredVersion: metav1.GroupVersionForDiscovery{GroupVersion: "batch/v1", Version: "v1"}, }, }, } case "/apis/batch/v1": list = &batchv1 default: t.Logf("unexpected request: %s", req.URL.Path) w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(list) if err != nil { t.Errorf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write(output) }, expected: map[schema.GroupVersionResource]struct{}{ {Group: "", Version: "v1", Resource: "pods"}: {}, {Group: "", Version: "v1", Resource: "services"}: {}, {Group: "batch", Version: "v1", Resource: "jobs"}: {}, }, }, { // Only return /apis (not legacy /api); does not error. 404 for legacy // core/v1 at /api is tolerated. response: func(w http.ResponseWriter, req *http.Request) { var list interface{} switch req.URL.Path { case "/apis": list = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "batch", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "batch/v1", Version: "v1"}, {GroupVersion: "batch/v2alpha1", Version: "v2alpha1"}, {GroupVersion: "batch/v3alpha1", Version: "v3alpha1"}, }, PreferredVersion: metav1.GroupVersionForDiscovery{GroupVersion: "batch/v1", Version: "v1"}, }, }, } case "/apis/batch/v1": list = &batchv1 case "/apis/batch/v2alpha1": list = &batchv2alpha1 case "/apis/batch/v3alpha1": list = &batchv3alpha1 default: t.Logf("unexpected request: %s", req.URL.Path) w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(list) if err != nil { t.Errorf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write(output) }, expected: map[schema.GroupVersionResource]struct{}{ {Group: "batch", Version: "v1", Resource: "jobs"}: {}, {Group: "batch", Version: "v2alpha1", Resource: "cronjobs"}: {}, }, }, { response: func(w http.ResponseWriter, req *http.Request) { var list interface{} switch req.URL.Path { case "/apis": list = &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "batch", Versions: []metav1.GroupVersionForDiscovery{ {GroupVersion: "batch/v1", Version: "v1"}, {GroupVersion: "batch/v2alpha1", Version: "v2alpha1"}, {GroupVersion: "batch/v3alpha1", Version: "v3alpha1"}, }, PreferredVersion: metav1.GroupVersionForDiscovery{GroupVersion: "batch/v2alpha", Version: "v2alpha1"}, }, }, } case "/apis/batch/v1": list = &batchv1 case "/apis/batch/v2alpha1": list = &batchv2alpha1 case "/apis/batch/v3alpha1": list = &batchv3alpha1 default: t.Logf("unexpected request: %s", req.URL.Path) w.WriteHeader(http.StatusNotFound) return } output, err := json.Marshal(list) if err != nil { t.Errorf("unexpected encoding error: %v", err) return } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write(output) }, expected: map[schema.GroupVersionResource]struct{}{ {Group: "batch", Version: "v2alpha1", Resource: "jobs"}: {}, {Group: "batch", Version: "v2alpha1", Resource: "cronjobs"}: {}, }, }, } for i, test := range tests { server := httptest.NewServer(http.HandlerFunc(test.response)) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) resources, err := client.ServerPreferredNamespacedResources() if err != nil { t.Errorf("[%d] unexpected error: %v", i, err) continue } got, err := GroupVersionResources(resources) if err != nil { t.Errorf("[%d] unexpected error: %v", i, err) continue } if !reflect.DeepEqual(got, test.expected) { t.Errorf("[%d] expected:\n%v\ngot:\n%v\n", i, test.expected, got) } server.Close() } } // Tests of the aggregated discovery format. func TestAggregatedServerGroups(t *testing.T) { tests := []struct { name string corev1 *apidiscovery.APIGroupDiscoveryList apis *apidiscovery.APIGroupDiscoveryList expectedGroupNames []string expectedGroupVersions []string expectedPreferredVersions []string }{ { name: "Aggregated discovery: 1 group/1 version at /api, 1 group/1 version at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedPreferredVersions: []string{"v1", "apps/v1"}, }, { name: "Aggregated discovery: 1 group/1 version at /api, 1 group/2 versions at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ // v2 is preferred since it is first { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1", "apps/v2"}, expectedPreferredVersions: []string{"v1", "apps/v2"}, }, { name: "Aggregated discovery: /api returns nothing, 2 groups at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{}, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ // v1 is preferred since it is first { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"apps", "batch"}, expectedGroupVersions: []string{"apps/v1", "batch/v1", "batch/v1beta1"}, expectedPreferredVersions: []string{"apps/v1", "batch/v1"}, }, } for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var output []byte var err error var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1 case "/apis": agg = test.apis default: w.WriteHeader(http.StatusNotFound) return } output, err = json.Marshal(agg) require.NoError(t, err) // Content-Type is "aggregated" discovery format. Add extra parameter // to ensure we are resilient to these extra parameters. w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8") w.WriteHeader(http.StatusOK) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) apiGroupList, err := client.ServerGroups() require.NoError(t, err) // Test the expected groups are returned for the aggregated format. expectedGroupNames := sets.NewString(test.expectedGroupNames...) actualGroupNames := sets.NewString(groupNamesFromList(apiGroupList)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected groups (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) // Test the expected group versions for the aggregated discovery is correct. expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) actualGroupVersions := sets.NewString(groupVersionsFromGroups(apiGroupList)...) assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), "%s: Expected group/versions (%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) // Test the groups preferred version is correct. expectedPreferredVersions := sets.NewString(test.expectedPreferredVersions...) actualPreferredVersions := sets.NewString(preferredVersionsFromList(apiGroupList)...) assert.True(t, expectedPreferredVersions.Equal(actualPreferredVersions), "%s: Expected preferred group/version (%s), got (%s)", test.name, expectedPreferredVersions.List(), actualPreferredVersions.List()) } } func TestAggregatedServerGroupsAndResources(t *testing.T) { tests := []struct { name string corev1 *apidiscovery.APIGroupDiscoveryList corev1DiscoveryBeta *apidiscoveryv2beta1.APIGroupDiscoveryList apis *apidiscovery.APIGroupDiscoveryList apisDiscoveryBeta *apidiscoveryv2beta1.APIGroupDiscoveryList expectedGroupNames []string expectedGroupVersions []string expectedGVKs []string expectedFailedGVs []string }{ { name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/1 resources at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ "/v1/Pod", "apps/v1/Deployment", }, }, { name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/2 versions/1 resources at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, { Version: "v2", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1", "apps/v2"}, expectedGVKs: []string{ "/v1/Pod", "apps/v1/Deployment", "apps/v2/Deployment", }, }, { name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/2 versions/1 resources at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, }, }, }, }, apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, { Version: "v2", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ "/v1/Pod", "apps/v1/Deployment", }, expectedFailedGVs: []string{"apps/v2"}, }, { name: "Aggregated discovery: 1 group/2 resources at /api, 1 group/2 resources at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ // Stale "v2" version not included. { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ // Stale "v2" version not included. { Version: "v2", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "StatefulSet", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, }, { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps"}, expectedGroupVersions: []string{"v1", "apps/v1"}, expectedGVKs: []string{ "/v1/Pod", "/v1/Service", "apps/v1/Deployment", "apps/v1/StatefulSet", }, expectedFailedGVs: []string{"apps/v2"}, }, { name: "Aggregated discovery: 1 group/2 resources at /api, 2 group/2 resources/1 stale GV at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ // Stale Group/Version is not included { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, { Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ // Stale Group/Version is not included { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, }, { Version: "v1beta1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "CronJob", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, }, }, expectedGroupNames: []string{"", "apps", "batch"}, expectedGroupVersions: []string{"v1", "apps/v1", "batch/v1beta1"}, expectedGVKs: []string{ "/v1/Pod", "/v1/Service", "apps/v1/Deployment", "apps/v1/StatefulSet", "batch/v1beta1/Job", "batch/v1beta1/CronJob", }, expectedFailedGVs: []string{"batch/v1"}, }, { name: "Aggregated discovery: /api returns nothing, 2 groups/2 resources at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{}, corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{}, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { // Stale "v1beta1" not included. Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, }, }, }, }, apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{ Items: []apidiscoveryv2beta1.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscoveryv2beta1.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, }, { // Stale "v1beta1" not included. Version: "v1beta1", Resources: []apidiscoveryv2beta1.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "CronJob", }, Scope: apidiscoveryv2beta1.ScopeNamespace, }, }, Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale, }, }, }, }, }, expectedGroupNames: []string{"apps", "batch"}, expectedGroupVersions: []string{"apps/v1", "batch/v1"}, expectedGVKs: []string{ "apps/v1/Deployment", "apps/v1/StatefulSet", "batch/v1/Job", "batch/v1/CronJob", }, expectedFailedGVs: []string{"batch/v1beta1"}, }, } // Ensure that client can parse both V2Beta1 and V2 types from server serverAccepts := []string{AcceptV2Beta1, AcceptV2} for _, test := range tests { for _, accept := range serverAccepts { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var output []byte var err error if accept == AcceptV2 { var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1 case "/apis": agg = test.apis default: w.WriteHeader(http.StatusNotFound) return } output, err = json.Marshal(agg) require.NoError(t, err) } else { var agg *apidiscoveryv2beta1.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1DiscoveryBeta case "/apis": agg = test.apisDiscoveryBeta default: w.WriteHeader(http.StatusNotFound) return } output, err = json.Marshal(&agg) require.NoError(t, err) } // Content-Type is "aggregated" discovery format. Add extra parameter // to ensure we are resilient to these extra parameters. w.Header().Set("Content-Type", accept+"; charset=utf-8") w.WriteHeader(http.StatusOK) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) apiGroups, resources, err := client.ServerGroupsAndResources() if len(test.expectedFailedGVs) > 0 { require.Error(t, err) expectedFailedGVs := sets.NewString(test.expectedFailedGVs...) actualFailedGVs := sets.NewString(failedGroupVersions(err)...) assert.True(t, expectedFailedGVs.Equal(actualFailedGVs), "%s: Expected Failed GVs (%s), got (%s)", test.name, expectedFailedGVs, actualFailedGVs) } else { require.NoError(t, err) } // Test the expected groups are returned for the aggregated format. expectedGroupNames := sets.NewString(test.expectedGroupNames...) actualGroupNames := sets.NewString(groupNames(apiGroups)...) assert.True(t, expectedGroupNames.Equal(actualGroupNames), "%s: Expected GVKs (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List()) // If the core V1 group is returned from /api, it should be the first group. if expectedGroupNames.Has("") { assert.True(t, len(apiGroups) > 0) actualFirstGroup := apiGroups[0] assert.True(t, len(actualFirstGroup.Versions) > 0) actualFirstGroupVersion := actualFirstGroup.Versions[0].GroupVersion assert.Equal(t, "v1", actualFirstGroupVersion) } // Test the expected group/versions are returned from the aggregated discovery. expectedGroupVersions := sets.NewString(test.expectedGroupVersions...) actualGroupVersions := sets.NewString(groupVersions(resources)...) assert.True(t, expectedGroupVersions.Equal(actualGroupVersions), "%s: Expected GroupVersions(%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List()) // Test the expected GVKs are returned from the aggregated discovery. expectedGVKs := sets.NewString(test.expectedGVKs...) actualGVKs := sets.NewString(groupVersionKinds(resources)...) assert.True(t, expectedGVKs.Equal(actualGVKs), "%s: Expected GVKs (%s), got (%s)", test.name, expectedGVKs.List(), actualGVKs.List()) } } } func TestAggregatedServerGroupsAndResourcesWithErrors(t *testing.T) { tests := []struct { name string corev1 *apidiscovery.APIGroupDiscoveryList coreHttpStatus int apis *apidiscovery.APIGroupDiscoveryList apisHttpStatus int expectedGroups []string expectedResources []string expectedErr bool }{ { name: "Aggregated Discovery: 404 for core/v1 is tolerated", corev1: &apidiscovery.APIGroupDiscoveryList{}, coreHttpStatus: http.StatusNotFound, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "daemonsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "DaemonSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apisHttpStatus: http.StatusOK, expectedGroups: []string{"apps"}, expectedResources: []string{"apps/v1/Deployment", "apps/v1/DaemonSet"}, expectedErr: false, }, { name: "Aggregated Discovery: 403 for core/v1 causes error", corev1: &apidiscovery.APIGroupDiscoveryList{}, coreHttpStatus: http.StatusForbidden, apis: &apidiscovery.APIGroupDiscoveryList{}, apisHttpStatus: http.StatusOK, expectedErr: true, }, { name: "Aggregated Discovery: 404 for /apis causes error", corev1: &apidiscovery.APIGroupDiscoveryList{}, coreHttpStatus: http.StatusOK, apis: &apidiscovery.APIGroupDiscoveryList{}, apisHttpStatus: http.StatusNotFound, expectedErr: true, }, { name: "Aggregated Discovery: 403 for /apis causes error", corev1: &apidiscovery.APIGroupDiscoveryList{}, coreHttpStatus: http.StatusOK, apis: &apidiscovery.APIGroupDiscoveryList{}, apisHttpStatus: http.StatusForbidden, expectedErr: true, }, } for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var output []byte var err error var status int var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1 status = test.coreHttpStatus case "/apis": agg = test.apis status = test.apisHttpStatus default: w.WriteHeader(http.StatusNotFound) return } output, err = json.Marshal(agg) require.NoError(t, err) // Content-Type is "aggregated" discovery format. Add extra parameter // to ensure we are resilient to these extra parameters. w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8") w.WriteHeader(status) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) apiGroups, resources, err := client.ServerGroupsAndResources() if test.expectedErr { require.Error(t, err) require.Nil(t, apiGroups) require.Nil(t, resources) continue } require.NoError(t, err) // First check the returned groups expectedGroups := sets.NewString(test.expectedGroups...) actualGroups := sets.NewString(groupNames(apiGroups)...) assert.True(t, expectedGroups.Equal(actualGroups), "%s: Expected GVKs (%s), got (%s)", test.name, expectedGroups.List(), actualGroups.List()) // Next check the returned resources expectedGVKs := sets.NewString(test.expectedResources...) actualGVKs := sets.NewString(groupVersionKinds(resources)...) assert.True(t, expectedGVKs.Equal(actualGVKs), "%s: Expected GVKs (%s), got (%s)", test.name, expectedGVKs.List(), actualGVKs.List()) } } func TestAggregatedServerPreferredResources(t *testing.T) { tests := []struct { name string corev1 *apidiscovery.APIGroupDiscoveryList apis *apidiscovery.APIGroupDiscoveryList expectedGVKs []string expectedFailedGVs []string }{ { name: "Aggregated discovery: basic corev1 and apps/v1 preferred resources returned", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGVKs: []string{ "/v1/Pod", "apps/v1/Deployment", }, }, { name: "Aggregated discovery: only resources from preferred apps/v2 group/version", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ // v2 is "preferred version since it is first { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, // Only v2 resources from apps group, since v2 is preferred version. expectedGVKs: []string{ "/v1/Pod", "apps/v2/Deployment", }, }, { name: "Aggregated discovery: stale Group/Version can not produce preferred version", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ // v2 is "stale", so it can not be "preferred". { Version: "v2", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v2", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, // Only v1 resources from apps group; v2 would be preferred but it is "stale". expectedGVKs: []string{ "/v1/Pod", "apps/v1/Deployment", }, expectedFailedGVs: []string{"apps/v2"}, }, { name: "Aggregated discovery: preferred multiple resources from multiple group/versions", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1beta1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1beta1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, Freshness: apidiscovery.DiscoveryFreshnessStale, }, }, }, }, }, expectedGVKs: []string{ "/v1/Pod", "/v1/Service", "apps/v1/Deployment", "apps/v1/StatefulSet", }, expectedFailedGVs: []string{"apps/v1beta1"}, }, { name: "Aggregated discovery: resources from multiple preferred group versions at /apis", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { // Not included because "v1" is preferred. Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1beta1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1beta1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, expectedGVKs: []string{ "/v1/Pod", "/v1/Service", "apps/v1/Deployment", "apps/v1/StatefulSet", "batch/v1/Job", "batch/v1/CronJob", }, }, { name: "Aggregated discovery: resources from only preferred group versions for batch group", corev1: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "pods", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "services", ResponseKind: &metav1.GroupVersionKind{ Group: "", Version: "v1", Kind: "Service", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, apis: &apidiscovery.APIGroupDiscoveryList{ Items: []apidiscovery.APIGroupDiscovery{ { ObjectMeta: metav1.ObjectMeta{ Name: "apps", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "deployments", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "Deployment", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "statefulsets", ResponseKind: &metav1.GroupVersionKind{ Group: "apps", Version: "v1", Kind: "StatefulSet", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "batch", }, Versions: []apidiscovery.APIVersionDiscovery{ { Version: "v1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, { // Not included, since "v1" is preferred. Version: "v1beta1", Resources: []apidiscovery.APIResourceDiscovery{ { Resource: "jobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "Job", }, Scope: apidiscovery.ScopeNamespace, }, { Resource: "cronjobs", ResponseKind: &metav1.GroupVersionKind{ Group: "batch", Version: "v1beta1", Kind: "CronJob", }, Scope: apidiscovery.ScopeNamespace, }, }, }, }, }, }, }, // Only preferred resources expected--not batch/v1beta1 resources. expectedGVKs: []string{ "/v1/Pod", "/v1/Service", "apps/v1/Deployment", "apps/v1/StatefulSet", "batch/v1/Job", "batch/v1/CronJob", }, }, } for _, test := range tests { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var output []byte var err error var agg *apidiscovery.APIGroupDiscoveryList switch req.URL.Path { case "/api": agg = test.corev1 case "/apis": agg = test.apis default: w.WriteHeader(http.StatusNotFound) return } output, err = json.Marshal(agg) require.NoError(t, err) // Content-Type is "aggregated" discovery format. Add extra parameter // to ensure we are resilient to these extra parameters. w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8") w.WriteHeader(http.StatusOK) _, err = w.Write(output) require.NoError(t, err) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) resources, err := client.ServerPreferredResources() if len(test.expectedFailedGVs) > 0 { require.Error(t, err) expectedFailedGVs := sets.NewString(test.expectedFailedGVs...) actualFailedGVs := sets.NewString(failedGroupVersions(err)...) assert.True(t, expectedFailedGVs.Equal(actualFailedGVs), "%s: Expected Failed GVs (%s), got (%s)", test.name, expectedFailedGVs, actualFailedGVs) } else { require.NoError(t, err) } // Test the expected preferred GVKs are returned from the aggregated discovery. expectedGVKs := sets.NewString(test.expectedGVKs...) actualGVKs := sets.NewString(groupVersionKinds(resources)...) assert.True(t, expectedGVKs.Equal(actualGVKs), "%s: Expected GVKs (%s), got (%s)", test.name, expectedGVKs.List(), actualGVKs.List()) } } func TestDiscoveryContentTypeVersion(t *testing.T) { v2 := schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2", Kind: "APIGroupDiscoveryList"} tests := []struct { contentType string gvk schema.GroupVersionKind match bool expectErr bool }{ { contentType: "application/json; g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList", gvk: v2, match: true, expectErr: false, }, { // content-type parameters are not in correct order, but comparison ignores order. contentType: "application/json; v=v2;as=APIGroupDiscoveryList;g=apidiscovery.k8s.io", gvk: v2, match: true, expectErr: false, }, { // content-type parameters are not in correct order, but comparison ignores order. contentType: "application/json; as=APIGroupDiscoveryList;g=apidiscovery.k8s.io;v=v2", gvk: v2, match: true, expectErr: false, }, { // Ignores extra parameter "charset=utf-8" contentType: "application/json; g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList;charset=utf-8", gvk: v2, match: true, expectErr: false, }, { contentType: "application/json", gvk: v2, match: false, expectErr: false, }, { contentType: "application/json; charset=UTF-8", gvk: v2, match: false, expectErr: false, }, { contentType: "text/json", gvk: v2, match: false, expectErr: false, }, { contentType: "text/html", gvk: v2, match: false, expectErr: false, }, { contentType: "", gvk: v2, match: false, expectErr: true, }, } for _, test := range tests { match, err := ContentTypeIsGVK(test.contentType, test.gvk) assert.Equal(t, test.expectErr, err != nil) assert.Equal(t, test.match, match) } } func TestUseLegacyDiscovery(t *testing.T) { // Default client sends aggregated discovery accept format (first) as well as legacy format. server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { acceptHeader := req.Header.Get("Accept") assert.Equal(t, acceptDiscoveryFormats, acceptHeader) })) defer server.Close() client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) client.ServerGroups() // When "UseLegacyDiscovery" field is set, only the legacy discovery format is requested. server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { acceptHeader := req.Header.Get("Accept") assert.Equal(t, AcceptV1, acceptHeader) })) defer server.Close() client = NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) client.UseLegacyDiscovery = true client.ServerGroups() } func groupNames(groups []*metav1.APIGroup) []string { result := []string{} for _, group := range groups { result = append(result, group.Name) } return result } func groupNamesFromList(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { result = append(result, group.Name) } return result } func preferredVersionsFromList(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { preferredGV := group.PreferredVersion.GroupVersion result = append(result, preferredGV) } return result } func groupVersions(resources []*metav1.APIResourceList) []string { result := []string{} for _, resourceList := range resources { result = append(result, resourceList.GroupVersion) } return result } func groupVersionsFromGroups(groups *metav1.APIGroupList) []string { result := []string{} for _, group := range groups.Groups { for _, version := range group.Versions { result = append(result, version.GroupVersion) } } return result } func groupVersionKinds(resources []*metav1.APIResourceList) []string { result := []string{} for _, resourceList := range resources { for _, resource := range resourceList.APIResources { gvk := fmt.Sprintf("%s/%s/%s", resource.Group, resource.Version, resource.Kind) result = append(result, gvk) } } return result } func failedGroupVersions(err error) []string { result := []string{} ferr, ok := err.(*ErrGroupDiscoveryFailed) if !ok { return result } for gv := range ferr.Groups { result = append(result, gv.String()) } return result } kubernetes-client-go-a2dfcab/discovery/doc.go000066400000000000000000000013331472614177300215030ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package discovery provides ways to discover server-supported // API groups, versions and resources. package discovery // import "k8s.io/client-go/discovery" kubernetes-client-go-a2dfcab/discovery/fake/000077500000000000000000000000001472614177300213155ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/discovery/fake/discovery.go000066400000000000000000000124121472614177300236530ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "fmt" "net/http" openapi_v2 "github.com/google/gnostic-models/openapiv2" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/discovery" "k8s.io/client-go/openapi" kubeversion "k8s.io/client-go/pkg/version" restclient "k8s.io/client-go/rest" "k8s.io/client-go/testing" ) // FakeDiscovery implements discovery.DiscoveryInterface and sometimes calls testing.Fake.Invoke with an action, // but doesn't respect the return value if any. There is a way to fake static values like ServerVersion by using the Faked... fields on the struct. type FakeDiscovery struct { *testing.Fake FakedServerVersion *version.Info } // ServerResourcesForGroupVersion returns the supported resources for a group // and version. func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { action := testing.ActionImpl{ Verb: "get", Resource: schema.GroupVersionResource{Resource: "resource"}, } if _, err := c.Invokes(action, nil); err != nil { return nil, err } for _, resourceList := range c.Resources { if resourceList.GroupVersion == groupVersion { return resourceList, nil } } return nil, &errors.StatusError{ ErrStatus: metav1.Status{ Status: metav1.StatusFailure, Code: http.StatusNotFound, Reason: metav1.StatusReasonNotFound, Message: fmt.Sprintf("the server could not find the requested resource, GroupVersion %q not found", groupVersion), }} } // ServerGroupsAndResources returns the supported groups and resources for all groups and versions. func (c *FakeDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { sgs, err := c.ServerGroups() if err != nil { return nil, nil, err } resultGroups := []*metav1.APIGroup{} for i := range sgs.Groups { resultGroups = append(resultGroups, &sgs.Groups[i]) } action := testing.ActionImpl{ Verb: "get", Resource: schema.GroupVersionResource{Resource: "resource"}, } if _, err = c.Invokes(action, nil); err != nil { return resultGroups, c.Resources, err } return resultGroups, c.Resources, nil } // ServerPreferredResources returns the supported resources with the version // preferred by the server. func (c *FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error) { return nil, nil } // ServerPreferredNamespacedResources returns the supported namespaced resources // with the version preferred by the server. func (c *FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { return nil, nil } // ServerGroups returns the supported groups, with information like supported // versions and the preferred version. func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) { action := testing.ActionImpl{ Verb: "get", Resource: schema.GroupVersionResource{Resource: "group"}, } if _, err := c.Invokes(action, nil); err != nil { return nil, err } groups := map[string]*metav1.APIGroup{} for _, res := range c.Resources { gv, err := schema.ParseGroupVersion(res.GroupVersion) if err != nil { return nil, err } group := groups[gv.Group] if group == nil { group = &metav1.APIGroup{ Name: gv.Group, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: res.GroupVersion, Version: gv.Version, }, } groups[gv.Group] = group } group.Versions = append(group.Versions, metav1.GroupVersionForDiscovery{ GroupVersion: res.GroupVersion, Version: gv.Version, }) } list := &metav1.APIGroupList{} for _, apiGroup := range groups { list.Groups = append(list.Groups, *apiGroup) } return list, nil } // ServerVersion retrieves and parses the server's version. func (c *FakeDiscovery) ServerVersion() (*version.Info, error) { action := testing.ActionImpl{} action.Verb = "get" action.Resource = schema.GroupVersionResource{Resource: "version"} _, err := c.Invokes(action, nil) if err != nil { return nil, err } if c.FakedServerVersion != nil { return c.FakedServerVersion, nil } versionInfo := kubeversion.Get() return &versionInfo, nil } // OpenAPISchema retrieves and parses the swagger API schema the server supports. func (c *FakeDiscovery) OpenAPISchema() (*openapi_v2.Document, error) { return &openapi_v2.Document{}, nil } func (c *FakeDiscovery) OpenAPIV3() openapi.Client { panic("unimplemented") } // RESTClient returns a RESTClient that is used to communicate with API server // by this client implementation. func (c *FakeDiscovery) RESTClient() restclient.Interface { return nil } func (c *FakeDiscovery) WithLegacy() discovery.DiscoveryInterface { panic("unimplemented") } kubernetes-client-go-a2dfcab/discovery/fake/discovery_test.go000066400000000000000000000074151472614177300247210ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake_test import ( "errors" "testing" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/version" fakediscovery "k8s.io/client-go/discovery/fake" fakeclientset "k8s.io/client-go/kubernetes/fake" kubetesting "k8s.io/client-go/testing" ) func TestFakingServerVersion(t *testing.T) { client := fakeclientset.NewSimpleClientset() fakeDiscovery, ok := client.Discovery().(*fakediscovery.FakeDiscovery) if !ok { t.Fatalf("couldn't convert Discovery() to *FakeDiscovery") } testGitCommit := "v1.0.0" fakeDiscovery.FakedServerVersion = &version.Info{ GitCommit: testGitCommit, } sv, err := client.Discovery().ServerVersion() if err != nil { t.Fatalf("unexpected error: %v", err) } if sv.GitCommit != testGitCommit { t.Fatalf("unexpected faked discovery return value: %q", sv.GitCommit) } } func TestFakingServerVersionWithError(t *testing.T) { expectedError := errors.New("an error occurred") fakeClient := fakeclientset.NewSimpleClientset() fakeClient.Discovery().(*fakediscovery.FakeDiscovery).PrependReactor("*", "*", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) { return true, nil, expectedError }) _, err := fakeClient.Discovery().ServerVersion() if err == nil { t.Fatal("ServerVersion should return error, returned nil instead") } if err != expectedError { t.Fatal("ServerVersion should return expected error, returned different error instead") } } func TestFakingServerResourcesForGroupVersionWithError(t *testing.T) { expectedError := errors.New("an error occurred") fakeClient := fakeclientset.NewClientset() fakeClient.Discovery().(*fakediscovery.FakeDiscovery).PrependReactor("*", "*", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) { return true, nil, expectedError }) result, err := fakeClient.Discovery().ServerResourcesForGroupVersion("dummy.group.io/v1beta2") if result != nil { t.Errorf(`expect result to be nil but got "%v" instead`, result) } if !errors.Is(err, expectedError) { t.Errorf(`expect error to be "%v" but got "%v" instead`, expectedError, err) } } func TestFakingServerGroupsWithError(t *testing.T) { expectedError := errors.New("an error occurred") fakeClient := fakeclientset.NewClientset() fakeClient.Discovery().(*fakediscovery.FakeDiscovery).PrependReactor("*", "*", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) { return true, nil, expectedError }) result, err := fakeClient.Discovery().ServerGroups() if result != nil { t.Errorf(`expect result to be nil but got "%v" instead`, result) } if !errors.Is(err, expectedError) { t.Errorf(`expect error to be "%v" but got "%v" instead`, expectedError, err) } } func TestFakingServerGroupsAndResourcesWithError(t *testing.T) { expectedError := errors.New("an error occurred") fakeClient := fakeclientset.NewClientset() fakeClient.Discovery().(*fakediscovery.FakeDiscovery).PrependReactor("get", "resource", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) { return true, nil, expectedError }) _, _, err := fakeClient.Discovery().ServerGroupsAndResources() if !errors.Is(err, expectedError) { t.Errorf(`expect error to be "%v" but got "%v" instead`, expectedError, err) } } kubernetes-client-go-a2dfcab/discovery/helper.go000066400000000000000000000124531472614177300222220ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package discovery import ( "fmt" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" apimachineryversion "k8s.io/apimachinery/pkg/version" ) // IsResourceEnabled queries the server to determine if the resource specified is present on the server. // This is particularly helpful when writing a controller or an e2e test that requires a particular resource to function. func IsResourceEnabled(client DiscoveryInterface, resourceToCheck schema.GroupVersionResource) (bool, error) { // this is a single request. The ServerResourcesForGroupVersion handles the core v1 group as legacy. resourceList, err := client.ServerResourcesForGroupVersion(resourceToCheck.GroupVersion().String()) if apierrors.IsNotFound(err) { // if the discovery endpoint isn't present, then the resource isn't present. return false, nil } if err != nil { return false, err } for _, actualResource := range resourceList.APIResources { if actualResource.Name == resourceToCheck.Resource { return true, nil } } return false, nil } // MatchesServerVersion queries the server to compares the build version // (git hash) of the client with the server's build version. It returns an error // if it failed to contact the server or if the versions are not an exact match. func MatchesServerVersion(clientVersion apimachineryversion.Info, client DiscoveryInterface) error { sVer, err := client.ServerVersion() if err != nil { return fmt.Errorf("couldn't read version from server: %v", err) } // GitVersion includes GitCommit and GitTreeState, but best to be safe? if clientVersion.GitVersion != sVer.GitVersion || clientVersion.GitCommit != sVer.GitCommit || clientVersion.GitTreeState != sVer.GitTreeState { return fmt.Errorf("server version (%#v) differs from client version (%#v)", sVer, clientVersion) } return nil } // ServerSupportsVersion returns an error if the server doesn't have the required version func ServerSupportsVersion(client DiscoveryInterface, requiredGV schema.GroupVersion) error { groups, err := client.ServerGroups() if err != nil { // This is almost always a connection error, and higher level code should treat this as a generic error, // not a negotiation specific error. return err } versions := metav1.ExtractGroupVersions(groups) serverVersions := sets.String{} for _, v := range versions { serverVersions.Insert(v) } if serverVersions.Has(requiredGV.String()) { return nil } // If the server supports no versions, then we should pretend it has the version because of old servers. // This can happen because discovery fails due to 403 Forbidden errors if len(serverVersions) == 0 { return nil } return fmt.Errorf("server does not support API version %q", requiredGV) } // GroupVersionResources converts APIResourceLists to the GroupVersionResources. func GroupVersionResources(rls []*metav1.APIResourceList) (map[schema.GroupVersionResource]struct{}, error) { gvrs := map[schema.GroupVersionResource]struct{}{} for _, rl := range rls { gv, err := schema.ParseGroupVersion(rl.GroupVersion) if err != nil { return nil, err } for i := range rl.APIResources { gvrs[schema.GroupVersionResource{Group: gv.Group, Version: gv.Version, Resource: rl.APIResources[i].Name}] = struct{}{} } } return gvrs, nil } // FilteredBy filters by the given predicate. Empty APIResourceLists are dropped. func FilteredBy(pred ResourcePredicate, rls []*metav1.APIResourceList) []*metav1.APIResourceList { result := []*metav1.APIResourceList{} for _, rl := range rls { filtered := *rl filtered.APIResources = nil for i := range rl.APIResources { if pred.Match(rl.GroupVersion, &rl.APIResources[i]) { filtered.APIResources = append(filtered.APIResources, rl.APIResources[i]) } } if filtered.APIResources != nil { result = append(result, &filtered) } } return result } // ResourcePredicate has a method to check if a resource matches a given condition. type ResourcePredicate interface { Match(groupVersion string, r *metav1.APIResource) bool } // ResourcePredicateFunc returns true if it matches a resource based on a custom condition. type ResourcePredicateFunc func(groupVersion string, r *metav1.APIResource) bool // Match is a wrapper around ResourcePredicateFunc. func (fn ResourcePredicateFunc) Match(groupVersion string, r *metav1.APIResource) bool { return fn(groupVersion, r) } // SupportsAllVerbs is a predicate matching a resource iff all given verbs are supported. type SupportsAllVerbs struct { Verbs []string } // Match checks if a resource contains all the given verbs. func (p SupportsAllVerbs) Match(groupVersion string, r *metav1.APIResource) bool { return sets.NewString([]string(r.Verbs)...).HasAll(p.Verbs...) } kubernetes-client-go-a2dfcab/discovery/helper_blackbox_test.go000066400000000000000000000134771472614177300251350ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package discovery_test import ( "bytes" "encoding/json" "errors" "io" "net/http" "strings" "testing" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/discovery" restclient "k8s.io/client-go/rest" "k8s.io/client-go/rest/fake" ) func objBody(object interface{}) io.ReadCloser { output, err := json.MarshalIndent(object, "", "") if err != nil { panic(err) } return io.NopCloser(bytes.NewReader([]byte(output))) } func TestServerSupportsVersion(t *testing.T) { tests := []struct { name string requiredVersion schema.GroupVersion serverVersions []string expectErr func(err error) bool sendErr error statusCode int }{ { name: "explicit version supported", requiredVersion: schema.GroupVersion{Version: "v1"}, serverVersions: []string{"/version1", v1.SchemeGroupVersion.String()}, statusCode: http.StatusOK, }, { name: "explicit version not supported on server", requiredVersion: schema.GroupVersion{Version: "v1"}, serverVersions: []string{"version1"}, expectErr: func(err error) bool { return strings.Contains(err.Error(), `server does not support API version "v1"`) }, statusCode: http.StatusOK, }, { name: "Status 403 Forbidden for core/v1 group returns error and is unsupported", requiredVersion: schema.GroupVersion{Version: "v1"}, serverVersions: []string{"/version1", v1.SchemeGroupVersion.String()}, expectErr: func(err error) bool { return strings.Contains(err.Error(), "unknown") }, statusCode: http.StatusForbidden, }, { name: "Status 404 Not Found for core/v1 group returns empty and is unsupported", requiredVersion: schema.GroupVersion{Version: "v1"}, serverVersions: []string{"/version1", v1.SchemeGroupVersion.String()}, expectErr: func(err error) bool { return strings.Contains(err.Error(), "server could not find the requested resource") }, statusCode: http.StatusNotFound, }, { name: "connection refused error", serverVersions: []string{"version1"}, sendErr: errors.New("connection refused"), expectErr: func(err error) bool { return strings.Contains(err.Error(), "connection refused") }, statusCode: http.StatusOK, }, } for _, test := range tests { fakeClient := fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { if test.sendErr != nil { return nil, test.sendErr } header := http.Header{} header.Set("Content-Type", runtime.ContentTypeJSON) return &http.Response{StatusCode: test.statusCode, Header: header, Body: objBody(&metav1.APIVersions{Versions: test.serverVersions})}, nil }) c := discovery.NewDiscoveryClientForConfigOrDie(&restclient.Config{}) c.RESTClient().(*restclient.RESTClient).Client = fakeClient err := discovery.ServerSupportsVersion(c, test.requiredVersion) if err == nil && test.expectErr != nil { t.Errorf("expected error, got nil for [%s].", test.name) } if err != nil { if test.expectErr == nil || !test.expectErr(err) { t.Errorf("unexpected error for [%s]: %v.", test.name, err) } continue } } } func TestFilteredBy(t *testing.T) { all := discovery.ResourcePredicateFunc(func(gv string, r *metav1.APIResource) bool { return true }) none := discovery.ResourcePredicateFunc(func(gv string, r *metav1.APIResource) bool { return false }) onlyV2 := discovery.ResourcePredicateFunc(func(gv string, r *metav1.APIResource) bool { return strings.HasSuffix(gv, "/v2") || gv == "v2" }) onlyBar := discovery.ResourcePredicateFunc(func(gv string, r *metav1.APIResource) bool { return r.Kind == "Bar" }) foo := []*metav1.APIResourceList{ { GroupVersion: "foo/v1", APIResources: []metav1.APIResource{ {Name: "bar", Kind: "Bar"}, {Name: "test", Kind: "Test"}, }, }, { GroupVersion: "foo/v2", APIResources: []metav1.APIResource{ {Name: "bar", Kind: "Bar"}, {Name: "test", Kind: "Test"}, }, }, { GroupVersion: "foo/v3", APIResources: []metav1.APIResource{}, }, } tests := []struct { input []*metav1.APIResourceList pred discovery.ResourcePredicate expectedResources []string }{ {nil, all, []string{}}, {[]*metav1.APIResourceList{ {GroupVersion: "foo/v1"}, }, all, []string{}}, {foo, all, []string{"foo/v1.bar", "foo/v1.test", "foo/v2.bar", "foo/v2.test"}}, {foo, onlyV2, []string{"foo/v2.bar", "foo/v2.test"}}, {foo, onlyBar, []string{"foo/v1.bar", "foo/v2.bar"}}, {foo, none, []string{}}, } for i, test := range tests { filtered := discovery.FilteredBy(test.pred, test.input) if expected, got := sets.NewString(test.expectedResources...), sets.NewString(stringify(filtered)...); !expected.Equal(got) { t.Errorf("[%d] unexpected group versions: expected=%v, got=%v", i, test.expectedResources, stringify(filtered)) } } } func stringify(rls []*metav1.APIResourceList) []string { result := []string{} for _, rl := range rls { for _, r := range rl.APIResources { result = append(result, rl.GroupVersion+"."+r.Name) } if len(rl.APIResources) == 0 { result = append(result, rl.GroupVersion) } } return result } kubernetes-client-go-a2dfcab/discovery/testdata/000077500000000000000000000000001472614177300222205ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/discovery/testdata/apis/000077500000000000000000000000001472614177300231545ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/discovery/testdata/apis/batch/000077500000000000000000000000001472614177300242355ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/discovery/testdata/apis/batch/v1.json000066400000000000000000011072721472614177300254700ustar00rootroot00000000000000{"openapi":"3.0.0","info":{"title":"Kubernetes","version":"v1.24.0"},"paths":{"/apis/batch/v1/":{"get":{"tags":["batch_v1"],"description":"get available resources","operationId":"getBatchV1APIResources","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}}}}}}},"/apis/batch/v1/cronjobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1CronJobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/jobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind Job","operationId":"listBatchV1JobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1NamespacedCronJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobList"}}}}}},"post":{"tags":["batch_v1"],"description":"create a CronJob","operationId":"createBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete collection of CronJob","operationId":"deleteBatchV1CollectionNamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1"],"description":"read the specified CronJob","operationId":"readBatchV1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"put":{"tags":["batch_v1"],"description":"replace the specified CronJob","operationId":"replaceBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete a CronJob","operationId":"deleteBatchV1NamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update the specified CronJob","operationId":"patchBatchV1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status":{"get":{"tags":["batch_v1"],"description":"read status of the specified CronJob","operationId":"readBatchV1NamespacedCronJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"put":{"tags":["batch_v1"],"description":"replace status of the specified CronJob","operationId":"replaceBatchV1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update status of the specified CronJob","operationId":"patchBatchV1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs":{"get":{"tags":["batch_v1"],"description":"list or watch objects of kind Job","operationId":"listBatchV1NamespacedJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobList"}}}}}},"post":{"tags":["batch_v1"],"description":"create a Job","operationId":"createBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete collection of Job","operationId":"deleteBatchV1CollectionNamespacedJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs/{name}":{"get":{"tags":["batch_v1"],"description":"read the specified Job","operationId":"readBatchV1NamespacedJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"put":{"tags":["batch_v1"],"description":"replace the specified Job","operationId":"replaceBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"delete":{"tags":["batch_v1"],"description":"delete a Job","operationId":"deleteBatchV1NamespacedJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update the specified Job","operationId":"patchBatchV1NamespacedJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status":{"get":{"tags":["batch_v1"],"description":"read status of the specified Job","operationId":"readBatchV1NamespacedJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"put":{"tags":["batch_v1"],"description":"replace status of the specified Job","operationId":"replaceBatchV1NamespacedJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"patch":{"tags":["batch_v1"],"description":"partially update status of the specified Job","operationId":"patchBatchV1NamespacedJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1/watch/cronjobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1CronJobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/jobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of Job. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1JobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1NamespacedCronJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1"],"description":"watch changes to an object of kind CronJob. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/jobs":{"get":{"tags":["batch_v1"],"description":"watch individual changes to a list of Job. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1NamespacedJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}":{"get":{"tags":["batch_v1"],"description":"watch changes to an object of kind Job. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1NamespacedJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the Job","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]}},"components":{"schemas":{"io.k8s.api.batch.v1.CronJob":{"description":"CronJob represents the configuration of a single cron job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobSpec"},"status":{"description":"Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJob","version":"v1"}]},"io.k8s.api.batch.v1.CronJobList":{"description":"CronJobList is a collection of cron jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of CronJobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.CronJob"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJobList","version":"v1"}]},"io.k8s.api.batch.v1.CronJobSpec":{"description":"CronJobSpec describes how the job execution will look like and when it will actually run.","type":"object","required":["schedule","jobTemplate"],"properties":{"concurrencyPolicy":{"description":"Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one\n\n","type":"string"},"failedJobsHistoryLimit":{"description":"The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1.","type":"integer","format":"int32"},"jobTemplate":{"description":"Specifies the job that will be created when executing a CronJob.","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobTemplateSpec"},"schedule":{"description":"The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.","type":"string","default":""},"startingDeadlineSeconds":{"description":"Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.","type":"integer","format":"int64"},"successfulJobsHistoryLimit":{"description":"The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3.","type":"integer","format":"int32"},"suspend":{"description":"This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.","type":"boolean"}}},"io.k8s.api.batch.v1.CronJobStatus":{"description":"CronJobStatus represents the current state of a cron job.","type":"object","properties":{"active":{"description":"A list of pointers to currently running jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectReference"},"x-kubernetes-list-type":"atomic"},"lastScheduleTime":{"description":"Information when was the last time the job was successfully scheduled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastSuccessfulTime":{"description":"Information when was the last time the job successfully completed.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.api.batch.v1.Job":{"description":"Job represents the configuration of a single job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"},"status":{"description":"Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"Job","version":"v1"}]},"io.k8s.api.batch.v1.JobCondition":{"description":"JobCondition describes current state of a job.","type":"object","required":["type","status"],"properties":{"lastProbeTime":{"description":"Last time the condition was checked.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastTransitionTime":{"description":"Last time the condition transit from one status to another.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"message":{"description":"Human readable message indicating details about last transition.","type":"string"},"reason":{"description":"(brief) reason for the condition's last transition.","type":"string"},"status":{"description":"Status of the condition, one of True, False, Unknown.","type":"string","default":""},"type":{"description":"Type of job condition, Complete or Failed.\n\n","type":"string","default":""}}},"io.k8s.api.batch.v1.JobList":{"description":"JobList is a collection of jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of Jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.Job"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"JobList","version":"v1"}]},"io.k8s.api.batch.v1.JobSpec":{"description":"JobSpec describes how the job execution will look like.","type":"object","required":["template"],"properties":{"activeDeadlineSeconds":{"description":"Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.","type":"integer","format":"int64"},"backoffLimit":{"description":"Specifies the number of retries before marking this job failed. Defaults to 6","type":"integer","format":"int32"},"completionMode":{"description":"CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.","type":"string"},"completions":{"description":"Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"manualSelector":{"description":"manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector","type":"boolean"},"parallelism":{"description":"Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) \u003c .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"selector":{"description":"A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"suspend":{"description":"Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.\n\nThis field is beta-level, gated by SuspendJob feature flag (enabled by default).","type":"boolean"},"template":{"description":"Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec"},"ttlSecondsAfterFinished":{"description":"ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.","type":"integer","format":"int32"}}},"io.k8s.api.batch.v1.JobStatus":{"description":"JobStatus represents the current state of a Job.","type":"object","properties":{"active":{"description":"The number of pending and running pods.","type":"integer","format":"int32"},"completedIndexes":{"description":"CompletedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".","type":"string"},"completionTime":{"description":"Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is only set when the job finishes successfully.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"conditions":{"description":"The latest available observations of an object's current state. When a Job fails, one of the conditions will have type \"Failed\" and status true. When a Job is suspended, one of the conditions will have type \"Suspended\" and status true; when the Job is resumed, the status of this condition will become false. When a Job is completed, one of the conditions will have type \"Complete\" and status true. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobCondition"},"x-kubernetes-list-type":"atomic","x-kubernetes-patch-merge-key":"type","x-kubernetes-patch-strategy":"merge"},"failed":{"description":"The number of pods which reached phase Failed.","type":"integer","format":"int32"},"ready":{"description":"The number of pods which have a Ready condition.\n\nThis field is alpha-level. The job controller populates the field when the feature gate JobReadyPods is enabled (disabled by default).","type":"integer","format":"int32"},"startTime":{"description":"Represents time when the job controller started processing a job. When a Job is created in the suspended state, this field is not set until the first time it is resumed. This field is reset every time a Job is resumed from suspension. It is represented in RFC3339 form and is in UTC.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"succeeded":{"description":"The number of pods which reached phase Succeeded.","type":"integer","format":"int32"},"uncountedTerminatedPods":{"description":"UncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status: (1) Add the pod UID to the arrays in this field. (2) Remove the pod finalizer. (3) Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nThis field is beta-level. The job controller only makes use of this field when the feature gate JobTrackingWithFinalizers is enabled (enabled by default). Old jobs might not be tracked using this field, in which case the field remains null.","$ref":"#/components/schemas/io.k8s.api.batch.v1.UncountedTerminatedPods"}}},"io.k8s.api.batch.v1.JobTemplateSpec":{"description":"JobTemplateSpec describes the data a Job should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"}}},"io.k8s.api.batch.v1.UncountedTerminatedPods":{"description":"UncountedTerminatedPods holds UIDs of Pods that have terminated but haven't been accounted in Job status counters.","type":"object","properties":{"failed":{"description":"Failed holds UIDs of failed Pods.","type":"array","items":{"type":"string","default":""},"x-kubernetes-list-type":"set"},"succeeded":{"description":"Succeeded holds UIDs of succeeded Pods.","type":"array","items":{"type":"string","default":""},"x-kubernetes-list-type":"set"}}},"io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource":{"description":"Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).","type":"integer","format":"int32"},"readOnly":{"description":"readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"boolean"},"volumeID":{"description":"volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string","default":""}}},"io.k8s.api.core.v1.Affinity":{"description":"Affinity is a group of affinity scheduling rules.","type":"object","properties":{"nodeAffinity":{"description":"Describes node affinity scheduling rules for the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeAffinity"},"podAffinity":{"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinity"},"podAntiAffinity":{"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity"}}},"io.k8s.api.core.v1.AzureDiskVolumeSource":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","type":"object","required":["diskName","diskURI"],"properties":{"cachingMode":{"description":"cachingMode is the Host Caching mode: None, Read Only, Read Write.","type":"string"},"diskName":{"description":"diskName is the Name of the data disk in the blob storage","type":"string","default":""},"diskURI":{"description":"diskURI is the URI of data disk in the blob storage","type":"string","default":""},"fsType":{"description":"fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"kind":{"description":"kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"}}},"io.k8s.api.core.v1.AzureFileVolumeSource":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","type":"object","required":["secretName","shareName"],"properties":{"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretName":{"description":"secretName is the name of secret that contains Azure Storage Account Name and Key","type":"string","default":""},"shareName":{"description":"shareName is the azure share Name","type":"string","default":""}}},"io.k8s.api.core.v1.CSIVolumeSource":{"description":"Represents a source location of a volume to mount, managed by an external CSI driver","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.","type":"string","default":""},"fsType":{"description":"fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.","type":"string"},"nodePublishSecretRef":{"description":"nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"readOnly":{"description":"readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeAttributes":{"description":"volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.","type":"object","additionalProperties":{"type":"string","default":""}}}},"io.k8s.api.core.v1.Capabilities":{"description":"Adds and removes POSIX capabilities from running containers.","type":"object","properties":{"add":{"description":"Added capabilities","type":"array","items":{"type":"string","default":""}},"drop":{"description":"Removed capabilities","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.CephFSVolumeSource":{"description":"Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["monitors"],"properties":{"monitors":{"description":"monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"path":{"description":"path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /","type":"string"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"boolean"},"secretFile":{"description":"secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"},"secretRef":{"description":"secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.CinderVolumeSource":{"description":"Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"boolean"},"secretRef":{"description":"secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeID":{"description":"volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string","default":""}}},"io.k8s.api.core.v1.ConfigMapEnvSource":{"description":"ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapKeySelector":{"description":"Selects a key from a ConfigMap.","type":"object","required":["key"],"properties":{"key":{"description":"The key to select.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ConfigMapProjection":{"description":"Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapVolumeSource":{"description":"Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.Container":{"description":"A single application container that you want to run within a pod.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Actions that the management system should take in response to container lifecycle events. Cannot be updated.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.","type":"string","default":""},"ports":{"description":"List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ContainerPort":{"description":"ContainerPort represents a network port in a single container.","type":"object","required":["containerPort"],"properties":{"containerPort":{"description":"Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.","type":"integer","format":"int32","default":0},"hostIP":{"description":"What host IP to bind the external port to.","type":"string"},"hostPort":{"description":"Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.","type":"integer","format":"int32"},"name":{"description":"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.","type":"string"},"protocol":{"description":"Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".\n\n","type":"string","default":"TCP"}}},"io.k8s.api.core.v1.DownwardAPIProjection":{"description":"Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.","type":"object","properties":{"items":{"description":"Items is a list of DownwardAPIVolume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.DownwardAPIVolumeFile":{"description":"DownwardAPIVolumeFile represents information to create the file containing the pod field","type":"object","required":["path"],"properties":{"fieldRef":{"description":"Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"mode":{"description":"Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'","type":"string","default":""},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"}}},"io.k8s.api.core.v1.DownwardAPIVolumeSource":{"description":"DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"Items is a list of downward API volume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.EmptyDirVolumeSource":{"description":"Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.","type":"object","properties":{"medium":{"description":"medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","type":"string"},"sizeLimit":{"description":"sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}},"io.k8s.api.core.v1.EnvFromSource":{"description":"EnvFromSource represents the source of a set of ConfigMaps","type":"object","properties":{"configMapRef":{"description":"The ConfigMap to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource"},"prefix":{"description":"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.","type":"string"},"secretRef":{"description":"The Secret to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretEnvSource"}}},"io.k8s.api.core.v1.EnvVar":{"description":"EnvVar represents an environment variable present in a Container.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the environment variable. Must be a C_IDENTIFIER.","type":"string","default":""},"value":{"description":"Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".","type":"string"},"valueFrom":{"description":"Source for the environment variable's value. Cannot be used if value is not empty.","$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVarSource"}}},"io.k8s.api.core.v1.EnvVarSource":{"description":"EnvVarSource represents a source for the value of an EnvVar.","type":"object","properties":{"configMapKeyRef":{"description":"Selects a key of a ConfigMap.","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector"},"fieldRef":{"description":"Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['\u003cKEY\u003e']`, `metadata.annotations['\u003cKEY\u003e']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"},"secretKeyRef":{"description":"Selects a key of a secret in the pod's namespace","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretKeySelector"}}},"io.k8s.api.core.v1.EphemeralContainer":{"description":"An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Lifecycle is not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.","type":"string","default":""},"ports":{"description":"Ports are not allowed for ephemeral containers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"targetContainerName":{"description":"If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.","type":"string"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.EphemeralVolumeSource":{"description":"Represents an ephemeral volume that is handled by a normal storage driver.","type":"object","properties":{"volumeClaimTemplate":{"description":"Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `\u003cpod name\u003e-\u003cvolume name\u003e` where `\u003cvolume name\u003e` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate"}}},"io.k8s.api.core.v1.ExecAction":{"description":"ExecAction describes a \"run in container\" action.","type":"object","properties":{"command":{"description":"Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FCVolumeSource":{"description":"Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"lun":{"description":"lun is Optional: FC target lun number","type":"integer","format":"int32"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"targetWWNs":{"description":"targetWWNs is Optional: FC target worldwide names (WWNs)","type":"array","items":{"type":"string","default":""}},"wwids":{"description":"wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FlexVolumeSource":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the driver to use for this volume.","type":"string","default":""},"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.","type":"string"},"options":{"description":"options is Optional: this field holds extra command options if any.","type":"object","additionalProperties":{"type":"string","default":""}},"readOnly":{"description":"readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"}}},"io.k8s.api.core.v1.FlockerVolumeSource":{"description":"Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.","type":"object","properties":{"datasetName":{"description":"datasetName is Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated","type":"string"},"datasetUUID":{"description":"datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset","type":"string"}}},"io.k8s.api.core.v1.GCEPersistentDiskVolumeSource":{"description":"Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.","type":"object","required":["pdName"],"properties":{"fsType":{"description":"fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"integer","format":"int32"},"pdName":{"description":"pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string","default":""},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"boolean"}}},"io.k8s.api.core.v1.GRPCAction":{"type":"object","required":["port"],"properties":{"port":{"description":"Port number of the gRPC service. Number must be in the range 1 to 65535.","type":"integer","format":"int32","default":0},"service":{"description":"Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.","type":"string","default":""}}},"io.k8s.api.core.v1.GitRepoVolumeSource":{"description":"Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","type":"object","required":["repository"],"properties":{"directory":{"description":"directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.","type":"string"},"repository":{"description":"repository is the URL","type":"string","default":""},"revision":{"description":"revision is the commit hash for the specified revision.","type":"string"}}},"io.k8s.api.core.v1.GlusterfsVolumeSource":{"description":"Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["endpoints","path"],"properties":{"endpoints":{"description":"endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"path":{"description":"path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"readOnly":{"description":"readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"boolean"}}},"io.k8s.api.core.v1.HTTPGetAction":{"description":"HTTPGetAction describes an action based on HTTP Get requests.","type":"object","required":["port"],"properties":{"host":{"description":"Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.","type":"string"},"httpHeaders":{"description":"Custom headers to set in the request. HTTP allows repeated headers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPHeader"}},"path":{"description":"Path to access on the HTTP server.","type":"string"},"port":{"description":"Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"},"scheme":{"description":"Scheme to use for connecting to the host. Defaults to HTTP.\n\n","type":"string"}}},"io.k8s.api.core.v1.HTTPHeader":{"description":"HTTPHeader describes a custom header to be used in HTTP probes","type":"object","required":["name","value"],"properties":{"name":{"description":"The header field name","type":"string","default":""},"value":{"description":"The header field value","type":"string","default":""}}},"io.k8s.api.core.v1.HostAlias":{"description":"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.","type":"object","properties":{"hostnames":{"description":"Hostnames for the above IP address.","type":"array","items":{"type":"string","default":""}},"ip":{"description":"IP address of the host file entry.","type":"string"}}},"io.k8s.api.core.v1.HostPathVolumeSource":{"description":"Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.","type":"object","required":["path"],"properties":{"path":{"description":"path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string","default":""},"type":{"description":"type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"}}},"io.k8s.api.core.v1.ISCSIVolumeSource":{"description":"Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.","type":"object","required":["targetPortal","iqn","lun"],"properties":{"chapAuthDiscovery":{"description":"chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication","type":"boolean"},"chapAuthSession":{"description":"chapAuthSession defines whether support iSCSI Session CHAP authentication","type":"boolean"},"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi","type":"string"},"initiatorName":{"description":"initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.","type":"string"},"iqn":{"description":"iqn is the target iSCSI Qualified Name.","type":"string","default":""},"iscsiInterface":{"description":"iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).","type":"string"},"lun":{"description":"lun represents iSCSI Target Lun number.","type":"integer","format":"int32","default":0},"portals":{"description":"portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"array","items":{"type":"string","default":""}},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.","type":"boolean"},"secretRef":{"description":"secretRef is the CHAP Secret for iSCSI target and initiator authentication","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"targetPortal":{"description":"targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"string","default":""}}},"io.k8s.api.core.v1.KeyToPath":{"description":"Maps a string key to a path within a volume.","type":"object","required":["key","path"],"properties":{"key":{"description":"key is the key to project.","type":"string","default":""},"mode":{"description":"mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.","type":"string","default":""}}},"io.k8s.api.core.v1.Lifecycle":{"description":"Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.","type":"object","properties":{"postStart":{"description":"PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"},"preStop":{"description":"PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"}}},"io.k8s.api.core.v1.LifecycleHandler":{"description":"LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"tcpSocket":{"description":"Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"}}},"io.k8s.api.core.v1.LocalObjectReference":{"description":"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NFSVolumeSource":{"description":"Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.","type":"object","required":["server","path"],"properties":{"path":{"description":"path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""},"readOnly":{"description":"readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"boolean"},"server":{"description":"server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""}}},"io.k8s.api.core.v1.NodeAffinity":{"description":"Node affinity is a group of node affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelector"}}},"io.k8s.api.core.v1.NodeSelector":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","type":"object","required":["nodeSelectorTerms"],"properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NodeSelectorRequirement":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"The label key that the selector applies to.","type":"string","default":""},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\n","type":"string","default":""},"values":{"description":"An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.NodeSelectorTerm":{"description":"A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.","type":"object","properties":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}},"matchFields":{"description":"A list of node selector requirements by node's fields.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectFieldSelector":{"description":"ObjectFieldSelector selects an APIVersioned field of an object.","type":"object","required":["fieldPath"],"properties":{"apiVersion":{"description":"Version of the schema the FieldPath is written in terms of, defaults to \"v1\".","type":"string"},"fieldPath":{"description":"Path of the field to select in the specified API version.","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectReference":{"description":"ObjectReference contains enough information to let you inspect or modify the referred object.","type":"object","properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"fieldPath":{"description":"If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.","type":"string"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"namespace":{"description":"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/","type":"string"},"resourceVersion":{"description":"Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.PersistentVolumeClaimSpec":{"description":"PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes","type":"object","properties":{"accessModes":{"description":"accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1","type":"array","items":{"type":"string","default":""}},"dataSource":{"description":"dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"dataSourceRef":{"description":"dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While DataSource ignores disallowed values (dropping them), DataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n(Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"resources":{"description":"resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"selector":{"description":"selector is a label query over volumes to consider for binding.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"storageClassName":{"description":"storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1","type":"string"},"volumeMode":{"description":"volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.","type":"string"},"volumeName":{"description":"volumeName is the binding reference to the PersistentVolume backing this claim.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimTemplate":{"description":"PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.","type":"object","required":["spec"],"properties":{"metadata":{"description":"May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec"}}},"io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource":{"description":"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).","type":"object","required":["claimName"],"properties":{"claimName":{"description":"claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","type":"string","default":""},"readOnly":{"description":"readOnly Will force the ReadOnly setting in VolumeMounts. Default false.","type":"boolean"}}},"io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource":{"description":"Represents a Photon Controller persistent disk resource.","type":"object","required":["pdID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"pdID":{"description":"pdID is the ID that identifies Photon Controller persistent disk","type":"string","default":""}}},"io.k8s.api.core.v1.PodAffinity":{"description":"Pod affinity is a group of inter pod affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running","type":"object","required":["topologyKey"],"properties":{"labelSelector":{"description":"A label query over a set of resources, in this case pods.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaceSelector":{"description":"A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"","type":"array","items":{"type":"string","default":""}},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string","default":""}}},"io.k8s.api.core.v1.PodAntiAffinity":{"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodDNSConfig":{"description":"PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.","type":"object","properties":{"nameservers":{"description":"A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.","type":"array","items":{"type":"string","default":""}},"options":{"description":"A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption"}},"searches":{"description":"A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.PodDNSConfigOption":{"description":"PodDNSConfigOption defines DNS resolver options of a pod.","type":"object","properties":{"name":{"description":"Required.","type":"string"},"value":{"type":"string"}}},"io.k8s.api.core.v1.PodOS":{"description":"PodOS defines the OS parameters of a pod.","type":"object","required":["name"],"properties":{"name":{"description":"Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null","type":"string","default":""}}},"io.k8s.api.core.v1.PodReadinessGate":{"description":"PodReadinessGate contains the reference to a pod condition","type":"object","required":["conditionType"],"properties":{"conditionType":{"description":"ConditionType refers to a condition in the pod's condition list with matching type.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.PodSecurityContext":{"description":"PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.","type":"object","properties":{"fsGroup":{"description":"A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"fsGroupChangePolicy":{"description":"fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"supplementalGroups":{"description":"A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"type":"integer","format":"int64","default":0}},"sysctls":{"description":"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Sysctl"}},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.PodSpec":{"description":"PodSpec is a description of a pod.","type":"object","required":["containers"],"properties":{"activeDeadlineSeconds":{"description":"Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.","type":"integer","format":"int64"},"affinity":{"description":"If specified, the pod's scheduling constraints","$ref":"#/components/schemas/io.k8s.api.core.v1.Affinity"},"automountServiceAccountToken":{"description":"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.","type":"boolean"},"containers":{"description":"List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"dnsConfig":{"description":"Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfig"},"dnsPolicy":{"description":"Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n\n","type":"string"},"enableServiceLinks":{"description":"EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.","type":"boolean"},"ephemeralContainers":{"description":"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralContainer"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"hostAliases":{"description":"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HostAlias"},"x-kubernetes-patch-merge-key":"ip","x-kubernetes-patch-strategy":"merge"},"hostIPC":{"description":"Use the host's ipc namespace. Optional: Default to false.","type":"boolean"},"hostNetwork":{"description":"Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.","type":"boolean"},"hostPID":{"description":"Use the host's pid namespace. Optional: Default to false.","type":"boolean"},"hostname":{"description":"Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.","type":"string"},"imagePullSecrets":{"description":"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"initContainers":{"description":"List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"nodeName":{"description":"NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.","type":"string"},"nodeSelector":{"description":"NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/","type":"object","additionalProperties":{"type":"string","default":""},"x-kubernetes-map-type":"atomic"},"os":{"description":"Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup This is an alpha field and requires the IdentifyPodOS feature","$ref":"#/components/schemas/io.k8s.api.core.v1.PodOS"},"overhead":{"description":"Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"preemptionPolicy":{"description":"PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.","type":"string"},"priority":{"description":"The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.","type":"integer","format":"int32"},"priorityClassName":{"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"},"readinessGates":{"description":"If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodReadinessGate"}},"restartPolicy":{"description":"Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\n","type":"string"},"runtimeClassName":{"description":"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.","type":"string"},"schedulerName":{"description":"If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.","type":"string"},"securityContext":{"description":"SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodSecurityContext"},"serviceAccount":{"description":"DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.","type":"string"},"serviceAccountName":{"description":"ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/","type":"string"},"setHostnameAsFQDN":{"description":"If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.","type":"boolean"},"shareProcessNamespace":{"description":"Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.","type":"boolean"},"subdomain":{"description":"If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.","type":"string"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.","type":"integer","format":"int64"},"tolerations":{"description":"If specified, the pod's tolerations.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Toleration"}},"topologySpreadConstraints":{"description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint"},"x-kubernetes-list-map-keys":["topologyKey","whenUnsatisfiable"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"topologyKey","x-kubernetes-patch-strategy":"merge"},"volumes":{"description":"List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Volume"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge,retainKeys"}}},"io.k8s.api.core.v1.PodTemplateSpec":{"description":"PodTemplateSpec describes the data a pod should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodSpec"}}},"io.k8s.api.core.v1.PortworxVolumeSource":{"description":"PortworxVolumeSource represents a Portworx volume resource.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"volumeID":{"description":"volumeID uniquely identifies a Portworx volume","type":"string","default":""}}},"io.k8s.api.core.v1.PreferredSchedulingTerm":{"description":"An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).","type":"object","required":["weight","preference"],"properties":{"preference":{"description":"A node selector term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.Probe":{"description":"Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"failureThreshold":{"description":"Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.","type":"integer","format":"int32"},"grpc":{"description":"GRPC specifies an action involving a GRPC port.","$ref":"#/components/schemas/io.k8s.api.core.v1.GRPCAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"},"periodSeconds":{"description":"How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.","type":"integer","format":"int32"},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.","type":"integer","format":"int32"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.","type":"integer","format":"int64"},"timeoutSeconds":{"description":"Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.ProjectedVolumeSource":{"description":"Represents a projected volume source","type":"object","properties":{"defaultMode":{"description":"defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"sources":{"description":"sources is the list of volume projections","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeProjection"}}}},"io.k8s.api.core.v1.QuobyteVolumeSource":{"description":"Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.","type":"object","required":["registry","volume"],"properties":{"group":{"description":"group to map volume access to Default is no group","type":"string"},"readOnly":{"description":"readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.","type":"boolean"},"registry":{"description":"registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes","type":"string","default":""},"tenant":{"description":"tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin","type":"string"},"user":{"description":"user to map volume access to Defaults to serivceaccount user","type":"string"},"volume":{"description":"volume is a string that references an already created Quobyte volume by name.","type":"string","default":""}}},"io.k8s.api.core.v1.RBDVolumeSource":{"description":"Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.","type":"object","required":["monitors","image"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd","type":"string"},"image":{"description":"image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string","default":""},"keyring":{"description":"keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"monitors":{"description":"monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"pool":{"description":"pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"boolean"},"secretRef":{"description":"secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.ResourceFieldSelector":{"description":"ResourceFieldSelector represents container resources (cpu, memory) and their output format","type":"object","required":["resource"],"properties":{"containerName":{"description":"Container name: required for volumes, optional for env vars","type":"string"},"divisor":{"description":"Specifies the output format of the exposed resources, defaults to \"1\"","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"},"resource":{"description":"Required: resource to select","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ResourceRequirements":{"description":"ResourceRequirements describes the compute resource requirements.","type":"object","properties":{"limits":{"description":"Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"requests":{"description":"Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}}},"io.k8s.api.core.v1.SELinuxOptions":{"description":"SELinuxOptions are the labels to be applied to the container","type":"object","properties":{"level":{"description":"Level is SELinux level label that applies to the container.","type":"string"},"role":{"description":"Role is a SELinux role label that applies to the container.","type":"string"},"type":{"description":"Type is a SELinux type label that applies to the container.","type":"string"},"user":{"description":"User is a SELinux user label that applies to the container.","type":"string"}}},"io.k8s.api.core.v1.ScaleIOVolumeSource":{"description":"ScaleIOVolumeSource represents a persistent ScaleIO volume","type":"object","required":["gateway","system","secretRef"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".","type":"string"},"gateway":{"description":"gateway is the host address of the ScaleIO API Gateway.","type":"string","default":""},"protectionDomain":{"description":"protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"sslEnabled":{"description":"sslEnabled Flag enable/disable SSL communication with Gateway, default false","type":"boolean"},"storageMode":{"description":"storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.","type":"string"},"storagePool":{"description":"storagePool is the ScaleIO Storage Pool associated with the protection domain.","type":"string"},"system":{"description":"system is the name of the storage system as configured in ScaleIO.","type":"string","default":""},"volumeName":{"description":"volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.","type":"string"}}},"io.k8s.api.core.v1.SeccompProfile":{"description":"SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.","type":"object","required":["type"],"properties":{"localhostProfile":{"description":"localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".","type":"string"},"type":{"description":"type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.\n\n","type":"string","default":""}},"x-kubernetes-unions":[{"discriminator":"type","fields-to-discriminateBy":{"localhostProfile":"LocalhostProfile"}}]},"io.k8s.api.core.v1.SecretEnvSource":{"description":"SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretKeySelector":{"description":"SecretKeySelector selects a key of a Secret.","type":"object","required":["key"],"properties":{"key":{"description":"The key of the secret to select from. Must be a valid secret key.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.SecretProjection":{"description":"Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional field specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretVolumeSource":{"description":"Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"optional":{"description":"optional field specify whether the Secret or its keys must be defined","type":"boolean"},"secretName":{"description":"secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","type":"string"}}},"io.k8s.api.core.v1.SecurityContext":{"description":"SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.","type":"object","properties":{"allowPrivilegeEscalation":{"description":"AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"capabilities":{"description":"The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.Capabilities"},"privileged":{"description":"Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"procMount":{"description":"procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"readOnlyRootFilesystem":{"description":"Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by this container. If seccomp options are provided at both the pod \u0026 container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.ServiceAccountTokenProjection":{"description":"ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).","type":"object","required":["path"],"properties":{"audience":{"description":"audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.","type":"string"},"expirationSeconds":{"description":"expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.","type":"integer","format":"int64"},"path":{"description":"path is the path relative to the mount point of the file to project the token into.","type":"string","default":""}}},"io.k8s.api.core.v1.StorageOSVolumeSource":{"description":"Represents a StorageOS persistent volume resource.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeName":{"description":"volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.","type":"string"},"volumeNamespace":{"description":"volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.","type":"string"}}},"io.k8s.api.core.v1.Sysctl":{"description":"Sysctl defines a kernel parameter to be set","type":"object","required":["name","value"],"properties":{"name":{"description":"Name of a property to set","type":"string","default":""},"value":{"description":"Value of a property to set","type":"string","default":""}}},"io.k8s.api.core.v1.TCPSocketAction":{"description":"TCPSocketAction describes an action based on opening a socket","type":"object","required":["port"],"properties":{"host":{"description":"Optional: Host name to connect to, defaults to the pod IP.","type":"string"},"port":{"description":"Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"}}},"io.k8s.api.core.v1.Toleration":{"description":"The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.","type":"object","properties":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.\n\n","type":"string"},"key":{"description":"Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.","type":"string"},"operator":{"description":"Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.\n\n","type":"string"},"tolerationSeconds":{"description":"TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.","type":"integer","format":"int64"},"value":{"description":"Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.","type":"string"}}},"io.k8s.api.core.v1.TopologySpreadConstraint":{"description":"TopologySpreadConstraint specifies how to spread matching pods among the given topology.","type":"object","required":["maxSkew","topologyKey","whenUnsatisfiable"],"properties":{"labelSelector":{"description":"LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"maxSkew":{"description":"MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.","type":"integer","format":"int32","default":0},"topologyKey":{"description":"TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each \u003ckey, value\u003e as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.","type":"string","default":""},"whenUnsatisfiable":{"description":"WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.TypedLocalObjectReference":{"description":"TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string","default":""},"name":{"description":"Name is the name of resource being referenced","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.Volume":{"description":"Volume represents a named volume in a pod that may be accessed by any container in the pod.","type":"object","required":["name"],"properties":{"awsElasticBlockStore":{"description":"awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","$ref":"#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"},"azureDisk":{"description":"azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource"},"azureFile":{"description":"azureFile represents an Azure File Service mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource"},"cephfs":{"description":"cephFS represents a Ceph FS mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource"},"cinder":{"description":"cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource"},"configMap":{"description":"configMap represents a configMap that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource"},"csi":{"description":"csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).","$ref":"#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource"},"downwardAPI":{"description":"downwardAPI represents downward API about the pod that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource"},"emptyDir":{"description":"emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource"},"ephemeral":{"description":"ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.","$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource"},"fc":{"description":"fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.FCVolumeSource"},"flexVolume":{"description":"flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","$ref":"#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource"},"flocker":{"description":"flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running","$ref":"#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource"},"gcePersistentDisk":{"description":"gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","$ref":"#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"},"gitRepo":{"description":"gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","$ref":"#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource"},"glusterfs":{"description":"glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource"},"hostPath":{"description":"hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","$ref":"#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource"},"iscsi":{"description":"iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource"},"name":{"description":"name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string","default":""},"nfs":{"description":"nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","$ref":"#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource"},"persistentVolumeClaim":{"description":"persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"},"photonPersistentDisk":{"description":"photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"},"portworxVolume":{"description":"portworxVolume represents a portworx volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource"},"projected":{"description":"projected items for all in one resources secrets, configmaps, and downward API","$ref":"#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource"},"quobyte":{"description":"quobyte represents a Quobyte mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource"},"rbd":{"description":"rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource"},"scaleIO":{"description":"scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource"},"secret":{"description":"secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource"},"storageos":{"description":"storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource"},"vsphereVolume":{"description":"vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"}}},"io.k8s.api.core.v1.VolumeDevice":{"description":"volumeDevice describes a mapping of a raw block device within a container.","type":"object","required":["name","devicePath"],"properties":{"devicePath":{"description":"devicePath is the path inside of the container that the device will be mapped to.","type":"string","default":""},"name":{"description":"name must match the name of a persistentVolumeClaim in the pod","type":"string","default":""}}},"io.k8s.api.core.v1.VolumeMount":{"description":"VolumeMount describes a mounting of a Volume within a container.","type":"object","required":["name","mountPath"],"properties":{"mountPath":{"description":"Path within the container at which the volume should be mounted. Must not contain ':'.","type":"string","default":""},"mountPropagation":{"description":"mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.","type":"string"},"name":{"description":"This must match the Name of a Volume.","type":"string","default":""},"readOnly":{"description":"Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.","type":"boolean"},"subPath":{"description":"Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).","type":"string"},"subPathExpr":{"description":"Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.","type":"string"}}},"io.k8s.api.core.v1.VolumeProjection":{"description":"Projection that may be projected along with other supported volume types","type":"object","properties":{"configMap":{"description":"configMap information about the configMap data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection"},"downwardAPI":{"description":"downwardAPI information about the downwardAPI data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection"},"secret":{"description":"secret information about the secret data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretProjection"},"serviceAccountToken":{"description":"serviceAccountToken is information about the serviceAccountToken data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection"}}},"io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource":{"description":"Represents a vSphere volume resource.","type":"object","required":["volumePath"],"properties":{"fsType":{"description":"fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"storagePolicyID":{"description":"storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.","type":"string"},"storagePolicyName":{"description":"storagePolicyName is the storage Policy Based Management (SPBM) profile name.","type":"string"},"volumePath":{"description":"volumePath is the path that identifies vSphere volume vmdk","type":"string","default":""}}},"io.k8s.api.core.v1.WeightedPodAffinityTerm":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","type":"object","required":["weight","podAffinityTerm"],"properties":{"podAffinityTerm":{"description":"Required. A pod affinity term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.WindowsSecurityContextOptions":{"description":"WindowsSecurityContextOptions contain Windows-specific options and credentials.","type":"object","properties":{"gmsaCredentialSpec":{"description":"GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.","type":"string"},"gmsaCredentialSpecName":{"description":"GMSACredentialSpecName is the name of the GMSA credential spec to use.","type":"string"},"hostProcess":{"description":"HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.","type":"boolean"},"runAsUserName":{"description":"The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"string"}}},"io.k8s.apimachinery.pkg.api.resource.Quantity":{"description":"Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9 \u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e \u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e \u003csign\u003e ::= \"+\" | \"-\" \u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e \u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e \u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.","type":"string"},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResource":{"description":"APIResource specifies the name of a resource and whether it is namespaced.","type":"object","required":["name","singularName","namespaced","kind","verbs"],"properties":{"categories":{"description":"categories is a list of the grouped resources this resource belongs to (e.g. 'all')","type":"array","items":{"type":"string","default":""}},"group":{"description":"group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".","type":"string"},"kind":{"description":"kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')","type":"string","default":""},"name":{"description":"name is the plural name of the resource.","type":"string","default":""},"namespaced":{"description":"namespaced indicates if a resource is namespaced or not.","type":"boolean","default":false},"shortNames":{"description":"shortNames is a list of suggested short names of the resource.","type":"array","items":{"type":"string","default":""}},"singularName":{"description":"singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.","type":"string","default":""},"storageVersionHash":{"description":"The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.","type":"string"},"verbs":{"description":"verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)","type":"array","items":{"type":"string","default":""}},"version":{"description":"version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList":{"description":"APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.","type":"object","required":["groupVersion","resources"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"groupVersion":{"description":"groupVersion is the group and version this APIResourceList is for.","type":"string","default":""},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"resources":{"description":"resources contains the name of the resources and if they are namespaced.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource"}}},"x-kubernetes-group-version-kind":[{"group":"","kind":"APIResourceList","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions":{"description":"DeleteOptions may be provided when deleting an API object.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"dryRun":{"description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","type":"array","items":{"type":"string","default":""}},"gracePeriodSeconds":{"description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","type":"integer","format":"int64"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"orphanDependents":{"description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","type":"boolean"},"preconditions":{"description":"Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"},"propagationPolicy":{"description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta2"},{"group":"batch","kind":"DeleteOptions","version":"v1"},{"group":"batch","kind":"DeleteOptions","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"extensions","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"policy","kind":"DeleteOptions","version":"v1"},{"group":"policy","kind":"DeleteOptions","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"description":"FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector":{"description":"A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.","type":"object","properties":{"matchExpressions":{"description":"matchExpressions is a list of label selector requirements. The requirements are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"}},"matchLabels":{"description":"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.","type":"object","additionalProperties":{"type":"string","default":""}}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement":{"description":"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"key is the label key that the selector applies to.","type":"string","default":"","x-kubernetes-patch-merge-key":"key","x-kubernetes-patch-strategy":"merge"},"operator":{"description":"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.","type":"string","default":""},"values":{"description":"values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"description":"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.","type":"object","properties":{"continue":{"description":"continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.","type":"string"},"remainingItemCount":{"description":"remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.","type":"integer","format":"int64"},"resourceVersion":{"description":"String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"description":"ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.","type":"string"},"fieldsType":{"description":"FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"","type":"string"},"fieldsV1":{"description":"FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"description":"Manager is an identifier of the workflow managing these fields.","type":"string"},"operation":{"description":"Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.","type":"string"},"subresource":{"description":"Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.","type":"string"},"time":{"description":"Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"description":"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.","type":"object","properties":{"annotations":{"description":"Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations","type":"object","additionalProperties":{"type":"string","default":""}},"clusterName":{"description":"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.","type":"string"},"creationTimestamp":{"description":"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"description":"Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.","type":"integer","format":"int64"},"deletionTimestamp":{"description":"DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"description":"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.","type":"array","items":{"type":"string","default":""},"x-kubernetes-patch-strategy":"merge"},"generateName":{"description":"GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency","type":"string"},"generation":{"description":"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.","type":"integer","format":"int64"},"labels":{"description":"Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels","type":"object","additionalProperties":{"type":"string","default":""}},"managedFields":{"description":"ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"}},"name":{"description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string"},"namespace":{"description":"Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces","type":"string"},"ownerReferences":{"description":"List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"x-kubernetes-patch-merge-key":"uid","x-kubernetes-patch-strategy":"merge"},"resourceVersion":{"description":"An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"},"uid":{"description":"UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"description":"OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.","type":"object","required":["apiVersion","kind","name","uid"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string","default":""},"blockOwnerDeletion":{"description":"If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.","type":"boolean"},"controller":{"description":"If true, this reference points to the managing controller.","type":"boolean"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string","default":""},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.Patch":{"description":"Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions":{"description":"Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.","type":"object","properties":{"resourceVersion":{"description":"Specifies the target ResourceVersion","type":"string"},"uid":{"description":"Specifies the target UID.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Status":{"description":"Status is a return value for calls that don't return other objects.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"code":{"description":"Suggested HTTP return code for this status, 0 if not set.","type":"integer","format":"int32"},"details":{"description":"Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"message":{"description":"A human-readable description of the status of this operation.","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"},"reason":{"description":"A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.","type":"string"},"status":{"description":"Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"Status","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause":{"description":"StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.","type":"object","properties":{"field":{"description":"The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"","type":"string"},"message":{"description":"A human-readable description of the cause of the error. This field may be presented as-is to a reader.","type":"string"},"reason":{"description":"A machine-readable description of the cause of the error. If this value is empty there is no information available.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails":{"description":"StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.","type":"object","properties":{"causes":{"description":"The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"}},"group":{"description":"The group attribute of the resource associated with the status StatusReason.","type":"string"},"kind":{"description":"The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).","type":"string"},"retryAfterSeconds":{"description":"If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.","type":"integer","format":"int32"},"uid":{"description":"UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"description":"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.","type":"string","format":"date-time"},"io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent":{"description":"Event represents a single event to a watched resource.","type":"object","required":["type","object"],"properties":{"object":{"description":"Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension"},"type":{"type":"string","default":""}},"x-kubernetes-group-version-kind":[{"group":"","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1"},{"group":"apps","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta2"},{"group":"batch","kind":"WatchEvent","version":"v1"},{"group":"batch","kind":"WatchEvent","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"extensions","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"policy","kind":"WatchEvent","version":"v1"},{"group":"policy","kind":"WatchEvent","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.runtime.RawExtension":{"description":"RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)","type":"object"},"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","type":"string","format":"int-or-string"}}}} kubernetes-client-go-a2dfcab/discovery/testdata/apis/batch/v1beta1.json000066400000000000000000007274421472614177300264130ustar00rootroot00000000000000{"openapi":"3.0.0","info":{"title":"Kubernetes","version":"v1.24.0"},"paths":{"/apis/batch/v1beta1/":{"get":{"tags":["batch_v1beta1"],"description":"get available resources","operationId":"getBatchV1beta1APIResources","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"}}}}}}},"/apis/batch/v1beta1/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1beta1CronJobForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"list or watch objects of kind CronJob","operationId":"listBatchV1beta1NamespacedCronJob","parameters":[{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}},{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobList"}}}}}},"post":{"tags":["batch_v1beta1"],"description":"create a CronJob","operationId":"createBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"delete":{"tags":["batch_v1beta1"],"description":"delete collection of CronJob","operationId":"deleteBatchV1beta1CollectionNamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"parameters":[{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1beta1"],"description":"read the specified CronJob","operationId":"readBatchV1beta1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"put":{"tags":["batch_v1beta1"],"description":"replace the specified CronJob","operationId":"replaceBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"delete":{"tags":["batch_v1beta1"],"description":"delete a CronJob","operationId":"deleteBatchV1beta1NamespacedCronJob","parameters":[{"name":"gracePeriodSeconds","in":"query","description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","schema":{"type":"integer","uniqueItems":true}},{"name":"orphanDependents","in":"query","description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","schema":{"type":"boolean","uniqueItems":true}},{"name":"propagationPolicy","in":"query","description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","schema":{"type":"string","uniqueItems":true}},{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"}}}}}},"patch":{"tags":["batch_v1beta1"],"description":"partially update the specified CronJob","operationId":"patchBatchV1beta1NamespacedCronJob","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status":{"get":{"tags":["batch_v1beta1"],"description":"read status of the specified CronJob","operationId":"readBatchV1beta1NamespacedCronJobStatus","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"put":{"tags":["batch_v1beta1"],"description":"replace status of the specified CronJob","operationId":"replaceBatchV1beta1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"patch":{"tags":["batch_v1beta1"],"description":"partially update status of the specified CronJob","operationId":"patchBatchV1beta1NamespacedCronJobStatus","parameters":[{"name":"dryRun","in":"query","description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","schema":{"type":"string","uniqueItems":true}},{"name":"force","in":"query","description":"Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.","schema":{"type":"boolean","uniqueItems":true}},{"name":"fieldManager","in":"query","description":"fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).","schema":{"type":"string","uniqueItems":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}}}}}},"parameters":[{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1beta1CronJobListForAllNamespaces","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs":{"get":{"tags":["batch_v1beta1"],"description":"watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.","operationId":"watchBatchV1beta1NamespacedCronJobList","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]},"/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}":{"get":{"tags":["batch_v1beta1"],"description":"watch changes to an object of kind CronJob. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.","operationId":"watchBatchV1beta1NamespacedCronJob","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/json;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/vnd.kubernetes.protobuf;stream=watch":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"}}}}}},"parameters":[{"name":"allowWatchBookmarks","in":"query","description":"allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.","schema":{"type":"boolean","uniqueItems":true}},{"name":"continue","in":"query","description":"The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.","schema":{"type":"string","uniqueItems":true}},{"name":"fieldSelector","in":"query","description":"A selector to restrict the list of returned objects by their fields. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"labelSelector","in":"query","description":"A selector to restrict the list of returned objects by their labels. Defaults to everything.","schema":{"type":"string","uniqueItems":true}},{"name":"limit","in":"query","description":"limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.","schema":{"type":"integer","uniqueItems":true}},{"name":"name","in":"path","description":"name of the CronJob","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"namespace","in":"path","description":"object name and auth scope, such as for teams and projects","required":true,"schema":{"type":"string","uniqueItems":true}},{"name":"pretty","in":"query","description":"If 'true', then the output is pretty printed.","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersion","in":"query","description":"resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"resourceVersionMatch","in":"query","description":"resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset","schema":{"type":"string","uniqueItems":true}},{"name":"timeoutSeconds","in":"query","description":"Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.","schema":{"type":"integer","uniqueItems":true}},{"name":"watch","in":"query","description":"Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.","schema":{"type":"boolean","uniqueItems":true}}]}},"components":{"schemas":{"io.k8s.api.batch.v1.JobSpec":{"description":"JobSpec describes how the job execution will look like.","type":"object","required":["template"],"properties":{"activeDeadlineSeconds":{"description":"Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.","type":"integer","format":"int64"},"backoffLimit":{"description":"Specifies the number of retries before marking this job failed. Defaults to 6","type":"integer","format":"int32"},"completionMode":{"description":"CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nThis field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job.","type":"string"},"completions":{"description":"Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"manualSelector":{"description":"manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector","type":"boolean"},"parallelism":{"description":"Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) \u003c .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"selector":{"description":"A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"suspend":{"description":"Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.\n\nThis field is beta-level, gated by SuspendJob feature flag (enabled by default).","type":"boolean"},"template":{"description":"Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec"},"ttlSecondsAfterFinished":{"description":"ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.","type":"integer","format":"int32"}}},"io.k8s.api.batch.v1beta1.CronJob":{"description":"CronJob represents the configuration of a single cron job.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobSpec"},"status":{"description":"Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJobStatus"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJob","version":"v1beta1"}]},"io.k8s.api.batch.v1beta1.CronJobList":{"description":"CronJobList is a collection of cron jobs.","type":"object","required":["items"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"items":{"description":"items is the list of CronJobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.CronJob"}},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}},"x-kubernetes-group-version-kind":[{"group":"batch","kind":"CronJobList","version":"v1beta1"}]},"io.k8s.api.batch.v1beta1.CronJobSpec":{"description":"CronJobSpec describes how the job execution will look like and when it will actually run.","type":"object","required":["schedule","jobTemplate"],"properties":{"concurrencyPolicy":{"description":"Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one","type":"string"},"failedJobsHistoryLimit":{"description":"The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.","type":"integer","format":"int32"},"jobTemplate":{"description":"Specifies the job that will be created when executing a CronJob.","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1beta1.JobTemplateSpec"},"schedule":{"description":"The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.","type":"string","default":""},"startingDeadlineSeconds":{"description":"Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.","type":"integer","format":"int64"},"successfulJobsHistoryLimit":{"description":"The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3.","type":"integer","format":"int32"},"suspend":{"description":"This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.","type":"boolean"}}},"io.k8s.api.batch.v1beta1.CronJobStatus":{"description":"CronJobStatus represents the current state of a cron job.","type":"object","properties":{"active":{"description":"A list of pointers to currently running jobs.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectReference"},"x-kubernetes-list-type":"atomic"},"lastScheduleTime":{"description":"Information when was the last time the job was successfully scheduled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastSuccessfulTime":{"description":"Information when was the last time the job successfully completed.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.api.batch.v1beta1.JobTemplateSpec":{"description":"JobTemplateSpec describes the data a Job should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.batch.v1.JobSpec"}}},"io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource":{"description":"Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).","type":"integer","format":"int32"},"readOnly":{"description":"readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"boolean"},"volumeID":{"description":"volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string","default":""}}},"io.k8s.api.core.v1.Affinity":{"description":"Affinity is a group of affinity scheduling rules.","type":"object","properties":{"nodeAffinity":{"description":"Describes node affinity scheduling rules for the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeAffinity"},"podAffinity":{"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinity"},"podAntiAffinity":{"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity"}}},"io.k8s.api.core.v1.AzureDiskVolumeSource":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","type":"object","required":["diskName","diskURI"],"properties":{"cachingMode":{"description":"cachingMode is the Host Caching mode: None, Read Only, Read Write.","type":"string"},"diskName":{"description":"diskName is the Name of the data disk in the blob storage","type":"string","default":""},"diskURI":{"description":"diskURI is the URI of data disk in the blob storage","type":"string","default":""},"fsType":{"description":"fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"kind":{"description":"kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"}}},"io.k8s.api.core.v1.AzureFileVolumeSource":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","type":"object","required":["secretName","shareName"],"properties":{"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretName":{"description":"secretName is the name of secret that contains Azure Storage Account Name and Key","type":"string","default":""},"shareName":{"description":"shareName is the azure share Name","type":"string","default":""}}},"io.k8s.api.core.v1.CSIVolumeSource":{"description":"Represents a source location of a volume to mount, managed by an external CSI driver","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.","type":"string","default":""},"fsType":{"description":"fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.","type":"string"},"nodePublishSecretRef":{"description":"nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"readOnly":{"description":"readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeAttributes":{"description":"volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.","type":"object","additionalProperties":{"type":"string","default":""}}}},"io.k8s.api.core.v1.Capabilities":{"description":"Adds and removes POSIX capabilities from running containers.","type":"object","properties":{"add":{"description":"Added capabilities","type":"array","items":{"type":"string","default":""}},"drop":{"description":"Removed capabilities","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.CephFSVolumeSource":{"description":"Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["monitors"],"properties":{"monitors":{"description":"monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"path":{"description":"path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /","type":"string"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"boolean"},"secretFile":{"description":"secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"},"secretRef":{"description":"secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.CinderVolumeSource":{"description":"Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"boolean"},"secretRef":{"description":"secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeID":{"description":"volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string","default":""}}},"io.k8s.api.core.v1.ConfigMapEnvSource":{"description":"ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapKeySelector":{"description":"Selects a key from a ConfigMap.","type":"object","required":["key"],"properties":{"key":{"description":"The key to select.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ConfigMapProjection":{"description":"Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapVolumeSource":{"description":"Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.Container":{"description":"A single application container that you want to run within a pod.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Actions that the management system should take in response to container lifecycle events. Cannot be updated.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.","type":"string","default":""},"ports":{"description":"List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ContainerPort":{"description":"ContainerPort represents a network port in a single container.","type":"object","required":["containerPort"],"properties":{"containerPort":{"description":"Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.","type":"integer","format":"int32","default":0},"hostIP":{"description":"What host IP to bind the external port to.","type":"string"},"hostPort":{"description":"Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.","type":"integer","format":"int32"},"name":{"description":"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.","type":"string"},"protocol":{"description":"Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".\n\n","type":"string","default":"TCP"}}},"io.k8s.api.core.v1.DownwardAPIProjection":{"description":"Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.","type":"object","properties":{"items":{"description":"Items is a list of DownwardAPIVolume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.DownwardAPIVolumeFile":{"description":"DownwardAPIVolumeFile represents information to create the file containing the pod field","type":"object","required":["path"],"properties":{"fieldRef":{"description":"Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"mode":{"description":"Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'","type":"string","default":""},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"}}},"io.k8s.api.core.v1.DownwardAPIVolumeSource":{"description":"DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"Items is a list of downward API volume file","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.EmptyDirVolumeSource":{"description":"Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.","type":"object","properties":{"medium":{"description":"medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","type":"string"},"sizeLimit":{"description":"sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}},"io.k8s.api.core.v1.EnvFromSource":{"description":"EnvFromSource represents the source of a set of ConfigMaps","type":"object","properties":{"configMapRef":{"description":"The ConfigMap to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource"},"prefix":{"description":"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.","type":"string"},"secretRef":{"description":"The Secret to select from","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretEnvSource"}}},"io.k8s.api.core.v1.EnvVar":{"description":"EnvVar represents an environment variable present in a Container.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the environment variable. Must be a C_IDENTIFIER.","type":"string","default":""},"value":{"description":"Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".","type":"string"},"valueFrom":{"description":"Source for the environment variable's value. Cannot be used if value is not empty.","$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVarSource"}}},"io.k8s.api.core.v1.EnvVarSource":{"description":"EnvVarSource represents a source for the value of an EnvVar.","type":"object","properties":{"configMapKeyRef":{"description":"Selects a key of a ConfigMap.","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector"},"fieldRef":{"description":"Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['\u003cKEY\u003e']`, `metadata.annotations['\u003cKEY\u003e']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.","$ref":"#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.","$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector"},"secretKeyRef":{"description":"Selects a key of a secret in the pod's namespace","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretKeySelector"}}},"io.k8s.api.core.v1.EphemeralContainer":{"description":"An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"command":{"description":"Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string","default":""}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Container image name. More info: https://kubernetes.io/docs/concepts/containers/images","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\n","type":"string"},"lifecycle":{"description":"Lifecycle is not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.","type":"string","default":""},"ports":{"description":"Ports are not allowed for ephemeral containers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"resources":{"description":"Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.","$ref":"#/components/schemas/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/components/schemas/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"targetContainerName":{"description":"If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.","type":"string"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\n","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.EphemeralVolumeSource":{"description":"Represents an ephemeral volume that is handled by a normal storage driver.","type":"object","properties":{"volumeClaimTemplate":{"description":"Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `\u003cpod name\u003e-\u003cvolume name\u003e` where `\u003cvolume name\u003e` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate"}}},"io.k8s.api.core.v1.ExecAction":{"description":"ExecAction describes a \"run in container\" action.","type":"object","properties":{"command":{"description":"Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FCVolumeSource":{"description":"Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"lun":{"description":"lun is Optional: FC target lun number","type":"integer","format":"int32"},"readOnly":{"description":"readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"targetWWNs":{"description":"targetWWNs is Optional: FC target worldwide names (WWNs)","type":"array","items":{"type":"string","default":""}},"wwids":{"description":"wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.FlexVolumeSource":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","type":"object","required":["driver"],"properties":{"driver":{"description":"driver is the name of the driver to use for this volume.","type":"string","default":""},"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.","type":"string"},"options":{"description":"options is Optional: this field holds extra command options if any.","type":"object","additionalProperties":{"type":"string","default":""}},"readOnly":{"description":"readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"}}},"io.k8s.api.core.v1.FlockerVolumeSource":{"description":"Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.","type":"object","properties":{"datasetName":{"description":"datasetName is Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated","type":"string"},"datasetUUID":{"description":"datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset","type":"string"}}},"io.k8s.api.core.v1.GCEPersistentDiskVolumeSource":{"description":"Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.","type":"object","required":["pdName"],"properties":{"fsType":{"description":"fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"partition":{"description":"partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"integer","format":"int32"},"pdName":{"description":"pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string","default":""},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"boolean"}}},"io.k8s.api.core.v1.GRPCAction":{"type":"object","required":["port"],"properties":{"port":{"description":"Port number of the gRPC service. Number must be in the range 1 to 65535.","type":"integer","format":"int32","default":0},"service":{"description":"Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.","type":"string","default":""}}},"io.k8s.api.core.v1.GitRepoVolumeSource":{"description":"Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","type":"object","required":["repository"],"properties":{"directory":{"description":"directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.","type":"string"},"repository":{"description":"repository is the URL","type":"string","default":""},"revision":{"description":"revision is the commit hash for the specified revision.","type":"string"}}},"io.k8s.api.core.v1.GlusterfsVolumeSource":{"description":"Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["endpoints","path"],"properties":{"endpoints":{"description":"endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"path":{"description":"path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string","default":""},"readOnly":{"description":"readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"boolean"}}},"io.k8s.api.core.v1.HTTPGetAction":{"description":"HTTPGetAction describes an action based on HTTP Get requests.","type":"object","required":["port"],"properties":{"host":{"description":"Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.","type":"string"},"httpHeaders":{"description":"Custom headers to set in the request. HTTP allows repeated headers.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPHeader"}},"path":{"description":"Path to access on the HTTP server.","type":"string"},"port":{"description":"Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"},"scheme":{"description":"Scheme to use for connecting to the host. Defaults to HTTP.\n\n","type":"string"}}},"io.k8s.api.core.v1.HTTPHeader":{"description":"HTTPHeader describes a custom header to be used in HTTP probes","type":"object","required":["name","value"],"properties":{"name":{"description":"The header field name","type":"string","default":""},"value":{"description":"The header field value","type":"string","default":""}}},"io.k8s.api.core.v1.HostAlias":{"description":"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.","type":"object","properties":{"hostnames":{"description":"Hostnames for the above IP address.","type":"array","items":{"type":"string","default":""}},"ip":{"description":"IP address of the host file entry.","type":"string"}}},"io.k8s.api.core.v1.HostPathVolumeSource":{"description":"Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.","type":"object","required":["path"],"properties":{"path":{"description":"path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string","default":""},"type":{"description":"type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"}}},"io.k8s.api.core.v1.ISCSIVolumeSource":{"description":"Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.","type":"object","required":["targetPortal","iqn","lun"],"properties":{"chapAuthDiscovery":{"description":"chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication","type":"boolean"},"chapAuthSession":{"description":"chapAuthSession defines whether support iSCSI Session CHAP authentication","type":"boolean"},"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi","type":"string"},"initiatorName":{"description":"initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.","type":"string"},"iqn":{"description":"iqn is the target iSCSI Qualified Name.","type":"string","default":""},"iscsiInterface":{"description":"iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).","type":"string"},"lun":{"description":"lun represents iSCSI Target Lun number.","type":"integer","format":"int32","default":0},"portals":{"description":"portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"array","items":{"type":"string","default":""}},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.","type":"boolean"},"secretRef":{"description":"secretRef is the CHAP Secret for iSCSI target and initiator authentication","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"targetPortal":{"description":"targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"string","default":""}}},"io.k8s.api.core.v1.KeyToPath":{"description":"Maps a string key to a path within a volume.","type":"object","required":["key","path"],"properties":{"key":{"description":"key is the key to project.","type":"string","default":""},"mode":{"description":"mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.","type":"string","default":""}}},"io.k8s.api.core.v1.Lifecycle":{"description":"Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.","type":"object","properties":{"postStart":{"description":"PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"},"preStop":{"description":"PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/components/schemas/io.k8s.api.core.v1.LifecycleHandler"}}},"io.k8s.api.core.v1.LifecycleHandler":{"description":"LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"tcpSocket":{"description":"Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"}}},"io.k8s.api.core.v1.LocalObjectReference":{"description":"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NFSVolumeSource":{"description":"Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.","type":"object","required":["server","path"],"properties":{"path":{"description":"path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""},"readOnly":{"description":"readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"boolean"},"server":{"description":"server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string","default":""}}},"io.k8s.api.core.v1.NodeAffinity":{"description":"Node affinity is a group of node affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.","$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelector"}}},"io.k8s.api.core.v1.NodeSelector":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","type":"object","required":["nodeSelectorTerms"],"properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.NodeSelectorRequirement":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"The label key that the selector applies to.","type":"string","default":""},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\n","type":"string","default":""},"values":{"description":"An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.NodeSelectorTerm":{"description":"A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.","type":"object","properties":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}},"matchFields":{"description":"A list of node selector requirements by node's fields.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement"}}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectFieldSelector":{"description":"ObjectFieldSelector selects an APIVersioned field of an object.","type":"object","required":["fieldPath"],"properties":{"apiVersion":{"description":"Version of the schema the FieldPath is written in terms of, defaults to \"v1\".","type":"string"},"fieldPath":{"description":"Path of the field to select in the specified API version.","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ObjectReference":{"description":"ObjectReference contains enough information to let you inspect or modify the referred object.","type":"object","properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"fieldPath":{"description":"If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.","type":"string"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"namespace":{"description":"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/","type":"string"},"resourceVersion":{"description":"Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids","type":"string"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.PersistentVolumeClaimSpec":{"description":"PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes","type":"object","properties":{"accessModes":{"description":"accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1","type":"array","items":{"type":"string","default":""}},"dataSource":{"description":"dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"dataSourceRef":{"description":"dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While DataSource ignores disallowed values (dropping them), DataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n(Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled.","$ref":"#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference"},"resources":{"description":"resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.ResourceRequirements"},"selector":{"description":"selector is a label query over volumes to consider for binding.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"storageClassName":{"description":"storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1","type":"string"},"volumeMode":{"description":"volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.","type":"string"},"volumeName":{"description":"volumeName is the binding reference to the PersistentVolume backing this claim.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimTemplate":{"description":"PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.","type":"object","required":["spec"],"properties":{"metadata":{"description":"May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec"}}},"io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource":{"description":"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).","type":"object","required":["claimName"],"properties":{"claimName":{"description":"claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","type":"string","default":""},"readOnly":{"description":"readOnly Will force the ReadOnly setting in VolumeMounts. Default false.","type":"boolean"}}},"io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource":{"description":"Represents a Photon Controller persistent disk resource.","type":"object","required":["pdID"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"pdID":{"description":"pdID is the ID that identifies Photon Controller persistent disk","type":"string","default":""}}},"io.k8s.api.core.v1.PodAffinity":{"description":"Pod affinity is a group of inter pod affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running","type":"object","required":["topologyKey"],"properties":{"labelSelector":{"description":"A label query over a set of resources, in this case pods.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaceSelector":{"description":"A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"","type":"array","items":{"type":"string","default":""}},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string","default":""}}},"io.k8s.api.core.v1.PodAntiAffinity":{"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodDNSConfig":{"description":"PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.","type":"object","properties":{"nameservers":{"description":"A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.","type":"array","items":{"type":"string","default":""}},"options":{"description":"A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption"}},"searches":{"description":"A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.api.core.v1.PodDNSConfigOption":{"description":"PodDNSConfigOption defines DNS resolver options of a pod.","type":"object","properties":{"name":{"description":"Required.","type":"string"},"value":{"type":"string"}}},"io.k8s.api.core.v1.PodOS":{"description":"PodOS defines the OS parameters of a pod.","type":"object","required":["name"],"properties":{"name":{"description":"Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null","type":"string","default":""}}},"io.k8s.api.core.v1.PodReadinessGate":{"description":"PodReadinessGate contains the reference to a pod condition","type":"object","required":["conditionType"],"properties":{"conditionType":{"description":"ConditionType refers to a condition in the pod's condition list with matching type.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.PodSecurityContext":{"description":"PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.","type":"object","properties":{"fsGroup":{"description":"A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"fsGroupChangePolicy":{"description":"fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"supplementalGroups":{"description":"A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"type":"integer","format":"int64","default":0}},"sysctls":{"description":"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Sysctl"}},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.PodSpec":{"description":"PodSpec is a description of a pod.","type":"object","required":["containers"],"properties":{"activeDeadlineSeconds":{"description":"Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.","type":"integer","format":"int64"},"affinity":{"description":"If specified, the pod's scheduling constraints","$ref":"#/components/schemas/io.k8s.api.core.v1.Affinity"},"automountServiceAccountToken":{"description":"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.","type":"boolean"},"containers":{"description":"List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"dnsConfig":{"description":"Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodDNSConfig"},"dnsPolicy":{"description":"Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n\n","type":"string"},"enableServiceLinks":{"description":"EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.","type":"boolean"},"ephemeralContainers":{"description":"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralContainer"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"hostAliases":{"description":"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.HostAlias"},"x-kubernetes-patch-merge-key":"ip","x-kubernetes-patch-strategy":"merge"},"hostIPC":{"description":"Use the host's ipc namespace. Optional: Default to false.","type":"boolean"},"hostNetwork":{"description":"Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.","type":"boolean"},"hostPID":{"description":"Use the host's pid namespace. Optional: Default to false.","type":"boolean"},"hostname":{"description":"Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.","type":"string"},"imagePullSecrets":{"description":"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"initContainers":{"description":"List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"nodeName":{"description":"NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.","type":"string"},"nodeSelector":{"description":"NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/","type":"object","additionalProperties":{"type":"string","default":""},"x-kubernetes-map-type":"atomic"},"os":{"description":"Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup This is an alpha field and requires the IdentifyPodOS feature","$ref":"#/components/schemas/io.k8s.api.core.v1.PodOS"},"overhead":{"description":"Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature.","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"preemptionPolicy":{"description":"PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.","type":"string"},"priority":{"description":"The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.","type":"integer","format":"int32"},"priorityClassName":{"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"},"readinessGates":{"description":"If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodReadinessGate"}},"restartPolicy":{"description":"Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\n","type":"string"},"runtimeClassName":{"description":"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14.","type":"string"},"schedulerName":{"description":"If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.","type":"string"},"securityContext":{"description":"SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.","$ref":"#/components/schemas/io.k8s.api.core.v1.PodSecurityContext"},"serviceAccount":{"description":"DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.","type":"string"},"serviceAccountName":{"description":"ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/","type":"string"},"setHostnameAsFQDN":{"description":"If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.","type":"boolean"},"shareProcessNamespace":{"description":"Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.","type":"boolean"},"subdomain":{"description":"If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.","type":"string"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.","type":"integer","format":"int64"},"tolerations":{"description":"If specified, the pod's tolerations.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Toleration"}},"topologySpreadConstraints":{"description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint"},"x-kubernetes-list-map-keys":["topologyKey","whenUnsatisfiable"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"topologyKey","x-kubernetes-patch-strategy":"merge"},"volumes":{"description":"List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.Volume"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge,retainKeys"}}},"io.k8s.api.core.v1.PodTemplateSpec":{"description":"PodTemplateSpec describes the data a pod should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodSpec"}}},"io.k8s.api.core.v1.PortworxVolumeSource":{"description":"PortworxVolumeSource represents a Portworx volume resource.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"volumeID":{"description":"volumeID uniquely identifies a Portworx volume","type":"string","default":""}}},"io.k8s.api.core.v1.PreferredSchedulingTerm":{"description":"An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).","type":"object","required":["weight","preference"],"properties":{"preference":{"description":"A node selector term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.Probe":{"description":"Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.","type":"object","properties":{"exec":{"description":"Exec specifies the action to take.","$ref":"#/components/schemas/io.k8s.api.core.v1.ExecAction"},"failureThreshold":{"description":"Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.","type":"integer","format":"int32"},"grpc":{"description":"GRPC specifies an action involving a GRPC port.","$ref":"#/components/schemas/io.k8s.api.core.v1.GRPCAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/components/schemas/io.k8s.api.core.v1.HTTPGetAction"},"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"},"periodSeconds":{"description":"How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.","type":"integer","format":"int32"},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.","type":"integer","format":"int32"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port.","$ref":"#/components/schemas/io.k8s.api.core.v1.TCPSocketAction"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.","type":"integer","format":"int64"},"timeoutSeconds":{"description":"Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.ProjectedVolumeSource":{"description":"Represents a projected volume source","type":"object","properties":{"defaultMode":{"description":"defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"sources":{"description":"sources is the list of volume projections","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.VolumeProjection"}}}},"io.k8s.api.core.v1.QuobyteVolumeSource":{"description":"Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.","type":"object","required":["registry","volume"],"properties":{"group":{"description":"group to map volume access to Default is no group","type":"string"},"readOnly":{"description":"readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.","type":"boolean"},"registry":{"description":"registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes","type":"string","default":""},"tenant":{"description":"tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin","type":"string"},"user":{"description":"user to map volume access to Defaults to serivceaccount user","type":"string"},"volume":{"description":"volume is a string that references an already created Quobyte volume by name.","type":"string","default":""}}},"io.k8s.api.core.v1.RBDVolumeSource":{"description":"Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.","type":"object","required":["monitors","image"],"properties":{"fsType":{"description":"fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd","type":"string"},"image":{"description":"image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string","default":""},"keyring":{"description":"keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"monitors":{"description":"monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"array","items":{"type":"string","default":""}},"pool":{"description":"pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"readOnly":{"description":"readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"boolean"},"secretRef":{"description":"secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.ResourceFieldSelector":{"description":"ResourceFieldSelector represents container resources (cpu, memory) and their output format","type":"object","required":["resource"],"properties":{"containerName":{"description":"Container name: required for volumes, optional for env vars","type":"string"},"divisor":{"description":"Specifies the output format of the exposed resources, defaults to \"1\"","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"},"resource":{"description":"Required: resource to select","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.ResourceRequirements":{"description":"ResourceRequirements describes the compute resource requirements.","type":"object","properties":{"limits":{"description":"Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"requests":{"description":"Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/","type":"object","additionalProperties":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"}}}},"io.k8s.api.core.v1.SELinuxOptions":{"description":"SELinuxOptions are the labels to be applied to the container","type":"object","properties":{"level":{"description":"Level is SELinux level label that applies to the container.","type":"string"},"role":{"description":"Role is a SELinux role label that applies to the container.","type":"string"},"type":{"description":"Type is a SELinux type label that applies to the container.","type":"string"},"user":{"description":"User is a SELinux user label that applies to the container.","type":"string"}}},"io.k8s.api.core.v1.ScaleIOVolumeSource":{"description":"ScaleIOVolumeSource represents a persistent ScaleIO volume","type":"object","required":["gateway","system","secretRef"],"properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".","type":"string"},"gateway":{"description":"gateway is the host address of the ScaleIO API Gateway.","type":"string","default":""},"protectionDomain":{"description":"protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.","type":"string"},"readOnly":{"description":"readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"sslEnabled":{"description":"sslEnabled Flag enable/disable SSL communication with Gateway, default false","type":"boolean"},"storageMode":{"description":"storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.","type":"string"},"storagePool":{"description":"storagePool is the ScaleIO Storage Pool associated with the protection domain.","type":"string"},"system":{"description":"system is the name of the storage system as configured in ScaleIO.","type":"string","default":""},"volumeName":{"description":"volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.","type":"string"}}},"io.k8s.api.core.v1.SeccompProfile":{"description":"SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.","type":"object","required":["type"],"properties":{"localhostProfile":{"description":"localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".","type":"string"},"type":{"description":"type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.\n\n","type":"string","default":""}},"x-kubernetes-unions":[{"discriminator":"type","fields-to-discriminateBy":{"localhostProfile":"LocalhostProfile"}}]},"io.k8s.api.core.v1.SecretEnvSource":{"description":"SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretKeySelector":{"description":"SecretKeySelector selects a key of a Secret.","type":"object","required":["key"],"properties":{"key":{"description":"The key of the secret to select from. Must be a valid secret key.","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.SecretProjection":{"description":"Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.","type":"object","properties":{"items":{"description":"items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"optional field specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretVolumeSource":{"description":"Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.KeyToPath"}},"optional":{"description":"optional field specify whether the Secret or its keys must be defined","type":"boolean"},"secretName":{"description":"secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","type":"string"}}},"io.k8s.api.core.v1.SecurityContext":{"description":"SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.","type":"object","properties":{"allowPrivilegeEscalation":{"description":"AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"capabilities":{"description":"The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.Capabilities"},"privileged":{"description":"Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"procMount":{"description":"procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.","type":"string"},"readOnlyRootFilesystem":{"description":"Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.","type":"boolean"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by this container. If seccomp options are provided at both the pod \u0026 container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows.","$ref":"#/components/schemas/io.k8s.api.core.v1.SeccompProfile"},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux.","$ref":"#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.ServiceAccountTokenProjection":{"description":"ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).","type":"object","required":["path"],"properties":{"audience":{"description":"audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.","type":"string"},"expirationSeconds":{"description":"expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.","type":"integer","format":"int64"},"path":{"description":"path is the path relative to the mount point of the file to project the token into.","type":"string","default":""}}},"io.k8s.api.core.v1.StorageOSVolumeSource":{"description":"Represents a StorageOS persistent volume resource.","type":"object","properties":{"fsType":{"description":"fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.","$ref":"#/components/schemas/io.k8s.api.core.v1.LocalObjectReference"},"volumeName":{"description":"volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.","type":"string"},"volumeNamespace":{"description":"volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.","type":"string"}}},"io.k8s.api.core.v1.Sysctl":{"description":"Sysctl defines a kernel parameter to be set","type":"object","required":["name","value"],"properties":{"name":{"description":"Name of a property to set","type":"string","default":""},"value":{"description":"Value of a property to set","type":"string","default":""}}},"io.k8s.api.core.v1.TCPSocketAction":{"description":"TCPSocketAction describes an action based on opening a socket","type":"object","required":["port"],"properties":{"host":{"description":"Optional: Host name to connect to, defaults to the pod IP.","type":"string"},"port":{"description":"Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString"}}},"io.k8s.api.core.v1.Toleration":{"description":"The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.","type":"object","properties":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.\n\n","type":"string"},"key":{"description":"Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.","type":"string"},"operator":{"description":"Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.\n\n","type":"string"},"tolerationSeconds":{"description":"TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.","type":"integer","format":"int64"},"value":{"description":"Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.","type":"string"}}},"io.k8s.api.core.v1.TopologySpreadConstraint":{"description":"TopologySpreadConstraint specifies how to spread matching pods among the given topology.","type":"object","required":["maxSkew","topologyKey","whenUnsatisfiable"],"properties":{"labelSelector":{"description":"LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"maxSkew":{"description":"MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.","type":"integer","format":"int32","default":0},"topologyKey":{"description":"TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each \u003ckey, value\u003e as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.","type":"string","default":""},"whenUnsatisfiable":{"description":"WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.\n\n","type":"string","default":""}}},"io.k8s.api.core.v1.TypedLocalObjectReference":{"description":"TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string","default":""},"name":{"description":"Name is the name of resource being referenced","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.api.core.v1.Volume":{"description":"Volume represents a named volume in a pod that may be accessed by any container in the pod.","type":"object","required":["name"],"properties":{"awsElasticBlockStore":{"description":"awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","$ref":"#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"},"azureDisk":{"description":"azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource"},"azureFile":{"description":"azureFile represents an Azure File Service mount on the host and bind mount to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource"},"cephfs":{"description":"cephFS represents a Ceph FS mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource"},"cinder":{"description":"cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource"},"configMap":{"description":"configMap represents a configMap that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource"},"csi":{"description":"csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).","$ref":"#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource"},"downwardAPI":{"description":"downwardAPI represents downward API about the pod that should populate this volume","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource"},"emptyDir":{"description":"emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource"},"ephemeral":{"description":"ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.","$ref":"#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource"},"fc":{"description":"fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.","$ref":"#/components/schemas/io.k8s.api.core.v1.FCVolumeSource"},"flexVolume":{"description":"flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","$ref":"#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource"},"flocker":{"description":"flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running","$ref":"#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource"},"gcePersistentDisk":{"description":"gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","$ref":"#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"},"gitRepo":{"description":"gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","$ref":"#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource"},"glusterfs":{"description":"glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource"},"hostPath":{"description":"hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","$ref":"#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource"},"iscsi":{"description":"iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource"},"name":{"description":"name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string","default":""},"nfs":{"description":"nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","$ref":"#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource"},"persistentVolumeClaim":{"description":"persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","$ref":"#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"},"photonPersistentDisk":{"description":"photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"},"portworxVolume":{"description":"portworxVolume represents a portworx volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource"},"projected":{"description":"projected items for all in one resources secrets, configmaps, and downward API","$ref":"#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource"},"quobyte":{"description":"quobyte represents a Quobyte mount on the host that shares a pod's lifetime","$ref":"#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource"},"rbd":{"description":"rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md","$ref":"#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource"},"scaleIO":{"description":"scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource"},"secret":{"description":"secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource"},"storageos":{"description":"storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.","$ref":"#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource"},"vsphereVolume":{"description":"vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine","$ref":"#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"}}},"io.k8s.api.core.v1.VolumeDevice":{"description":"volumeDevice describes a mapping of a raw block device within a container.","type":"object","required":["name","devicePath"],"properties":{"devicePath":{"description":"devicePath is the path inside of the container that the device will be mapped to.","type":"string","default":""},"name":{"description":"name must match the name of a persistentVolumeClaim in the pod","type":"string","default":""}}},"io.k8s.api.core.v1.VolumeMount":{"description":"VolumeMount describes a mounting of a Volume within a container.","type":"object","required":["name","mountPath"],"properties":{"mountPath":{"description":"Path within the container at which the volume should be mounted. Must not contain ':'.","type":"string","default":""},"mountPropagation":{"description":"mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.","type":"string"},"name":{"description":"This must match the Name of a Volume.","type":"string","default":""},"readOnly":{"description":"Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.","type":"boolean"},"subPath":{"description":"Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).","type":"string"},"subPathExpr":{"description":"Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.","type":"string"}}},"io.k8s.api.core.v1.VolumeProjection":{"description":"Projection that may be projected along with other supported volume types","type":"object","properties":{"configMap":{"description":"configMap information about the configMap data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection"},"downwardAPI":{"description":"downwardAPI information about the downwardAPI data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection"},"secret":{"description":"secret information about the secret data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.SecretProjection"},"serviceAccountToken":{"description":"serviceAccountToken is information about the serviceAccountToken data to project","$ref":"#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection"}}},"io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource":{"description":"Represents a vSphere volume resource.","type":"object","required":["volumePath"],"properties":{"fsType":{"description":"fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"storagePolicyID":{"description":"storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.","type":"string"},"storagePolicyName":{"description":"storagePolicyName is the storage Policy Based Management (SPBM) profile name.","type":"string"},"volumePath":{"description":"volumePath is the path that identifies vSphere volume vmdk","type":"string","default":""}}},"io.k8s.api.core.v1.WeightedPodAffinityTerm":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","type":"object","required":["weight","podAffinityTerm"],"properties":{"podAffinityTerm":{"description":"Required. A pod affinity term, associated with the corresponding weight.","default":{},"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","type":"integer","format":"int32","default":0}}},"io.k8s.api.core.v1.WindowsSecurityContextOptions":{"description":"WindowsSecurityContextOptions contain Windows-specific options and credentials.","type":"object","properties":{"gmsaCredentialSpec":{"description":"GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.","type":"string"},"gmsaCredentialSpecName":{"description":"GMSACredentialSpecName is the name of the GMSA credential spec to use.","type":"string"},"hostProcess":{"description":"HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.","type":"boolean"},"runAsUserName":{"description":"The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"string"}}},"io.k8s.apimachinery.pkg.api.resource.Quantity":{"description":"Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9 \u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e \u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e \u003csign\u003e ::= \"+\" | \"-\" \u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e \u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e \u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.","type":"string"},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResource":{"description":"APIResource specifies the name of a resource and whether it is namespaced.","type":"object","required":["name","singularName","namespaced","kind","verbs"],"properties":{"categories":{"description":"categories is a list of the grouped resources this resource belongs to (e.g. 'all')","type":"array","items":{"type":"string","default":""}},"group":{"description":"group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".","type":"string"},"kind":{"description":"kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')","type":"string","default":""},"name":{"description":"name is the plural name of the resource.","type":"string","default":""},"namespaced":{"description":"namespaced indicates if a resource is namespaced or not.","type":"boolean","default":false},"shortNames":{"description":"shortNames is a list of suggested short names of the resource.","type":"array","items":{"type":"string","default":""}},"singularName":{"description":"singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.","type":"string","default":""},"storageVersionHash":{"description":"The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.","type":"string"},"verbs":{"description":"verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)","type":"array","items":{"type":"string","default":""}},"version":{"description":"version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList":{"description":"APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.","type":"object","required":["groupVersion","resources"],"properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"groupVersion":{"description":"groupVersion is the group and version this APIResourceList is for.","type":"string","default":""},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"resources":{"description":"resources contains the name of the resources and if they are namespaced.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource"}}},"x-kubernetes-group-version-kind":[{"group":"","kind":"APIResourceList","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions":{"description":"DeleteOptions may be provided when deleting an API object.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"dryRun":{"description":"When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed","type":"array","items":{"type":"string","default":""}},"gracePeriodSeconds":{"description":"The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.","type":"integer","format":"int64"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"orphanDependents":{"description":"Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.","type":"boolean"},"preconditions":{"description":"Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"},"propagationPolicy":{"description":"Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admission.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiextensions.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"apiregistration.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta1"},{"group":"apps","kind":"DeleteOptions","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authentication.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta1"},{"group":"autoscaling","kind":"DeleteOptions","version":"v2beta2"},{"group":"batch","kind":"DeleteOptions","version":"v1"},{"group":"batch","kind":"DeleteOptions","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"certificates.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"coordination.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"discovery.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"events.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"extensions","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"DeleteOptions","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"networking.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"node.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"policy","kind":"DeleteOptions","version":"v1"},{"group":"policy","kind":"DeleteOptions","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"DeleteOptions","version":"v1beta1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"DeleteOptions","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"description":"FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector":{"description":"A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.","type":"object","properties":{"matchExpressions":{"description":"matchExpressions is a list of label selector requirements. The requirements are ANDed.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"}},"matchLabels":{"description":"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.","type":"object","additionalProperties":{"type":"string","default":""}}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement":{"description":"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"key is the label key that the selector applies to.","type":"string","default":"","x-kubernetes-patch-merge-key":"key","x-kubernetes-patch-strategy":"merge"},"operator":{"description":"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.","type":"string","default":""},"values":{"description":"values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string","default":""}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"description":"ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.","type":"object","properties":{"continue":{"description":"continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.","type":"string"},"remainingItemCount":{"description":"remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.","type":"integer","format":"int64"},"resourceVersion":{"description":"String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"description":"ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.","type":"string"},"fieldsType":{"description":"FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"","type":"string"},"fieldsV1":{"description":"FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"description":"Manager is an identifier of the workflow managing these fields.","type":"string"},"operation":{"description":"Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.","type":"string"},"subresource":{"description":"Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.","type":"string"},"time":{"description":"Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"description":"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.","type":"object","properties":{"annotations":{"description":"Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations","type":"object","additionalProperties":{"type":"string","default":""}},"clusterName":{"description":"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.","type":"string"},"creationTimestamp":{"description":"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"description":"Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.","type":"integer","format":"int64"},"deletionTimestamp":{"description":"DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"description":"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.","type":"array","items":{"type":"string","default":""},"x-kubernetes-patch-strategy":"merge"},"generateName":{"description":"GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency","type":"string"},"generation":{"description":"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.","type":"integer","format":"int64"},"labels":{"description":"Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels","type":"object","additionalProperties":{"type":"string","default":""}},"managedFields":{"description":"ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"}},"name":{"description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string"},"namespace":{"description":"Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces","type":"string"},"ownerReferences":{"description":"List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"x-kubernetes-patch-merge-key":"uid","x-kubernetes-patch-strategy":"merge"},"resourceVersion":{"description":"An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency","type":"string"},"selfLink":{"description":"selfLink is DEPRECATED read-only field that is no longer populated by the system.","type":"string"},"uid":{"description":"UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"description":"OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.","type":"object","required":["apiVersion","kind","name","uid"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string","default":""},"blockOwnerDeletion":{"description":"If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.","type":"boolean"},"controller":{"description":"If true, this reference points to the managing controller.","type":"boolean"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string","default":""},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names","type":"string","default":""},"uid":{"description":"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string","default":""}},"x-kubernetes-map-type":"atomic"},"io.k8s.apimachinery.pkg.apis.meta.v1.Patch":{"description":"Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.","type":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions":{"description":"Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.","type":"object","properties":{"resourceVersion":{"description":"Specifies the target ResourceVersion","type":"string"},"uid":{"description":"Specifies the target UID.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Status":{"description":"Status is a return value for calls that don't return other objects.","type":"object","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources","type":"string"},"code":{"description":"Suggested HTTP return code for this status, 0 if not set.","type":"integer","format":"int32"},"details":{"description":"Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.","$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"message":{"description":"A human-readable description of the status of this operation.","type":"string"},"metadata":{"description":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"},"reason":{"description":"A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.","type":"string"},"status":{"description":"Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","type":"string"}},"x-kubernetes-group-version-kind":[{"group":"","kind":"Status","version":"v1"}]},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause":{"description":"StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.","type":"object","properties":{"field":{"description":"The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"","type":"string"},"message":{"description":"A human-readable description of the cause of the error. This field may be presented as-is to a reader.","type":"string"},"reason":{"description":"A machine-readable description of the cause of the error. If this value is empty there is no information available.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails":{"description":"StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.","type":"object","properties":{"causes":{"description":"The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.","type":"array","items":{"default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"}},"group":{"description":"The group attribute of the resource associated with the status StatusReason.","type":"string"},"kind":{"description":"The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).","type":"string"},"retryAfterSeconds":{"description":"If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.","type":"integer","format":"int32"},"uid":{"description":"UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"description":"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.","type":"string","format":"date-time"},"io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent":{"description":"Event represents a single event to a watched resource.","type":"object","required":["type","object"],"properties":{"object":{"description":"Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.","default":{},"$ref":"#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension"},"type":{"type":"string","default":""}},"x-kubernetes-group-version-kind":[{"group":"","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admission.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"admissionregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiextensions.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"apiregistration.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1"},{"group":"apps","kind":"WatchEvent","version":"v1beta1"},{"group":"apps","kind":"WatchEvent","version":"v1beta2"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authentication.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta1"},{"group":"autoscaling","kind":"WatchEvent","version":"v2beta2"},{"group":"batch","kind":"WatchEvent","version":"v1"},{"group":"batch","kind":"WatchEvent","version":"v1beta1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"certificates.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"coordination.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"discovery.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"events.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"extensions","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"flowcontrol.apiserver.k8s.io","kind":"WatchEvent","version":"v1beta2"},{"group":"imagepolicy.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"internal.apiserver.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"networking.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"node.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"policy","kind":"WatchEvent","version":"v1"},{"group":"policy","kind":"WatchEvent","version":"v1beta1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"rbac.authorization.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"scheduling.k8s.io","kind":"WatchEvent","version":"v1beta1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1alpha1"},{"group":"storage.k8s.io","kind":"WatchEvent","version":"v1beta1"}]},"io.k8s.apimachinery.pkg.runtime.RawExtension":{"description":"RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)","type":"object"},"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","type":"string","format":"int-or-string"}}}} kubernetes-client-go-a2dfcab/doc.go000066400000000000000000000011511472614177300174720ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientgo // import "k8s.io/client-go" kubernetes-client-go-a2dfcab/dynamic/000077500000000000000000000000001472614177300200245ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/dynamic/client_test.go000066400000000000000000000753451472614177300227060ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamic import ( "bytes" "context" "fmt" "io" "net/http" "net/http/httptest" "reflect" "strings" "testing" "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" clientfeatures "k8s.io/client-go/features" clientfeaturestesting "k8s.io/client-go/features/testing" restclient "k8s.io/client-go/rest" restclientwatch "k8s.io/client-go/rest/watch" ) func getJSON(version, kind, name string) []byte { return []byte(fmt.Sprintf(`{"apiVersion": %q, "kind": %q, "metadata": {"name": %q}}`, version, kind, name)) } func getListJSON(version, kind string, items ...[]byte) []byte { json := fmt.Sprintf(`{"apiVersion": %q, "kind": %q, "items": [%s]}`, version, kind, bytes.Join(items, []byte(","))) return []byte(json) } func getObject(version, kind, name string) *unstructured.Unstructured { return &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": version, "kind": kind, "metadata": map[string]interface{}{ "name": name, }, }, } } func getClientServer(h func(http.ResponseWriter, *http.Request)) (Interface, *httptest.Server, error) { srv := httptest.NewServer(http.HandlerFunc(h)) cl, err := NewForConfig(&restclient.Config{ Host: srv.URL, }) if err != nil { srv.Close() return nil, nil, err } return cl, srv, nil } func TestList(t *testing.T) { tcs := []struct { name string namespace string path string resp []byte want *unstructured.UnstructuredList }{ { name: "normal_list", path: "/apis/gtest/vtest/rtest", resp: getListJSON("vTest", "rTestList", getJSON("vTest", "rTest", "item1"), getJSON("vTest", "rTest", "item2")), want: &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "vTest", "kind": "rTestList", }, Items: []unstructured.Unstructured{ *getObject("vTest", "rTest", "item1"), *getObject("vTest", "rTest", "item2"), }, }, }, { name: "namespaced_list", namespace: "nstest", path: "/apis/gtest/vtest/namespaces/nstest/rtest", resp: getListJSON("vTest", "rTestList", getJSON("vTest", "rTest", "item1"), getJSON("vTest", "rTest", "item2")), want: &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "vTest", "kind": "rTestList", }, Items: []unstructured.Unstructured{ *getObject("vTest", "rTest", "item1"), *getObject("vTest", "rTest", "item2"), }, }, }, } for _, tc := range tcs { resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: "rtest"} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "GET" { t.Errorf("List(%q) got HTTP method %s. wanted GET", tc.name, r.Method) } if r.URL.Path != tc.path { t.Errorf("List(%q) got path %s. wanted %s", tc.name, r.URL.Path, tc.path) } w.Header().Set("Content-Type", runtime.ContentTypeJSON) w.Write(tc.resp) }) if err != nil { t.Errorf("unexpected error when creating client: %v", err) continue } defer srv.Close() got, err := cl.Resource(resource).Namespace(tc.namespace).List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Errorf("unexpected error when listing %q: %v", tc.name, err) continue } if !reflect.DeepEqual(got, tc.want) { t.Errorf("List(%q) want: %v\ngot: %v", tc.name, tc.want, got) } } } func TestWatchList(t *testing.T) { clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, true) type requestParam struct { Path string Query string } scenarios := []struct { name string namespace string watchResponse []watch.Event listResponse []byte expectedRequestParams []requestParam expectedList *unstructured.UnstructuredList }{ { name: "watch-list request for cluster wide resource", watchResponse: []watch.Event{ {Type: watch.Added, Object: getObject("gtest/vTest", "rTest", "item1")}, {Type: watch.Added, Object: getObject("gtest/vTest", "rTest", "item2")}, {Type: watch.Bookmark, Object: func() runtime.Object { obj := getObject("gtest/vTest", "rTest", "item2") obj.SetResourceVersion("10") obj.SetAnnotations(map[string]string{metav1.InitialEventsAnnotationKey: "true"}) return obj }()}, }, expectedRequestParams: []requestParam{ { Path: "/apis/gtest/vtest/rtest", Query: "allowWatchBookmarks=true&resourceVersionMatch=NotOlderThan&sendInitialEvents=true&watch=true", }, }, expectedList: &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "", "kind": "UnstructuredList", "metadata": map[string]interface{}{ "resourceVersion": "10", }, }, Items: []unstructured.Unstructured{ *getObject("gtest/vTest", "rTest", "item1"), *getObject("gtest/vTest", "rTest", "item2"), }, }, }, { name: "watch-list request for namespaced watch resource", namespace: "nstest", watchResponse: []watch.Event{ {Type: watch.Added, Object: getObject("gtest/vTest", "rTest", "item1")}, {Type: watch.Bookmark, Object: func() runtime.Object { obj := getObject("gtest/vTest", "rTest", "item2") obj.SetResourceVersion("39") obj.SetAnnotations(map[string]string{metav1.InitialEventsAnnotationKey: "true"}) return obj }()}, }, expectedRequestParams: []requestParam{ { Path: "/apis/gtest/vtest/namespaces/nstest/rtest", Query: "allowWatchBookmarks=true&resourceVersionMatch=NotOlderThan&sendInitialEvents=true&watch=true", }, }, expectedList: &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "", "kind": "UnstructuredList", "metadata": map[string]interface{}{ "resourceVersion": "39", }, }, Items: []unstructured.Unstructured{ *getObject("gtest/vTest", "rTest", "item1"), }, }, }, { name: "watch-list request falls back to standard list on any error", namespace: "nstest", // watchList method in client-go expect only watch.Add and watch.Bookmark events // receiving watch.Error will cause this method to report an error which will // trigger the fallback logic watchResponse: []watch.Event{ {Type: watch.Error, Object: getObject("gtest/vTest", "rTest", "item1")}, }, listResponse: getListJSON("vTest", "UnstructuredList", getJSON("gtest/vTest", "rTest", "item1"), getJSON("gtest/vTest", "rTest", "item2")), expectedRequestParams: []requestParam{ // a watch-list request first { Path: "/apis/gtest/vtest/namespaces/nstest/rtest", Query: "allowWatchBookmarks=true&resourceVersionMatch=NotOlderThan&sendInitialEvents=true&watch=true", }, // a standard list request second { Path: "/apis/gtest/vtest/namespaces/nstest/rtest", }, }, expectedList: &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "vTest", "kind": "UnstructuredList", }, Items: []unstructured.Unstructured{ *getObject("gtest/vTest", "rTest", "item1"), *getObject("gtest/vTest", "rTest", "item2"), }, }, }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { var actualRequestParams []requestParam resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: "rtest"} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "GET" { t.Errorf("unexpected HTTP method %s. expected GET", r.Method) } actualRequestParams = append(actualRequestParams, requestParam{ Path: r.URL.Path, Query: r.URL.RawQuery, }) w.Header().Set("Content-Type", runtime.ContentTypeJSON) // handle LIST response if len(scenario.listResponse) > 0 { if _, err := w.Write(scenario.listResponse); err != nil { t.Fatal(err) } return } // handle WATCH response enc := restclientwatch.NewEncoder(streaming.NewEncoder(w, unstructured.UnstructuredJSONScheme), unstructured.UnstructuredJSONScheme) for _, e := range scenario.watchResponse { if err := enc.Encode(&e); err != nil { t.Fatal(err) } } }) if err != nil { t.Fatalf("unexpected error when creating test client and server: %v", err) } defer srv.Close() actualList, err := cl.Resource(resource).Namespace(scenario.namespace).List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Fatalf("unexpected error: %v", err) } if !cmp.Equal(scenario.expectedRequestParams, actualRequestParams) { t.Fatalf("unexpected request params: %v", cmp.Diff(scenario.expectedRequestParams, actualRequestParams)) } if !cmp.Equal(scenario.expectedList, actualList) { t.Errorf("received expected list, diff: %s", cmp.Diff(scenario.expectedList, actualList)) } }) } } func TestGet(t *testing.T) { tcs := []struct { resource string subresource []string namespace string name string path string resp []byte want *unstructured.Unstructured }{ { resource: "rtest", name: "normal_get", path: "/apis/gtest/vtest/rtest/normal_get", resp: getJSON("vTest", "rTest", "normal_get"), want: getObject("vTest", "rTest", "normal_get"), }, { resource: "rtest", namespace: "nstest", name: "namespaced_get", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_get", resp: getJSON("vTest", "rTest", "namespaced_get"), want: getObject("vTest", "rTest", "namespaced_get"), }, { resource: "rtest", subresource: []string{"srtest"}, name: "normal_subresource_get", path: "/apis/gtest/vtest/rtest/normal_subresource_get/srtest", resp: getJSON("vTest", "srTest", "normal_subresource_get"), want: getObject("vTest", "srTest", "normal_subresource_get"), }, { resource: "rtest", subresource: []string{"srtest"}, namespace: "nstest", name: "namespaced_subresource_get", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_get/srtest", resp: getJSON("vTest", "srTest", "namespaced_subresource_get"), want: getObject("vTest", "srTest", "namespaced_subresource_get"), }, } for _, tc := range tcs { resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: tc.resource} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "GET" { t.Errorf("Get(%q) got HTTP method %s. wanted GET", tc.name, r.Method) } if r.URL.Path != tc.path { t.Errorf("Get(%q) got path %s. wanted %s", tc.name, r.URL.Path, tc.path) } w.Header().Set("Content-Type", runtime.ContentTypeJSON) w.Write(tc.resp) }) if err != nil { t.Errorf("unexpected error when creating client: %v", err) continue } defer srv.Close() got, err := cl.Resource(resource).Namespace(tc.namespace).Get(context.TODO(), tc.name, metav1.GetOptions{}, tc.subresource...) if err != nil { t.Errorf("unexpected error when getting %q: %v", tc.name, err) continue } if !reflect.DeepEqual(got, tc.want) { t.Errorf("Get(%q) want: %v\ngot: %v", tc.name, tc.want, got) } } } func TestDelete(t *testing.T) { background := metav1.DeletePropagationBackground uid := types.UID("uid") statusOK := &metav1.Status{ TypeMeta: metav1.TypeMeta{Kind: "Status"}, Status: metav1.StatusSuccess, } tcs := []struct { subresource []string namespace string name string path string deleteOptions metav1.DeleteOptions }{ { name: "normal_delete", path: "/apis/gtest/vtest/rtest/normal_delete", }, { namespace: "nstest", name: "namespaced_delete", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_delete", }, { subresource: []string{"srtest"}, name: "normal_delete", path: "/apis/gtest/vtest/rtest/normal_delete/srtest", }, { subresource: []string{"srtest"}, namespace: "nstest", name: "namespaced_delete", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_delete/srtest", }, { namespace: "nstest", name: "namespaced_delete_with_options", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_delete_with_options", deleteOptions: metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &uid}, PropagationPolicy: &background}, }, } for _, tc := range tcs { resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: "rtest"} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "DELETE" { t.Errorf("Delete(%q) got HTTP method %s. wanted DELETE", tc.name, r.Method) } if r.URL.Path != tc.path { t.Errorf("Delete(%q) got path %s. wanted %s", tc.name, r.URL.Path, tc.path) } content := r.Header.Get("Content-Type") if content != runtime.ContentTypeJSON { t.Errorf("Delete(%q) got Content-Type %s. wanted %s", tc.name, content, runtime.ContentTypeJSON) } w.Header().Set("Content-Type", runtime.ContentTypeJSON) unstructured.UnstructuredJSONScheme.Encode(statusOK, w) }) if err != nil { t.Errorf("unexpected error when creating client: %v", err) continue } defer srv.Close() err = cl.Resource(resource).Namespace(tc.namespace).Delete(context.TODO(), tc.name, tc.deleteOptions, tc.subresource...) if err != nil { t.Errorf("unexpected error when deleting %q: %v", tc.name, err) continue } } } func TestDeleteCollection(t *testing.T) { statusOK := &metav1.Status{ TypeMeta: metav1.TypeMeta{Kind: "Status"}, Status: metav1.StatusSuccess, } tcs := []struct { namespace string name string path string }{ { name: "normal_delete_collection", path: "/apis/gtest/vtest/rtest", }, { namespace: "nstest", name: "namespaced_delete_collection", path: "/apis/gtest/vtest/namespaces/nstest/rtest", }, } for _, tc := range tcs { resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: "rtest"} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "DELETE" { t.Errorf("DeleteCollection(%q) got HTTP method %s. wanted DELETE", tc.name, r.Method) } if r.URL.Path != tc.path { t.Errorf("DeleteCollection(%q) got path %s. wanted %s", tc.name, r.URL.Path, tc.path) } content := r.Header.Get("Content-Type") if content != runtime.ContentTypeJSON { t.Errorf("DeleteCollection(%q) got Content-Type %s. wanted %s", tc.name, content, runtime.ContentTypeJSON) } w.Header().Set("Content-Type", runtime.ContentTypeJSON) unstructured.UnstructuredJSONScheme.Encode(statusOK, w) }) if err != nil { t.Errorf("unexpected error when creating client: %v", err) continue } defer srv.Close() err = cl.Resource(resource).Namespace(tc.namespace).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) if err != nil { t.Errorf("unexpected error when deleting collection %q: %v", tc.name, err) continue } } } func TestCreate(t *testing.T) { tcs := []struct { resource string subresource []string name string namespace string obj *unstructured.Unstructured path string }{ { resource: "rtest", name: "normal_create", path: "/apis/gtest/vtest/rtest", obj: getObject("gtest/vTest", "rTest", "normal_create"), }, { resource: "rtest", name: "namespaced_create", namespace: "nstest", path: "/apis/gtest/vtest/namespaces/nstest/rtest", obj: getObject("gtest/vTest", "rTest", "namespaced_create"), }, { resource: "rtest", subresource: []string{"srtest"}, name: "normal_subresource_create", path: "/apis/gtest/vtest/rtest/normal_subresource_create/srtest", obj: getObject("vTest", "srTest", "normal_subresource_create"), }, { resource: "rtest/", subresource: []string{"srtest"}, name: "namespaced_subresource_create", namespace: "nstest", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_create/srtest", obj: getObject("vTest", "srTest", "namespaced_subresource_create"), }, } for _, tc := range tcs { resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: tc.resource} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "POST" { t.Errorf("Create(%q) got HTTP method %s. wanted POST", tc.name, r.Method) } if r.URL.Path != tc.path { t.Errorf("Create(%q) got path %s. wanted %s", tc.name, r.URL.Path, tc.path) } content := r.Header.Get("Content-Type") if content != runtime.ContentTypeJSON { t.Errorf("Create(%q) got Content-Type %s. wanted %s", tc.name, content, runtime.ContentTypeJSON) } w.Header().Set("Content-Type", runtime.ContentTypeJSON) data, err := io.ReadAll(r.Body) if err != nil { t.Errorf("Create(%q) unexpected error reading body: %v", tc.name, err) w.WriteHeader(http.StatusInternalServerError) return } w.Write(data) }) if err != nil { t.Errorf("unexpected error when creating client: %v", err) continue } defer srv.Close() got, err := cl.Resource(resource).Namespace(tc.namespace).Create(context.TODO(), tc.obj, metav1.CreateOptions{}, tc.subresource...) if err != nil { t.Errorf("unexpected error when creating %q: %v", tc.name, err) continue } if !reflect.DeepEqual(got, tc.obj) { t.Errorf("Create(%q) want: %v\ngot: %v", tc.name, tc.obj, got) } } } func TestUpdate(t *testing.T) { tcs := []struct { resource string subresource []string name string namespace string obj *unstructured.Unstructured path string }{ { resource: "rtest", name: "normal_update", path: "/apis/gtest/vtest/rtest/normal_update", obj: getObject("gtest/vTest", "rTest", "normal_update"), }, { resource: "rtest", name: "namespaced_update", namespace: "nstest", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_update", obj: getObject("gtest/vTest", "rTest", "namespaced_update"), }, { resource: "rtest", subresource: []string{"srtest"}, name: "normal_subresource_update", path: "/apis/gtest/vtest/rtest/normal_update/srtest", obj: getObject("gtest/vTest", "srTest", "normal_update"), }, { resource: "rtest", subresource: []string{"srtest"}, name: "namespaced_subresource_update", namespace: "nstest", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_update/srtest", obj: getObject("gtest/vTest", "srTest", "namespaced_update"), }, } for _, tc := range tcs { resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: tc.resource} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "PUT" { t.Errorf("Update(%q) got HTTP method %s. wanted PUT", tc.name, r.Method) } if r.URL.Path != tc.path { t.Errorf("Update(%q) got path %s. wanted %s", tc.name, r.URL.Path, tc.path) } content := r.Header.Get("Content-Type") if content != runtime.ContentTypeJSON { t.Errorf("Uppdate(%q) got Content-Type %s. wanted %s", tc.name, content, runtime.ContentTypeJSON) } w.Header().Set("Content-Type", runtime.ContentTypeJSON) data, err := io.ReadAll(r.Body) if err != nil { t.Errorf("Update(%q) unexpected error reading body: %v", tc.name, err) w.WriteHeader(http.StatusInternalServerError) return } w.Write(data) }) if err != nil { t.Errorf("unexpected error when creating client: %v", err) continue } defer srv.Close() got, err := cl.Resource(resource).Namespace(tc.namespace).Update(context.TODO(), tc.obj, metav1.UpdateOptions{}, tc.subresource...) if err != nil { t.Errorf("unexpected error when updating %q: %v", tc.name, err) continue } if !reflect.DeepEqual(got, tc.obj) { t.Errorf("Update(%q) want: %v\ngot: %v", tc.name, tc.obj, got) } } } func TestWatch(t *testing.T) { tcs := []struct { name string namespace string events []watch.Event path string query string }{ { name: "normal_watch", path: "/apis/gtest/vtest/rtest", query: "watch=true", events: []watch.Event{ {Type: watch.Added, Object: getObject("gtest/vTest", "rTest", "normal_watch")}, {Type: watch.Modified, Object: getObject("gtest/vTest", "rTest", "normal_watch")}, {Type: watch.Deleted, Object: getObject("gtest/vTest", "rTest", "normal_watch")}, }, }, { name: "namespaced_watch", namespace: "nstest", path: "/apis/gtest/vtest/namespaces/nstest/rtest", query: "watch=true", events: []watch.Event{ {Type: watch.Added, Object: getObject("gtest/vTest", "rTest", "namespaced_watch")}, {Type: watch.Modified, Object: getObject("gtest/vTest", "rTest", "namespaced_watch")}, {Type: watch.Deleted, Object: getObject("gtest/vTest", "rTest", "namespaced_watch")}, }, }, } for _, tc := range tcs { resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: "rtest"} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "GET" { t.Errorf("Watch(%q) got HTTP method %s. wanted GET", tc.name, r.Method) } if r.URL.Path != tc.path { t.Errorf("Watch(%q) got path %s. wanted %s", tc.name, r.URL.Path, tc.path) } if r.URL.RawQuery != tc.query { t.Errorf("Watch(%q) got query %s. wanted %s", tc.name, r.URL.RawQuery, tc.query) } w.Header().Set("Content-Type", "application/json") enc := restclientwatch.NewEncoder(streaming.NewEncoder(w, unstructured.UnstructuredJSONScheme), unstructured.UnstructuredJSONScheme) for _, e := range tc.events { enc.Encode(&e) } }) if err != nil { t.Errorf("unexpected error when creating client: %v", err) continue } defer srv.Close() watcher, err := cl.Resource(resource).Namespace(tc.namespace).Watch(context.TODO(), metav1.ListOptions{}) if err != nil { t.Errorf("unexpected error when watching %q: %v", tc.name, err) continue } for _, want := range tc.events { got := <-watcher.ResultChan() if !reflect.DeepEqual(got, want) { t.Errorf("Watch(%q) want: %v\ngot: %v", tc.name, want, got) } } } } func TestPatch(t *testing.T) { tcs := []struct { resource string subresource []string name string namespace string patch []byte want *unstructured.Unstructured path string }{ { resource: "rtest", name: "normal_patch", path: "/apis/gtest/vtest/rtest/normal_patch", patch: getJSON("gtest/vTest", "rTest", "normal_patch"), want: getObject("gtest/vTest", "rTest", "normal_patch"), }, { resource: "rtest", name: "namespaced_patch", namespace: "nstest", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_patch", patch: getJSON("gtest/vTest", "rTest", "namespaced_patch"), want: getObject("gtest/vTest", "rTest", "namespaced_patch"), }, { resource: "rtest", subresource: []string{"srtest"}, name: "normal_subresource_patch", path: "/apis/gtest/vtest/rtest/normal_subresource_patch/srtest", patch: getJSON("gtest/vTest", "srTest", "normal_subresource_patch"), want: getObject("gtest/vTest", "srTest", "normal_subresource_patch"), }, { resource: "rtest", subresource: []string{"srtest"}, name: "namespaced_subresource_patch", namespace: "nstest", path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_patch/srtest", patch: getJSON("gtest/vTest", "srTest", "namespaced_subresource_patch"), want: getObject("gtest/vTest", "srTest", "namespaced_subresource_patch"), }, } for _, tc := range tcs { resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: tc.resource} cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { if r.Method != "PATCH" { t.Errorf("Patch(%q) got HTTP method %s. wanted PATCH", tc.name, r.Method) } if r.URL.Path != tc.path { t.Errorf("Patch(%q) got path %s. wanted %s", tc.name, r.URL.Path, tc.path) } content := r.Header.Get("Content-Type") if content != string(types.StrategicMergePatchType) { t.Errorf("Patch(%q) got Content-Type %s. wanted %s", tc.name, content, types.StrategicMergePatchType) } data, err := io.ReadAll(r.Body) if err != nil { t.Errorf("Patch(%q) unexpected error reading body: %v", tc.name, err) w.WriteHeader(http.StatusInternalServerError) return } w.Header().Set("Content-Type", "application/json") w.Write(data) }) if err != nil { t.Errorf("unexpected error when creating client: %v", err) continue } defer srv.Close() got, err := cl.Resource(resource).Namespace(tc.namespace).Patch(context.TODO(), tc.name, types.StrategicMergePatchType, tc.patch, metav1.PatchOptions{}, tc.subresource...) if err != nil { t.Errorf("unexpected error when patching %q: %v", tc.name, err) continue } if !reflect.DeepEqual(got, tc.want) { t.Errorf("Patch(%q) want: %v\ngot: %v", tc.name, tc.want, got) } } } func TestInvalidSegments(t *testing.T) { name := "bad/name" namespace := "bad/namespace" resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: "rtest"} obj := &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "vtest", "kind": "vkind", "metadata": map[string]interface{}{ "name": name, }, }, } cl, err := NewForConfig(&restclient.Config{ Host: "127.0.0.1", }) if err != nil { t.Fatalf("Failed to create config: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).Create(context.TODO(), obj, metav1.CreateOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } _, err = cl.Resource(resource).Update(context.TODO(), obj, metav1.UpdateOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid resource name") { t.Fatalf("Expected `invalid resource name` error, got: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).Update(context.TODO(), obj, metav1.UpdateOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } _, err = cl.Resource(resource).UpdateStatus(context.TODO(), obj, metav1.UpdateOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid resource name") { t.Fatalf("Expected `invalid resource name` error, got: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).UpdateStatus(context.TODO(), obj, metav1.UpdateOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } err = cl.Resource(resource).Delete(context.TODO(), name, metav1.DeleteOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid resource name") { t.Fatalf("Expected `invalid resource name` error, got: %v", err) } err = cl.Resource(resource).Namespace(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } err = cl.Resource(resource).Namespace(namespace).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } _, err = cl.Resource(resource).Get(context.TODO(), name, metav1.GetOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid resource name") { t.Fatalf("Expected `invalid resource name` error, got: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).Get(context.TODO(), name, metav1.GetOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).List(context.TODO(), metav1.ListOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).Watch(context.TODO(), metav1.ListOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } _, err = cl.Resource(resource).Patch(context.TODO(), name, types.StrategicMergePatchType, []byte("{}"), metav1.PatchOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid resource name") { t.Fatalf("Expected `invalid resource name` error, got: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).Patch(context.TODO(), name, types.StrategicMergePatchType, []byte("{}"), metav1.PatchOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } _, err = cl.Resource(resource).Apply(context.TODO(), name, obj, metav1.ApplyOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid resource name") { t.Fatalf("Expected `invalid resource name` error, got: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).Apply(context.TODO(), name, obj, metav1.ApplyOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } _, err = cl.Resource(resource).ApplyStatus(context.TODO(), name, obj, metav1.ApplyOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid resource name") { t.Fatalf("Expected `invalid resource name` error, got: %v", err) } _, err = cl.Resource(resource).Namespace(namespace).ApplyStatus(context.TODO(), name, obj, metav1.ApplyOptions{}) if err == nil || !strings.Contains(err.Error(), "invalid namespace") { t.Fatalf("Expected `invalid namespace` error, got: %v", err) } } kubernetes-client-go-a2dfcab/dynamic/dynamicinformer/000077500000000000000000000000001472614177300232125ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/dynamic/dynamicinformer/informer.go000066400000000000000000000141511472614177300253640ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamicinformer import ( "context" "sync" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/dynamic" "k8s.io/client-go/dynamic/dynamiclister" "k8s.io/client-go/informers" "k8s.io/client-go/tools/cache" ) // NewDynamicSharedInformerFactory constructs a new instance of dynamicSharedInformerFactory for all namespaces. func NewDynamicSharedInformerFactory(client dynamic.Interface, defaultResync time.Duration) DynamicSharedInformerFactory { return NewFilteredDynamicSharedInformerFactory(client, defaultResync, metav1.NamespaceAll, nil) } // NewFilteredDynamicSharedInformerFactory constructs a new instance of dynamicSharedInformerFactory. // Listers obtained via this factory will be subject to the same filters as specified here. func NewFilteredDynamicSharedInformerFactory(client dynamic.Interface, defaultResync time.Duration, namespace string, tweakListOptions TweakListOptionsFunc) DynamicSharedInformerFactory { return &dynamicSharedInformerFactory{ client: client, defaultResync: defaultResync, namespace: namespace, informers: map[schema.GroupVersionResource]informers.GenericInformer{}, startedInformers: make(map[schema.GroupVersionResource]bool), tweakListOptions: tweakListOptions, } } type dynamicSharedInformerFactory struct { client dynamic.Interface defaultResync time.Duration namespace string lock sync.Mutex informers map[schema.GroupVersionResource]informers.GenericInformer // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[schema.GroupVersionResource]bool tweakListOptions TweakListOptionsFunc // wg tracks how many goroutines were started. wg sync.WaitGroup // shuttingDown is true when Shutdown has been called. It may still be running // because it needs to wait for goroutines. shuttingDown bool } var _ DynamicSharedInformerFactory = &dynamicSharedInformerFactory{} func (f *dynamicSharedInformerFactory) ForResource(gvr schema.GroupVersionResource) informers.GenericInformer { f.lock.Lock() defer f.lock.Unlock() key := gvr informer, exists := f.informers[key] if exists { return informer } informer = NewFilteredDynamicInformer(f.client, gvr, f.namespace, f.defaultResync, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) f.informers[key] = informer return informer } // Start initializes all requested informers. func (f *dynamicSharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() if f.shuttingDown { return } for informerType, informer := range f.informers { if !f.startedInformers[informerType] { f.wg.Add(1) // We need a new variable in each loop iteration, // otherwise the goroutine would use the loop variable // and that keeps changing. informer := informer.Informer() go func() { defer f.wg.Done() informer.Run(stopCh) }() f.startedInformers[informerType] = true } } } // WaitForCacheSync waits for all started informers' cache were synced. func (f *dynamicSharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool { informers := func() map[schema.GroupVersionResource]cache.SharedIndexInformer { f.lock.Lock() defer f.lock.Unlock() informers := map[schema.GroupVersionResource]cache.SharedIndexInformer{} for informerType, informer := range f.informers { if f.startedInformers[informerType] { informers[informerType] = informer.Informer() } } return informers }() res := map[schema.GroupVersionResource]bool{} for informType, informer := range informers { res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) } return res } func (f *dynamicSharedInformerFactory) Shutdown() { // Will return immediately if there is nothing to wait for. defer f.wg.Wait() f.lock.Lock() defer f.lock.Unlock() f.shuttingDown = true } // NewFilteredDynamicInformer constructs a new informer for a dynamic type. func NewFilteredDynamicInformer(client dynamic.Interface, gvr schema.GroupVersionResource, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions TweakListOptionsFunc) informers.GenericInformer { return &dynamicInformer{ gvr: gvr, informer: cache.NewSharedIndexInformerWithOptions( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.Resource(gvr).Namespace(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.Resource(gvr).Namespace(namespace).Watch(context.TODO(), options) }, }, &unstructured.Unstructured{}, cache.SharedIndexInformerOptions{ ResyncPeriod: resyncPeriod, Indexers: indexers, ObjectDescription: gvr.String(), }, ), } } type dynamicInformer struct { informer cache.SharedIndexInformer gvr schema.GroupVersionResource } var _ informers.GenericInformer = &dynamicInformer{} func (d *dynamicInformer) Informer() cache.SharedIndexInformer { return d.informer } func (d *dynamicInformer) Lister() cache.GenericLister { return dynamiclister.NewRuntimeObjectShim(dynamiclister.New(d.informer.GetIndexer(), d.gvr)) } kubernetes-client-go-a2dfcab/dynamic/dynamicinformer/informer_test.go000066400000000000000000000235411472614177300264260ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamicinformer_test import ( "context" "testing" "time" "github.com/google/go-cmp/cmp" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic/dynamicinformer" "k8s.io/client-go/dynamic/fake" "k8s.io/client-go/tools/cache" ) type triggerFunc func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured func triggerFactory(t *testing.T) triggerFunc { return func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, _ *unstructured.Unstructured) *unstructured.Unstructured { testObject := newUnstructured("apps/v1", "Deployment", "ns-foo", "name-foo") createdObj, err := fakeClient.Resource(gvr).Namespace(ns).Create(context.TODO(), testObject, metav1.CreateOptions{}) if err != nil { t.Error(err) } return createdObj } } func handler(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandlerFuncs { return &cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { rcvCh <- obj.(*unstructured.Unstructured) }, } } func TestFilteredDynamicSharedInformerFactory(t *testing.T) { scenarios := []struct { name string existingObj *unstructured.Unstructured gvr schema.GroupVersionResource informNS string ns string trigger func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured handler func(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandlerFuncs }{ // scenario 1 { name: "scenario 1: test adding an object in different namespace should not trigger AddFunc", informNS: "ns-bar", ns: "ns-foo", gvr: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"}, trigger: triggerFactory(t), handler: handler, }, // scenario 2 { name: "scenario 2: test adding an object should trigger AddFunc", informNS: "ns-foo", ns: "ns-foo", gvr: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"}, trigger: triggerFactory(t), handler: handler, }, } for _, ts := range scenarios { t.Run(ts.name, func(t *testing.T) { // test data timeout := time.Duration(3 * time.Second) ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() scheme := runtime.NewScheme() informerReciveObjectCh := make(chan *unstructured.Unstructured, 1) objs := []runtime.Object{} if ts.existingObj != nil { objs = append(objs, ts.existingObj) } // don't adjust the scheme to include deploymentlist. This is testing whether an informer can be created against using // a client that doesn't have a type registered in the scheme. gvrToListKind := map[schema.GroupVersionResource]string{ {Group: "apps", Version: "v1", Resource: "deployments"}: "DeploymentList", } fakeClient := fake.NewSimpleDynamicClientWithCustomListKinds(scheme, gvrToListKind, objs...) target := dynamicinformer.NewFilteredDynamicSharedInformerFactory(fakeClient, 0, ts.informNS, nil) // act informerListerForGvr := target.ForResource(ts.gvr) informerListerForGvr.Informer().AddEventHandler(ts.handler(informerReciveObjectCh)) target.Start(ctx.Done()) if synced := target.WaitForCacheSync(ctx.Done()); !synced[ts.gvr] { t.Errorf("informer for %s hasn't synced", ts.gvr) } testObject := ts.trigger(ts.gvr, ts.ns, fakeClient, ts.existingObj) select { case objFromInformer := <-informerReciveObjectCh: if ts.ns != ts.informNS { t.Errorf("informer received an object for namespace %s when watching namespace %s", ts.ns, ts.informNS) } if !equality.Semantic.DeepEqual(testObject, objFromInformer) { t.Fatalf("%v", cmp.Diff(testObject, objFromInformer)) } case <-ctx.Done(): if ts.ns == ts.informNS { t.Errorf("tested informer haven't received an object, waited %v", timeout) } } }) } } func TestDynamicSharedInformerFactory(t *testing.T) { scenarios := []struct { name string existingObj *unstructured.Unstructured gvr schema.GroupVersionResource ns string trigger func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured handler func(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandlerFuncs }{ // scenario 1 { name: "scenario 1: test if adding an object triggers AddFunc", ns: "ns-foo", gvr: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"}, trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, _ *unstructured.Unstructured) *unstructured.Unstructured { testObject := newUnstructured("extensions/v1beta1", "Deployment", "ns-foo", "name-foo") createdObj, err := fakeClient.Resource(gvr).Namespace(ns).Create(context.TODO(), testObject, metav1.CreateOptions{}) if err != nil { t.Error(err) } return createdObj }, handler: func(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandlerFuncs { return &cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { rcvCh <- obj.(*unstructured.Unstructured) }, } }, }, // scenario 2 { name: "scenario 2: tests if updating an object triggers UpdateFunc", ns: "ns-foo", gvr: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"}, existingObj: newUnstructured("extensions/v1beta1", "Deployment", "ns-foo", "name-foo"), trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured { testObject.Object["spec"] = "updatedName" updatedObj, err := fakeClient.Resource(gvr).Namespace(ns).Update(context.TODO(), testObject, metav1.UpdateOptions{}) if err != nil { t.Error(err) } return updatedObj }, handler: func(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandlerFuncs { return &cache.ResourceEventHandlerFuncs{ UpdateFunc: func(old, updated interface{}) { rcvCh <- updated.(*unstructured.Unstructured) }, } }, }, // scenario 3 { name: "scenario 3: test if deleting an object triggers DeleteFunc", ns: "ns-foo", gvr: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"}, existingObj: newUnstructured("extensions/v1beta1", "Deployment", "ns-foo", "name-foo"), trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured { err := fakeClient.Resource(gvr).Namespace(ns).Delete(context.TODO(), testObject.GetName(), metav1.DeleteOptions{}) if err != nil { t.Error(err) } return testObject }, handler: func(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandlerFuncs { return &cache.ResourceEventHandlerFuncs{ DeleteFunc: func(obj interface{}) { rcvCh <- obj.(*unstructured.Unstructured) }, } }, }, } for _, ts := range scenarios { t.Run(ts.name, func(t *testing.T) { // test data timeout := time.Duration(3 * time.Second) ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() scheme := runtime.NewScheme() informerReciveObjectCh := make(chan *unstructured.Unstructured, 1) objs := []runtime.Object{} if ts.existingObj != nil { objs = append(objs, ts.existingObj) } // don't adjust the scheme to include deploymentlist. This is testing whether an informer can be created against using // a client that doesn't have a type registered in the scheme. gvrToListKind := map[schema.GroupVersionResource]string{ {Group: "extensions", Version: "v1beta1", Resource: "deployments"}: "DeploymentList", } fakeClient := fake.NewSimpleDynamicClientWithCustomListKinds(scheme, gvrToListKind, objs...) target := dynamicinformer.NewDynamicSharedInformerFactory(fakeClient, 0) // act informerListerForGvr := target.ForResource(ts.gvr) informerListerForGvr.Informer().AddEventHandler(ts.handler(informerReciveObjectCh)) target.Start(ctx.Done()) if synced := target.WaitForCacheSync(ctx.Done()); !synced[ts.gvr] { t.Errorf("informer for %s hasn't synced", ts.gvr) } testObject := ts.trigger(ts.gvr, ts.ns, fakeClient, ts.existingObj) select { case objFromInformer := <-informerReciveObjectCh: if !equality.Semantic.DeepEqual(testObject, objFromInformer) { t.Fatalf("%v", cmp.Diff(testObject, objFromInformer)) } case <-ctx.Done(): t.Errorf("tested informer haven't received an object, waited %v", timeout) } }) } } func newUnstructured(apiVersion, kind, namespace, name string) *unstructured.Unstructured { return &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": apiVersion, "kind": kind, "metadata": map[string]interface{}{ "namespace": namespace, "name": name, }, "spec": name, }, } } kubernetes-client-go-a2dfcab/dynamic/dynamicinformer/interface.go000066400000000000000000000040411472614177300255000ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamicinformer import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/informers" ) // DynamicSharedInformerFactory provides access to a shared informer and lister for dynamic client type DynamicSharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. Start(stopCh <-chan struct{}) // ForResource gives generic access to a shared informer of the matching type. ForResource(gvr schema.GroupVersionResource) informers.GenericInformer // WaitForCacheSync blocks until all started informers' caches were synced // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool // Shutdown marks a factory as shutting down. At that point no new // informers can be started anymore and Start will return without // doing anything. // // In addition, Shutdown blocks until all goroutines have terminated. For that // to happen, the close channel(s) that they were started with must be closed, // either before Shutdown gets called or while it is waiting. // // Shutdown may be called multiple times, even concurrently. All such calls will // block until all goroutines have terminated. Shutdown() } // TweakListOptionsFunc defines the signature of a helper function // that wants to provide more listing options to API type TweakListOptionsFunc func(*metav1.ListOptions) kubernetes-client-go-a2dfcab/dynamic/dynamiclister/000077500000000000000000000000001472614177300226735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/dynamic/dynamiclister/interface.go000066400000000000000000000027171472614177300251710ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamiclister import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" ) // Lister helps list resources. type Lister interface { // List lists all resources in the indexer. List(selector labels.Selector) (ret []*unstructured.Unstructured, err error) // Get retrieves a resource from the indexer with the given name Get(name string) (*unstructured.Unstructured, error) // Namespace returns an object that can list and get resources in a given namespace. Namespace(namespace string) NamespaceLister } // NamespaceLister helps list and get resources. type NamespaceLister interface { // List lists all resources in the indexer for a given namespace. List(selector labels.Selector) (ret []*unstructured.Unstructured, err error) // Get retrieves a resource from the indexer for a given namespace and name. Get(name string) (*unstructured.Unstructured, error) } kubernetes-client-go-a2dfcab/dynamic/dynamiclister/lister.go000066400000000000000000000056731472614177300245370ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamiclister import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" ) var _ Lister = &dynamicLister{} var _ NamespaceLister = &dynamicNamespaceLister{} // dynamicLister implements the Lister interface. type dynamicLister struct { indexer cache.Indexer gvr schema.GroupVersionResource } // New returns a new Lister. func New(indexer cache.Indexer, gvr schema.GroupVersionResource) Lister { return &dynamicLister{indexer: indexer, gvr: gvr} } // List lists all resources in the indexer. func (l *dynamicLister) List(selector labels.Selector) (ret []*unstructured.Unstructured, err error) { err = cache.ListAll(l.indexer, selector, func(m interface{}) { ret = append(ret, m.(*unstructured.Unstructured)) }) return ret, err } // Get retrieves a resource from the indexer with the given name func (l *dynamicLister) Get(name string) (*unstructured.Unstructured, error) { obj, exists, err := l.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(l.gvr.GroupResource(), name) } return obj.(*unstructured.Unstructured), nil } // Namespace returns an object that can list and get resources from a given namespace. func (l *dynamicLister) Namespace(namespace string) NamespaceLister { return &dynamicNamespaceLister{indexer: l.indexer, namespace: namespace, gvr: l.gvr} } // dynamicNamespaceLister implements the NamespaceLister interface. type dynamicNamespaceLister struct { indexer cache.Indexer namespace string gvr schema.GroupVersionResource } // List lists all resources in the indexer for a given namespace. func (l *dynamicNamespaceLister) List(selector labels.Selector) (ret []*unstructured.Unstructured, err error) { err = cache.ListAllByNamespace(l.indexer, l.namespace, selector, func(m interface{}) { ret = append(ret, m.(*unstructured.Unstructured)) }) return ret, err } // Get retrieves a resource from the indexer for a given namespace and name. func (l *dynamicNamespaceLister) Get(name string) (*unstructured.Unstructured, error) { obj, exists, err := l.indexer.GetByKey(l.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(l.gvr.GroupResource(), name) } return obj.(*unstructured.Unstructured), nil } kubernetes-client-go-a2dfcab/dynamic/dynamiclister/lister_test.go000066400000000000000000000204471472614177300255720ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamiclister_test import ( "reflect" "testing" "github.com/google/go-cmp/cmp" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic/dynamiclister" "k8s.io/client-go/tools/cache" ) func TestNamespaceGetMethod(t *testing.T) { tests := []struct { name string existingObjects []runtime.Object namespaceToSync string gvrToSync schema.GroupVersionResource objectToGet string expectedObject *unstructured.Unstructured expectError bool }{ { name: "scenario 1: gets name-foo1 resource from the indexer from ns-foo namespace", existingObjects: []runtime.Object{ newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group/version", "TheKind", "ns-foo", "name-foo1"), newUnstructured("group/version", "TheKind", "ns-bar", "name-bar"), }, namespaceToSync: "ns-foo", gvrToSync: schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}, objectToGet: "name-foo1", expectedObject: newUnstructured("group/version", "TheKind", "ns-foo", "name-foo1"), }, { name: "scenario 2: gets name-foo-non-existing resource from the indexer from ns-foo namespace", existingObjects: []runtime.Object{ newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group/version", "TheKind", "ns-foo", "name-foo1"), newUnstructured("group/version", "TheKind", "ns-bar", "name-bar"), }, namespaceToSync: "ns-foo", gvrToSync: schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}, objectToGet: "name-foo-non-existing", expectError: true, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { // test data indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, obj := range test.existingObjects { err := indexer.Add(obj) if err != nil { t.Fatal(err) } } // act target := dynamiclister.New(indexer, test.gvrToSync).Namespace(test.namespaceToSync) actualObject, err := target.Get(test.objectToGet) // validate if test.expectError { if err == nil { t.Fatal("expected to get an error but non was returned") } return } if err != nil { t.Fatal(err) } if !reflect.DeepEqual(test.expectedObject, actualObject) { t.Fatalf("unexpected object has been returned expected = %v actual = %v, diff = %v", test.expectedObject, actualObject, cmp.Diff(test.expectedObject, actualObject)) } }) } } func TestNamespaceListMethod(t *testing.T) { // test data objs := []runtime.Object{ newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group/version", "TheKind", "ns-foo", "name-foo1"), newUnstructured("group/version", "TheKind", "ns-bar", "name-bar"), } indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, obj := range objs { err := indexer.Add(obj) if err != nil { t.Fatal(err) } } expectedOutput := []*unstructured.Unstructured{ newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group/version", "TheKind", "ns-foo", "name-foo1"), } namespaceToList := "ns-foo" // act target := dynamiclister.New(indexer, schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}).Namespace(namespaceToList) actualOutput, err := target.List(labels.Everything()) // validate if err != nil { t.Fatal(err) } assertListOrDie(expectedOutput, actualOutput, t) } func TestListerGetMethod(t *testing.T) { tests := []struct { name string existingObjects []runtime.Object namespaceToSync string gvrToSync schema.GroupVersionResource objectToGet string expectedObject *unstructured.Unstructured expectError bool }{ { name: "scenario 1: gets name-foo1 resource from the indexer", existingObjects: []runtime.Object{ newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group/version", "TheKind", "", "name-foo1"), newUnstructured("group/version", "TheKind", "ns-bar", "name-bar"), }, namespaceToSync: "", gvrToSync: schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}, objectToGet: "name-foo1", expectedObject: newUnstructured("group/version", "TheKind", "", "name-foo1"), }, { name: "scenario 2: doesn't get name-foo resource from the indexer from ns-foo namespace", existingObjects: []runtime.Object{ newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group/version", "TheKind", "ns-foo", "name-foo1"), newUnstructured("group/version", "TheKind", "ns-bar", "name-bar"), }, namespaceToSync: "ns-foo", gvrToSync: schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}, objectToGet: "name-foo", expectError: true, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { // test data indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, obj := range test.existingObjects { err := indexer.Add(obj) if err != nil { t.Fatal(err) } } // act target := dynamiclister.New(indexer, test.gvrToSync) actualObject, err := target.Get(test.objectToGet) // validate if test.expectError { if err == nil { t.Fatal("expected to get an error but non was returned") } return } if err != nil { t.Fatal(err) } if !reflect.DeepEqual(test.expectedObject, actualObject) { t.Fatalf("unexpected object has been returned expected = %v actual = %v, diff = %v", test.expectedObject, actualObject, cmp.Diff(test.expectedObject, actualObject)) } }) } } func TestListerListMethod(t *testing.T) { // test data objs := []runtime.Object{ newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group/version", "TheKind", "ns-foo", "name-bar"), } indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, obj := range objs { err := indexer.Add(obj) if err != nil { t.Fatal(err) } } expectedOutput := []*unstructured.Unstructured{ newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group/version", "TheKind", "ns-foo", "name-bar"), } // act target := dynamiclister.New(indexer, schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}) actualOutput, err := target.List(labels.Everything()) // validate if err != nil { t.Fatal(err) } assertListOrDie(expectedOutput, actualOutput, t) } func newUnstructured(apiVersion, kind, namespace, name string) *unstructured.Unstructured { return &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": apiVersion, "kind": kind, "metadata": map[string]interface{}{ "namespace": namespace, "name": name, }, }, } } func assertListOrDie(expected, actual []*unstructured.Unstructured, t *testing.T) { if len(actual) != len(expected) { t.Fatalf("unexpected number of items returned, expected = %d, actual = %d", len(expected), len(actual)) } for _, expectedObject := range expected { found := false for _, actualObject := range actual { if actualObject.GetName() == expectedObject.GetName() { if !reflect.DeepEqual(expectedObject, actualObject) { t.Fatalf("unexpected object has been returned expected = %v actual = %v, diff = %v", expectedObject, actualObject, cmp.Diff(expectedObject, actualObject)) } found = true } } if !found { t.Fatalf("the resource with the name = %s was not found in the returned output", expectedObject.GetName()) } } } kubernetes-client-go-a2dfcab/dynamic/dynamiclister/shim.go000066400000000000000000000050751472614177300241710ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamiclister import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/cache" ) var _ cache.GenericLister = &dynamicListerShim{} var _ cache.GenericNamespaceLister = &dynamicNamespaceListerShim{} // dynamicListerShim implements the cache.GenericLister interface. type dynamicListerShim struct { lister Lister } // NewRuntimeObjectShim returns a new shim for Lister. // It wraps Lister so that it implements cache.GenericLister interface func NewRuntimeObjectShim(lister Lister) cache.GenericLister { return &dynamicListerShim{lister: lister} } // List will return all objects across namespaces func (s *dynamicListerShim) List(selector labels.Selector) (ret []runtime.Object, err error) { objs, err := s.lister.List(selector) if err != nil { return nil, err } ret = make([]runtime.Object, len(objs)) for index, obj := range objs { ret[index] = obj } return ret, err } // Get will attempt to retrieve assuming that name==key func (s *dynamicListerShim) Get(name string) (runtime.Object, error) { return s.lister.Get(name) } func (s *dynamicListerShim) ByNamespace(namespace string) cache.GenericNamespaceLister { return &dynamicNamespaceListerShim{ namespaceLister: s.lister.Namespace(namespace), } } // dynamicNamespaceListerShim implements the NamespaceLister interface. // It wraps NamespaceLister so that it implements cache.GenericNamespaceLister interface type dynamicNamespaceListerShim struct { namespaceLister NamespaceLister } // List will return all objects in this namespace func (ns *dynamicNamespaceListerShim) List(selector labels.Selector) (ret []runtime.Object, err error) { objs, err := ns.namespaceLister.List(selector) if err != nil { return nil, err } ret = make([]runtime.Object, len(objs)) for index, obj := range objs { ret[index] = obj } return ret, err } // Get will attempt to retrieve by namespace and name func (ns *dynamicNamespaceListerShim) Get(name string) (runtime.Object, error) { return ns.namespaceLister.Get(name) } kubernetes-client-go-a2dfcab/dynamic/fake/000077500000000000000000000000001472614177300207325ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/dynamic/fake/simple.go000066400000000000000000000443351472614177300225630ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" "fmt" "strings" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/dynamic" "k8s.io/client-go/testing" ) func NewSimpleDynamicClient(scheme *runtime.Scheme, objects ...runtime.Object) *FakeDynamicClient { unstructuredScheme := runtime.NewScheme() for gvk := range scheme.AllKnownTypes() { if unstructuredScheme.Recognizes(gvk) { continue } if strings.HasSuffix(gvk.Kind, "List") { unstructuredScheme.AddKnownTypeWithName(gvk, &unstructured.UnstructuredList{}) continue } unstructuredScheme.AddKnownTypeWithName(gvk, &unstructured.Unstructured{}) } objects, err := convertObjectsToUnstructured(scheme, objects) if err != nil { panic(err) } for _, obj := range objects { gvk := obj.GetObjectKind().GroupVersionKind() if !unstructuredScheme.Recognizes(gvk) { unstructuredScheme.AddKnownTypeWithName(gvk, &unstructured.Unstructured{}) } gvk.Kind += "List" if !unstructuredScheme.Recognizes(gvk) { unstructuredScheme.AddKnownTypeWithName(gvk, &unstructured.UnstructuredList{}) } } return NewSimpleDynamicClientWithCustomListKinds(unstructuredScheme, nil, objects...) } // NewSimpleDynamicClientWithCustomListKinds try not to use this. In general you want to have the scheme have the List types registered // and allow the default guessing for resources match. Sometimes that doesn't work, so you can specify a custom mapping here. func NewSimpleDynamicClientWithCustomListKinds(scheme *runtime.Scheme, gvrToListKind map[schema.GroupVersionResource]string, objects ...runtime.Object) *FakeDynamicClient { // In order to use List with this client, you have to have your lists registered so that the object tracker will find them // in the scheme to support the t.scheme.New(listGVK) call when it's building the return value. // Since the base fake client needs the listGVK passed through the action (in cases where there are no instances, it // cannot look up the actual hits), we need to know a mapping of GVR to listGVK here. For GETs and other types of calls, // there is no return value that contains a GVK, so it doesn't have to know the mapping in advance. // first we attempt to invert known List types from the scheme to auto guess the resource with unsafe guesses // this covers common usage of registering types in scheme and passing them completeGVRToListKind := map[schema.GroupVersionResource]string{} for listGVK := range scheme.AllKnownTypes() { if !strings.HasSuffix(listGVK.Kind, "List") { continue } nonListGVK := listGVK.GroupVersion().WithKind(listGVK.Kind[:len(listGVK.Kind)-4]) plural, _ := meta.UnsafeGuessKindToResource(nonListGVK) completeGVRToListKind[plural] = listGVK.Kind } for gvr, listKind := range gvrToListKind { if !strings.HasSuffix(listKind, "List") { panic("coding error, listGVK must end in List or this fake client doesn't work right") } listGVK := gvr.GroupVersion().WithKind(listKind) // if we already have this type registered, just skip it if _, err := scheme.New(listGVK); err == nil { completeGVRToListKind[gvr] = listKind continue } scheme.AddKnownTypeWithName(listGVK, &unstructured.UnstructuredList{}) completeGVRToListKind[gvr] = listKind } codecs := serializer.NewCodecFactory(scheme) o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { if err := o.Add(obj); err != nil { panic(err) } } cs := &FakeDynamicClient{scheme: scheme, gvrToListKind: completeGVRToListKind, tracker: o} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { gvr := action.GetResource() ns := action.GetNamespace() watch, err := o.Watch(gvr, ns) if err != nil { return false, nil, err } return true, watch, nil }) return cs } // Clientset implements clientset.Interface. Meant to be embedded into a // struct to get a default implementation. This makes faking out just the method // you want to test easier. type FakeDynamicClient struct { testing.Fake scheme *runtime.Scheme gvrToListKind map[schema.GroupVersionResource]string tracker testing.ObjectTracker } type dynamicResourceClient struct { client *FakeDynamicClient namespace string resource schema.GroupVersionResource listKind string } var ( _ dynamic.Interface = &FakeDynamicClient{} _ testing.FakeClient = &FakeDynamicClient{} ) func (c *FakeDynamicClient) Tracker() testing.ObjectTracker { return c.tracker } func (c *FakeDynamicClient) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface { return &dynamicResourceClient{client: c, resource: resource, listKind: c.gvrToListKind[resource]} } func (c *dynamicResourceClient) Namespace(ns string) dynamic.ResourceInterface { ret := *c ret.namespace = ns return &ret } func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootCreateAction(c.resource, obj), obj) case len(c.namespace) == 0 && len(subresources) > 0: var accessor metav1.Object // avoid shadowing err accessor, err = meta.Accessor(obj) if err != nil { return nil, err } name := accessor.GetName() uncastRet, err = c.client.Fake. Invokes(testing.NewRootCreateSubresourceAction(c.resource, name, strings.Join(subresources, "/"), obj), obj) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewCreateAction(c.resource, c.namespace, obj), obj) case len(c.namespace) > 0 && len(subresources) > 0: var accessor metav1.Object // avoid shadowing err accessor, err = meta.Accessor(obj) if err != nil { return nil, err } name := accessor.GetName() uncastRet, err = c.client.Fake. Invokes(testing.NewCreateSubresourceAction(c.resource, name, strings.Join(subresources, "/"), c.namespace, obj), obj) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret := &unstructured.Unstructured{} if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { return nil, err } return ret, err } func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootUpdateAction(c.resource, obj), obj) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootUpdateSubresourceAction(c.resource, strings.Join(subresources, "/"), obj), obj) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewUpdateAction(c.resource, c.namespace, obj), obj) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewUpdateSubresourceAction(c.resource, strings.Join(subresources, "/"), c.namespace, obj), obj) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret := &unstructured.Unstructured{} if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { return nil, err } return ret, err } func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootUpdateSubresourceAction(c.resource, "status", obj), obj) case len(c.namespace) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewUpdateSubresourceAction(c.resource, "status", c.namespace, obj), obj) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret := &unstructured.Unstructured{} if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { return nil, err } return ret, err } func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error { var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: _, err = c.client.Fake. Invokes(testing.NewRootDeleteAction(c.resource, name), &metav1.Status{Status: "dynamic delete fail"}) case len(c.namespace) == 0 && len(subresources) > 0: _, err = c.client.Fake. Invokes(testing.NewRootDeleteSubresourceAction(c.resource, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic delete fail"}) case len(c.namespace) > 0 && len(subresources) == 0: _, err = c.client.Fake. Invokes(testing.NewDeleteAction(c.resource, c.namespace, name), &metav1.Status{Status: "dynamic delete fail"}) case len(c.namespace) > 0 && len(subresources) > 0: _, err = c.client.Fake. Invokes(testing.NewDeleteSubresourceAction(c.resource, strings.Join(subresources, "/"), c.namespace, name), &metav1.Status{Status: "dynamic delete fail"}) } return err } func (c *dynamicResourceClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOptions metav1.ListOptions) error { var err error switch { case len(c.namespace) == 0: action := testing.NewRootDeleteCollectionAction(c.resource, listOptions) _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "dynamic deletecollection fail"}) case len(c.namespace) > 0: action := testing.NewDeleteCollectionAction(c.resource, c.namespace, listOptions) _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "dynamic deletecollection fail"}) } return err } func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootGetAction(c.resource, name), &metav1.Status{Status: "dynamic get fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootGetSubresourceAction(c.resource, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic get fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewGetAction(c.resource, c.namespace, name), &metav1.Status{Status: "dynamic get fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewGetSubresourceAction(c.resource, c.namespace, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic get fail"}) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret := &unstructured.Unstructured{} if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { return nil, err } return ret, err } func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { if len(c.listKind) == 0 { panic(fmt.Sprintf("coding error: you must register resource to list kind for every resource you're going to LIST when creating the client. See NewSimpleDynamicClientWithCustomListKinds or register the list into the scheme: %v out of %v", c.resource, c.client.gvrToListKind)) } listGVK := c.resource.GroupVersion().WithKind(c.listKind) listForFakeClientGVK := c.resource.GroupVersion().WithKind(c.listKind[:len(c.listKind)-4]) /*base library appends List*/ var obj runtime.Object var err error switch { case len(c.namespace) == 0: obj, err = c.client.Fake. Invokes(testing.NewRootListAction(c.resource, listForFakeClientGVK, opts), &metav1.Status{Status: "dynamic list fail"}) case len(c.namespace) > 0: obj, err = c.client.Fake. Invokes(testing.NewListAction(c.resource, listForFakeClientGVK, c.namespace, opts), &metav1.Status{Status: "dynamic list fail"}) } if obj == nil { return nil, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } retUnstructured := &unstructured.Unstructured{} if err := c.client.scheme.Convert(obj, retUnstructured, nil); err != nil { return nil, err } entireList, err := retUnstructured.ToList() if err != nil { return nil, err } list := &unstructured.UnstructuredList{} list.SetRemainingItemCount(entireList.GetRemainingItemCount()) list.SetResourceVersion(entireList.GetResourceVersion()) list.SetContinue(entireList.GetContinue()) list.GetObjectKind().SetGroupVersionKind(listGVK) for i := range entireList.Items { item := &entireList.Items[i] metadata, err := meta.Accessor(item) if err != nil { return nil, err } if label.Matches(labels.Set(metadata.GetLabels())) { list.Items = append(list.Items, *item) } } return list, nil } func (c *dynamicResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { switch { case len(c.namespace) == 0: return c.client.Fake. InvokesWatch(testing.NewRootWatchAction(c.resource, opts)) case len(c.namespace) > 0: return c.client.Fake. InvokesWatch(testing.NewWatchAction(c.resource, c.namespace, opts)) } panic("math broke") } // TODO: opts are currently ignored. func (c *dynamicResourceClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootPatchAction(c.resource, name, pt, data), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootPatchSubresourceAction(c.resource, name, pt, data, subresources...), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewPatchAction(c.resource, c.namespace, name, pt, data), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewPatchSubresourceAction(c.resource, c.namespace, name, pt, data, subresources...), &metav1.Status{Status: "dynamic patch fail"}) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret := &unstructured.Unstructured{} if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { return nil, err } return ret, err } // TODO: opts are currently ignored. func (c *dynamicResourceClient) Apply(ctx context.Context, name string, obj *unstructured.Unstructured, options metav1.ApplyOptions, subresources ...string) (*unstructured.Unstructured, error) { outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) if err != nil { return nil, err } var uncastRet runtime.Object switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootPatchAction(c.resource, name, types.ApplyPatchType, outBytes), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootPatchSubresourceAction(c.resource, name, types.ApplyPatchType, outBytes, subresources...), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewPatchAction(c.resource, c.namespace, name, types.ApplyPatchType, outBytes), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewPatchSubresourceAction(c.resource, c.namespace, name, types.ApplyPatchType, outBytes, subresources...), &metav1.Status{Status: "dynamic patch fail"}) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret := &unstructured.Unstructured{} if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { return nil, err } return ret, nil } func (c *dynamicResourceClient) ApplyStatus(ctx context.Context, name string, obj *unstructured.Unstructured, options metav1.ApplyOptions) (*unstructured.Unstructured, error) { return c.Apply(ctx, name, obj, options, "status") } func convertObjectsToUnstructured(s *runtime.Scheme, objs []runtime.Object) ([]runtime.Object, error) { ul := make([]runtime.Object, 0, len(objs)) for _, obj := range objs { u, err := convertToUnstructured(s, obj) if err != nil { return nil, err } ul = append(ul, u) } return ul, nil } func convertToUnstructured(s *runtime.Scheme, obj runtime.Object) (runtime.Object, error) { var ( err error u unstructured.Unstructured ) u.Object, err = runtime.DefaultUnstructuredConverter.ToUnstructured(obj) if err != nil { return nil, fmt.Errorf("failed to convert to unstructured: %w", err) } gvk := u.GroupVersionKind() if gvk.Group == "" || gvk.Kind == "" { gvks, _, err := s.ObjectKinds(obj) if err != nil { return nil, fmt.Errorf("failed to convert to unstructured - unable to get GVK %w", err) } apiv, k := gvks[0].ToAPIVersionAndKind() u.SetAPIVersion(apiv) u.SetKind(k) } return &u, nil } kubernetes-client-go-a2dfcab/dynamic/fake/simple_test.go000066400000000000000000000372001472614177300236130ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" "fmt" "testing" "github.com/google/go-cmp/cmp" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" ) const ( testGroup = "testgroup" testVersion = "testversion" testResource = "testkinds" testNamespace = "testns" testName = "testname" testKind = "TestKind" testAPIVersion = "testgroup/testversion" ) func newUnstructured(apiVersion, kind, namespace, name string) *unstructured.Unstructured { return &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": apiVersion, "kind": kind, "metadata": map[string]interface{}{ "namespace": namespace, "name": name, }, }, } } func newUnstructuredWithSpec(spec map[string]interface{}) *unstructured.Unstructured { u := newUnstructured(testAPIVersion, testKind, testNamespace, testName) u.Object["spec"] = spec return u } func TestGet(t *testing.T) { scheme := runtime.NewScheme() client := NewSimpleDynamicClient(scheme, newUnstructured("group/version", "TheKind", "ns-foo", "name-foo")) get, err := client.Resource(schema.GroupVersionResource{Group: "group", Version: "version", Resource: "thekinds"}).Namespace("ns-foo").Get(context.TODO(), "name-foo", metav1.GetOptions{}) if err != nil { t.Fatal(err) } expected := &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "group/version", "kind": "TheKind", "metadata": map[string]interface{}{ "name": "name-foo", "namespace": "ns-foo", }, }, } if !equality.Semantic.DeepEqual(get, expected) { t.Fatal(cmp.Diff(expected, get)) } } func TestListDecoding(t *testing.T) { // this the duplication of logic from the real List API. This will prove that our dynamic client actually returns the gvk uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, []byte(`{"apiVersion": "group/version", "kind": "TheKindList", "items":[]}`)) if err != nil { t.Fatal(err) } list := uncastObj.(*unstructured.UnstructuredList) expectedList := &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "group/version", "kind": "TheKindList", }, Items: []unstructured.Unstructured{}, } if !equality.Semantic.DeepEqual(list, expectedList) { t.Fatal(cmp.Diff(expectedList, list)) } } func TestGetDecoding(t *testing.T) { // this the duplication of logic from the real Get API. This will prove that our dynamic client actually returns the gvk uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, []byte(`{"apiVersion": "group/version", "kind": "TheKind"}`)) if err != nil { t.Fatal(err) } get := uncastObj.(*unstructured.Unstructured) expectedObj := &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "group/version", "kind": "TheKind", }, } if !equality.Semantic.DeepEqual(get, expectedObj) { t.Fatal(cmp.Diff(expectedObj, get)) } } func TestList(t *testing.T) { scheme := runtime.NewScheme() client := NewSimpleDynamicClientWithCustomListKinds(scheme, map[schema.GroupVersionResource]string{ {Group: "group", Version: "version", Resource: "thekinds"}: "TheKindList", }, newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), newUnstructured("group2/version", "TheKind", "ns-foo", "name2-foo"), newUnstructured("group/version", "TheKind", "ns-foo", "name-bar"), newUnstructured("group/version", "TheKind", "ns-foo", "name-baz"), newUnstructured("group2/version", "TheKind", "ns-foo", "name2-baz"), ) listFirst, err := client.Resource(schema.GroupVersionResource{Group: "group", Version: "version", Resource: "thekinds"}).List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Fatal(err) } expected := []unstructured.Unstructured{ *newUnstructured("group/version", "TheKind", "ns-foo", "name-bar"), *newUnstructured("group/version", "TheKind", "ns-foo", "name-baz"), *newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), } if !equality.Semantic.DeepEqual(listFirst.Items, expected) { t.Fatal(cmp.Diff(expected, listFirst.Items)) } } func Test_ListKind(t *testing.T) { scheme := runtime.NewScheme() client := NewSimpleDynamicClientWithCustomListKinds(scheme, map[schema.GroupVersionResource]string{ {Group: "group", Version: "version", Resource: "thekinds"}: "TheKindList", }, &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "group/version", "kind": "TheKindList", }, Items: []unstructured.Unstructured{ *newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), *newUnstructured("group/version", "TheKind", "ns-foo", "name-bar"), *newUnstructured("group/version", "TheKind", "ns-foo", "name-baz"), }, }, ) listFirst, err := client.Resource(schema.GroupVersionResource{Group: "group", Version: "version", Resource: "thekinds"}).List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Fatal(err) } expectedList := &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "group/version", "kind": "TheKindList", "metadata": map[string]interface{}{ "continue": "", "resourceVersion": "", }, }, Items: []unstructured.Unstructured{ *newUnstructured("group/version", "TheKind", "ns-foo", "name-bar"), *newUnstructured("group/version", "TheKind", "ns-foo", "name-baz"), *newUnstructured("group/version", "TheKind", "ns-foo", "name-foo"), }, } if !equality.Semantic.DeepEqual(listFirst, expectedList) { t.Fatal(cmp.Diff(expectedList, listFirst)) } } type patchTestCase struct { name string object runtime.Object patchType types.PatchType patchBytes []byte wantErrMsg string expectedPatchedObject runtime.Object } func (tc *patchTestCase) runner(t *testing.T) { client := NewSimpleDynamicClient(runtime.NewScheme(), tc.object) resourceInterface := client.Resource(schema.GroupVersionResource{Group: testGroup, Version: testVersion, Resource: testResource}).Namespace(testNamespace) got, recErr := resourceInterface.Patch(context.TODO(), testName, tc.patchType, tc.patchBytes, metav1.PatchOptions{}) if err := tc.verifyErr(recErr); err != nil { t.Error(err) } if err := tc.verifyResult(got); err != nil { t.Error(err) } } // verifyErr verifies that the given error returned from Patch is the error // expected by the test case. func (tc *patchTestCase) verifyErr(err error) error { if tc.wantErrMsg != "" && err == nil { return fmt.Errorf("want error, got nil") } if tc.wantErrMsg == "" && err != nil { return fmt.Errorf("want no error, got %v", err) } if err != nil { if want, got := tc.wantErrMsg, err.Error(); want != got { return fmt.Errorf("incorrect error: want: %q got: %q", want, got) } } return nil } func (tc *patchTestCase) verifyResult(result *unstructured.Unstructured) error { if tc.expectedPatchedObject == nil && result == nil { return nil } if !equality.Semantic.DeepEqual(result, tc.expectedPatchedObject) { return fmt.Errorf("unexpected diff in received object: %s", cmp.Diff(tc.expectedPatchedObject, result)) } return nil } func TestPatch(t *testing.T) { testCases := []patchTestCase{ { name: "jsonpatch fails with merge type", object: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}), patchType: types.StrategicMergePatchType, patchBytes: []byte(`[]`), wantErrMsg: "invalid JSON document", }, { name: "jsonpatch works with empty patch", object: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}), patchType: types.JSONPatchType, // No-op patchBytes: []byte(`[]`), expectedPatchedObject: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}), }, { name: "jsonpatch works with simple change patch", object: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}), patchType: types.JSONPatchType, // change spec.foo from bar to foobar patchBytes: []byte(`[{"op": "replace", "path": "/spec/foo", "value": "foobar"}]`), expectedPatchedObject: newUnstructuredWithSpec(map[string]interface{}{"foo": "foobar"}), }, { name: "jsonpatch works with simple addition", object: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}), patchType: types.JSONPatchType, // add spec.newvalue = dummy patchBytes: []byte(`[{"op": "add", "path": "/spec/newvalue", "value": "dummy"}]`), expectedPatchedObject: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar", "newvalue": "dummy"}), }, { name: "jsonpatch works with simple deletion", object: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar", "toremove": "shouldnotbehere"}), patchType: types.JSONPatchType, // remove spec.newvalue = dummy patchBytes: []byte(`[{"op": "remove", "path": "/spec/toremove"}]`), expectedPatchedObject: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}), }, { name: "strategic merge patch fails with JSONPatch", object: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}), patchType: types.StrategicMergePatchType, // add spec.newvalue = dummy patchBytes: []byte(`[{"op": "add", "path": "/spec/newvalue", "value": "dummy"}]`), wantErrMsg: "invalid JSON document", }, { name: "merge patch works with simple replacement", object: newUnstructuredWithSpec(map[string]interface{}{"foo": "bar"}), patchType: types.MergePatchType, patchBytes: []byte(`{ "spec": { "foo": "baz" } }`), expectedPatchedObject: newUnstructuredWithSpec(map[string]interface{}{"foo": "baz"}), }, // TODO: Add tests for strategic merge using v1.Pod for example to ensure the test cases // demonstrate expected use cases. } for _, tc := range testCases { t.Run(tc.name, tc.runner) } } // This test ensures list works when the fake dynamic client is seeded with a typed scheme and // unstructured type fixtures func TestListWithUnstructuredObjectsAndTypedScheme(t *testing.T) { gvr := schema.GroupVersionResource{Group: testGroup, Version: testVersion, Resource: testResource} gvk := gvr.GroupVersion().WithKind(testKind) listGVK := gvk listGVK.Kind += "List" u := unstructured.Unstructured{} u.SetGroupVersionKind(gvk) u.SetName("name") u.SetNamespace("namespace") typedScheme := runtime.NewScheme() typedScheme.AddKnownTypeWithName(gvk, &mockResource{}) typedScheme.AddKnownTypeWithName(listGVK, &mockResourceList{}) client := NewSimpleDynamicClient(typedScheme, &u) list, err := client.Resource(gvr).Namespace("namespace").List(context.Background(), metav1.ListOptions{}) if err != nil { t.Error("error listing", err) } expectedList := &unstructured.UnstructuredList{} expectedList.SetGroupVersionKind(listGVK) expectedList.SetResourceVersion("") // by product of the fake setting resource version expectedList.SetContinue("") expectedList.Items = append(expectedList.Items, u) if diff := cmp.Diff(expectedList, list); diff != "" { t.Fatal("unexpected diff (-want, +got): ", diff) } } func TestListWithNoFixturesAndTypedScheme(t *testing.T) { gvr := schema.GroupVersionResource{Group: testGroup, Version: testVersion, Resource: testResource} gvk := gvr.GroupVersion().WithKind(testKind) listGVK := gvk listGVK.Kind += "List" typedScheme := runtime.NewScheme() typedScheme.AddKnownTypeWithName(gvk, &mockResource{}) typedScheme.AddKnownTypeWithName(listGVK, &mockResourceList{}) client := NewSimpleDynamicClient(typedScheme) list, err := client.Resource(gvr).Namespace("namespace").List(context.Background(), metav1.ListOptions{}) if err != nil { t.Error("error listing", err) } expectedList := &unstructured.UnstructuredList{} expectedList.SetGroupVersionKind(listGVK) expectedList.SetResourceVersion("") // by product of the fake setting resource version expectedList.SetContinue("") if diff := cmp.Diff(expectedList, list); diff != "" { t.Fatal("unexpected diff (-want, +got): ", diff) } } // This test ensures list works when the dynamic client is seeded with an empty scheme and // unstructured typed fixtures func TestListWithNoScheme(t *testing.T) { gvr := schema.GroupVersionResource{Group: testGroup, Version: testVersion, Resource: testResource} gvk := gvr.GroupVersion().WithKind(testKind) listGVK := gvk listGVK.Kind += "List" u := unstructured.Unstructured{} u.SetGroupVersionKind(gvk) u.SetName("name") u.SetNamespace("namespace") emptyScheme := runtime.NewScheme() client := NewSimpleDynamicClient(emptyScheme, &u) list, err := client.Resource(gvr).Namespace("namespace").List(context.Background(), metav1.ListOptions{}) if err != nil { t.Error("error listing", err) } expectedList := &unstructured.UnstructuredList{} expectedList.SetGroupVersionKind(listGVK) expectedList.SetResourceVersion("") // by product of the fake setting resource version expectedList.SetContinue("") expectedList.Items = append(expectedList.Items, u) if diff := cmp.Diff(expectedList, list); diff != "" { t.Fatal("unexpected diff (-want, +got): ", diff) } } // This test ensures list works when the dynamic client is seeded with an empty scheme and // unstructured typed fixtures func TestListWithTypedFixtures(t *testing.T) { gvr := schema.GroupVersionResource{Group: testGroup, Version: testVersion, Resource: testResource} gvk := gvr.GroupVersion().WithKind(testKind) listGVK := gvk listGVK.Kind += "List" r := mockResource{} r.SetGroupVersionKind(gvk) r.SetName("name") r.SetNamespace("namespace") u := unstructured.Unstructured{} u.SetGroupVersionKind(r.GetObjectKind().GroupVersionKind()) u.SetName(r.GetName()) u.SetNamespace(r.GetNamespace()) // Needed see: https://github.com/kubernetes/kubernetes/issues/67610 unstructured.SetNestedField(u.Object, nil, "metadata", "creationTimestamp") typedScheme := runtime.NewScheme() typedScheme.AddKnownTypeWithName(gvk, &mockResource{}) typedScheme.AddKnownTypeWithName(listGVK, &mockResourceList{}) client := NewSimpleDynamicClient(typedScheme, &r) list, err := client.Resource(gvr).Namespace("namespace").List(context.Background(), metav1.ListOptions{}) if err != nil { t.Error("error listing", err) } expectedList := &unstructured.UnstructuredList{} expectedList.SetGroupVersionKind(listGVK) expectedList.SetResourceVersion("") // by product of the fake setting resource version expectedList.SetContinue("") expectedList.Items = []unstructured.Unstructured{u} if diff := cmp.Diff(expectedList, list); diff != "" { t.Fatal("unexpected diff (-want, +got): ", diff) } } type ( mockResource struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` } mockResourceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []mockResource } ) func (l *mockResourceList) DeepCopyObject() runtime.Object { o := *l return &o } func (r *mockResource) DeepCopyObject() runtime.Object { o := *r return &o } var _ runtime.Object = (*mockResource)(nil) var _ runtime.Object = (*mockResourceList)(nil) kubernetes-client-go-a2dfcab/dynamic/golden_test.go000066400000000000000000000165351472614177300226740ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamic_test import ( "context" "fmt" "net" "net/http" "net/http/httptest" "net/http/httputil" "net/url" "os" "path/filepath" "testing" "time" "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/dynamic" "k8s.io/client-go/rest" ) func TestGoldenRequest(t *testing.T) { for _, tc := range []struct { name string do func(context.Context, dynamic.Interface) error }{ { name: "create", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Create( ctx, &unstructured.Unstructured{Object: map[string]interface{}{ "metadata": map[string]interface{}{"name": "mips"}, }}, metav1.CreateOptions{FieldValidation: "warn"}, "fin", ) return err }, }, { name: "update", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Update( ctx, &unstructured.Unstructured{Object: map[string]interface{}{ "metadata": map[string]interface{}{"name": "mips"}, }}, metav1.UpdateOptions{FieldValidation: "warn"}, "fin", ) return err }, }, { name: "updatestatus", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").UpdateStatus( ctx, &unstructured.Unstructured{Object: map[string]interface{}{ "metadata": map[string]interface{}{"name": "mips"}, }}, metav1.UpdateOptions{FieldValidation: "warn"}, ) return err }, }, { name: "delete", do: func(ctx context.Context, client dynamic.Interface) error { return client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Delete( ctx, "mips", metav1.DeleteOptions{DryRun: []string{metav1.DryRunAll}}, "fin", ) }, }, { name: "deletecollection", do: func(ctx context.Context, client dynamic.Interface) error { return client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").DeleteCollection( ctx, metav1.DeleteOptions{DryRun: []string{metav1.DryRunAll}}, metav1.ListOptions{ResourceVersion: "42"}, ) }, }, { name: "get", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Get( ctx, "mips", metav1.GetOptions{ResourceVersion: "42"}, "fin", ) return err }, }, { name: "list", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").List( ctx, metav1.ListOptions{ResourceVersion: "42"}, ) return err }, }, { name: "watch", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Watch( ctx, metav1.ListOptions{ResourceVersion: "42"}, ) return err }, }, { name: "patch", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Patch( ctx, "mips", types.StrategicMergePatchType, []byte("{\"foo\":\"bar\"}\n"), metav1.PatchOptions{FieldManager: "baz"}, "fin", ) return err }, }, { name: "apply", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Apply( ctx, "mips", &unstructured.Unstructured{Object: map[string]interface{}{ "metadata": map[string]interface{}{"name": "mips"}, }}, metav1.ApplyOptions{Force: true}, "fin", ) return err }, }, { name: "applystatus", do: func(ctx context.Context, client dynamic.Interface) error { _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").ApplyStatus( ctx, "mips", &unstructured.Unstructured{Object: map[string]interface{}{ "metadata": map[string]interface{}{"name": "mips"}, }}, metav1.ApplyOptions{Force: true}, ) return err }, }, } { t.Run(tc.name, func(t *testing.T) { handled := make(chan struct{}) srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { defer close(handled) got, err := httputil.DumpRequest(r, true) if err != nil { t.Fatal(err) } path := filepath.Join("testdata", filepath.FromSlash(t.Name())) if os.Getenv("UPDATE_DYNAMIC_CLIENT_FIXTURES") == "true" { err := os.WriteFile(path, got, os.FileMode(0755)) if err != nil { t.Fatalf("failed to update fixture: %v", err) } } want, err := os.ReadFile(path) if err != nil { t.Fatalf("failed to load fixture: %v", err) } if diff := cmp.Diff(got, want); diff != "" { t.Errorf("unexpected difference from expected bytes:\n%s", diff) } })) defer srv.Close() client, err := dynamic.NewForConfig(&rest.Config{ Host: "example.com", UserAgent: "TestGoldenRequest", Transport: &http.Transport{ // The client will send a static Host header while always // connecting to the test server. DialContext: func(ctx context.Context, network string, addr string) (net.Conn, error) { u, err := url.Parse(srv.URL) if err != nil { return nil, fmt.Errorf("failed to parse test server url: %w", err) } return (&net.Dialer{}).DialContext(ctx, "tcp", u.Host) }, }, }) if err != nil { t.Fatal(err) } ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() if err := tc.do(ctx, client); err != nil { // This test detects server-perceptible changes to the request. As // long as the server receives the expected request, a non-nil error // returned from a client method is not a failure. t.Logf("client returned non-nil error: %v", err) } select { case <-handled: default: t.Fatal("no request received") } }) } } kubernetes-client-go-a2dfcab/dynamic/interface.go000066400000000000000000000056561472614177300223270ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamic import ( "context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" ) type Interface interface { Resource(resource schema.GroupVersionResource) NamespaceableResourceInterface } type ResourceInterface interface { Create(ctx context.Context, obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) Update(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions) (*unstructured.Unstructured, error) Delete(ctx context.Context, name string, options metav1.DeleteOptions, subresources ...string) error DeleteCollection(ctx context.Context, options metav1.DeleteOptions, listOptions metav1.ListOptions) error Get(ctx context.Context, name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) Apply(ctx context.Context, name string, obj *unstructured.Unstructured, options metav1.ApplyOptions, subresources ...string) (*unstructured.Unstructured, error) ApplyStatus(ctx context.Context, name string, obj *unstructured.Unstructured, options metav1.ApplyOptions) (*unstructured.Unstructured, error) } type NamespaceableResourceInterface interface { Namespace(string) ResourceInterface ResourceInterface } // APIPathResolverFunc knows how to convert a groupVersion to its API path. The Kind field is optional. // TODO find a better place to move this for existing callers type APIPathResolverFunc func(kind schema.GroupVersionKind) string // LegacyAPIPathResolverFunc can resolve paths properly with the legacy API. // TODO find a better place to move this for existing callers func LegacyAPIPathResolverFunc(kind schema.GroupVersionKind) string { if len(kind.Group) == 0 { return "/api" } return "/apis" } kubernetes-client-go-a2dfcab/dynamic/scheme.go000066400000000000000000000070551472614177300216260ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamic import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/runtime/serializer/json" ) var watchScheme = runtime.NewScheme() var basicScheme = runtime.NewScheme() var deleteScheme = runtime.NewScheme() var parameterScheme = runtime.NewScheme() var deleteOptionsCodec = serializer.NewCodecFactory(deleteScheme) var dynamicParameterCodec = runtime.NewParameterCodec(parameterScheme) var versionV1 = schema.GroupVersion{Version: "v1"} func init() { metav1.AddToGroupVersion(watchScheme, versionV1) metav1.AddToGroupVersion(basicScheme, versionV1) metav1.AddToGroupVersion(parameterScheme, versionV1) metav1.AddToGroupVersion(deleteScheme, versionV1) } // basicNegotiatedSerializer is used to handle discovery and error handling serialization type basicNegotiatedSerializer struct{} func (s basicNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInfo { return []runtime.SerializerInfo{ { MediaType: "application/json", MediaTypeType: "application", MediaTypeSubType: "json", EncodesAsText: true, Serializer: json.NewSerializer(json.DefaultMetaFactory, unstructuredCreater{basicScheme}, unstructuredTyper{basicScheme}, false), PrettySerializer: json.NewSerializer(json.DefaultMetaFactory, unstructuredCreater{basicScheme}, unstructuredTyper{basicScheme}, true), StreamSerializer: &runtime.StreamSerializerInfo{ EncodesAsText: true, Serializer: json.NewSerializer(json.DefaultMetaFactory, basicScheme, basicScheme, false), Framer: json.Framer, }, }, } } func (s basicNegotiatedSerializer) EncoderForVersion(encoder runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder { return runtime.WithVersionEncoder{ Version: gv, Encoder: encoder, ObjectTyper: unstructuredTyper{basicScheme}, } } func (s basicNegotiatedSerializer) DecoderToVersion(decoder runtime.Decoder, gv runtime.GroupVersioner) runtime.Decoder { return decoder } type unstructuredCreater struct { nested runtime.ObjectCreater } func (c unstructuredCreater) New(kind schema.GroupVersionKind) (runtime.Object, error) { out, err := c.nested.New(kind) if err == nil { return out, nil } out = &unstructured.Unstructured{} out.GetObjectKind().SetGroupVersionKind(kind) return out, nil } type unstructuredTyper struct { nested runtime.ObjectTyper } func (t unstructuredTyper) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error) { kinds, unversioned, err := t.nested.ObjectKinds(obj) if err == nil { return kinds, unversioned, nil } if _, ok := obj.(runtime.Unstructured); ok && !obj.GetObjectKind().GroupVersionKind().Empty() { return []schema.GroupVersionKind{obj.GetObjectKind().GroupVersionKind()}, false, nil } return nil, false, err } func (t unstructuredTyper) Recognizes(gvk schema.GroupVersionKind) bool { return true } kubernetes-client-go-a2dfcab/dynamic/simple.go000066400000000000000000000360551472614177300216550ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package dynamic import ( "context" "fmt" "net/http" "time" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/rest" "k8s.io/client-go/util/consistencydetector" "k8s.io/client-go/util/watchlist" "k8s.io/klog/v2" ) type DynamicClient struct { client rest.Interface } var _ Interface = &DynamicClient{} // ConfigFor returns a copy of the provided config with the // appropriate dynamic client defaults set. func ConfigFor(inConfig *rest.Config) *rest.Config { config := rest.CopyConfig(inConfig) config.AcceptContentTypes = "application/json" config.ContentType = "application/json" config.NegotiatedSerializer = basicNegotiatedSerializer{} // this gets used for discovery and error handling types if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return config } // New creates a new DynamicClient for the given RESTClient. func New(c rest.Interface) *DynamicClient { return &DynamicClient{client: c} } // NewForConfigOrDie creates a new DynamicClient for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *DynamicClient { ret, err := NewForConfig(c) if err != nil { panic(err) } return ret } // NewForConfig creates a new dynamic client or returns an error. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(inConfig *rest.Config) (*DynamicClient, error) { config := ConfigFor(inConfig) httpClient, err := rest.HTTPClientFor(config) if err != nil { return nil, err } return NewForConfigAndClient(config, httpClient) } // NewForConfigAndClient creates a new dynamic client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(inConfig *rest.Config, h *http.Client) (*DynamicClient, error) { config := ConfigFor(inConfig) // for serializing the options config.GroupVersion = &schema.GroupVersion{} config.APIPath = "/if-you-see-this-search-for-the-break" restClient, err := rest.RESTClientForConfigAndClient(config, h) if err != nil { return nil, err } return &DynamicClient{client: restClient}, nil } type dynamicResourceClient struct { client *DynamicClient namespace string resource schema.GroupVersionResource } func (c *DynamicClient) Resource(resource schema.GroupVersionResource) NamespaceableResourceInterface { return &dynamicResourceClient{client: c, resource: resource} } func (c *dynamicResourceClient) Namespace(ns string) ResourceInterface { ret := *c ret.namespace = ns return &ret } func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) { outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) if err != nil { return nil, err } name := "" if len(subresources) > 0 { accessor, err := meta.Accessor(obj) if err != nil { return nil, err } name = accessor.GetName() if len(name) == 0 { return nil, fmt.Errorf("name is required") } } if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil { return nil, err } result := c.client.client. Post(). AbsPath(append(c.makeURLSegments(name), subresources...)...). SetHeader("Content-Type", runtime.ContentTypeJSON). Body(outBytes). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } retBytes, err := result.Raw() if err != nil { return nil, err } uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) if err != nil { return nil, err } return uncastObj.(*unstructured.Unstructured), nil } func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) { accessor, err := meta.Accessor(obj) if err != nil { return nil, err } name := accessor.GetName() if len(name) == 0 { return nil, fmt.Errorf("name is required") } if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil { return nil, err } outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) if err != nil { return nil, err } result := c.client.client. Put(). AbsPath(append(c.makeURLSegments(name), subresources...)...). SetHeader("Content-Type", runtime.ContentTypeJSON). Body(outBytes). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } retBytes, err := result.Raw() if err != nil { return nil, err } uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) if err != nil { return nil, err } return uncastObj.(*unstructured.Unstructured), nil } func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) { accessor, err := meta.Accessor(obj) if err != nil { return nil, err } name := accessor.GetName() if len(name) == 0 { return nil, fmt.Errorf("name is required") } if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil { return nil, err } outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) if err != nil { return nil, err } result := c.client.client. Put(). AbsPath(append(c.makeURLSegments(name), "status")...). SetHeader("Content-Type", runtime.ContentTypeJSON). Body(outBytes). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } retBytes, err := result.Raw() if err != nil { return nil, err } uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) if err != nil { return nil, err } return uncastObj.(*unstructured.Unstructured), nil } func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error { if len(name) == 0 { return fmt.Errorf("name is required") } if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil { return err } deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts) if err != nil { return err } result := c.client.client. Delete(). AbsPath(append(c.makeURLSegments(name), subresources...)...). SetHeader("Content-Type", runtime.ContentTypeJSON). Body(deleteOptionsByte). Do(ctx) return result.Error() } func (c *dynamicResourceClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOptions metav1.ListOptions) error { if err := validateNamespaceWithOptionalName(c.namespace); err != nil { return err } deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts) if err != nil { return err } result := c.client.client. Delete(). AbsPath(c.makeURLSegments("")...). SetHeader("Content-Type", runtime.ContentTypeJSON). Body(deleteOptionsByte). SpecificallyVersionedParams(&listOptions, dynamicParameterCodec, versionV1). Do(ctx) return result.Error() } func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) { if len(name) == 0 { return nil, fmt.Errorf("name is required") } if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil { return nil, err } result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(ctx) if err := result.Error(); err != nil { return nil, err } retBytes, err := result.Raw() if err != nil { return nil, err } uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) if err != nil { return nil, err } return uncastObj.(*unstructured.Unstructured), nil } func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { klog.Warningf("Failed preparing watchlist options for %v, falling back to the standard LIST semantics, err = %v", c.resource, watchListOptionsErr) } else if hasWatchListOptionsPrepared { result, err := c.watchList(ctx, watchListOptions) if err == nil { consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, fmt.Sprintf("watchlist request for %v", c.resource), c.list, opts, result) return result, nil } klog.Warningf("The watchlist request for %v ended with an error, falling back to the standard LIST semantics, err = %v", c.resource, err) } result, err := c.list(ctx, opts) if err == nil { consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, fmt.Sprintf("list request for %v", c.resource), c.list, opts, result) } return result, err } func (c *dynamicResourceClient) list(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { if err := validateNamespaceWithOptionalName(c.namespace); err != nil { return nil, err } result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(ctx) if err := result.Error(); err != nil { return nil, err } retBytes, err := result.Raw() if err != nil { return nil, err } uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) if err != nil { return nil, err } if list, ok := uncastObj.(*unstructured.UnstructuredList); ok { return list, nil } list, err := uncastObj.(*unstructured.Unstructured).ToList() if err != nil { return nil, err } return list, nil } // watchList establishes a watch stream with the server and returns an unstructured list. func (c *dynamicResourceClient) watchList(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { if err := validateNamespaceWithOptionalName(c.namespace); err != nil { return nil, err } var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } result := &unstructured.UnstructuredList{} err := c.client.client.Get().AbsPath(c.makeURLSegments("")...). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Timeout(timeout). WatchList(ctx). Into(result) return result, err } func (c *dynamicResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { opts.Watch = true if err := validateNamespaceWithOptionalName(c.namespace); err != nil { return nil, err } return c.client.client.Get().AbsPath(c.makeURLSegments("")...). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Watch(ctx) } func (c *dynamicResourceClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) { if len(name) == 0 { return nil, fmt.Errorf("name is required") } if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil { return nil, err } result := c.client.client. Patch(pt). AbsPath(append(c.makeURLSegments(name), subresources...)...). Body(data). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } retBytes, err := result.Raw() if err != nil { return nil, err } uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) if err != nil { return nil, err } return uncastObj.(*unstructured.Unstructured), nil } func (c *dynamicResourceClient) Apply(ctx context.Context, name string, obj *unstructured.Unstructured, opts metav1.ApplyOptions, subresources ...string) (*unstructured.Unstructured, error) { if len(name) == 0 { return nil, fmt.Errorf("name is required") } if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil { return nil, err } outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) if err != nil { return nil, err } accessor, err := meta.Accessor(obj) if err != nil { return nil, err } managedFields := accessor.GetManagedFields() if len(managedFields) > 0 { return nil, fmt.Errorf(`cannot apply an object with managed fields already set. Use the client-go/applyconfigurations "UnstructructuredExtractor" to obtain the unstructured ApplyConfiguration for the given field manager that you can use/modify here to apply`) } patchOpts := opts.ToPatchOptions() result := c.client.client. Patch(types.ApplyPatchType). AbsPath(append(c.makeURLSegments(name), subresources...)...). Body(outBytes). SpecificallyVersionedParams(&patchOpts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } retBytes, err := result.Raw() if err != nil { return nil, err } uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes) if err != nil { return nil, err } return uncastObj.(*unstructured.Unstructured), nil } func (c *dynamicResourceClient) ApplyStatus(ctx context.Context, name string, obj *unstructured.Unstructured, opts metav1.ApplyOptions) (*unstructured.Unstructured, error) { return c.Apply(ctx, name, obj, opts, "status") } func validateNamespaceWithOptionalName(namespace string, name ...string) error { if msgs := rest.IsValidPathSegmentName(namespace); len(msgs) != 0 { return fmt.Errorf("invalid namespace %q: %v", namespace, msgs) } if len(name) > 1 { panic("Invalid number of names") } else if len(name) == 1 { if msgs := rest.IsValidPathSegmentName(name[0]); len(msgs) != 0 { return fmt.Errorf("invalid resource name %q: %v", name[0], msgs) } } return nil } func (c *dynamicResourceClient) makeURLSegments(name string) []string { url := []string{} if len(c.resource.Group) == 0 { url = append(url, "api") } else { url = append(url, "apis", c.resource.Group) } url = append(url, c.resource.Version) if len(c.namespace) > 0 { url = append(url, "namespaces", c.namespace) } url = append(url, c.resource.Resource) if len(name) > 0 { url = append(url, name) } return url } kubernetes-client-go-a2dfcab/dynamic/testdata/000077500000000000000000000000001472614177300216355ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/000077500000000000000000000000001472614177300252565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/apply000077500000000000000000000004211472614177300263260ustar00rootroot00000000000000PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?force=true HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip Content-Length: 29 Content-Type: application/apply-patch+yaml User-Agent: TestGoldenRequest {"metadata":{"name":"mips"}} kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/applystatus000077500000000000000000000004241472614177300275750ustar00rootroot00000000000000PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/status?force=true HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip Content-Length: 29 Content-Type: application/apply-patch+yaml User-Agent: TestGoldenRequest {"metadata":{"name":"mips"}} kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/create000077500000000000000000000004161472614177300264500ustar00rootroot00000000000000POST /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldValidation=warn HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip Content-Length: 29 Content-Type: application/json User-Agent: TestGoldenRequest {"metadata":{"name":"mips"}} kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/delete000077500000000000000000000004321472614177300264450ustar00rootroot00000000000000DELETE /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip Content-Length: 60 Content-Type: application/json User-Agent: TestGoldenRequest {"kind":"DeleteOptions","apiVersion":"v1","dryRun":["All"]} kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/deletecollection000077500000000000000000000004441472614177300305240ustar00rootroot00000000000000DELETE /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42 HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip Content-Length: 60 Content-Type: application/json User-Agent: TestGoldenRequest {"kind":"DeleteOptions","apiVersion":"v1","dryRun":["All"]} kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/get000077500000000000000000000002721472614177300257640ustar00rootroot00000000000000GET /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?resourceVersion=42 HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip User-Agent: TestGoldenRequest kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/list000077500000000000000000000002611472614177300261560ustar00rootroot00000000000000GET /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42 HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip User-Agent: TestGoldenRequest kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/patch000077500000000000000000000004221472614177300263010ustar00rootroot00000000000000PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldManager=baz HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip Content-Length: 14 Content-Type: application/strategic-merge-patch+json User-Agent: TestGoldenRequest {"foo":"bar"} kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/update000077500000000000000000000004151472614177300264660ustar00rootroot00000000000000PUT /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldValidation=warn HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip Content-Length: 29 Content-Type: application/json User-Agent: TestGoldenRequest {"metadata":{"name":"mips"}} kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/updatestatus000077500000000000000000000004201472614177300277260ustar00rootroot00000000000000PUT /apis/flops/v1alpha1/namespaces/mops/flips/mips/status?fieldValidation=warn HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip Content-Length: 29 Content-Type: application/json User-Agent: TestGoldenRequest {"metadata":{"name":"mips"}} kubernetes-client-go-a2dfcab/dynamic/testdata/TestGoldenRequest/watch000077500000000000000000000002741472614177300263150ustar00rootroot00000000000000GET /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42&watch=true HTTP/1.1 Host: example.com Accept: application/json Accept-Encoding: gzip User-Agent: TestGoldenRequest kubernetes-client-go-a2dfcab/examples/000077500000000000000000000000001472614177300202165ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/examples/README.md000066400000000000000000000036121472614177300214770ustar00rootroot00000000000000# client-go Examples This directory contains examples that cover various use cases and functionality for client-go. ### Auth plugins Client configuration is typically loaded from kubeconfig files containing server and credential configuration. Several plugins for obtaining credentials from external sources are available, but are not loaded by default. To enable these plugins in your program, import them in your main package. You can load all auth plugins: ```go import _ "k8s.io/client-go/plugin/pkg/client/auth" ``` Or you can load specific auth plugins: ```go import _ "k8s.io/client-go/plugin/pkg/client/auth/azure" import _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" import _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" ``` ### Configuration - [**Authenticate in cluster**](./in-cluster-client-configuration): Configure a client while running inside the Kubernetes cluster. - [**Authenticate out of cluster**](./out-of-cluster-client-configuration): Configure a client to access a Kubernetes cluster from outside. ### Basics - [**Managing resources with API**](./create-update-delete-deployment): Create, get, update, delete a Deployment resource. ### Advanced Concepts - [**Work queues**](./workqueue): Create a hotloop-free controller with the rate-limited workqueue and the [informer framework][informer]. - [**Custom Resource Definition (CRD)**](https://git.k8s.io/apiextensions-apiserver/examples/client-go): Register a custom resource type with the API, create/update/query this custom type, and write a controller that drives the cluster state based on the changes to the custom resources. - [**Leader election**](./leader-election): Demonstrates the use of the leader election package, which can be used to implement HA controllers. [informer]: https://godoc.org/k8s.io/client-go/tools/cache#NewInformer ### Testing - [**Fake Client**](./fake-client): Use a fake client in tests. kubernetes-client-go-a2dfcab/examples/create-update-delete-deployment/000077500000000000000000000000001472614177300263575ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/examples/create-update-delete-deployment/README.md000066400000000000000000000050741472614177300276440ustar00rootroot00000000000000# Create, Update & Delete Deployment This example program demonstrates the fundamental operations for managing on [Deployment][1] resources, such as `Create`, `List`, `Update` and `Delete`. You can adopt the source code from this example to write programs that manage other types of resources through the Kubernetes API. ## Running this example Make sure you have a Kubernetes cluster and `kubectl` is configured: kubectl get nodes Compile this example on your workstation: ``` cd create-update-delete-deployment go build -o ./app ``` Now, run this application on your workstation with your local kubeconfig file: ``` ./app # or specify a kubeconfig file with flag ./app -kubeconfig=$HOME/.kube/config ``` Running this command will execute the following operations on your cluster: 1. **Create Deployment:** This will create a 2 replica Deployment. Verify with `kubectl get pods`. 2. **Update Deployment:** This will update the Deployment resource created in previous step by setting the replica count to 1 and changing the container image to `nginx:1.13`. You are encouraged to inspect the retry loop that handles conflicts. Verify the new replica count and container image with `kubectl describe deployment demo`. 3. **List Deployments:** This will retrieve Deployments in the `default` namespace and print their names and replica counts. 4. **Delete Deployment:** This will delete the Deployment object and its dependent ReplicaSet resource. Verify with `kubectl get deployments`. Each step is separated by an interactive prompt. You must hit the Return key to proceed to the next step. You can use these prompts as a break to take time to run `kubectl` and inspect the result of the operations executed. You should see an output like the following: ``` Creating deployment... Created deployment "demo-deployment". -> Press Return key to continue. Updating deployment... Updated deployment... -> Press Return key to continue. Listing deployments in namespace "default": * demo-deployment (1 replicas) -> Press Return key to continue. Deleting deployment... Deleted deployment. ``` ## Cleanup Successfully running this program will clean the created artifacts. If you terminate the program without completing, you can clean up the created deployment with: kubectl delete deploy demo-deployment ## Troubleshooting If you are getting the following error, make sure Kubernetes version of your cluster is v1.6 or above in `kubectl version`: panic: the server could not find the requested resource [1]: https://kubernetes.io/docs/user-guide/deployments/ kubernetes-client-go-a2dfcab/examples/create-update-delete-deployment/main.go000066400000000000000000000124461472614177300276410ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Note: the example only works with the code within the same release/branch. package main import ( "bufio" "context" "flag" "fmt" "os" "path/filepath" appsv1 "k8s.io/api/apps/v1" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" "k8s.io/client-go/util/retry" // // Uncomment to load all auth plugins // _ "k8s.io/client-go/plugin/pkg/client/auth" // // Or uncomment to load specific auth plugins // _ "k8s.io/client-go/plugin/pkg/client/auth/azure" // _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" ) func main() { var kubeconfig *string if home := homedir.HomeDir(); home != "" { kubeconfig = flag.String("kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file") } else { kubeconfig = flag.String("kubeconfig", "", "absolute path to the kubeconfig file") } flag.Parse() config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig) if err != nil { panic(err) } clientset, err := kubernetes.NewForConfig(config) if err != nil { panic(err) } deploymentsClient := clientset.AppsV1().Deployments(apiv1.NamespaceDefault) deployment := &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "demo-deployment", }, Spec: appsv1.DeploymentSpec{ Replicas: int32Ptr(2), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "demo", }, }, Template: apiv1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "app": "demo", }, }, Spec: apiv1.PodSpec{ Containers: []apiv1.Container{ { Name: "web", Image: "nginx:1.12", Ports: []apiv1.ContainerPort{ { Name: "http", Protocol: apiv1.ProtocolTCP, ContainerPort: 80, }, }, }, }, }, }, }, } // Create Deployment fmt.Println("Creating deployment...") result, err := deploymentsClient.Create(context.TODO(), deployment, metav1.CreateOptions{}) if err != nil { panic(err) } fmt.Printf("Created deployment %q.\n", result.GetObjectMeta().GetName()) // Update Deployment prompt() fmt.Println("Updating deployment...") // You have two options to Update() this Deployment: // // 1. Modify the "deployment" variable and call: Update(deployment). // This works like the "kubectl replace" command and it overwrites/loses changes // made by other clients between you Create() and Update() the object. // 2. Modify the "result" returned by Get() and retry Update(result) until // you no longer get a conflict error. This way, you can preserve changes made // by other clients between Create() and Update(). This is implemented below // using the retry utility package included with client-go. (RECOMMENDED) // // More Info: // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { // Retrieve the latest version of Deployment before attempting update // RetryOnConflict uses exponential backoff to avoid exhausting the apiserver result, getErr := deploymentsClient.Get(context.TODO(), "demo-deployment", metav1.GetOptions{}) if getErr != nil { panic(fmt.Errorf("Failed to get latest version of Deployment: %v", getErr)) } result.Spec.Replicas = int32Ptr(1) // reduce replica count result.Spec.Template.Spec.Containers[0].Image = "nginx:1.13" // change nginx version _, updateErr := deploymentsClient.Update(context.TODO(), result, metav1.UpdateOptions{}) return updateErr }) if retryErr != nil { panic(fmt.Errorf("Update failed: %v", retryErr)) } fmt.Println("Updated deployment...") // List Deployments prompt() fmt.Printf("Listing deployments in namespace %q:\n", apiv1.NamespaceDefault) list, err := deploymentsClient.List(context.TODO(), metav1.ListOptions{}) if err != nil { panic(err) } for _, d := range list.Items { fmt.Printf(" * %s (%d replicas)\n", d.Name, *d.Spec.Replicas) } // Delete Deployment prompt() fmt.Println("Deleting deployment...") deletePolicy := metav1.DeletePropagationForeground if err := deploymentsClient.Delete(context.TODO(), "demo-deployment", metav1.DeleteOptions{ PropagationPolicy: &deletePolicy, }); err != nil { panic(err) } fmt.Println("Deleted deployment.") } func prompt() { fmt.Printf("-> Press Return key to continue.") scanner := bufio.NewScanner(os.Stdin) for scanner.Scan() { break } if err := scanner.Err(); err != nil { panic(err) } fmt.Println() } func int32Ptr(i int32) *int32 { return &i } kubernetes-client-go-a2dfcab/examples/dynamic-create-update-delete-deployment/000077500000000000000000000000001472614177300300015ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/examples/dynamic-create-update-delete-deployment/README.md000066400000000000000000000076111472614177300312650ustar00rootroot00000000000000# Create, Update & Delete Deployment with the Dynamic Package This example program demonstrates the fundamental operations for managing on [Deployment][1] resources, such as `Create`, `List`, `Update` and `Delete` using client-go's `dynamic` package. ## Typed Vs. Dynamic The code in this directory is based on a similar [example that uses Kubernetes typed client sets][2]. The typed client sets make it simple to communicate with the API server using pre-generated local API objects to achieve an RPC-like programming experience. Typed clients uses program compilations to enforce data safety and some validation. However, when using typed clients, programs are forced to be tightly coupled with the version and the types used. The `dynamic` package on the other hand, uses a simple type, `unstructured.Unstructured`, to represent all object values from the API server. Type `Unstructured` uses a collection of nested `map[string]interface{}` values to create an internal structure that closely resemble the REST payload from the server. The dynamic package defers all data bindings until runtime. This means programs that use the dynamic client will not get any of the benefits of type validation until the program is running. This may be a problem for certain types of applications that require strong data type check and validation. Being loosely coupled, however, means that programs that uses the `dynamic` package do not require recompilation when the client API changes. The client program has more flexibility in handling updates to the API surface without knowing ahead of time what those changes are. ## Running this example Make sure you have a Kubernetes cluster and `kubectl` is configured: ``` kubectl get nodes ``` Compile this example on your workstation: ``` cd dynamic-create-update-delete-deployment go build -o ./app ``` Now, run this application on your workstation with your local kubeconfig file: ``` ./app # or specify a kubeconfig file with flag ./app -kubeconfig=$HOME/.kube/config ``` Running this command will execute the following operations on your cluster: 1. **Create Deployment:** This will create a 2 replica Deployment. Verify with `kubectl get pods`. 2. **Update Deployment:** This will update the Deployment resource created in previous step by setting the replica count to 1 and changing the container image to `nginx:1.13`. You are encouraged to inspect the retry loop that handles conflicts. Verify the new replica count and container image with `kubectl describe deployment demo`. 3. **List Deployments:** This will retrieve Deployments in the `default` namespace and print their names and replica counts. 4. **Delete Deployment:** This will delete the Deployment object and its dependent ReplicaSet resource. Verify with `kubectl get deployments`. Each step is separated by an interactive prompt. You must hit the Return key to proceed to the next step. You can use these prompts as a break to take time to run `kubectl` and inspect the result of the operations executed. You should see an output like the following: ``` Creating deployment... Created deployment "demo-deployment". -> Press Return key to continue. Updating deployment... Updated deployment... -> Press Return key to continue. Listing deployments in namespace "default": * demo-deployment (1 replicas) -> Press Return key to continue. Deleting deployment... Deleted deployment. ``` ## Cleanup Successfully running this program will clean the created artifacts. If you terminate the program without completing, you can clean up the created deployment with: kubectl delete deploy demo-deployment ## Troubleshooting If you are getting the following error, make sure Kubernetes version of your cluster is v1.13 or higher in `kubectl version`: panic: the server could not find the requested resource [1]: https://kubernetes.io/docs/user-guide/deployments/ [2]: ../create-update-delete-deployment kubernetes-client-go-a2dfcab/examples/dynamic-create-update-delete-deployment/main.go000066400000000000000000000150501472614177300312550ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Note: the example only works with the code within the same release/branch. package main import ( "bufio" "context" "flag" "fmt" "os" "path/filepath" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" "k8s.io/client-go/util/retry" // // Uncomment to load all auth plugins // _ "k8s.io/client-go/plugin/pkg/client/auth" // // Or uncomment to load specific auth plugins // _ "k8s.io/client-go/plugin/pkg/client/auth/azure" // _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" ) func main() { var kubeconfig *string if home := homedir.HomeDir(); home != "" { kubeconfig = flag.String("kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file") } else { kubeconfig = flag.String("kubeconfig", "", "absolute path to the kubeconfig file") } flag.Parse() config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig) if err != nil { panic(err) } client, err := dynamic.NewForConfig(config) if err != nil { panic(err) } deploymentRes := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"} deployment := &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", "metadata": map[string]interface{}{ "name": "demo-deployment", }, "spec": map[string]interface{}{ "replicas": 2, "selector": map[string]interface{}{ "matchLabels": map[string]interface{}{ "app": "demo", }, }, "template": map[string]interface{}{ "metadata": map[string]interface{}{ "labels": map[string]interface{}{ "app": "demo", }, }, "spec": map[string]interface{}{ "containers": []map[string]interface{}{ { "name": "web", "image": "nginx:1.12", "ports": []map[string]interface{}{ { "name": "http", "protocol": "TCP", "containerPort": 80, }, }, }, }, }, }, }, }, } // Create Deployment fmt.Println("Creating deployment...") result, err := client.Resource(deploymentRes).Namespace(apiv1.NamespaceDefault).Create(context.TODO(), deployment, metav1.CreateOptions{}) if err != nil { panic(err) } fmt.Printf("Created deployment %q.\n", result.GetName()) // Update Deployment prompt() fmt.Println("Updating deployment...") // You have two options to Update() this Deployment: // // 1. Modify the "deployment" variable and call: Update(deployment). // This works like the "kubectl replace" command and it overwrites/loses changes // made by other clients between you Create() and Update() the object. // 2. Modify the "result" returned by Get() and retry Update(result) until // you no longer get a conflict error. This way, you can preserve changes made // by other clients between Create() and Update(). This is implemented below // using the retry utility package included with client-go. (RECOMMENDED) // // More Info: // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { // Retrieve the latest version of Deployment before attempting update // RetryOnConflict uses exponential backoff to avoid exhausting the apiserver result, getErr := client.Resource(deploymentRes).Namespace(apiv1.NamespaceDefault).Get(context.TODO(), "demo-deployment", metav1.GetOptions{}) if getErr != nil { panic(fmt.Errorf("failed to get latest version of Deployment: %v", getErr)) } // update replicas to 1 if err := unstructured.SetNestedField(result.Object, int64(1), "spec", "replicas"); err != nil { panic(fmt.Errorf("failed to set replica value: %v", err)) } // extract spec containers containers, found, err := unstructured.NestedSlice(result.Object, "spec", "template", "spec", "containers") if err != nil || !found || containers == nil { panic(fmt.Errorf("deployment containers not found or error in spec: %v", err)) } // update container[0] image if err := unstructured.SetNestedField(containers[0].(map[string]interface{}), "nginx:1.13", "image"); err != nil { panic(err) } if err := unstructured.SetNestedField(result.Object, containers, "spec", "template", "spec", "containers"); err != nil { panic(err) } _, updateErr := client.Resource(deploymentRes).Namespace(apiv1.NamespaceDefault).Update(context.TODO(), result, metav1.UpdateOptions{}) return updateErr }) if retryErr != nil { panic(fmt.Errorf("update failed: %v", retryErr)) } fmt.Println("Updated deployment...") // List Deployments prompt() fmt.Printf("Listing deployments in namespace %q:\n", apiv1.NamespaceDefault) list, err := client.Resource(deploymentRes).Namespace(apiv1.NamespaceDefault).List(context.TODO(), metav1.ListOptions{}) if err != nil { panic(err) } for _, d := range list.Items { replicas, found, err := unstructured.NestedInt64(d.Object, "spec", "replicas") if err != nil || !found { fmt.Printf("Replicas not found for deployment %s: error=%s", d.GetName(), err) continue } fmt.Printf(" * %s (%d replicas)\n", d.GetName(), replicas) } // Delete Deployment prompt() fmt.Println("Deleting deployment...") deletePolicy := metav1.DeletePropagationForeground deleteOptions := metav1.DeleteOptions{ PropagationPolicy: &deletePolicy, } if err := client.Resource(deploymentRes).Namespace(apiv1.NamespaceDefault).Delete(context.TODO(), "demo-deployment", deleteOptions); err != nil { panic(err) } fmt.Println("Deleted deployment.") } func prompt() { fmt.Printf("-> Press Return key to continue.") scanner := bufio.NewScanner(os.Stdin) for scanner.Scan() { break } if err := scanner.Err(); err != nil { panic(err) } fmt.Println() } kubernetes-client-go-a2dfcab/examples/fake-client/000077500000000000000000000000001472614177300224005ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/examples/fake-client/README.md000066400000000000000000000004421472614177300236570ustar00rootroot00000000000000# Fake Client Example This example demonstrates how to use a fake client with SharedInformerFactory in tests. It covers: * Creating the fake client * Setting up real informers * Injecting events into those informers ## Running ``` go test -v k8s.io/client-go/examples/fake-client ```kubernetes-client-go-a2dfcab/examples/fake-client/doc.go000066400000000000000000000014721472614177300235000ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package fakeclient contains examples on how to use fakeclient in tests. // Note: This file is here to avoid warnings on go build since there are no // non-test files in this package. package fakeclient // import "k8s.io/client-go/examples/fake-client" kubernetes-client-go-a2dfcab/examples/fake-client/main_test.go000066400000000000000000000064031472614177300247150ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fakeclient import ( "context" "testing" "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" clienttesting "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" ) // TestFakeClient demonstrates how to use a fake client with SharedInformerFactory in tests. func TestFakeClient(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() watcherStarted := make(chan struct{}) // Create the fake client. client := fake.NewSimpleClientset() // A catch-all watch reactor that allows us to inject the watcherStarted channel. client.PrependWatchReactor("*", func(action clienttesting.Action) (handled bool, ret watch.Interface, err error) { gvr := action.GetResource() ns := action.GetNamespace() watch, err := client.Tracker().Watch(gvr, ns) if err != nil { return false, nil, err } close(watcherStarted) return true, watch, nil }) // We will create an informer that writes added pods to a channel. pods := make(chan *v1.Pod, 1) informers := informers.NewSharedInformerFactory(client, 0) podInformer := informers.Core().V1().Pods().Informer() podInformer.AddEventHandler(&cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { pod := obj.(*v1.Pod) t.Logf("pod added: %s/%s", pod.Namespace, pod.Name) pods <- pod }, }) // Make sure informers are running. informers.Start(ctx.Done()) // This is not required in tests, but it serves as a proof-of-concept by // ensuring that the informer goroutine have warmed up and called List before // we send any events to it. cache.WaitForCacheSync(ctx.Done(), podInformer.HasSynced) // The fake client doesn't support resource version. Any writes to the client // after the informer's initial LIST and before the informer establishing the // watcher will be missed by the informer. Therefore we wait until the watcher // starts. // Note that the fake client isn't designed to work with informer. It // doesn't support resource version. It's encouraged to use a real client // in an integration/E2E test if you need to test complex behavior with // informer/controllers. <-watcherStarted // Inject an event into the fake client. p := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "my-pod"}} _, err := client.CoreV1().Pods("test-ns").Create(context.TODO(), p, metav1.CreateOptions{}) if err != nil { t.Fatalf("error injecting pod add: %v", err) } select { case pod := <-pods: t.Logf("Got pod from channel: %s/%s", pod.Namespace, pod.Name) case <-time.After(wait.ForeverTestTimeout): t.Error("Informer did not get the added pod") } } kubernetes-client-go-a2dfcab/examples/in-cluster-client-configuration/000077500000000000000000000000001472614177300264245ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/examples/in-cluster-client-configuration/Dockerfile000066400000000000000000000011701472614177300304150ustar00rootroot00000000000000# Copyright 2017 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. FROM debian COPY ./app /app ENTRYPOINT /app kubernetes-client-go-a2dfcab/examples/in-cluster-client-configuration/README.md000066400000000000000000000036231472614177300277070ustar00rootroot00000000000000# Authenticating inside the cluster This example shows you how to configure a client with client-go to authenticate to the Kubernetes API from an application running inside the Kubernetes cluster. client-go uses the [Service Account token][sa] mounted inside the Pod at the `/var/run/secrets/kubernetes.io/serviceaccount` path when the `rest.InClusterConfig()` is used. ## Running this example First compile the application for Linux: cd in-cluster-client-configuration GOOS=linux go build -o ./app . Then package it to a docker image using the provided Dockerfile to run it on Kubernetes. If you are running a [Minikube][mk] cluster, you can build this image directly on the Docker engine of the Minikube node without pushing it to a registry. To build the image on Minikube: eval $(minikube docker-env) docker build -t in-cluster . If you are not using Minikube, you should build this image and push it to a registry that your Kubernetes cluster can pull from. If you have RBAC enabled on your cluster, use the following snippet to create role binding which will grant the default service account view permissions. ``` kubectl create clusterrolebinding default-view --clusterrole=view --serviceaccount=default:default ``` Then, run the image in a Pod with a single instance Deployment: kubectl run --rm -i demo --image=in-cluster There are 4 pods in the cluster There are 4 pods in the cluster There are 4 pods in the cluster ... The example now runs on Kubernetes API and successfully queries the number of pods in the cluster every 10 seconds. ### Clean up To stop this example and clean up the pod, press Ctrl+C on the `kubectl run` command and then run: kubectl delete deployment demo [sa]: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#service-account-tokens [mk]: https://kubernetes.io/docs/getting-started-guides/minikube/ kubernetes-client-go-a2dfcab/examples/in-cluster-client-configuration/main.go000066400000000000000000000045371472614177300277100ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Note: the example only works with the code within the same release/branch. package main import ( "context" "fmt" "time" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" // // Uncomment to load all auth plugins // _ "k8s.io/client-go/plugin/pkg/client/auth" // // Or uncomment to load specific auth plugins // _ "k8s.io/client-go/plugin/pkg/client/auth/azure" // _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" ) func main() { // creates the in-cluster config config, err := rest.InClusterConfig() if err != nil { panic(err.Error()) } // creates the clientset clientset, err := kubernetes.NewForConfig(config) if err != nil { panic(err.Error()) } for { // get pods in all the namespaces by omitting namespace // Or specify namespace to get pods in particular namespace pods, err := clientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{}) if err != nil { panic(err.Error()) } fmt.Printf("There are %d pods in the cluster\n", len(pods.Items)) // Examples for error handling: // - Use helper functions e.g. errors.IsNotFound() // - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message _, err = clientset.CoreV1().Pods("default").Get(context.TODO(), "example-xxxxx", metav1.GetOptions{}) if errors.IsNotFound(err) { fmt.Printf("Pod example-xxxxx not found in default namespace\n") } else if statusError, isStatus := err.(*errors.StatusError); isStatus { fmt.Printf("Error getting pod %v\n", statusError.ErrStatus.Message) } else if err != nil { panic(err.Error()) } else { fmt.Printf("Found example-xxxxx pod in default namespace\n") } time.Sleep(10 * time.Second) } } kubernetes-client-go-a2dfcab/examples/leader-election/000077500000000000000000000000001472614177300232525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/examples/leader-election/README.md000066400000000000000000000015711472614177300245350ustar00rootroot00000000000000# Leader Election Example This example demonstrates how to use the leader election package. ## Running Run the following three commands in separate terminals. Each terminal needs a unique `id`. ```bash # first terminal go run main.go -kubeconfig=/path/to/kubeconfig -logtostderr=true -lease-lock-name=example -lease-lock-namespace=default -id=1 # second terminal go run main.go -kubeconfig=/path/to/kubeconfig -logtostderr=true -lease-lock-name=example -lease-lock-namespace=default -id=2 # third terminal go run main.go -kubeconfig=/path/to/kubeconfig -logtostderr=true -lease-lock-name=example -lease-lock-namespace=default -id=3 ``` > You can ignore the `-kubeconfig` flag if you are running these commands in the Kubernetes cluster. Now kill the existing leader. You will see from the terminal outputs that one of the remaining two processes will be elected as the new leader. kubernetes-client-go-a2dfcab/examples/leader-election/main.go000066400000000000000000000106161472614177300245310ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package main import ( "context" "flag" "os" "os/signal" "syscall" "time" "github.com/google/uuid" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/leaderelection" "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/klog/v2" ) func buildConfig(kubeconfig string) (*rest.Config, error) { if kubeconfig != "" { cfg, err := clientcmd.BuildConfigFromFlags("", kubeconfig) if err != nil { return nil, err } return cfg, nil } cfg, err := rest.InClusterConfig() if err != nil { return nil, err } return cfg, nil } func main() { klog.InitFlags(nil) var kubeconfig string var leaseLockName string var leaseLockNamespace string var id string flag.StringVar(&kubeconfig, "kubeconfig", "", "absolute path to the kubeconfig file") flag.StringVar(&id, "id", uuid.New().String(), "the holder identity name") flag.StringVar(&leaseLockName, "lease-lock-name", "", "the lease lock resource name") flag.StringVar(&leaseLockNamespace, "lease-lock-namespace", "", "the lease lock resource namespace") flag.Parse() if leaseLockName == "" { klog.Fatal("unable to get lease lock resource name (missing lease-lock-name flag).") } if leaseLockNamespace == "" { klog.Fatal("unable to get lease lock resource namespace (missing lease-lock-namespace flag).") } // leader election uses the Kubernetes API by writing to a // lock object, which can be a LeaseLock object (preferred), // a ConfigMap, or an Endpoints (deprecated) object. // Conflicting writes are detected and each client handles those actions // independently. config, err := buildConfig(kubeconfig) if err != nil { klog.Fatal(err) } client := clientset.NewForConfigOrDie(config) run := func(ctx context.Context) { // complete your controller loop here klog.Info("Controller loop...") select {} } // use a Go context so we can tell the leaderelection code when we // want to step down ctx, cancel := context.WithCancel(context.Background()) defer cancel() // listen for interrupts or the Linux SIGTERM signal and cancel // our context, which the leader election code will observe and // step down ch := make(chan os.Signal, 1) signal.Notify(ch, os.Interrupt, syscall.SIGTERM) go func() { <-ch klog.Info("Received termination, signaling shutdown") cancel() }() // we use the Lease lock type since edits to Leases are less common // and fewer objects in the cluster watch "all Leases". lock := &resourcelock.LeaseLock{ LeaseMeta: metav1.ObjectMeta{ Name: leaseLockName, Namespace: leaseLockNamespace, }, Client: client.CoordinationV1(), LockConfig: resourcelock.ResourceLockConfig{ Identity: id, }, } // start the leader election code loop leaderelection.RunOrDie(ctx, leaderelection.LeaderElectionConfig{ Lock: lock, // IMPORTANT: you MUST ensure that any code you have that // is protected by the lease must terminate **before** // you call cancel. Otherwise, you could have a background // loop still running and another process could // get elected before your background loop finished, violating // the stated goal of the lease. ReleaseOnCancel: true, LeaseDuration: 60 * time.Second, RenewDeadline: 15 * time.Second, RetryPeriod: 5 * time.Second, Callbacks: leaderelection.LeaderCallbacks{ OnStartedLeading: func(ctx context.Context) { // we're notified when we start - this is where you would // usually put your code run(ctx) }, OnStoppedLeading: func() { // we can do cleanup here klog.Infof("leader lost: %s", id) os.Exit(0) }, OnNewLeader: func(identity string) { // we're notified when new leader elected if identity == id { // I just got the lock return } klog.Infof("new leader elected: %s", identity) }, }, }) } kubernetes-client-go-a2dfcab/examples/out-of-cluster-client-configuration/000077500000000000000000000000001472614177300272275ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/examples/out-of-cluster-client-configuration/README.md000066400000000000000000000022331472614177300305060ustar00rootroot00000000000000# Authenticating outside the cluster This example shows you how to configure a client with client-go to authenticate to the Kubernetes API from an application running outside the Kubernetes cluster. You can use your kubeconfig file that contains the context information of your cluster to initialize a client. The kubeconfig file is also used by the `kubectl` command to authenticate to the clusters. ## Running this example Make sure your `kubectl` is configured and pointed to a cluster. Run `kubectl get nodes` to confirm. Run this application with: cd out-of-cluster-client-configuration go build -o app . ./app Running this application will use the kubeconfig file and then authenticate to the cluster, and print the number of pods in the cluster every 10 seconds: ./app There are 3 pods in the cluster There are 3 pods in the cluster There are 3 pods in the cluster ... Press Ctrl+C to quit this application. > **Note:** You can use the `-kubeconfig` option to use a different config file. By default this program picks up the default file used by kubectl (when `KUBECONFIG` environment variable is not set). kubernetes-client-go-a2dfcab/examples/out-of-cluster-client-configuration/main.go000066400000000000000000000053311472614177300305040ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Note: the example only works with the code within the same release/branch. package main import ( "context" "flag" "fmt" "path/filepath" "time" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" // // Uncomment to load all auth plugins // _ "k8s.io/client-go/plugin/pkg/client/auth" // // Or uncomment to load specific auth plugins // _ "k8s.io/client-go/plugin/pkg/client/auth/azure" // _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" ) func main() { var kubeconfig *string if home := homedir.HomeDir(); home != "" { kubeconfig = flag.String("kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file") } else { kubeconfig = flag.String("kubeconfig", "", "absolute path to the kubeconfig file") } flag.Parse() // use the current context in kubeconfig config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig) if err != nil { panic(err.Error()) } // create the clientset clientset, err := kubernetes.NewForConfig(config) if err != nil { panic(err.Error()) } for { pods, err := clientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{}) if err != nil { panic(err.Error()) } fmt.Printf("There are %d pods in the cluster\n", len(pods.Items)) // Examples for error handling: // - Use helper functions like e.g. errors.IsNotFound() // - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message namespace := "default" pod := "example-xxxxx" _, err = clientset.CoreV1().Pods(namespace).Get(context.TODO(), pod, metav1.GetOptions{}) if errors.IsNotFound(err) { fmt.Printf("Pod %s in namespace %s not found\n", pod, namespace) } else if statusError, isStatus := err.(*errors.StatusError); isStatus { fmt.Printf("Error getting pod %s in namespace %s: %v\n", pod, namespace, statusError.ErrStatus.Message) } else if err != nil { panic(err.Error()) } else { fmt.Printf("Found pod %s in namespace %s\n", pod, namespace) } time.Sleep(10 * time.Second) } } kubernetes-client-go-a2dfcab/examples/workqueue/000077500000000000000000000000001472614177300222455ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/examples/workqueue/README.md000066400000000000000000000006641472614177300235320ustar00rootroot00000000000000# Workqueue Example This example demonstrates how to write a controller which follows the states of watched resources. It demonstrates how to: * combine the workqueue with a cache to a full controller * synchronize the controller on startup The example is based on https://git.k8s.io/community/contributors/devel/sig-api-machinery/controllers.md. ## Running ``` # if outside of the cluster go run *.go -kubeconfig=/my/config ``` kubernetes-client-go-a2dfcab/examples/workqueue/main.go000066400000000000000000000155561472614177300235340ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package main import ( "flag" "fmt" "time" "k8s.io/klog/v2" v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/workqueue" ) // Controller demonstrates how to implement a controller with client-go. type Controller struct { indexer cache.Indexer queue workqueue.TypedRateLimitingInterface[string] informer cache.Controller } // NewController creates a new Controller. func NewController(queue workqueue.TypedRateLimitingInterface[string], indexer cache.Indexer, informer cache.Controller) *Controller { return &Controller{ informer: informer, indexer: indexer, queue: queue, } } func (c *Controller) processNextItem() bool { // Wait until there is a new item in the working queue key, quit := c.queue.Get() if quit { return false } // Tell the queue that we are done with processing this key. This unblocks the key for other workers // This allows safe parallel processing because two pods with the same key are never processed in // parallel. defer c.queue.Done(key) // Invoke the method containing the business logic err := c.syncToStdout(key) // Handle the error if something went wrong during the execution of the business logic c.handleErr(err, key) return true } // syncToStdout is the business logic of the controller. In this controller it simply prints // information about the pod to stdout. In case an error happened, it has to simply return the error. // The retry logic should not be part of the business logic. func (c *Controller) syncToStdout(key string) error { obj, exists, err := c.indexer.GetByKey(key) if err != nil { klog.Errorf("Fetching object with key %s from store failed with %v", key, err) return err } if !exists { // Below we will warm up our cache with a Pod, so that we will see a delete for one pod fmt.Printf("Pod %s does not exist anymore\n", key) } else { // Note that you also have to check the uid if you have a local controlled resource, which // is dependent on the actual instance, to detect that a Pod was recreated with the same name fmt.Printf("Sync/Add/Update for Pod %s\n", obj.(*v1.Pod).GetName()) } return nil } // handleErr checks if an error happened and makes sure we will retry later. func (c *Controller) handleErr(err error, key string) { if err == nil { // Forget about the #AddRateLimited history of the key on every successful synchronization. // This ensures that future processing of updates for this key is not delayed because of // an outdated error history. c.queue.Forget(key) return } // This controller retries 5 times if something goes wrong. After that, it stops trying. if c.queue.NumRequeues(key) < 5 { klog.Infof("Error syncing pod %v: %v", key, err) // Re-enqueue the key rate limited. Based on the rate limiter on the // queue and the re-enqueue history, the key will be processed later again. c.queue.AddRateLimited(key) return } c.queue.Forget(key) // Report to an external entity that, even after several retries, we could not successfully process this key runtime.HandleError(err) klog.Infof("Dropping pod %q out of the queue: %v", key, err) } // Run begins watching and syncing. func (c *Controller) Run(workers int, stopCh chan struct{}) { defer runtime.HandleCrash() // Let the workers stop when we are done defer c.queue.ShutDown() klog.Info("Starting Pod controller") go c.informer.Run(stopCh) // Wait for all involved caches to be synced, before processing items from the queue is started if !cache.WaitForCacheSync(stopCh, c.informer.HasSynced) { runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync")) return } for i := 0; i < workers; i++ { go wait.Until(c.runWorker, time.Second, stopCh) } <-stopCh klog.Info("Stopping Pod controller") } func (c *Controller) runWorker() { for c.processNextItem() { } } func main() { var kubeconfig string var master string flag.StringVar(&kubeconfig, "kubeconfig", "", "absolute path to the kubeconfig file") flag.StringVar(&master, "master", "", "master url") flag.Parse() // creates the connection config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig) if err != nil { klog.Fatal(err) } // creates the clientset clientset, err := kubernetes.NewForConfig(config) if err != nil { klog.Fatal(err) } // create the pod watcher podListWatcher := cache.NewListWatchFromClient(clientset.CoreV1().RESTClient(), "pods", v1.NamespaceDefault, fields.Everything()) // create the workqueue queue := workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()) // Bind the workqueue to a cache with the help of an informer. This way we make sure that // whenever the cache is updated, the pod key is added to the workqueue. // Note that when we finally process the item from the workqueue, we might see a newer version // of the Pod than the version which was responsible for triggering the update. indexer, informer := cache.NewIndexerInformer(podListWatcher, &v1.Pod{}, 0, cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { key, err := cache.MetaNamespaceKeyFunc(obj) if err == nil { queue.Add(key) } }, UpdateFunc: func(old interface{}, new interface{}) { key, err := cache.MetaNamespaceKeyFunc(new) if err == nil { queue.Add(key) } }, DeleteFunc: func(obj interface{}) { // IndexerInformer uses a delta queue, therefore for deletes we have to use this // key function. key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) if err == nil { queue.Add(key) } }, }, cache.Indexers{}) controller := NewController(queue, indexer, informer) // We can now warm up the cache for initial synchronization. // Let's suppose that we knew about a pod "mypod" on our last run, therefore add it to the cache. // If this pod is not there anymore, the controller will be notified about the removal after the // cache has synchronized. indexer.Add(&v1.Pod{ ObjectMeta: meta_v1.ObjectMeta{ Name: "mypod", Namespace: v1.NamespaceDefault, }, }) // Now let's start the controller stop := make(chan struct{}) defer close(stop) go controller.Run(1, stop) // Wait forever select {} } kubernetes-client-go-a2dfcab/features/000077500000000000000000000000001472614177300202165ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/features/envvar.go000066400000000000000000000144251472614177300220540ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package features import ( "fmt" "os" "strconv" "sync" "sync/atomic" "k8s.io/apimachinery/pkg/util/naming" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/klog/v2" ) // internalPackages are packages that ignored when creating a name for featureGates. These packages are in the common // call chains, so they'd be unhelpful as names. var internalPackages = []string{"k8s.io/client-go/features/envvar.go"} var _ Gates = &envVarFeatureGates{} // newEnvVarFeatureGates creates a feature gate that allows for registration // of features and checking if the features are enabled. // // On the first call to Enabled, the effective state of all known features is loaded from // environment variables. The environment variable read for a given feature is formed by // concatenating the prefix "KUBE_FEATURE_" with the feature's name. // // For example, if you have a feature named "MyFeature" // setting an environmental variable "KUBE_FEATURE_MyFeature" // will allow you to configure the state of that feature. // // Please note that environmental variables can only be set to the boolean value. // Incorrect values will be ignored and logged. // // Features can also be set directly via the Set method. // In that case, these features take precedence over // features set via environmental variables. func newEnvVarFeatureGates(features map[Feature]FeatureSpec) *envVarFeatureGates { known := map[Feature]FeatureSpec{} for name, spec := range features { known[name] = spec } fg := &envVarFeatureGates{ callSiteName: naming.GetNameFromCallsite(internalPackages...), known: known, } fg.enabledViaEnvVar.Store(map[Feature]bool{}) fg.enabledViaSetMethod = map[Feature]bool{} return fg } // envVarFeatureGates implements Gates and allows for feature registration. type envVarFeatureGates struct { // callSiteName holds the name of the file // that created this instance callSiteName string // readEnvVarsOnce guards reading environmental variables readEnvVarsOnce sync.Once // known holds known feature gates known map[Feature]FeatureSpec // enabledViaEnvVar holds a map[Feature]bool // with values explicitly set via env var enabledViaEnvVar atomic.Value // lockEnabledViaSetMethod protects enabledViaSetMethod lockEnabledViaSetMethod sync.RWMutex // enabledViaSetMethod holds values explicitly set // via Set method, features stored in this map take // precedence over features stored in enabledViaEnvVar enabledViaSetMethod map[Feature]bool // readEnvVars holds the boolean value which // indicates whether readEnvVarsOnce has been called. readEnvVars atomic.Bool } // Enabled returns true if the key is enabled. If the key is not known, this call will panic. func (f *envVarFeatureGates) Enabled(key Feature) bool { if v, ok := f.wasFeatureEnabledViaSetMethod(key); ok { // ensue that the state of all known features // is loaded from environment variables // on the first call to Enabled method. if !f.hasAlreadyReadEnvVar() { _ = f.getEnabledMapFromEnvVar() } return v } if v, ok := f.getEnabledMapFromEnvVar()[key]; ok { return v } if v, ok := f.known[key]; ok { return v.Default } panic(fmt.Errorf("feature %q is not registered in FeatureGates %q", key, f.callSiteName)) } // Set sets the given feature to the given value. // // Features set via this method take precedence over // the features set via environment variables. func (f *envVarFeatureGates) Set(featureName Feature, featureValue bool) error { feature, ok := f.known[featureName] if !ok { return fmt.Errorf("feature %q is not registered in FeatureGates %q", featureName, f.callSiteName) } if feature.LockToDefault && feature.Default != featureValue { return fmt.Errorf("cannot set feature gate %q to %v, feature is locked to %v", featureName, featureValue, feature.Default) } f.lockEnabledViaSetMethod.Lock() defer f.lockEnabledViaSetMethod.Unlock() f.enabledViaSetMethod[featureName] = featureValue return nil } // getEnabledMapFromEnvVar will fill the enabled map on the first call. // This is the only time a known feature can be set to a value // read from the corresponding environmental variable. func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool { f.readEnvVarsOnce.Do(func() { featureGatesState := map[Feature]bool{} for feature, featureSpec := range f.known { featureState, featureStateSet := os.LookupEnv(fmt.Sprintf("KUBE_FEATURE_%s", feature)) if !featureStateSet { continue } boolVal, boolErr := strconv.ParseBool(featureState) switch { case boolErr != nil: utilruntime.HandleError(fmt.Errorf("cannot set feature gate %q to %q, due to %v", feature, featureState, boolErr)) case featureSpec.LockToDefault: if boolVal != featureSpec.Default { utilruntime.HandleError(fmt.Errorf("cannot set feature gate %q to %q, feature is locked to %v", feature, featureState, featureSpec.Default)) break } featureGatesState[feature] = featureSpec.Default default: featureGatesState[feature] = boolVal } } f.enabledViaEnvVar.Store(featureGatesState) f.readEnvVars.Store(true) for feature, featureSpec := range f.known { if featureState, ok := featureGatesState[feature]; ok { klog.V(1).InfoS("Feature gate updated state", "feature", feature, "enabled", featureState) continue } klog.V(1).InfoS("Feature gate default state", "feature", feature, "enabled", featureSpec.Default) } }) return f.enabledViaEnvVar.Load().(map[Feature]bool) } func (f *envVarFeatureGates) wasFeatureEnabledViaSetMethod(key Feature) (bool, bool) { f.lockEnabledViaSetMethod.RLock() defer f.lockEnabledViaSetMethod.RUnlock() value, found := f.enabledViaSetMethod[key] return value, found } func (f *envVarFeatureGates) hasAlreadyReadEnvVar() bool { return f.readEnvVars.Load() } kubernetes-client-go-a2dfcab/features/envvar_test.go000066400000000000000000000210111472614177300231000ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package features import ( "fmt" "testing" "github.com/stretchr/testify/require" ) var defaultTestFeatures = map[Feature]FeatureSpec{ "TestAlpha": { Default: false, LockToDefault: false, PreRelease: "Alpha", }, "TestBeta": { Default: true, LockToDefault: false, PreRelease: "Beta", }, } func TestEnvVarFeatureGates(t *testing.T) { expectedDefaultFeaturesState := map[Feature]bool{"TestAlpha": false, "TestBeta": true} copyExpectedStateMap := func(toCopy map[Feature]bool) map[Feature]bool { m := map[Feature]bool{} for k, v := range toCopy { m[k] = v } return m } scenarios := []struct { name string features map[Feature]FeatureSpec envVariables map[string]string setMethodFeatures map[Feature]bool expectedFeaturesState map[Feature]bool expectedInternalEnabledViaEnvVarFeatureState map[Feature]bool expectedInternalEnabledViaSetMethodFeatureState map[Feature]bool }{ { name: "can add empty features", }, { name: "no env var, features get Defaults assigned", features: defaultTestFeatures, expectedFeaturesState: expectedDefaultFeaturesState, }, { name: "incorrect env var, feature gets Default assigned", features: defaultTestFeatures, envVariables: map[string]string{"TestAlpha": "true"}, expectedFeaturesState: expectedDefaultFeaturesState, }, { name: "correct env var changes the feature gets state", features: defaultTestFeatures, envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "true"}, expectedFeaturesState: func() map[Feature]bool { expectedDefaultFeaturesStateCopy := copyExpectedStateMap(expectedDefaultFeaturesState) expectedDefaultFeaturesStateCopy["TestAlpha"] = true return expectedDefaultFeaturesStateCopy }(), expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true}, }, { name: "incorrect env var value gets ignored", features: defaultTestFeatures, envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "TrueFalse"}, expectedFeaturesState: expectedDefaultFeaturesState, }, { name: "empty env var value gets ignored", features: defaultTestFeatures, envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": ""}, expectedFeaturesState: expectedDefaultFeaturesState, }, { name: "a feature LockToDefault wins", features: map[Feature]FeatureSpec{ "TestAlpha": { Default: true, LockToDefault: true, PreRelease: "Alpha", }, }, envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "False"}, expectedFeaturesState: map[Feature]bool{"TestAlpha": true}, }, { name: "setting a feature to LockToDefault changes the internal state", features: map[Feature]FeatureSpec{ "TestAlpha": { Default: true, LockToDefault: true, PreRelease: "Alpha", }, }, envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"}, expectedFeaturesState: map[Feature]bool{"TestAlpha": true}, expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true}, }, { name: "setting a feature via the Set method works", features: defaultTestFeatures, setMethodFeatures: map[Feature]bool{"TestAlpha": true}, expectedFeaturesState: map[Feature]bool{"TestAlpha": true}, expectedInternalEnabledViaSetMethodFeatureState: map[Feature]bool{"TestAlpha": true}, }, { name: "setting a feature via the Set method wins", features: defaultTestFeatures, setMethodFeatures: map[Feature]bool{"TestAlpha": false}, envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"}, expectedFeaturesState: map[Feature]bool{"TestAlpha": false}, expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true}, expectedInternalEnabledViaSetMethodFeatureState: map[Feature]bool{"TestAlpha": false}, }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { for k, v := range scenario.envVariables { t.Setenv(k, v) } target := newEnvVarFeatureGates(scenario.features) for k, v := range scenario.setMethodFeatures { err := target.Set(k, v) require.NoError(t, err) } for expectedFeature, expectedValue := range scenario.expectedFeaturesState { actualValue := target.Enabled(expectedFeature) require.Equal(t, actualValue, expectedValue, "expected feature=%v, to be=%v, not=%v", expectedFeature, expectedValue, actualValue) } enabledViaEnvVarInternalMap := target.enabledViaEnvVar.Load().(map[Feature]bool) require.Len(t, enabledViaEnvVarInternalMap, len(scenario.expectedInternalEnabledViaEnvVarFeatureState)) for expectedFeatureName, expectedFeatureValue := range scenario.expectedInternalEnabledViaEnvVarFeatureState { actualFeatureValue, wasExpectedFeatureFound := enabledViaEnvVarInternalMap[expectedFeatureName] if !wasExpectedFeatureFound { t.Errorf("feature %v has not been found in enabledViaEnvVarInternalMap", expectedFeatureName) } require.Equal(t, expectedFeatureValue, actualFeatureValue, "feature %v has incorrect value = %v, expected = %v", expectedFeatureName, actualFeatureValue, expectedFeatureValue) } enabledViaSetMethodInternalMap := target.enabledViaSetMethod require.Len(t, enabledViaSetMethodInternalMap, len(scenario.expectedInternalEnabledViaSetMethodFeatureState)) for expectedFeatureName, expectedFeatureValue := range scenario.expectedInternalEnabledViaSetMethodFeatureState { actualFeatureValue, wasExpectedFeatureFound := enabledViaSetMethodInternalMap[expectedFeatureName] if !wasExpectedFeatureFound { t.Errorf("feature %v has not been found in enabledViaSetMethod", expectedFeatureName) } require.Equal(t, expectedFeatureValue, actualFeatureValue, "feature %v has incorrect value = %v, expected = %v", expectedFeatureName, actualFeatureValue, expectedFeatureValue) } }) } } func TestEnvVarFeatureGatesEnabledPanic(t *testing.T) { target := newEnvVarFeatureGates(nil) require.PanicsWithError(t, fmt.Errorf("feature %q is not registered in FeatureGates %q", "UnknownFeature", target.callSiteName).Error(), func() { target.Enabled("UnknownFeature") }) } func TestHasAlreadyReadEnvVar(t *testing.T) { target := newEnvVarFeatureGates(nil) require.False(t, target.hasAlreadyReadEnvVar()) _ = target.getEnabledMapFromEnvVar() require.True(t, target.hasAlreadyReadEnvVar()) } func TestEnvVarFeatureGatesSetNegative(t *testing.T) { scenarios := []struct { name string features map[Feature]FeatureSpec featureName Feature featureValue bool expectedErr func(string) error }{ { name: "empty feature name returns an error", features: defaultTestFeatures, expectedErr: func(callSiteName string) error { return fmt.Errorf("feature %q is not registered in FeatureGates %q", "", callSiteName) }, }, { name: "setting unknown feature returns an error", features: defaultTestFeatures, featureName: "Unknown", expectedErr: func(callSiteName string) error { return fmt.Errorf("feature %q is not registered in FeatureGates %q", "Unknown", callSiteName) }, }, { name: "setting locked feature returns an error", features: map[Feature]FeatureSpec{"LockedFeature": {LockToDefault: true, Default: true}}, featureName: "LockedFeature", featureValue: false, expectedErr: func(_ string) error { return fmt.Errorf("cannot set feature gate %q to %v, feature is locked to %v", "LockedFeature", false, true) }, }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { target := newEnvVarFeatureGates(scenario.features) err := target.Set(scenario.featureName, scenario.featureValue) require.Equal(t, scenario.expectedErr(target.callSiteName), err) }) } } kubernetes-client-go-a2dfcab/features/features.go000066400000000000000000000115321472614177300223650ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package features import ( "errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "sync/atomic" ) // NOTE: types Feature, FeatureSpec, prerelease (and its values) // were duplicated from the component-base repository // // for more information please refer to https://docs.google.com/document/d/1g9BGCRw-7ucUxO6OtCWbb3lfzUGA_uU9178wLdXAIfs const ( // Values for PreRelease. Alpha = prerelease("ALPHA") Beta = prerelease("BETA") GA = prerelease("") // Deprecated Deprecated = prerelease("DEPRECATED") ) type prerelease string type Feature string type FeatureSpec struct { // Default is the default enablement state for the feature Default bool // LockToDefault indicates that the feature is locked to its default and cannot be changed LockToDefault bool // PreRelease indicates the maturity level of the feature PreRelease prerelease } // Gates indicates whether a given feature is enabled or not. type Gates interface { // Enabled returns true if the key is enabled. Enabled(key Feature) bool } // Registry represents an external feature gates registry. type Registry interface { // Add adds existing feature gates to the provided registry. // // As of today, this method is used by AddFeaturesToExistingFeatureGates and // ReplaceFeatureGates to take control of the features exposed by this library. Add(map[Feature]FeatureSpec) error } // FeatureGates returns the feature gates exposed by this library. // // By default, only the default features gates will be returned. // The default implementation allows controlling the features // via environmental variables. // For example, if you have a feature named "MyFeature" // setting an environmental variable "KUBE_FEATURE_MyFeature" // will allow you to configure the state of that feature. // // Please note that the actual set of the feature gates // might be overwritten by calling ReplaceFeatureGates method. func FeatureGates() Gates { return featureGates.Load().(*featureGatesWrapper).Gates } // AddFeaturesToExistingFeatureGates adds the default feature gates to the provided registry. // Usually this function is combined with ReplaceFeatureGates to take control of the // features exposed by this library. func AddFeaturesToExistingFeatureGates(registry Registry) error { return registry.Add(defaultKubernetesFeatureGates) } // ReplaceFeatureGates overwrites the default implementation of the feature gates // used by this library. // // Useful for binaries that would like to have full control of the features // exposed by this library, such as allowing consumers of a binary // to interact with the features via a command line flag. // // For example: // // // first, register client-go's features to your registry. // clientgofeaturegate.AddFeaturesToExistingFeatureGates(utilfeature.DefaultMutableFeatureGate) // // then replace client-go's feature gates implementation with your implementation // clientgofeaturegate.ReplaceFeatureGates(utilfeature.DefaultMutableFeatureGate) func ReplaceFeatureGates(newFeatureGates Gates) { if replaceFeatureGatesWithWarningIndicator(newFeatureGates) { utilruntime.HandleError(errors.New("the default feature gates implementation has already been used and now it's being overwritten. This might lead to unexpected behaviour. Check your initialization order")) } } func replaceFeatureGatesWithWarningIndicator(newFeatureGates Gates) bool { shouldProduceWarning := false if defaultFeatureGates, ok := FeatureGates().(*envVarFeatureGates); ok { if defaultFeatureGates.hasAlreadyReadEnvVar() { shouldProduceWarning = true } } wrappedFeatureGates := &featureGatesWrapper{newFeatureGates} featureGates.Store(wrappedFeatureGates) return shouldProduceWarning } func init() { envVarGates := newEnvVarFeatureGates(defaultKubernetesFeatureGates) wrappedFeatureGates := &featureGatesWrapper{envVarGates} featureGates.Store(wrappedFeatureGates) } // featureGatesWrapper a thin wrapper to satisfy featureGates variable (atomic.Value). // That is, all calls to Store for a given Value must use values of the same concrete type. type featureGatesWrapper struct { Gates } var ( // featureGates is a shared global FeatureGates. // // Top-level commands/options setup that needs to modify this feature gates // should use AddFeaturesToExistingFeatureGates followed by ReplaceFeatureGates. featureGates = &atomic.Value{} ) kubernetes-client-go-a2dfcab/features/features_test.go000066400000000000000000000030651472614177300234260ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package features import ( "testing" "github.com/stretchr/testify/require" ) // TestAddFeaturesToExistingFeatureGates ensures that // the defaultKubernetesFeatureGates are added to a test feature gates registry. func TestAddFeaturesToExistingFeatureGates(t *testing.T) { fakeFeatureGates := &fakeRegistry{} require.NoError(t, AddFeaturesToExistingFeatureGates(fakeFeatureGates)) require.Equal(t, defaultKubernetesFeatureGates, fakeFeatureGates.specs) } func TestReplaceFeatureGatesWithWarningIndicator(t *testing.T) { defaultFeatureGates := FeatureGates() require.Panics(t, func() { defaultFeatureGates.Enabled("Foo") }, "reading an unregistered feature gate Foo should panic") if !replaceFeatureGatesWithWarningIndicator(defaultFeatureGates) { t.Error("replacing the default feature gates after reading a value hasn't produced a warning") } } type fakeRegistry struct { specs map[Feature]FeatureSpec } func (f *fakeRegistry) Add(specs map[Feature]FeatureSpec) error { f.specs = specs return nil } kubernetes-client-go-a2dfcab/features/known_features.go000066400000000000000000000036361472614177300236070ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package features const ( // Every feature gate should add method here following this template: // // // owner: @username // // alpha: v1.4 // MyFeature featuregate.Feature = "MyFeature" // // Feature gates should be listed in alphabetical, case-sensitive // (upper before any lower case character) order. This reduces the risk // of code conflicts because changes are more likely to be scattered // across the file. // owner: @p0lyn0mial // beta: v1.30 // // Allow the client to get a stream of individual items instead of chunking from the server. // // NOTE: // The feature is disabled in Beta by default because // it will only be turned on for selected control plane component(s). WatchListClient Feature = "WatchListClient" // owner: @nilekhc // alpha: v1.30 InformerResourceVersion Feature = "InformerResourceVersion" ) // defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. // // To add a new feature, define a key for it above and add it here. // After registering with the binary, the features are, by default, controllable using environment variables. // For more details, please see envVarFeatureGates implementation. var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{ WatchListClient: {Default: false, PreRelease: Beta}, InformerResourceVersion: {Default: false, PreRelease: Alpha}, } kubernetes-client-go-a2dfcab/features/testing/000077500000000000000000000000001472614177300216735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/features/testing/features.go000066400000000000000000000053651472614177300240510ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "fmt" "strings" "sync" "testing" clientfeatures "k8s.io/client-go/features" ) var ( overriddenFeaturesLock sync.Mutex overriddenFeatures map[clientfeatures.Feature]string ) func init() { overriddenFeatures = map[clientfeatures.Feature]string{} } type featureGatesSetter interface { clientfeatures.Gates Set(clientfeatures.Feature, bool) error } // SetFeatureDuringTest sets the specified feature to the specified value for the duration of the test. // // Example use: // // clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, true) func SetFeatureDuringTest(tb testing.TB, feature clientfeatures.Feature, featureValue bool) { if err := setFeatureDuringTestInternal(tb, feature, featureValue); err != nil { tb.Fatal(err) } } func setFeatureDuringTestInternal(tb testing.TB, feature clientfeatures.Feature, featureValue bool) error { overriddenFeaturesLock.Lock() defer overriddenFeaturesLock.Unlock() currentFeatureGates := clientfeatures.FeatureGates() featureGates, ok := currentFeatureGates.(featureGatesSetter) if !ok { panic(fmt.Errorf("clientfeatures.FeatureGates(): %T does not implement featureGatesSetter interface", currentFeatureGates)) } originalFeatureValue := featureGates.Enabled(feature) if overridingTestName, ok := overriddenFeatures[feature]; ok { if !sameTestOrSubtest(tb, overridingTestName) { return fmt.Errorf("client-go feature %q is currently overridden by %q test and cannot be also modified by %q", feature, overridingTestName, tb.Name()) } } if err := featureGates.Set(feature, featureValue); err != nil { return err } overriddenFeatures[feature] = tb.Name() tb.Cleanup(func() { overriddenFeaturesLock.Lock() defer overriddenFeaturesLock.Unlock() delete(overriddenFeatures, feature) if err := featureGates.Set(feature, originalFeatureValue); err != nil { tb.Errorf("failed restoring client-go feature: %v to its original value: %v, err: %v", feature, originalFeatureValue, err) } }) return nil } // copied from component-base/featuregate/testing func sameTestOrSubtest(tb testing.TB, testName string) bool { return tb.Name() == testName || strings.HasPrefix(tb.Name(), testName+"/") } kubernetes-client-go-a2dfcab/features/testing/features_init_test.go000066400000000000000000000127631472614177300261330ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "fmt" "strings" "testing" "github.com/stretchr/testify/require" "k8s.io/client-go/features" ) func TestDriveInitDefaultFeatureGates(t *testing.T) { featureGates := features.FeatureGates() assertFunctionPanicsWithMessage(t, func() { featureGates.Enabled("FakeFeatureGate") }, "features.FeatureGates().Enabled", fmt.Sprintf("feature %q is not registered in FeatureGate", "FakeFeatureGate")) fakeGates := &fakeFeatureGates{features: map[features.Feature]bool{"FakeFeatureGate": true}} require.True(t, fakeGates.Enabled("FakeFeatureGate")) features.ReplaceFeatureGates(fakeGates) featureGates = features.FeatureGates() assertFeatureGatesType(t, featureGates) require.True(t, featureGates.Enabled("FakeFeatureGate")) } func TestSetFeatureGatesDuringTest(t *testing.T) { featureA := features.Feature("FeatureA") featureB := features.Feature("FeatureB") fakeGates := &fakeFeatureGates{map[features.Feature]bool{featureA: true, featureB: true}} features.ReplaceFeatureGates(fakeGates) t.Cleanup(func() { // since cleanup functions will be called in last added, first called order. // check if the original feature wasn't restored require.True(t, features.FeatureGates().Enabled(featureA), "the original feature = %v wasn't restored", featureA) }) SetFeatureDuringTest(t, featureA, false) require.False(t, features.FeatureGates().Enabled(featureA)) require.True(t, features.FeatureGates().Enabled(featureB)) } func TestSetFeatureGatesDuringTestPanics(t *testing.T) { fakeGates := &fakeFeatureGates{features: map[features.Feature]bool{"FakeFeatureGate": true}} features.ReplaceFeatureGates(fakeGates) assertFunctionPanicsWithMessage(t, func() { SetFeatureDuringTest(t, "UnknownFeature", false) }, "SetFeatureDuringTest", fmt.Sprintf("feature %q is not registered in featureGates", "UnknownFeature")) readOnlyGates := &readOnlyAlwaysDisabledFeatureGates{} features.ReplaceFeatureGates(readOnlyGates) assertFunctionPanicsWithMessage(t, func() { SetFeatureDuringTest(t, "FakeFeature", false) }, "SetFeatureDuringTest", fmt.Sprintf("clientfeatures.FeatureGates(): %T does not implement featureGatesSetter interface", readOnlyGates)) } func TestOverridesForSetFeatureGatesDuringTest(t *testing.T) { scenarios := []struct { name string firstTestName string secondTestName string expectError bool }{ { name: "concurrent tests setting the same feature fail", firstTestName: "fooTest", secondTestName: "barTest", expectError: true, }, { name: "same test setting the same feature does not fail", firstTestName: "fooTest", secondTestName: "fooTest", expectError: false, }, { name: "subtests setting the same feature don't not fail", firstTestName: "fooTest", secondTestName: "fooTest/scenario1", expectError: false, }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { featureA := features.Feature("FeatureA") fakeGates := &fakeFeatureGates{map[features.Feature]bool{featureA: true}} fakeTesting := &fakeT{fakeTestName: scenario.firstTestName, TB: t} features.ReplaceFeatureGates(fakeGates) require.NoError(t, setFeatureDuringTestInternal(fakeTesting, featureA, true)) require.True(t, features.FeatureGates().Enabled(featureA)) fakeTesting.fakeTestName = scenario.secondTestName err := setFeatureDuringTestInternal(fakeTesting, featureA, false) require.Equal(t, scenario.expectError, err != nil) }) } } type fakeFeatureGates struct { features map[features.Feature]bool } func (f *fakeFeatureGates) Enabled(feature features.Feature) bool { featureValue, ok := f.features[feature] if !ok { panic(fmt.Errorf("feature %q is not registered in featureGates", feature)) } return featureValue } func (f *fakeFeatureGates) Set(feature features.Feature, value bool) error { f.features[feature] = value return nil } type readOnlyAlwaysDisabledFeatureGates struct{} func (f *readOnlyAlwaysDisabledFeatureGates) Enabled(feature features.Feature) bool { return false } type fakeT struct { fakeTestName string testing.TB } func (t *fakeT) Name() string { return t.fakeTestName } func assertFeatureGatesType(t *testing.T, fg features.Gates) { _, ok := fg.(*fakeFeatureGates) if !ok { t.Fatalf("passed features.FeatureGates() is NOT of type *alwaysEnabledFakeGates, it is of type = %T", fg) } } func assertFunctionPanicsWithMessage(t *testing.T, f func(), fName, errMessage string) { didPanic, panicMessage := didFunctionPanic(f) if !didPanic { t.Fatalf("function %q did not panicked", fName) } panicError, ok := panicMessage.(error) if !ok || !strings.Contains(panicError.Error(), errMessage) { t.Fatalf("func %q should panic with error message:\t%#v\n\tPanic value:\t%#v\n", fName, errMessage, panicMessage) } } func didFunctionPanic(f func()) (didPanic bool, panicMessage interface{}) { didPanic = true defer func() { panicMessage = recover() }() f() didPanic = false return } kubernetes-client-go-a2dfcab/gentype/000077500000000000000000000000001472614177300200535ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/gentype/type.go000066400000000000000000000304521472614177300213670ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package gentype import ( "context" json "encoding/json" "fmt" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" "k8s.io/client-go/util/consistencydetector" "k8s.io/client-go/util/watchlist" "k8s.io/klog/v2" ) // objectWithMeta matches objects implementing both runtime.Object and metav1.Object. type objectWithMeta interface { runtime.Object metav1.Object } // namedObject matches comparable objects implementing GetName(); it is intended for use with apply declarative configurations. type namedObject interface { comparable GetName() *string } // Client represents a client, optionally namespaced, with no support for lists or apply declarative configurations. type Client[T objectWithMeta] struct { resource string client rest.Interface namespace string // "" for non-namespaced clients newObject func() T parameterCodec runtime.ParameterCodec } // ClientWithList represents a client with support for lists. type ClientWithList[T objectWithMeta, L runtime.Object] struct { *Client[T] alsoLister[T, L] } // ClientWithApply represents a client with support for apply declarative configurations. type ClientWithApply[T objectWithMeta, C namedObject] struct { *Client[T] alsoApplier[T, C] } // ClientWithListAndApply represents a client with support for lists and apply declarative configurations. type ClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject] struct { *Client[T] alsoLister[T, L] alsoApplier[T, C] } // Helper types for composition type alsoLister[T objectWithMeta, L runtime.Object] struct { client *Client[T] newList func() L } type alsoApplier[T objectWithMeta, C namedObject] struct { client *Client[T] } // NewClient constructs a client, namespaced or not, with no support for lists or apply. // Non-namespaced clients are constructed by passing an empty namespace (""). func NewClient[T objectWithMeta]( resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, ) *Client[T] { return &Client[T]{ resource: resource, client: client, parameterCodec: parameterCodec, namespace: namespace, newObject: emptyObjectCreator, } } // NewClientWithList constructs a namespaced client with support for lists. func NewClientWithList[T objectWithMeta, L runtime.Object]( resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, emptyListCreator func() L, ) *ClientWithList[T, L] { typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator) return &ClientWithList[T, L]{ typeClient, alsoLister[T, L]{typeClient, emptyListCreator}, } } // NewClientWithApply constructs a namespaced client with support for apply declarative configurations. func NewClientWithApply[T objectWithMeta, C namedObject]( resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, ) *ClientWithApply[T, C] { typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator) return &ClientWithApply[T, C]{ typeClient, alsoApplier[T, C]{typeClient}, } } // NewClientWithListAndApply constructs a client with support for lists and applying declarative configurations. func NewClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject]( resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, emptyListCreator func() L, ) *ClientWithListAndApply[T, L, C] { typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator) return &ClientWithListAndApply[T, L, C]{ typeClient, alsoLister[T, L]{typeClient, emptyListCreator}, alsoApplier[T, C]{typeClient}, } } // GetClient returns the REST interface. func (c *Client[T]) GetClient() rest.Interface { return c.client } // GetNamespace returns the client's namespace, if any. func (c *Client[T]) GetNamespace() string { return c.namespace } // Get takes name of the resource, and returns the corresponding object, and an error if there is any. func (c *Client[T]) Get(ctx context.Context, name string, options metav1.GetOptions) (T, error) { result := c.newObject() err := c.client.Get(). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(c.resource). Name(name). VersionedParams(&options, c.parameterCodec). Do(ctx). Into(result) return result, err } // List takes label and field selectors, and returns the list of resources that match those selectors. func (l *alsoLister[T, L]) List(ctx context.Context, opts metav1.ListOptions) (L, error) { if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { klog.Warningf("Failed preparing watchlist options for $.type|resource$, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) } else if hasWatchListOptionsPrepared { result, err := l.watchList(ctx, watchListOptions) if err == nil { consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for "+l.client.resource, l.list, opts, result) return result, nil } klog.Warningf("The watchlist request for %s ended with an error, falling back to the standard LIST semantics, err = %v", l.client.resource, err) } result, err := l.list(ctx, opts) if err == nil { consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for "+l.client.resource, l.list, opts, result) } return result, err } func (l *alsoLister[T, L]) list(ctx context.Context, opts metav1.ListOptions) (L, error) { list := l.newList() var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } err := l.client.client.Get(). NamespaceIfScoped(l.client.namespace, l.client.namespace != ""). Resource(l.client.resource). VersionedParams(&opts, l.client.parameterCodec). Timeout(timeout). Do(ctx). Into(list) return list, err } // watchList establishes a watch stream with the server and returns the list of resources. func (l *alsoLister[T, L]) watchList(ctx context.Context, opts metav1.ListOptions) (result L, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } result = l.newList() err = l.client.client.Get(). NamespaceIfScoped(l.client.namespace, l.client.namespace != ""). Resource(l.client.resource). VersionedParams(&opts, l.client.parameterCodec). Timeout(timeout). WatchList(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested resources. func (c *Client[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } opts.Watch = true return c.client.Get(). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(c.resource). VersionedParams(&opts, c.parameterCodec). Timeout(timeout). Watch(ctx) } // Create takes the representation of a resource and creates it. Returns the server's representation of the resource, and an error, if there is any. func (c *Client[T]) Create(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error) { result := c.newObject() err := c.client.Post(). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(c.resource). VersionedParams(&opts, c.parameterCodec). Body(obj). Do(ctx). Into(result) return result, err } // Update takes the representation of a resource and updates it. Returns the server's representation of the resource, and an error, if there is any. func (c *Client[T]) Update(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error) { result := c.newObject() err := c.client.Put(). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(c.resource). Name(obj.GetName()). VersionedParams(&opts, c.parameterCodec). Body(obj). Do(ctx). Into(result) return result, err } // UpdateStatus updates the status subresource of a resource. Returns the server's representation of the resource, and an error, if there is any. func (c *Client[T]) UpdateStatus(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error) { result := c.newObject() err := c.client.Put(). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(c.resource). Name(obj.GetName()). SubResource("status"). VersionedParams(&opts, c.parameterCodec). Body(obj). Do(ctx). Into(result) return result, err } // Delete takes name of the resource and deletes it. Returns an error if one occurs. func (c *Client[T]) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(c.resource). Name(name). Body(&opts). Do(ctx). Error() } // DeleteCollection deletes a collection of objects. func (l *alsoLister[T, L]) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration if listOpts.TimeoutSeconds != nil { timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return l.client.client.Delete(). NamespaceIfScoped(l.client.namespace, l.client.namespace != ""). Resource(l.client.resource). VersionedParams(&listOpts, l.client.parameterCodec). Timeout(timeout). Body(&opts). Do(ctx). Error() } // Patch applies the patch and returns the patched resource. func (c *Client[T]) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (T, error) { result := c.newObject() err := c.client.Patch(pt). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(c.resource). Name(name). SubResource(subresources...). VersionedParams(&opts, c.parameterCodec). Body(data). Do(ctx). Into(result) return result, err } // Apply takes the given apply declarative configuration, applies it and returns the applied resource. func (a *alsoApplier[T, C]) Apply(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error) { result := a.client.newObject() if obj == *new(C) { return *new(T), fmt.Errorf("object provided to Apply must not be nil") } patchOpts := opts.ToPatchOptions() data, err := json.Marshal(obj) if err != nil { return *new(T), err } if obj.GetName() == nil { return *new(T), fmt.Errorf("obj.Name must be provided to Apply") } err = a.client.client.Patch(types.ApplyPatchType). NamespaceIfScoped(a.client.namespace, a.client.namespace != ""). Resource(a.client.resource). Name(*obj.GetName()). VersionedParams(&patchOpts, a.client.parameterCodec). Body(data). Do(ctx). Into(result) return result, err } // Apply takes the given apply declarative configuration, applies it to the status subresource and returns the applied resource. func (a *alsoApplier[T, C]) ApplyStatus(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error) { if obj == *new(C) { return *new(T), fmt.Errorf("object provided to Apply must not be nil") } patchOpts := opts.ToPatchOptions() data, err := json.Marshal(obj) if err != nil { return *new(T), err } if obj.GetName() == nil { return *new(T), fmt.Errorf("obj.Name must be provided to Apply") } result := a.client.newObject() err = a.client.client.Patch(types.ApplyPatchType). NamespaceIfScoped(a.client.namespace, a.client.namespace != ""). Resource(a.client.resource). Name(*obj.GetName()). SubResource("status"). VersionedParams(&patchOpts, a.client.parameterCodec). Body(data). Do(ctx). Into(result) return result, err } kubernetes-client-go-a2dfcab/go.mod000066400000000000000000000051311472614177300175060ustar00rootroot00000000000000// This is a generated file. Do not edit directly. module k8s.io/client-go go 1.22.0 require ( github.com/gogo/protobuf v1.3.2 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da github.com/golang/protobuf v1.5.4 github.com/google/gnostic-models v0.6.8 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.0 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 github.com/imdario/mergo v0.3.6 github.com/peterbourgon/diskv v2.0.1+incompatible github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 go.uber.org/goleak v1.3.0 golang.org/x/net v0.26.0 golang.org/x/oauth2 v0.21.0 golang.org/x/term v0.21.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 k8s.io/api v0.31.4 k8s.io/apimachinery v0.31.4 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd sigs.k8s.io/structured-merge-diff/v4 v4.4.1 sigs.k8s.io/yaml v1.4.0 ) require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.4 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/btree v1.0.1 // indirect github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/moby/spdystream v0.4.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/onsi/ginkgo/v2 v2.19.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/x448/float16 v0.8.4 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) kubernetes-client-go-a2dfcab/go.sum000066400000000000000000000372071472614177300175440ustar00rootroot00000000000000github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/api v0.31.4 h1:I2QNzitPVsPeLQvexMEsj945QumYraqv9m74isPDKhM= k8s.io/api v0.31.4/go.mod h1:d+7vgXLvmcdT1BCo79VEgJxHHryww3V5np2OYTr6jdw= k8s.io/apimachinery v0.31.4 h1:8xjE2C4CzhYVm9DGf60yohpNUh5AEBnPxCryPBECmlM= k8s.io/apimachinery v0.31.4/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= kubernetes-client-go-a2dfcab/informers/000077500000000000000000000000001472614177300204045ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/admissionregistration/000077500000000000000000000000001472614177300250255ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/admissionregistration/interface.go000066400000000000000000000042101472614177300273110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package admissionregistration import ( v1 "k8s.io/client-go/informers/admissionregistration/v1" v1alpha1 "k8s.io/client-go/informers/admissionregistration/v1alpha1" v1beta1 "k8s.io/client-go/informers/admissionregistration/v1beta1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1/000077500000000000000000000000001472614177300253535ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/admissionregistration/v1/interface.go000066400000000000000000000056521472614177300276520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer { return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer { return &validatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer { return &validatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer { return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1/mutatingwebhookconfiguration.go000066400000000000000000000075111472614177300337050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/admissionregistration/v1" cache "k8s.io/client-go/tools/cache" ) // MutatingWebhookConfigurationInformer provides access to a shared informer and lister for // MutatingWebhookConfigurations. type MutatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1.MutatingWebhookConfigurationLister } type mutatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(context.TODO(), options) }, }, &admissionregistrationv1.MutatingWebhookConfiguration{}, resyncPeriod, indexers, ) } func (f *mutatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *mutatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1.MutatingWebhookConfiguration{}, f.defaultInformer) } func (f *mutatingWebhookConfigurationInformer) Lister() v1.MutatingWebhookConfigurationLister { return v1.NewMutatingWebhookConfigurationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1/validatingadmissionpolicy.go000066400000000000000000000074121472614177300331570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/admissionregistration/v1" cache "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for // ValidatingAdmissionPolicies. type ValidatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ValidatingAdmissionPolicyLister } type validatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, indexers, nil) } // NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) }, }, &admissionregistrationv1.ValidatingAdmissionPolicy{}, resyncPeriod, indexers, ) } func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1.ValidatingAdmissionPolicy{}, f.defaultInformer) } func (f *validatingAdmissionPolicyInformer) Lister() v1.ValidatingAdmissionPolicyLister { return v1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1/validatingadmissionpolicybinding.go000066400000000000000000000076411472614177300345160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/admissionregistration/v1" cache "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for // ValidatingAdmissionPolicyBindings. type ValidatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ValidatingAdmissionPolicyBindingLister } type validatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, indexers, nil) } // NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) }, }, &admissionregistrationv1.ValidatingAdmissionPolicyBinding{}, resyncPeriod, indexers, ) } func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) } func (f *validatingAdmissionPolicyBindingInformer) Lister() v1.ValidatingAdmissionPolicyBindingLister { return v1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1/validatingwebhookconfiguration.go000066400000000000000000000075651472614177300342100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/admissionregistration/v1" cache "k8s.io/client-go/tools/cache" ) // ValidatingWebhookConfigurationInformer provides access to a shared informer and lister for // ValidatingWebhookConfigurations. type ValidatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ValidatingWebhookConfigurationLister } type validatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredValidatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(context.TODO(), options) }, }, &admissionregistrationv1.ValidatingWebhookConfiguration{}, resyncPeriod, indexers, ) } func (f *validatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredValidatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *validatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1.ValidatingWebhookConfiguration{}, f.defaultInformer) } func (f *validatingWebhookConfigurationInformer) Lister() v1.ValidatingWebhookConfigurationLister { return v1.NewValidatingWebhookConfigurationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1alpha1/000077500000000000000000000000001472614177300264425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/admissionregistration/v1alpha1/interface.go000066400000000000000000000041041472614177300307300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer { return &validatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer { return &validatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go000066400000000000000000000075061472614177300342520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/admissionregistration/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for // ValidatingAdmissionPolicies. type ValidatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.ValidatingAdmissionPolicyLister } type validatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, indexers, nil) } // NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicies().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) }, }, &admissionregistrationv1alpha1.ValidatingAdmissionPolicy{}, resyncPeriod, indexers, ) } func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1alpha1.ValidatingAdmissionPolicy{}, f.defaultInformer) } func (f *validatingAdmissionPolicyInformer) Lister() v1alpha1.ValidatingAdmissionPolicyLister { return v1alpha1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer()) } validatingadmissionpolicybinding.go000066400000000000000000000077351472614177300355320ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/admissionregistration/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for // ValidatingAdmissionPolicyBindings. type ValidatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.ValidatingAdmissionPolicyBindingLister } type validatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, indexers, nil) } // NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) }, }, &admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding{}, resyncPeriod, indexers, ) } func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) } func (f *validatingAdmissionPolicyBindingInformer) Lister() v1alpha1.ValidatingAdmissionPolicyBindingLister { return v1alpha1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1beta1/000077500000000000000000000000001472614177300262705ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/admissionregistration/v1beta1/interface.go000066400000000000000000000056571472614177300305740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer { return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer { return &validatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer { return &validatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer { return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go000066400000000000000000000075711472614177300346300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" cache "k8s.io/client-go/tools/cache" ) // MutatingWebhookConfigurationInformer provides access to a shared informer and lister for // MutatingWebhookConfigurations. type MutatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.MutatingWebhookConfigurationLister } type mutatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(context.TODO(), options) }, }, &admissionregistrationv1beta1.MutatingWebhookConfiguration{}, resyncPeriod, indexers, ) } func (f *mutatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *mutatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1beta1.MutatingWebhookConfiguration{}, f.defaultInformer) } func (f *mutatingWebhookConfigurationInformer) Lister() v1beta1.MutatingWebhookConfigurationLister { return v1beta1.NewMutatingWebhookConfigurationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go000066400000000000000000000074721472614177300341020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" cache "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for // ValidatingAdmissionPolicies. type ValidatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.ValidatingAdmissionPolicyLister } type validatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, indexers, nil) } // NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) }, }, &admissionregistrationv1beta1.ValidatingAdmissionPolicy{}, resyncPeriod, indexers, ) } func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1beta1.ValidatingAdmissionPolicy{}, f.defaultInformer) } func (f *validatingAdmissionPolicyInformer) Lister() v1beta1.ValidatingAdmissionPolicyLister { return v1beta1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer()) } validatingadmissionpolicybinding.go000066400000000000000000000077211472614177300353530ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" cache "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for // ValidatingAdmissionPolicyBindings. type ValidatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.ValidatingAdmissionPolicyBindingLister } type validatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, indexers, nil) } // NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) }, }, &admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding{}, resyncPeriod, indexers, ) } func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) } func (f *validatingAdmissionPolicyBindingInformer) Lister() v1beta1.ValidatingAdmissionPolicyBindingLister { return v1beta1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } validatingwebhookconfiguration.go000066400000000000000000000076451472614177300350450ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" cache "k8s.io/client-go/tools/cache" ) // ValidatingWebhookConfigurationInformer provides access to a shared informer and lister for // ValidatingWebhookConfigurations. type ValidatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.ValidatingWebhookConfigurationLister } type validatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredValidatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(context.TODO(), options) }, }, &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}, resyncPeriod, indexers, ) } func (f *validatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredValidatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *validatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&admissionregistrationv1beta1.ValidatingWebhookConfiguration{}, f.defaultInformer) } func (f *validatingWebhookConfigurationInformer) Lister() v1beta1.ValidatingWebhookConfigurationLister { return v1beta1.NewValidatingWebhookConfigurationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apiserverinternal/000077500000000000000000000000001472614177300241415ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/apiserverinternal/interface.go000066400000000000000000000030471472614177300264340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package apiserverinternal import ( v1alpha1 "k8s.io/client-go/informers/apiserverinternal/v1alpha1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/apiserverinternal/v1alpha1/000077500000000000000000000000001472614177300255565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/apiserverinternal/v1alpha1/interface.go000066400000000000000000000030141472614177300300430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // StorageVersions returns a StorageVersionInformer. StorageVersions() StorageVersionInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // StorageVersions returns a StorageVersionInformer. func (v *version) StorageVersions() StorageVersionInformer { return &storageVersionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/apiserverinternal/v1alpha1/storageversion.go000066400000000000000000000070431472614177300311630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" apiserverinternalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/apiserverinternal/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // StorageVersionInformer provides access to a shared informer and lister for // StorageVersions. type StorageVersionInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.StorageVersionLister } type storageVersionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewStorageVersionInformer constructs a new informer for StorageVersion type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewStorageVersionInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredStorageVersionInformer(client, resyncPeriod, indexers, nil) } // NewFilteredStorageVersionInformer constructs a new informer for StorageVersion type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredStorageVersionInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.InternalV1alpha1().StorageVersions().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.InternalV1alpha1().StorageVersions().Watch(context.TODO(), options) }, }, &apiserverinternalv1alpha1.StorageVersion{}, resyncPeriod, indexers, ) } func (f *storageVersionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredStorageVersionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *storageVersionInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&apiserverinternalv1alpha1.StorageVersion{}, f.defaultInformer) } func (f *storageVersionInformer) Lister() v1alpha1.StorageVersionLister { return v1alpha1.NewStorageVersionLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/000077500000000000000000000000001472614177300213475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/apps/interface.go000066400000000000000000000040711472614177300236400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package apps import ( v1 "k8s.io/client-go/informers/apps/v1" v1beta1 "k8s.io/client-go/informers/apps/v1beta1" v1beta2 "k8s.io/client-go/informers/apps/v1beta2" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface // V1beta2 provides access to shared informers for resources in V1beta2. V1beta2() v1beta2.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta2 returns a new v1beta2.Interface. func (g *group) V1beta2() v1beta2.Interface { return v1beta2.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/apps/v1/000077500000000000000000000000001472614177300216755ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/apps/v1/controllerrevision.go000066400000000000000000000071351472614177300261740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" ) // ControllerRevisionInformer provides access to a shared informer and lister for // ControllerRevisions. type ControllerRevisionInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ControllerRevisionLister } type controllerRevisionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredControllerRevisionInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().ControllerRevisions(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().ControllerRevisions(namespace).Watch(context.TODO(), options) }, }, &appsv1.ControllerRevision{}, resyncPeriod, indexers, ) } func (f *controllerRevisionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredControllerRevisionInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *controllerRevisionInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1.ControllerRevision{}, f.defaultInformer) } func (f *controllerRevisionInformer) Lister() v1.ControllerRevisionLister { return v1.NewControllerRevisionLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1/daemonset.go000066400000000000000000000066271472614177300242160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" ) // DaemonSetInformer provides access to a shared informer and lister for // DaemonSets. type DaemonSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1.DaemonSetLister } type daemonSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredDaemonSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().DaemonSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().DaemonSets(namespace).Watch(context.TODO(), options) }, }, &appsv1.DaemonSet{}, resyncPeriod, indexers, ) } func (f *daemonSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredDaemonSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *daemonSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1.DaemonSet{}, f.defaultInformer) } func (f *daemonSetInformer) Lister() v1.DaemonSetLister { return v1.NewDaemonSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1/deployment.go000066400000000000000000000066551472614177300244200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" ) // DeploymentInformer provides access to a shared informer and lister for // Deployments. type DeploymentInformer interface { Informer() cache.SharedIndexInformer Lister() v1.DeploymentLister } type deploymentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredDeploymentInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().Deployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().Deployments(namespace).Watch(context.TODO(), options) }, }, &appsv1.Deployment{}, resyncPeriod, indexers, ) } func (f *deploymentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *deploymentInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1.Deployment{}, f.defaultInformer) } func (f *deploymentInformer) Lister() v1.DeploymentLister { return v1.NewDeploymentLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1/interface.go000066400000000000000000000053161472614177300241710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ControllerRevisions returns a ControllerRevisionInformer. ControllerRevisions() ControllerRevisionInformer // DaemonSets returns a DaemonSetInformer. DaemonSets() DaemonSetInformer // Deployments returns a DeploymentInformer. Deployments() DeploymentInformer // ReplicaSets returns a ReplicaSetInformer. ReplicaSets() ReplicaSetInformer // StatefulSets returns a StatefulSetInformer. StatefulSets() StatefulSetInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ControllerRevisions returns a ControllerRevisionInformer. func (v *version) ControllerRevisions() ControllerRevisionInformer { return &controllerRevisionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // DaemonSets returns a DaemonSetInformer. func (v *version) DaemonSets() DaemonSetInformer { return &daemonSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Deployments returns a DeploymentInformer. func (v *version) Deployments() DeploymentInformer { return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ReplicaSets returns a ReplicaSetInformer. func (v *version) ReplicaSets() ReplicaSetInformer { return &replicaSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // StatefulSets returns a StatefulSetInformer. func (v *version) StatefulSets() StatefulSetInformer { return &statefulSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/apps/v1/replicaset.go000066400000000000000000000066551472614177300243730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" ) // ReplicaSetInformer provides access to a shared informer and lister for // ReplicaSets. type ReplicaSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ReplicaSetLister } type replicaSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredReplicaSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().ReplicaSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().ReplicaSets(namespace).Watch(context.TODO(), options) }, }, &appsv1.ReplicaSet{}, resyncPeriod, indexers, ) } func (f *replicaSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredReplicaSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *replicaSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1.ReplicaSet{}, f.defaultInformer) } func (f *replicaSetInformer) Lister() v1.ReplicaSetLister { return v1.NewReplicaSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1/statefulset.go000066400000000000000000000067031472614177300245750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" ) // StatefulSetInformer provides access to a shared informer and lister for // StatefulSets. type StatefulSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1.StatefulSetLister } type statefulSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredStatefulSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().StatefulSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1().StatefulSets(namespace).Watch(context.TODO(), options) }, }, &appsv1.StatefulSet{}, resyncPeriod, indexers, ) } func (f *statefulSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredStatefulSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *statefulSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1.StatefulSet{}, f.defaultInformer) } func (f *statefulSetInformer) Lister() v1.StatefulSetLister { return v1.NewStatefulSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1beta1/000077500000000000000000000000001472614177300226125ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/apps/v1beta1/controllerrevision.go000066400000000000000000000072151472614177300271100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" appsv1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" ) // ControllerRevisionInformer provides access to a shared informer and lister for // ControllerRevisions. type ControllerRevisionInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.ControllerRevisionLister } type controllerRevisionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredControllerRevisionInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta1().ControllerRevisions(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta1().ControllerRevisions(namespace).Watch(context.TODO(), options) }, }, &appsv1beta1.ControllerRevision{}, resyncPeriod, indexers, ) } func (f *controllerRevisionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredControllerRevisionInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *controllerRevisionInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1beta1.ControllerRevision{}, f.defaultInformer) } func (f *controllerRevisionInformer) Lister() v1beta1.ControllerRevisionLister { return v1beta1.NewControllerRevisionLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1beta1/deployment.go000066400000000000000000000067351472614177300253340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" appsv1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" ) // DeploymentInformer provides access to a shared informer and lister for // Deployments. type DeploymentInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.DeploymentLister } type deploymentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredDeploymentInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta1().Deployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta1().Deployments(namespace).Watch(context.TODO(), options) }, }, &appsv1beta1.Deployment{}, resyncPeriod, indexers, ) } func (f *deploymentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *deploymentInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1beta1.Deployment{}, f.defaultInformer) } func (f *deploymentInformer) Lister() v1beta1.DeploymentLister { return v1beta1.NewDeploymentLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1beta1/interface.go000066400000000000000000000042261472614177300251050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ControllerRevisions returns a ControllerRevisionInformer. ControllerRevisions() ControllerRevisionInformer // Deployments returns a DeploymentInformer. Deployments() DeploymentInformer // StatefulSets returns a StatefulSetInformer. StatefulSets() StatefulSetInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ControllerRevisions returns a ControllerRevisionInformer. func (v *version) ControllerRevisions() ControllerRevisionInformer { return &controllerRevisionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Deployments returns a DeploymentInformer. func (v *version) Deployments() DeploymentInformer { return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // StatefulSets returns a StatefulSetInformer. func (v *version) StatefulSets() StatefulSetInformer { return &statefulSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/apps/v1beta1/statefulset.go000066400000000000000000000067631472614177300255200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" appsv1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" ) // StatefulSetInformer provides access to a shared informer and lister for // StatefulSets. type StatefulSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.StatefulSetLister } type statefulSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredStatefulSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta1().StatefulSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta1().StatefulSets(namespace).Watch(context.TODO(), options) }, }, &appsv1beta1.StatefulSet{}, resyncPeriod, indexers, ) } func (f *statefulSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredStatefulSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *statefulSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1beta1.StatefulSet{}, f.defaultInformer) } func (f *statefulSetInformer) Lister() v1beta1.StatefulSetLister { return v1beta1.NewStatefulSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1beta2/000077500000000000000000000000001472614177300226135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/apps/v1beta2/controllerrevision.go000066400000000000000000000072151472614177300271110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" ) // ControllerRevisionInformer provides access to a shared informer and lister for // ControllerRevisions. type ControllerRevisionInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta2.ControllerRevisionLister } type controllerRevisionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredControllerRevisionInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().ControllerRevisions(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().ControllerRevisions(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.ControllerRevision{}, resyncPeriod, indexers, ) } func (f *controllerRevisionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredControllerRevisionInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *controllerRevisionInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1beta2.ControllerRevision{}, f.defaultInformer) } func (f *controllerRevisionInformer) Lister() v1beta2.ControllerRevisionLister { return v1beta2.NewControllerRevisionLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1beta2/daemonset.go000066400000000000000000000067071472614177300251330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" ) // DaemonSetInformer provides access to a shared informer and lister for // DaemonSets. type DaemonSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta2.DaemonSetLister } type daemonSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredDaemonSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().DaemonSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().DaemonSets(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.DaemonSet{}, resyncPeriod, indexers, ) } func (f *daemonSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredDaemonSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *daemonSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1beta2.DaemonSet{}, f.defaultInformer) } func (f *daemonSetInformer) Lister() v1beta2.DaemonSetLister { return v1beta2.NewDaemonSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1beta2/deployment.go000066400000000000000000000067351472614177300253350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" ) // DeploymentInformer provides access to a shared informer and lister for // Deployments. type DeploymentInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta2.DeploymentLister } type deploymentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredDeploymentInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().Deployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().Deployments(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.Deployment{}, resyncPeriod, indexers, ) } func (f *deploymentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *deploymentInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1beta2.Deployment{}, f.defaultInformer) } func (f *deploymentInformer) Lister() v1beta2.DeploymentLister { return v1beta2.NewDeploymentLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1beta2/interface.go000066400000000000000000000053231472614177300251050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ControllerRevisions returns a ControllerRevisionInformer. ControllerRevisions() ControllerRevisionInformer // DaemonSets returns a DaemonSetInformer. DaemonSets() DaemonSetInformer // Deployments returns a DeploymentInformer. Deployments() DeploymentInformer // ReplicaSets returns a ReplicaSetInformer. ReplicaSets() ReplicaSetInformer // StatefulSets returns a StatefulSetInformer. StatefulSets() StatefulSetInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ControllerRevisions returns a ControllerRevisionInformer. func (v *version) ControllerRevisions() ControllerRevisionInformer { return &controllerRevisionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // DaemonSets returns a DaemonSetInformer. func (v *version) DaemonSets() DaemonSetInformer { return &daemonSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Deployments returns a DeploymentInformer. func (v *version) Deployments() DeploymentInformer { return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ReplicaSets returns a ReplicaSetInformer. func (v *version) ReplicaSets() ReplicaSetInformer { return &replicaSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // StatefulSets returns a StatefulSetInformer. func (v *version) StatefulSets() StatefulSetInformer { return &statefulSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/apps/v1beta2/replicaset.go000066400000000000000000000067351472614177300253100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" ) // ReplicaSetInformer provides access to a shared informer and lister for // ReplicaSets. type ReplicaSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta2.ReplicaSetLister } type replicaSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredReplicaSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().ReplicaSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().ReplicaSets(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.ReplicaSet{}, resyncPeriod, indexers, ) } func (f *replicaSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredReplicaSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *replicaSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1beta2.ReplicaSet{}, f.defaultInformer) } func (f *replicaSetInformer) Lister() v1beta2.ReplicaSetLister { return v1beta2.NewReplicaSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/apps/v1beta2/statefulset.go000066400000000000000000000067631472614177300255210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" ) // StatefulSetInformer provides access to a shared informer and lister for // StatefulSets. type StatefulSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta2.StatefulSetLister } type statefulSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredStatefulSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().StatefulSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AppsV1beta2().StatefulSets(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.StatefulSet{}, resyncPeriod, indexers, ) } func (f *statefulSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredStatefulSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *statefulSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&appsv1beta2.StatefulSet{}, f.defaultInformer) } func (f *statefulSetInformer) Lister() v1beta2.StatefulSetLister { return v1beta2.NewStatefulSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/autoscaling/000077500000000000000000000000001472614177300227155ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/autoscaling/interface.go000066400000000000000000000045341472614177300252120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package autoscaling import ( v1 "k8s.io/client-go/informers/autoscaling/v1" v2 "k8s.io/client-go/informers/autoscaling/v2" v2beta1 "k8s.io/client-go/informers/autoscaling/v2beta1" v2beta2 "k8s.io/client-go/informers/autoscaling/v2beta2" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V2 provides access to shared informers for resources in V2. V2() v2.Interface // V2beta1 provides access to shared informers for resources in V2beta1. V2beta1() v2beta1.Interface // V2beta2 provides access to shared informers for resources in V2beta2. V2beta2() v2beta2.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V2 returns a new v2.Interface. func (g *group) V2() v2.Interface { return v2.New(g.factory, g.namespace, g.tweakListOptions) } // V2beta1 returns a new v2beta1.Interface. func (g *group) V2beta1() v2beta1.Interface { return v2beta1.New(g.factory, g.namespace, g.tweakListOptions) } // V2beta2 returns a new v2beta2.Interface. func (g *group) V2beta2() v2beta2.Interface { return v2beta2.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/autoscaling/v1/000077500000000000000000000000001472614177300232435ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/autoscaling/v1/horizontalpodautoscaler.go000066400000000000000000000073741472614177300305640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/autoscaling/v1" cache "k8s.io/client-go/tools/cache" ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for // HorizontalPodAutoscalers. type HorizontalPodAutoscalerInformer interface { Informer() cache.SharedIndexInformer Lister() v1.HorizontalPodAutoscalerLister } type horizontalPodAutoscalerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredHorizontalPodAutoscalerInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) }, }, &autoscalingv1.HorizontalPodAutoscaler{}, resyncPeriod, indexers, ) } func (f *horizontalPodAutoscalerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredHorizontalPodAutoscalerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&autoscalingv1.HorizontalPodAutoscaler{}, f.defaultInformer) } func (f *horizontalPodAutoscalerInformer) Lister() v1.HorizontalPodAutoscalerLister { return v1.NewHorizontalPodAutoscalerLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/autoscaling/v1/interface.go000066400000000000000000000031571472614177300255400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. func (v *version) HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/autoscaling/v2/000077500000000000000000000000001472614177300232445ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/autoscaling/v2/horizontalpodautoscaler.go000066400000000000000000000073601472614177300305600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v2 import ( "context" time "time" autoscalingv2 "k8s.io/api/autoscaling/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v2 "k8s.io/client-go/listers/autoscaling/v2" cache "k8s.io/client-go/tools/cache" ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for // HorizontalPodAutoscalers. type HorizontalPodAutoscalerInformer interface { Informer() cache.SharedIndexInformer Lister() v2.HorizontalPodAutoscalerLister } type horizontalPodAutoscalerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredHorizontalPodAutoscalerInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AutoscalingV2().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AutoscalingV2().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) }, }, &autoscalingv2.HorizontalPodAutoscaler{}, resyncPeriod, indexers, ) } func (f *horizontalPodAutoscalerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredHorizontalPodAutoscalerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&autoscalingv2.HorizontalPodAutoscaler{}, f.defaultInformer) } func (f *horizontalPodAutoscalerInformer) Lister() v2.HorizontalPodAutoscalerLister { return v2.NewHorizontalPodAutoscalerLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/autoscaling/v2/interface.go000066400000000000000000000031571472614177300255410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v2 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. func (v *version) HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/autoscaling/v2beta1/000077500000000000000000000000001472614177300241615ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/autoscaling/v2beta1/horizontalpodautoscaler.go000066400000000000000000000074541472614177300315010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v2beta1 import ( "context" time "time" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v2beta1 "k8s.io/client-go/listers/autoscaling/v2beta1" cache "k8s.io/client-go/tools/cache" ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for // HorizontalPodAutoscalers. type HorizontalPodAutoscalerInformer interface { Informer() cache.SharedIndexInformer Lister() v2beta1.HorizontalPodAutoscalerLister } type horizontalPodAutoscalerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredHorizontalPodAutoscalerInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) }, }, &autoscalingv2beta1.HorizontalPodAutoscaler{}, resyncPeriod, indexers, ) } func (f *horizontalPodAutoscalerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredHorizontalPodAutoscalerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&autoscalingv2beta1.HorizontalPodAutoscaler{}, f.defaultInformer) } func (f *horizontalPodAutoscalerInformer) Lister() v2beta1.HorizontalPodAutoscalerLister { return v2beta1.NewHorizontalPodAutoscalerLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/autoscaling/v2beta1/interface.go000066400000000000000000000031641472614177300264540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v2beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. func (v *version) HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/autoscaling/v2beta2/000077500000000000000000000000001472614177300241625ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/autoscaling/v2beta2/horizontalpodautoscaler.go000066400000000000000000000074541472614177300315020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v2beta2 import ( "context" time "time" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v2beta2 "k8s.io/client-go/listers/autoscaling/v2beta2" cache "k8s.io/client-go/tools/cache" ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for // HorizontalPodAutoscalers. type HorizontalPodAutoscalerInformer interface { Informer() cache.SharedIndexInformer Lister() v2beta2.HorizontalPodAutoscalerLister } type horizontalPodAutoscalerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredHorizontalPodAutoscalerInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) }, }, &autoscalingv2beta2.HorizontalPodAutoscaler{}, resyncPeriod, indexers, ) } func (f *horizontalPodAutoscalerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredHorizontalPodAutoscalerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&autoscalingv2beta2.HorizontalPodAutoscaler{}, f.defaultInformer) } func (f *horizontalPodAutoscalerInformer) Lister() v2beta2.HorizontalPodAutoscalerLister { return v2beta2.NewHorizontalPodAutoscalerLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/autoscaling/v2beta2/interface.go000066400000000000000000000031641472614177300264550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v2beta2 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. func (v *version) HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/batch/000077500000000000000000000000001472614177300214655ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/batch/interface.go000066400000000000000000000034051472614177300237560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package batch import ( v1 "k8s.io/client-go/informers/batch/v1" v1beta1 "k8s.io/client-go/informers/batch/v1beta1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/batch/v1/000077500000000000000000000000001472614177300220135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/batch/v1/cronjob.go000066400000000000000000000065621472614177300240070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/batch/v1" cache "k8s.io/client-go/tools/cache" ) // CronJobInformer provides access to a shared informer and lister for // CronJobs. type CronJobInformer interface { Informer() cache.SharedIndexInformer Lister() v1.CronJobLister } type cronJobInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewCronJobInformer constructs a new informer for CronJob type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCronJobInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredCronJobInformer constructs a new informer for CronJob type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.BatchV1().CronJobs(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.BatchV1().CronJobs(namespace).Watch(context.TODO(), options) }, }, &batchv1.CronJob{}, resyncPeriod, indexers, ) } func (f *cronJobInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCronJobInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cronJobInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&batchv1.CronJob{}, f.defaultInformer) } func (f *cronJobInformer) Lister() v1.CronJobLister { return v1.NewCronJobLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/batch/v1/interface.go000066400000000000000000000033031472614177300243010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // CronJobs returns a CronJobInformer. CronJobs() CronJobInformer // Jobs returns a JobInformer. Jobs() JobInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // CronJobs returns a CronJobInformer. func (v *version) CronJobs() CronJobInformer { return &cronJobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Jobs returns a JobInformer. func (v *version) Jobs() JobInformer { return &jobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/batch/v1/job.go000066400000000000000000000064321472614177300231210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/batch/v1" cache "k8s.io/client-go/tools/cache" ) // JobInformer provides access to a shared informer and lister for // Jobs. type JobInformer interface { Informer() cache.SharedIndexInformer Lister() v1.JobLister } type jobInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewJobInformer constructs a new informer for Job type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredJobInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredJobInformer constructs a new informer for Job type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.BatchV1().Jobs(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.BatchV1().Jobs(namespace).Watch(context.TODO(), options) }, }, &batchv1.Job{}, resyncPeriod, indexers, ) } func (f *jobInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredJobInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *jobInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&batchv1.Job{}, f.defaultInformer) } func (f *jobInformer) Lister() v1.JobLister { return v1.NewJobLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/batch/v1beta1/000077500000000000000000000000001472614177300227305ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/batch/v1beta1/cronjob.go000066400000000000000000000066421472614177300247230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" batchv1beta1 "k8s.io/api/batch/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/batch/v1beta1" cache "k8s.io/client-go/tools/cache" ) // CronJobInformer provides access to a shared informer and lister for // CronJobs. type CronJobInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.CronJobLister } type cronJobInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewCronJobInformer constructs a new informer for CronJob type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCronJobInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredCronJobInformer constructs a new informer for CronJob type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.BatchV1beta1().CronJobs(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.BatchV1beta1().CronJobs(namespace).Watch(context.TODO(), options) }, }, &batchv1beta1.CronJob{}, resyncPeriod, indexers, ) } func (f *cronJobInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCronJobInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cronJobInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&batchv1beta1.CronJob{}, f.defaultInformer) } func (f *cronJobInformer) Lister() v1beta1.CronJobLister { return v1beta1.NewCronJobLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/batch/v1beta1/interface.go000066400000000000000000000027441472614177300252260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // CronJobs returns a CronJobInformer. CronJobs() CronJobInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // CronJobs returns a CronJobInformer. func (v *version) CronJobs() CronJobInformer { return &cronJobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/certificates/000077500000000000000000000000001472614177300230515ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/certificates/interface.go000066400000000000000000000041441472614177300253430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package certificates import ( v1 "k8s.io/client-go/informers/certificates/v1" v1alpha1 "k8s.io/client-go/informers/certificates/v1alpha1" v1beta1 "k8s.io/client-go/informers/certificates/v1beta1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/certificates/v1/000077500000000000000000000000001472614177300233775ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/certificates/v1/certificatesigningrequest.go000066400000000000000000000073101472614177300312010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" certificatesv1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/certificates/v1" cache "k8s.io/client-go/tools/cache" ) // CertificateSigningRequestInformer provides access to a shared informer and lister for // CertificateSigningRequests. type CertificateSigningRequestInformer interface { Informer() cache.SharedIndexInformer Lister() v1.CertificateSigningRequestLister } type certificateSigningRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCertificateSigningRequestInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CertificatesV1().CertificateSigningRequests().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CertificatesV1().CertificateSigningRequests().Watch(context.TODO(), options) }, }, &certificatesv1.CertificateSigningRequest{}, resyncPeriod, indexers, ) } func (f *certificateSigningRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCertificateSigningRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *certificateSigningRequestInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&certificatesv1.CertificateSigningRequest{}, f.defaultInformer) } func (f *certificateSigningRequestInformer) Lister() v1.CertificateSigningRequestLister { return v1.NewCertificateSigningRequestLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/certificates/v1/interface.go000066400000000000000000000031511472614177300256660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // CertificateSigningRequests returns a CertificateSigningRequestInformer. CertificateSigningRequests() CertificateSigningRequestInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // CertificateSigningRequests returns a CertificateSigningRequestInformer. func (v *version) CertificateSigningRequests() CertificateSigningRequestInformer { return &certificateSigningRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/certificates/v1alpha1/000077500000000000000000000000001472614177300244665ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/certificates/v1alpha1/clustertrustbundle.go000066400000000000000000000071521472614177300307770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/certificates/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // ClusterTrustBundleInformer provides access to a shared informer and lister for // ClusterTrustBundles. type ClusterTrustBundleInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.ClusterTrustBundleLister } type clusterTrustBundleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredClusterTrustBundleInformer(client, resyncPeriod, indexers, nil) } // NewFilteredClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CertificatesV1alpha1().ClusterTrustBundles().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CertificatesV1alpha1().ClusterTrustBundles().Watch(context.TODO(), options) }, }, &certificatesv1alpha1.ClusterTrustBundle{}, resyncPeriod, indexers, ) } func (f *clusterTrustBundleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredClusterTrustBundleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *clusterTrustBundleInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&certificatesv1alpha1.ClusterTrustBundle{}, f.defaultInformer) } func (f *clusterTrustBundleInformer) Lister() v1alpha1.ClusterTrustBundleLister { return v1alpha1.NewClusterTrustBundleLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/certificates/v1alpha1/interface.go000066400000000000000000000030601472614177300267540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ClusterTrustBundles returns a ClusterTrustBundleInformer. ClusterTrustBundles() ClusterTrustBundleInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ClusterTrustBundles returns a ClusterTrustBundleInformer. func (v *version) ClusterTrustBundles() ClusterTrustBundleInformer { return &clusterTrustBundleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/certificates/v1beta1/000077500000000000000000000000001472614177300243145ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/certificates/v1beta1/certificatesigningrequest.go000066400000000000000000000073701472614177300321240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/certificates/v1beta1" cache "k8s.io/client-go/tools/cache" ) // CertificateSigningRequestInformer provides access to a shared informer and lister for // CertificateSigningRequests. type CertificateSigningRequestInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.CertificateSigningRequestLister } type certificateSigningRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCertificateSigningRequestInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CertificatesV1beta1().CertificateSigningRequests().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CertificatesV1beta1().CertificateSigningRequests().Watch(context.TODO(), options) }, }, &certificatesv1beta1.CertificateSigningRequest{}, resyncPeriod, indexers, ) } func (f *certificateSigningRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCertificateSigningRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *certificateSigningRequestInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&certificatesv1beta1.CertificateSigningRequest{}, f.defaultInformer) } func (f *certificateSigningRequestInformer) Lister() v1beta1.CertificateSigningRequestLister { return v1beta1.NewCertificateSigningRequestLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/certificates/v1beta1/interface.go000066400000000000000000000031561472614177300266100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // CertificateSigningRequests returns a CertificateSigningRequestInformer. CertificateSigningRequests() CertificateSigningRequestInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // CertificateSigningRequests returns a CertificateSigningRequestInformer. func (v *version) CertificateSigningRequests() CertificateSigningRequestInformer { return &certificateSigningRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/coordination/000077500000000000000000000000001472614177300230745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/coordination/interface.go000066400000000000000000000041441472614177300253660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package coordination import ( v1 "k8s.io/client-go/informers/coordination/v1" v1alpha1 "k8s.io/client-go/informers/coordination/v1alpha1" v1beta1 "k8s.io/client-go/informers/coordination/v1beta1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/coordination/v1/000077500000000000000000000000001472614177300234225ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/coordination/v1/interface.go000066400000000000000000000027151472614177300257160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // Leases returns a LeaseInformer. Leases() LeaseInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // Leases returns a LeaseInformer. func (v *version) Leases() LeaseInformer { return &leaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/coordination/v1/lease.go000066400000000000000000000065671472614177300250600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" coordinationv1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/coordination/v1" cache "k8s.io/client-go/tools/cache" ) // LeaseInformer provides access to a shared informer and lister for // Leases. type LeaseInformer interface { Informer() cache.SharedIndexInformer Lister() v1.LeaseLister } type leaseInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewLeaseInformer constructs a new informer for Lease type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredLeaseInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredLeaseInformer constructs a new informer for Lease type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoordinationV1().Leases(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoordinationV1().Leases(namespace).Watch(context.TODO(), options) }, }, &coordinationv1.Lease{}, resyncPeriod, indexers, ) } func (f *leaseInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredLeaseInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *leaseInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&coordinationv1.Lease{}, f.defaultInformer) } func (f *leaseInformer) Lister() v1.LeaseLister { return v1.NewLeaseLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/coordination/v1alpha1/000077500000000000000000000000001472614177300245115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/coordination/v1alpha1/interface.go000066400000000000000000000030441472614177300270010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // LeaseCandidates returns a LeaseCandidateInformer. LeaseCandidates() LeaseCandidateInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // LeaseCandidates returns a LeaseCandidateInformer. func (v *version) LeaseCandidates() LeaseCandidateInformer { return &leaseCandidateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/coordination/v1alpha1/leasecandidate.go000066400000000000000000000071711472614177300277740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/coordination/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // LeaseCandidateInformer provides access to a shared informer and lister for // LeaseCandidates. type LeaseCandidateInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.LeaseCandidateLister } type leaseCandidateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewLeaseCandidateInformer constructs a new informer for LeaseCandidate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredLeaseCandidateInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredLeaseCandidateInformer constructs a new informer for LeaseCandidate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoordinationV1alpha1().LeaseCandidates(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoordinationV1alpha1().LeaseCandidates(namespace).Watch(context.TODO(), options) }, }, &coordinationv1alpha1.LeaseCandidate{}, resyncPeriod, indexers, ) } func (f *leaseCandidateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredLeaseCandidateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *leaseCandidateInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&coordinationv1alpha1.LeaseCandidate{}, f.defaultInformer) } func (f *leaseCandidateInformer) Lister() v1alpha1.LeaseCandidateLister { return v1alpha1.NewLeaseCandidateLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/coordination/v1beta1/000077500000000000000000000000001472614177300243375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/coordination/v1beta1/interface.go000066400000000000000000000027221472614177300266310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // Leases returns a LeaseInformer. Leases() LeaseInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // Leases returns a LeaseInformer. func (v *version) Leases() LeaseInformer { return &leaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/coordination/v1beta1/lease.go000066400000000000000000000066471472614177300257740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/coordination/v1beta1" cache "k8s.io/client-go/tools/cache" ) // LeaseInformer provides access to a shared informer and lister for // Leases. type LeaseInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.LeaseLister } type leaseInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewLeaseInformer constructs a new informer for Lease type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredLeaseInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredLeaseInformer constructs a new informer for Lease type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoordinationV1beta1().Leases(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoordinationV1beta1().Leases(namespace).Watch(context.TODO(), options) }, }, &coordinationv1beta1.Lease{}, resyncPeriod, indexers, ) } func (f *leaseInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredLeaseInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *leaseInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&coordinationv1beta1.Lease{}, f.defaultInformer) } func (f *leaseInformer) Lister() v1beta1.LeaseLister { return v1beta1.NewLeaseLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/000077500000000000000000000000001472614177300213345ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/core/interface.go000066400000000000000000000027131472614177300236260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package core import ( v1 "k8s.io/client-go/informers/core/v1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/core/v1/000077500000000000000000000000001472614177300216625ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/core/v1/componentstatus.go000066400000000000000000000066671472614177300254760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // ComponentStatusInformer provides access to a shared informer and lister for // ComponentStatuses. type ComponentStatusInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ComponentStatusLister } type componentStatusInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewComponentStatusInformer constructs a new informer for ComponentStatus type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredComponentStatusInformer(client, resyncPeriod, indexers, nil) } // NewFilteredComponentStatusInformer constructs a new informer for ComponentStatus type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ComponentStatuses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ComponentStatuses().Watch(context.TODO(), options) }, }, &corev1.ComponentStatus{}, resyncPeriod, indexers, ) } func (f *componentStatusInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredComponentStatusInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *componentStatusInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.ComponentStatus{}, f.defaultInformer) } func (f *componentStatusInformer) Lister() v1.ComponentStatusLister { return v1.NewComponentStatusLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/configmap.go000066400000000000000000000066271472614177300241670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // ConfigMapInformer provides access to a shared informer and lister for // ConfigMaps. type ConfigMapInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ConfigMapLister } type configMapInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewConfigMapInformer constructs a new informer for ConfigMap type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewConfigMapInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredConfigMapInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredConfigMapInformer constructs a new informer for ConfigMap type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredConfigMapInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ConfigMaps(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ConfigMaps(namespace).Watch(context.TODO(), options) }, }, &corev1.ConfigMap{}, resyncPeriod, indexers, ) } func (f *configMapInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredConfigMapInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *configMapInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.ConfigMap{}, f.defaultInformer) } func (f *configMapInformer) Lister() v1.ConfigMapLister { return v1.NewConfigMapLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/endpoints.go000066400000000000000000000066241472614177300242240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // EndpointsInformer provides access to a shared informer and lister for // Endpoints. type EndpointsInformer interface { Informer() cache.SharedIndexInformer Lister() v1.EndpointsLister } type endpointsInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewEndpointsInformer constructs a new informer for Endpoints type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewEndpointsInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredEndpointsInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredEndpointsInformer constructs a new informer for Endpoints type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredEndpointsInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Endpoints(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Endpoints(namespace).Watch(context.TODO(), options) }, }, &corev1.Endpoints{}, resyncPeriod, indexers, ) } func (f *endpointsInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredEndpointsInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *endpointsInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.Endpoints{}, f.defaultInformer) } func (f *endpointsInformer) Lister() v1.EndpointsLister { return v1.NewEndpointsLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/event.go000066400000000000000000000064771472614177300233500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // EventInformer provides access to a shared informer and lister for // Events. type EventInformer interface { Informer() cache.SharedIndexInformer Lister() v1.EventLister } type eventInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredEventInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Events(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Events(namespace).Watch(context.TODO(), options) }, }, &corev1.Event{}, resyncPeriod, indexers, ) } func (f *eventInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredEventInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *eventInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.Event{}, f.defaultInformer) } func (f *eventInformer) Lister() v1.EventLister { return v1.NewEventLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/interface.go000066400000000000000000000134341472614177300241560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ComponentStatuses returns a ComponentStatusInformer. ComponentStatuses() ComponentStatusInformer // ConfigMaps returns a ConfigMapInformer. ConfigMaps() ConfigMapInformer // Endpoints returns a EndpointsInformer. Endpoints() EndpointsInformer // Events returns a EventInformer. Events() EventInformer // LimitRanges returns a LimitRangeInformer. LimitRanges() LimitRangeInformer // Namespaces returns a NamespaceInformer. Namespaces() NamespaceInformer // Nodes returns a NodeInformer. Nodes() NodeInformer // PersistentVolumes returns a PersistentVolumeInformer. PersistentVolumes() PersistentVolumeInformer // PersistentVolumeClaims returns a PersistentVolumeClaimInformer. PersistentVolumeClaims() PersistentVolumeClaimInformer // Pods returns a PodInformer. Pods() PodInformer // PodTemplates returns a PodTemplateInformer. PodTemplates() PodTemplateInformer // ReplicationControllers returns a ReplicationControllerInformer. ReplicationControllers() ReplicationControllerInformer // ResourceQuotas returns a ResourceQuotaInformer. ResourceQuotas() ResourceQuotaInformer // Secrets returns a SecretInformer. Secrets() SecretInformer // Services returns a ServiceInformer. Services() ServiceInformer // ServiceAccounts returns a ServiceAccountInformer. ServiceAccounts() ServiceAccountInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ComponentStatuses returns a ComponentStatusInformer. func (v *version) ComponentStatuses() ComponentStatusInformer { return &componentStatusInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ConfigMaps returns a ConfigMapInformer. func (v *version) ConfigMaps() ConfigMapInformer { return &configMapInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Endpoints returns a EndpointsInformer. func (v *version) Endpoints() EndpointsInformer { return &endpointsInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Events returns a EventInformer. func (v *version) Events() EventInformer { return &eventInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // LimitRanges returns a LimitRangeInformer. func (v *version) LimitRanges() LimitRangeInformer { return &limitRangeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Namespaces returns a NamespaceInformer. func (v *version) Namespaces() NamespaceInformer { return &namespaceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // Nodes returns a NodeInformer. func (v *version) Nodes() NodeInformer { return &nodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // PersistentVolumes returns a PersistentVolumeInformer. func (v *version) PersistentVolumes() PersistentVolumeInformer { return &persistentVolumeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // PersistentVolumeClaims returns a PersistentVolumeClaimInformer. func (v *version) PersistentVolumeClaims() PersistentVolumeClaimInformer { return &persistentVolumeClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Pods returns a PodInformer. func (v *version) Pods() PodInformer { return &podInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // PodTemplates returns a PodTemplateInformer. func (v *version) PodTemplates() PodTemplateInformer { return &podTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ReplicationControllers returns a ReplicationControllerInformer. func (v *version) ReplicationControllers() ReplicationControllerInformer { return &replicationControllerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ResourceQuotas returns a ResourceQuotaInformer. func (v *version) ResourceQuotas() ResourceQuotaInformer { return &resourceQuotaInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Secrets returns a SecretInformer. func (v *version) Secrets() SecretInformer { return &secretInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Services returns a ServiceInformer. func (v *version) Services() ServiceInformer { return &serviceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ServiceAccounts returns a ServiceAccountInformer. func (v *version) ServiceAccounts() ServiceAccountInformer { return &serviceAccountInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/core/v1/limitrange.go000066400000000000000000000066551472614177300243600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // LimitRangeInformer provides access to a shared informer and lister for // LimitRanges. type LimitRangeInformer interface { Informer() cache.SharedIndexInformer Lister() v1.LimitRangeLister } type limitRangeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewLimitRangeInformer constructs a new informer for LimitRange type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewLimitRangeInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredLimitRangeInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredLimitRangeInformer constructs a new informer for LimitRange type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredLimitRangeInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().LimitRanges(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().LimitRanges(namespace).Watch(context.TODO(), options) }, }, &corev1.LimitRange{}, resyncPeriod, indexers, ) } func (f *limitRangeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredLimitRangeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *limitRangeInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.LimitRange{}, f.defaultInformer) } func (f *limitRangeInformer) Lister() v1.LimitRangeLister { return v1.NewLimitRangeLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/namespace.go000066400000000000000000000064601472614177300241530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // NamespaceInformer provides access to a shared informer and lister for // Namespaces. type NamespaceInformer interface { Informer() cache.SharedIndexInformer Lister() v1.NamespaceLister } type namespaceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewNamespaceInformer constructs a new informer for Namespace type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewNamespaceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredNamespaceInformer(client, resyncPeriod, indexers, nil) } // NewFilteredNamespaceInformer constructs a new informer for Namespace type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredNamespaceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Namespaces().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Namespaces().Watch(context.TODO(), options) }, }, &corev1.Namespace{}, resyncPeriod, indexers, ) } func (f *namespaceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredNamespaceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *namespaceInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.Namespace{}, f.defaultInformer) } func (f *namespaceInformer) Lister() v1.NamespaceLister { return v1.NewNamespaceLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/node.go000066400000000000000000000063021472614177300231370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // NodeInformer provides access to a shared informer and lister for // Nodes. type NodeInformer interface { Informer() cache.SharedIndexInformer Lister() v1.NodeLister } type nodeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewNodeInformer constructs a new informer for Node type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewNodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredNodeInformer(client, resyncPeriod, indexers, nil) } // NewFilteredNodeInformer constructs a new informer for Node type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredNodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Nodes().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Nodes().Watch(context.TODO(), options) }, }, &corev1.Node{}, resyncPeriod, indexers, ) } func (f *nodeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredNodeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *nodeInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.Node{}, f.defaultInformer) } func (f *nodeInformer) Lister() v1.NodeLister { return v1.NewNodeLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/persistentvolume.go000066400000000000000000000067121472614177300256470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // PersistentVolumeInformer provides access to a shared informer and lister for // PersistentVolumes. type PersistentVolumeInformer interface { Informer() cache.SharedIndexInformer Lister() v1.PersistentVolumeLister } type persistentVolumeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewPersistentVolumeInformer constructs a new informer for PersistentVolume type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPersistentVolumeInformer(client, resyncPeriod, indexers, nil) } // NewFilteredPersistentVolumeInformer constructs a new informer for PersistentVolume type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().PersistentVolumes().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().PersistentVolumes().Watch(context.TODO(), options) }, }, &corev1.PersistentVolume{}, resyncPeriod, indexers, ) } func (f *persistentVolumeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPersistentVolumeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *persistentVolumeInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.PersistentVolume{}, f.defaultInformer) } func (f *persistentVolumeInformer) Lister() v1.PersistentVolumeLister { return v1.NewPersistentVolumeLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/persistentvolumeclaim.go000066400000000000000000000072371472614177300266600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // PersistentVolumeClaimInformer provides access to a shared informer and lister for // PersistentVolumeClaims. type PersistentVolumeClaimInformer interface { Informer() cache.SharedIndexInformer Lister() v1.PersistentVolumeClaimLister } type persistentVolumeClaimInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewPersistentVolumeClaimInformer constructs a new informer for PersistentVolumeClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPersistentVolumeClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPersistentVolumeClaimInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredPersistentVolumeClaimInformer constructs a new informer for PersistentVolumeClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPersistentVolumeClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().PersistentVolumeClaims(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().PersistentVolumeClaims(namespace).Watch(context.TODO(), options) }, }, &corev1.PersistentVolumeClaim{}, resyncPeriod, indexers, ) } func (f *persistentVolumeClaimInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPersistentVolumeClaimInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *persistentVolumeClaimInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.PersistentVolumeClaim{}, f.defaultInformer) } func (f *persistentVolumeClaimInformer) Lister() v1.PersistentVolumeClaimLister { return v1.NewPersistentVolumeClaimLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/pod.go000066400000000000000000000064231472614177300230000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // PodInformer provides access to a shared informer and lister for // Pods. type PodInformer interface { Informer() cache.SharedIndexInformer Lister() v1.PodLister } type podInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewPodInformer constructs a new informer for Pod type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPodInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPodInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredPodInformer constructs a new informer for Pod type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPodInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Pods(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Pods(namespace).Watch(context.TODO(), options) }, }, &corev1.Pod{}, resyncPeriod, indexers, ) } func (f *podInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPodInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *podInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.Pod{}, f.defaultInformer) } func (f *podInformer) Lister() v1.PodLister { return v1.NewPodLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/podtemplate.go000066400000000000000000000067031472614177300245350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // PodTemplateInformer provides access to a shared informer and lister for // PodTemplates. type PodTemplateInformer interface { Informer() cache.SharedIndexInformer Lister() v1.PodTemplateLister } type podTemplateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewPodTemplateInformer constructs a new informer for PodTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPodTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPodTemplateInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredPodTemplateInformer constructs a new informer for PodTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPodTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().PodTemplates(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().PodTemplates(namespace).Watch(context.TODO(), options) }, }, &corev1.PodTemplate{}, resyncPeriod, indexers, ) } func (f *podTemplateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPodTemplateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *podTemplateInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.PodTemplate{}, f.defaultInformer) } func (f *podTemplateInformer) Lister() v1.PodTemplateLister { return v1.NewPodTemplateLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/replicationcontroller.go000066400000000000000000000072371472614177300266370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // ReplicationControllerInformer provides access to a shared informer and lister for // ReplicationControllers. type ReplicationControllerInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ReplicationControllerLister } type replicationControllerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewReplicationControllerInformer constructs a new informer for ReplicationController type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewReplicationControllerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredReplicationControllerInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredReplicationControllerInformer constructs a new informer for ReplicationController type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredReplicationControllerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ReplicationControllers(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ReplicationControllers(namespace).Watch(context.TODO(), options) }, }, &corev1.ReplicationController{}, resyncPeriod, indexers, ) } func (f *replicationControllerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredReplicationControllerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *replicationControllerInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.ReplicationController{}, f.defaultInformer) } func (f *replicationControllerInformer) Lister() v1.ReplicationControllerLister { return v1.NewReplicationControllerLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/resourcequota.go000066400000000000000000000067571472614177300251310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // ResourceQuotaInformer provides access to a shared informer and lister for // ResourceQuotas. type ResourceQuotaInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ResourceQuotaLister } type resourceQuotaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewResourceQuotaInformer constructs a new informer for ResourceQuota type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewResourceQuotaInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredResourceQuotaInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredResourceQuotaInformer constructs a new informer for ResourceQuota type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredResourceQuotaInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ResourceQuotas(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ResourceQuotas(namespace).Watch(context.TODO(), options) }, }, &corev1.ResourceQuota{}, resyncPeriod, indexers, ) } func (f *resourceQuotaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredResourceQuotaInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *resourceQuotaInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.ResourceQuota{}, f.defaultInformer) } func (f *resourceQuotaInformer) Lister() v1.ResourceQuotaLister { return v1.NewResourceQuotaLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/secret.go000066400000000000000000000065251472614177300235060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // SecretInformer provides access to a shared informer and lister for // Secrets. type SecretInformer interface { Informer() cache.SharedIndexInformer Lister() v1.SecretLister } type secretInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewSecretInformer constructs a new informer for Secret type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewSecretInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredSecretInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredSecretInformer constructs a new informer for Secret type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredSecretInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Secrets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Secrets(namespace).Watch(context.TODO(), options) }, }, &corev1.Secret{}, resyncPeriod, indexers, ) } func (f *secretInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredSecretInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *secretInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.Secret{}, f.defaultInformer) } func (f *secretInformer) Lister() v1.SecretLister { return v1.NewSecretLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/service.go000066400000000000000000000065531472614177300236620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // ServiceInformer provides access to a shared informer and lister for // Services. type ServiceInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ServiceLister } type serviceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewServiceInformer constructs a new informer for Service type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewServiceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredServiceInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredServiceInformer constructs a new informer for Service type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredServiceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Services(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().Services(namespace).Watch(context.TODO(), options) }, }, &corev1.Service{}, resyncPeriod, indexers, ) } func (f *serviceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredServiceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *serviceInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.Service{}, f.defaultInformer) } func (f *serviceInformer) Lister() v1.ServiceLister { return v1.NewServiceLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/core/v1/serviceaccount.go000066400000000000000000000070051472614177300252300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" ) // ServiceAccountInformer provides access to a shared informer and lister for // ServiceAccounts. type ServiceAccountInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ServiceAccountLister } type serviceAccountInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewServiceAccountInformer constructs a new informer for ServiceAccount type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewServiceAccountInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredServiceAccountInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredServiceAccountInformer constructs a new informer for ServiceAccount type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredServiceAccountInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ServiceAccounts(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.CoreV1().ServiceAccounts(namespace).Watch(context.TODO(), options) }, }, &corev1.ServiceAccount{}, resyncPeriod, indexers, ) } func (f *serviceAccountInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredServiceAccountInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *serviceAccountInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&corev1.ServiceAccount{}, f.defaultInformer) } func (f *serviceAccountInformer) Lister() v1.ServiceAccountLister { return v1.NewServiceAccountLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/discovery/000077500000000000000000000000001472614177300224135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/discovery/interface.go000066400000000000000000000034211472614177300247020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package discovery import ( v1 "k8s.io/client-go/informers/discovery/v1" v1beta1 "k8s.io/client-go/informers/discovery/v1beta1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/discovery/v1/000077500000000000000000000000001472614177300227415ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/discovery/v1/endpointslice.go000066400000000000000000000070221472614177300261310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" discoveryv1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/discovery/v1" cache "k8s.io/client-go/tools/cache" ) // EndpointSliceInformer provides access to a shared informer and lister for // EndpointSlices. type EndpointSliceInformer interface { Informer() cache.SharedIndexInformer Lister() v1.EndpointSliceLister } type endpointSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewEndpointSliceInformer constructs a new informer for EndpointSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredEndpointSliceInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredEndpointSliceInformer constructs a new informer for EndpointSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.DiscoveryV1().EndpointSlices(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.DiscoveryV1().EndpointSlices(namespace).Watch(context.TODO(), options) }, }, &discoveryv1.EndpointSlice{}, resyncPeriod, indexers, ) } func (f *endpointSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredEndpointSliceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *endpointSliceInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&discoveryv1.EndpointSlice{}, f.defaultInformer) } func (f *endpointSliceInformer) Lister() v1.EndpointSliceLister { return v1.NewEndpointSliceLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/discovery/v1/interface.go000066400000000000000000000030251472614177300252300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // EndpointSlices returns a EndpointSliceInformer. EndpointSlices() EndpointSliceInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // EndpointSlices returns a EndpointSliceInformer. func (v *version) EndpointSlices() EndpointSliceInformer { return &endpointSliceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/discovery/v1beta1/000077500000000000000000000000001472614177300236565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/discovery/v1beta1/endpointslice.go000066400000000000000000000071021472614177300270450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/discovery/v1beta1" cache "k8s.io/client-go/tools/cache" ) // EndpointSliceInformer provides access to a shared informer and lister for // EndpointSlices. type EndpointSliceInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.EndpointSliceLister } type endpointSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewEndpointSliceInformer constructs a new informer for EndpointSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredEndpointSliceInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredEndpointSliceInformer constructs a new informer for EndpointSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.DiscoveryV1beta1().EndpointSlices(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(context.TODO(), options) }, }, &discoveryv1beta1.EndpointSlice{}, resyncPeriod, indexers, ) } func (f *endpointSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredEndpointSliceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *endpointSliceInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&discoveryv1beta1.EndpointSlice{}, f.defaultInformer) } func (f *endpointSliceInformer) Lister() v1beta1.EndpointSliceLister { return v1beta1.NewEndpointSliceLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/discovery/v1beta1/interface.go000066400000000000000000000030321472614177300261430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // EndpointSlices returns a EndpointSliceInformer. EndpointSlices() EndpointSliceInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // EndpointSlices returns a EndpointSliceInformer. func (v *version) EndpointSlices() EndpointSliceInformer { return &endpointSliceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/doc.go000066400000000000000000000012731472614177300215030ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package informers provides generated informers for Kubernetes APIs. package informers // import "k8s.io/client-go/informers" kubernetes-client-go-a2dfcab/informers/events/000077500000000000000000000000001472614177300217105ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/events/interface.go000066400000000000000000000034101472614177300241750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package events import ( v1 "k8s.io/client-go/informers/events/v1" v1beta1 "k8s.io/client-go/informers/events/v1beta1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/events/v1/000077500000000000000000000000001472614177300222365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/events/v1/event.go000066400000000000000000000065151472614177300237150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/events/v1" cache "k8s.io/client-go/tools/cache" ) // EventInformer provides access to a shared informer and lister for // Events. type EventInformer interface { Informer() cache.SharedIndexInformer Lister() v1.EventLister } type eventInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredEventInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.EventsV1().Events(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.EventsV1().Events(namespace).Watch(context.TODO(), options) }, }, &eventsv1.Event{}, resyncPeriod, indexers, ) } func (f *eventInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredEventInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *eventInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&eventsv1.Event{}, f.defaultInformer) } func (f *eventInformer) Lister() v1.EventLister { return v1.NewEventLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/events/v1/interface.go000066400000000000000000000027151472614177300245320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // Events returns a EventInformer. Events() EventInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // Events returns a EventInformer. func (v *version) Events() EventInformer { return &eventInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/events/v1beta1/000077500000000000000000000000001472614177300231535ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/events/v1beta1/event.go000066400000000000000000000065751472614177300246400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" eventsv1beta1 "k8s.io/api/events/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/events/v1beta1" cache "k8s.io/client-go/tools/cache" ) // EventInformer provides access to a shared informer and lister for // Events. type EventInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.EventLister } type eventInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredEventInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.EventsV1beta1().Events(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.EventsV1beta1().Events(namespace).Watch(context.TODO(), options) }, }, &eventsv1beta1.Event{}, resyncPeriod, indexers, ) } func (f *eventInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredEventInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *eventInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&eventsv1beta1.Event{}, f.defaultInformer) } func (f *eventInformer) Lister() v1beta1.EventLister { return v1beta1.NewEventLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/events/v1beta1/interface.go000066400000000000000000000027221472614177300254450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // Events returns a EventInformer. Events() EventInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // Events returns a EventInformer. func (v *version) Events() EventInformer { return &eventInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/extensions/000077500000000000000000000000001472614177300226035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/extensions/interface.go000066400000000000000000000030161472614177300250720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package extensions import ( v1beta1 "k8s.io/client-go/informers/extensions/v1beta1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/extensions/v1beta1/000077500000000000000000000000001472614177300240465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/extensions/v1beta1/daemonset.go000066400000000000000000000067611472614177300263660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" ) // DaemonSetInformer provides access to a shared informer and lister for // DaemonSets. type DaemonSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.DaemonSetLister } type daemonSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredDaemonSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().DaemonSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.DaemonSet{}, resyncPeriod, indexers, ) } func (f *daemonSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredDaemonSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *daemonSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&extensionsv1beta1.DaemonSet{}, f.defaultInformer) } func (f *daemonSetInformer) Lister() v1beta1.DaemonSetLister { return v1beta1.NewDaemonSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/extensions/v1beta1/deployment.go000066400000000000000000000070071472614177300265610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" ) // DeploymentInformer provides access to a shared informer and lister for // Deployments. type DeploymentInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.DeploymentLister } type deploymentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredDeploymentInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().Deployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().Deployments(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.Deployment{}, resyncPeriod, indexers, ) } func (f *deploymentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *deploymentInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&extensionsv1beta1.Deployment{}, f.defaultInformer) } func (f *deploymentInformer) Lister() v1beta1.DeploymentLister { return v1beta1.NewDeploymentLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/extensions/v1beta1/ingress.go000066400000000000000000000067101472614177300260530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" ) // IngressInformer provides access to a shared informer and lister for // Ingresses. type IngressInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.IngressLister } type ingressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredIngressInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().Ingresses(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().Ingresses(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.Ingress{}, resyncPeriod, indexers, ) } func (f *ingressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredIngressInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *ingressInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&extensionsv1beta1.Ingress{}, f.defaultInformer) } func (f *ingressInformer) Lister() v1beta1.IngressLister { return v1beta1.NewIngressLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/extensions/v1beta1/interface.go000066400000000000000000000052121472614177300263350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // DaemonSets returns a DaemonSetInformer. DaemonSets() DaemonSetInformer // Deployments returns a DeploymentInformer. Deployments() DeploymentInformer // Ingresses returns a IngressInformer. Ingresses() IngressInformer // NetworkPolicies returns a NetworkPolicyInformer. NetworkPolicies() NetworkPolicyInformer // ReplicaSets returns a ReplicaSetInformer. ReplicaSets() ReplicaSetInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // DaemonSets returns a DaemonSetInformer. func (v *version) DaemonSets() DaemonSetInformer { return &daemonSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Deployments returns a DeploymentInformer. func (v *version) Deployments() DeploymentInformer { return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // Ingresses returns a IngressInformer. func (v *version) Ingresses() IngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // NetworkPolicies returns a NetworkPolicyInformer. func (v *version) NetworkPolicies() NetworkPolicyInformer { return &networkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ReplicaSets returns a ReplicaSetInformer. func (v *version) ReplicaSets() ReplicaSetInformer { return &replicaSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/extensions/v1beta1/networkpolicy.go000066400000000000000000000071141472614177300273110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" ) // NetworkPolicyInformer provides access to a shared informer and lister for // NetworkPolicies. type NetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.NetworkPolicyLister } type networkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredNetworkPolicyInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().NetworkPolicies(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().NetworkPolicies(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.NetworkPolicy{}, resyncPeriod, indexers, ) } func (f *networkPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredNetworkPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&extensionsv1beta1.NetworkPolicy{}, f.defaultInformer) } func (f *networkPolicyInformer) Lister() v1beta1.NetworkPolicyLister { return v1beta1.NewNetworkPolicyLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/extensions/v1beta1/replicaset.go000066400000000000000000000070071472614177300265340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" ) // ReplicaSetInformer provides access to a shared informer and lister for // ReplicaSets. type ReplicaSetInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.ReplicaSetLister } type replicaSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredReplicaSetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().ReplicaSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.ReplicaSet{}, resyncPeriod, indexers, ) } func (f *replicaSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredReplicaSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *replicaSetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&extensionsv1beta1.ReplicaSet{}, f.defaultInformer) } func (f *replicaSetInformer) Lister() v1beta1.ReplicaSetLister { return v1beta1.NewReplicaSetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/factory.go000066400000000000000000000315511472614177300224070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package informers import ( reflect "reflect" sync "sync" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" admissionregistration "k8s.io/client-go/informers/admissionregistration" apiserverinternal "k8s.io/client-go/informers/apiserverinternal" apps "k8s.io/client-go/informers/apps" autoscaling "k8s.io/client-go/informers/autoscaling" batch "k8s.io/client-go/informers/batch" certificates "k8s.io/client-go/informers/certificates" coordination "k8s.io/client-go/informers/coordination" core "k8s.io/client-go/informers/core" discovery "k8s.io/client-go/informers/discovery" events "k8s.io/client-go/informers/events" extensions "k8s.io/client-go/informers/extensions" flowcontrol "k8s.io/client-go/informers/flowcontrol" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" networking "k8s.io/client-go/informers/networking" node "k8s.io/client-go/informers/node" policy "k8s.io/client-go/informers/policy" rbac "k8s.io/client-go/informers/rbac" resource "k8s.io/client-go/informers/resource" scheduling "k8s.io/client-go/informers/scheduling" storage "k8s.io/client-go/informers/storage" storagemigration "k8s.io/client-go/informers/storagemigration" kubernetes "k8s.io/client-go/kubernetes" cache "k8s.io/client-go/tools/cache" ) // SharedInformerOption defines the functional option type for SharedInformerFactory. type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory type sharedInformerFactory struct { client kubernetes.Interface namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool // wg tracks how many goroutines were started. wg sync.WaitGroup // shuttingDown is true when Shutdown has been called. It may still be running // because it needs to wait for goroutines. shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { return func(factory *sharedInformerFactory) *sharedInformerFactory { for k, v := range resyncConfig { factory.customResync[reflect.TypeOf(k)] = v } return factory } } // WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { return func(factory *sharedInformerFactory) *sharedInformerFactory { factory.tweakListOptions = tweakListOptions return factory } } // WithNamespace limits the SharedInformerFactory to the specified namespace. func WithNamespace(namespace string) SharedInformerOption { return func(factory *sharedInformerFactory) *sharedInformerFactory { factory.namespace = namespace return factory } } // WithTransform sets a transform on all informers. func WithTransform(transform cache.TransformFunc) SharedInformerOption { return func(factory *sharedInformerFactory) *sharedInformerFactory { factory.transform = transform return factory } } // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client kubernetes.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) } // NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. // Listers obtained via this SharedInformerFactory will be subject to the same filters // as specified here. // Deprecated: Please use NewSharedInformerFactoryWithOptions instead func NewFilteredSharedInformerFactory(client kubernetes.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) } // NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. func NewSharedInformerFactoryWithOptions(client kubernetes.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { factory := &sharedInformerFactory{ client: client, namespace: v1.NamespaceAll, defaultResync: defaultResync, informers: make(map[reflect.Type]cache.SharedIndexInformer), startedInformers: make(map[reflect.Type]bool), customResync: make(map[reflect.Type]time.Duration), } // Apply all options for _, opt := range options { factory = opt(factory) } return factory } func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() if f.shuttingDown { return } for informerType, informer := range f.informers { if !f.startedInformers[informerType] { f.wg.Add(1) // We need a new variable in each loop iteration, // otherwise the goroutine would use the loop variable // and that keeps changing. informer := informer go func() { defer f.wg.Done() informer.Run(stopCh) }() f.startedInformers[informerType] = true } } } func (f *sharedInformerFactory) Shutdown() { f.lock.Lock() f.shuttingDown = true f.lock.Unlock() // Will return immediately if there is nothing to wait for. f.wg.Wait() } func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() defer f.lock.Unlock() informers := map[reflect.Type]cache.SharedIndexInformer{} for informerType, informer := range f.informers { if f.startedInformers[informerType] { informers[informerType] = informer } } return informers }() res := map[reflect.Type]bool{} for informType, informer := range informers { res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) } return res } // InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() defer f.lock.Unlock() informerType := reflect.TypeOf(obj) informer, exists := f.informers[informerType] if exists { return informer } resyncPeriod, exists := f.customResync[informerType] if !exists { resyncPeriod = f.defaultResync } informer = newFunc(f.client, resyncPeriod) informer.SetTransform(f.transform) f.informers[informerType] = informer return informer } // SharedInformerFactory provides shared informers for resources in all known // API group versions. // // It is typically used like this: // // ctx, cancel := context.Background() // defer cancel() // factory := NewSharedInformerFactory(client, resyncPeriod) // defer factory.WaitForStop() // Returns immediately if nothing was started. // genericInformer := factory.ForResource(resource) // typedInformer := factory.SomeAPIGroup().V1().SomeType() // factory.Start(ctx.Done()) // Start processing these informers. // synced := factory.WaitForCacheSync(ctx.Done()) // for v, ok := range synced { // if !ok { // fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) // return // } // } // // // Creating informers can also be created after Start, but then // // Start must be called again: // anotherGenericInformer := factory.ForResource(resource) // factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. Start(stopCh <-chan struct{}) // Shutdown marks a factory as shutting down. At that point no new // informers can be started anymore and Start will return without // doing anything. // // In addition, Shutdown blocks until all goroutines have terminated. For that // to happen, the close channel(s) that they were started with must be closed, // either before Shutdown gets called or while it is waiting. // // Shutdown may be called multiple times, even concurrently. All such calls will // block until all goroutines have terminated. Shutdown() // WaitForCacheSync blocks until all started informers' caches were synced // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer Admissionregistration() admissionregistration.Interface Internal() apiserverinternal.Interface Apps() apps.Interface Autoscaling() autoscaling.Interface Batch() batch.Interface Certificates() certificates.Interface Coordination() coordination.Interface Core() core.Interface Discovery() discovery.Interface Events() events.Interface Extensions() extensions.Interface Flowcontrol() flowcontrol.Interface Networking() networking.Interface Node() node.Interface Policy() policy.Interface Rbac() rbac.Interface Resource() resource.Interface Scheduling() scheduling.Interface Storage() storage.Interface Storagemigration() storagemigration.Interface } func (f *sharedInformerFactory) Admissionregistration() admissionregistration.Interface { return admissionregistration.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Internal() apiserverinternal.Interface { return apiserverinternal.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Apps() apps.Interface { return apps.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Autoscaling() autoscaling.Interface { return autoscaling.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Batch() batch.Interface { return batch.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Certificates() certificates.Interface { return certificates.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Coordination() coordination.Interface { return coordination.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Core() core.Interface { return core.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Discovery() discovery.Interface { return discovery.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Events() events.Interface { return events.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Extensions() extensions.Interface { return extensions.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Flowcontrol() flowcontrol.Interface { return flowcontrol.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Networking() networking.Interface { return networking.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Node() node.Interface { return node.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Policy() policy.Interface { return policy.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Rbac() rbac.Interface { return rbac.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Resource() resource.Interface { return resource.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Scheduling() scheduling.Interface { return scheduling.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Storage() storage.Interface { return storage.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Storagemigration() storagemigration.Interface { return storagemigration.New(f, f.namespace, f.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/flowcontrol/000077500000000000000000000000001472614177300227545ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/flowcontrol/interface.go000066400000000000000000000046231472614177300252500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package flowcontrol import ( v1 "k8s.io/client-go/informers/flowcontrol/v1" v1beta1 "k8s.io/client-go/informers/flowcontrol/v1beta1" v1beta2 "k8s.io/client-go/informers/flowcontrol/v1beta2" v1beta3 "k8s.io/client-go/informers/flowcontrol/v1beta3" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface // V1beta2 provides access to shared informers for resources in V1beta2. V1beta2() v1beta2.Interface // V1beta3 provides access to shared informers for resources in V1beta3. V1beta3() v1beta3.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta2 returns a new v1beta2.Interface. func (g *group) V1beta2() v1beta2.Interface { return v1beta2.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta3 returns a new v1beta3.Interface. func (g *group) V1beta3() v1beta3.Interface { return v1beta3.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1/000077500000000000000000000000001472614177300233025ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/flowcontrol/v1/flowschema.go000066400000000000000000000065671472614177300257770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" flowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/flowcontrol/v1" cache "k8s.io/client-go/tools/cache" ) // FlowSchemaInformer provides access to a shared informer and lister for // FlowSchemas. type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer Lister() v1.FlowSchemaLister } type flowSchemaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredFlowSchemaInformer(client, resyncPeriod, indexers, nil) } // NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1().FlowSchemas().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1().FlowSchemas().Watch(context.TODO(), options) }, }, &flowcontrolv1.FlowSchema{}, resyncPeriod, indexers, ) } func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredFlowSchemaInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&flowcontrolv1.FlowSchema{}, f.defaultInformer) } func (f *flowSchemaInformer) Lister() v1.FlowSchemaLister { return v1.NewFlowSchemaLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1/interface.go000066400000000000000000000035751472614177300256030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // FlowSchemas returns a FlowSchemaInformer. FlowSchemas() FlowSchemaInformer // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. PriorityLevelConfigurations() PriorityLevelConfigurationInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // FlowSchemas returns a FlowSchemaInformer. func (v *version) FlowSchemas() FlowSchemaInformer { return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1/prioritylevelconfiguration.go000066400000000000000000000073271472614177300313430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" flowcontrolv1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/flowcontrol/v1" cache "k8s.io/client-go/tools/cache" ) // PriorityLevelConfigurationInformer provides access to a shared informer and lister for // PriorityLevelConfigurations. type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1.PriorityLevelConfigurationLister } type priorityLevelConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1().PriorityLevelConfigurations().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(context.TODO(), options) }, }, &flowcontrolv1.PriorityLevelConfiguration{}, resyncPeriod, indexers, ) } func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&flowcontrolv1.PriorityLevelConfiguration{}, f.defaultInformer) } func (f *priorityLevelConfigurationInformer) Lister() v1.PriorityLevelConfigurationLister { return v1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta1/000077500000000000000000000000001472614177300242175ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta1/flowschema.go000066400000000000000000000066471472614177300267130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/flowcontrol/v1beta1" cache "k8s.io/client-go/tools/cache" ) // FlowSchemaInformer provides access to a shared informer and lister for // FlowSchemas. type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.FlowSchemaLister } type flowSchemaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredFlowSchemaInformer(client, resyncPeriod, indexers, nil) } // NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta1().FlowSchemas().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta1().FlowSchemas().Watch(context.TODO(), options) }, }, &flowcontrolv1beta1.FlowSchema{}, resyncPeriod, indexers, ) } func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredFlowSchemaInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&flowcontrolv1beta1.FlowSchema{}, f.defaultInformer) } func (f *flowSchemaInformer) Lister() v1beta1.FlowSchemaLister { return v1beta1.NewFlowSchemaLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta1/interface.go000066400000000000000000000036021472614177300265070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // FlowSchemas returns a FlowSchemaInformer. FlowSchemas() FlowSchemaInformer // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. PriorityLevelConfigurations() PriorityLevelConfigurationInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // FlowSchemas returns a FlowSchemaInformer. func (v *version) FlowSchemas() FlowSchemaInformer { return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go000066400000000000000000000074071472614177300322570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/flowcontrol/v1beta1" cache "k8s.io/client-go/tools/cache" ) // PriorityLevelConfigurationInformer provides access to a shared informer and lister for // PriorityLevelConfigurations. type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.PriorityLevelConfigurationLister } type priorityLevelConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta1().PriorityLevelConfigurations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta1().PriorityLevelConfigurations().Watch(context.TODO(), options) }, }, &flowcontrolv1beta1.PriorityLevelConfiguration{}, resyncPeriod, indexers, ) } func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&flowcontrolv1beta1.PriorityLevelConfiguration{}, f.defaultInformer) } func (f *priorityLevelConfigurationInformer) Lister() v1beta1.PriorityLevelConfigurationLister { return v1beta1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta2/000077500000000000000000000000001472614177300242205ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta2/flowschema.go000066400000000000000000000066471472614177300267140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( "context" time "time" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/flowcontrol/v1beta2" cache "k8s.io/client-go/tools/cache" ) // FlowSchemaInformer provides access to a shared informer and lister for // FlowSchemas. type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta2.FlowSchemaLister } type flowSchemaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredFlowSchemaInformer(client, resyncPeriod, indexers, nil) } // NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta2().FlowSchemas().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta2().FlowSchemas().Watch(context.TODO(), options) }, }, &flowcontrolv1beta2.FlowSchema{}, resyncPeriod, indexers, ) } func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredFlowSchemaInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&flowcontrolv1beta2.FlowSchema{}, f.defaultInformer) } func (f *flowSchemaInformer) Lister() v1beta2.FlowSchemaLister { return v1beta2.NewFlowSchemaLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta2/interface.go000066400000000000000000000036021472614177300265100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // FlowSchemas returns a FlowSchemaInformer. FlowSchemas() FlowSchemaInformer // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. PriorityLevelConfigurations() PriorityLevelConfigurationInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // FlowSchemas returns a FlowSchemaInformer. func (v *version) FlowSchemas() FlowSchemaInformer { return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go000066400000000000000000000074071472614177300322600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( "context" time "time" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/flowcontrol/v1beta2" cache "k8s.io/client-go/tools/cache" ) // PriorityLevelConfigurationInformer provides access to a shared informer and lister for // PriorityLevelConfigurations. type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta2.PriorityLevelConfigurationLister } type priorityLevelConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta2().PriorityLevelConfigurations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta2().PriorityLevelConfigurations().Watch(context.TODO(), options) }, }, &flowcontrolv1beta2.PriorityLevelConfiguration{}, resyncPeriod, indexers, ) } func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&flowcontrolv1beta2.PriorityLevelConfiguration{}, f.defaultInformer) } func (f *priorityLevelConfigurationInformer) Lister() v1beta2.PriorityLevelConfigurationLister { return v1beta2.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta3/000077500000000000000000000000001472614177300242215ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta3/flowschema.go000066400000000000000000000066471472614177300267150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta3 import ( "context" time "time" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta3 "k8s.io/client-go/listers/flowcontrol/v1beta3" cache "k8s.io/client-go/tools/cache" ) // FlowSchemaInformer provides access to a shared informer and lister for // FlowSchemas. type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta3.FlowSchemaLister } type flowSchemaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredFlowSchemaInformer(client, resyncPeriod, indexers, nil) } // NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta3().FlowSchemas().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta3().FlowSchemas().Watch(context.TODO(), options) }, }, &flowcontrolv1beta3.FlowSchema{}, resyncPeriod, indexers, ) } func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredFlowSchemaInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&flowcontrolv1beta3.FlowSchema{}, f.defaultInformer) } func (f *flowSchemaInformer) Lister() v1beta3.FlowSchemaLister { return v1beta3.NewFlowSchemaLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta3/interface.go000066400000000000000000000036021472614177300265110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta3 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // FlowSchemas returns a FlowSchemaInformer. FlowSchemas() FlowSchemaInformer // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. PriorityLevelConfigurations() PriorityLevelConfigurationInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // FlowSchemas returns a FlowSchemaInformer. func (v *version) FlowSchemas() FlowSchemaInformer { return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go000066400000000000000000000074071472614177300322610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta3 import ( "context" time "time" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta3 "k8s.io/client-go/listers/flowcontrol/v1beta3" cache "k8s.io/client-go/tools/cache" ) // PriorityLevelConfigurationInformer provides access to a shared informer and lister for // PriorityLevelConfigurations. type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta3.PriorityLevelConfigurationLister } type priorityLevelConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta3().PriorityLevelConfigurations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.FlowcontrolV1beta3().PriorityLevelConfigurations().Watch(context.TODO(), options) }, }, &flowcontrolv1beta3.PriorityLevelConfiguration{}, resyncPeriod, indexers, ) } func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&flowcontrolv1beta3.PriorityLevelConfiguration{}, f.defaultInformer) } func (f *priorityLevelConfigurationInformer) Lister() v1beta3.PriorityLevelConfigurationLister { return v1beta3.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/generic.go000066400000000000000000000716721472614177300223640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package informers import ( "fmt" v1 "k8s.io/api/admissionregistration/v1" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1beta1 "k8s.io/api/admissionregistration/v1beta1" apiserverinternalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" v1beta2 "k8s.io/api/apps/v1beta2" autoscalingv1 "k8s.io/api/autoscaling/v1" v2 "k8s.io/api/autoscaling/v2" v2beta1 "k8s.io/api/autoscaling/v2beta1" v2beta2 "k8s.io/api/autoscaling/v2beta2" batchv1 "k8s.io/api/batch/v1" batchv1beta1 "k8s.io/api/batch/v1beta1" certificatesv1 "k8s.io/api/certificates/v1" certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" flowcontrolv1 "k8s.io/api/flowcontrol/v1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" v1beta3 "k8s.io/api/flowcontrol/v1beta3" networkingv1 "k8s.io/api/networking/v1" networkingv1alpha1 "k8s.io/api/networking/v1alpha1" networkingv1beta1 "k8s.io/api/networking/v1beta1" nodev1 "k8s.io/api/node/v1" nodev1alpha1 "k8s.io/api/node/v1alpha1" nodev1beta1 "k8s.io/api/node/v1beta1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" v1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other // sharedInformers based on type type GenericInformer interface { Informer() cache.SharedIndexInformer Lister() cache.GenericLister } type genericInformer struct { informer cache.SharedIndexInformer resource schema.GroupResource } // Informer returns the SharedIndexInformer. func (f *genericInformer) Informer() cache.SharedIndexInformer { return f.informer } // Lister returns the GenericLister. func (f *genericInformer) Lister() cache.GenericLister { return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) } // ForResource gives generic access to a shared informer of the matching type // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { // Group=admissionregistration.k8s.io, Version=v1 case v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().MutatingWebhookConfigurations().Informer()}, nil case v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingAdmissionPolicies().Informer()}, nil case v1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingAdmissionPolicyBindings().Informer()}, nil case v1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingWebhookConfigurations().Informer()}, nil // Group=admissionregistration.k8s.io, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().ValidatingAdmissionPolicies().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().ValidatingAdmissionPolicyBindings().Informer()}, nil // Group=admissionregistration.k8s.io, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().MutatingWebhookConfigurations().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().ValidatingAdmissionPolicies().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().ValidatingAdmissionPolicyBindings().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().ValidatingWebhookConfigurations().Informer()}, nil // Group=apps, Version=v1 case appsv1.SchemeGroupVersion.WithResource("controllerrevisions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().ControllerRevisions().Informer()}, nil case appsv1.SchemeGroupVersion.WithResource("daemonsets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().DaemonSets().Informer()}, nil case appsv1.SchemeGroupVersion.WithResource("deployments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().Deployments().Informer()}, nil case appsv1.SchemeGroupVersion.WithResource("replicasets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().ReplicaSets().Informer()}, nil case appsv1.SchemeGroupVersion.WithResource("statefulsets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().StatefulSets().Informer()}, nil // Group=apps, Version=v1beta1 case appsv1beta1.SchemeGroupVersion.WithResource("controllerrevisions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().ControllerRevisions().Informer()}, nil case appsv1beta1.SchemeGroupVersion.WithResource("deployments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().Deployments().Informer()}, nil case appsv1beta1.SchemeGroupVersion.WithResource("statefulsets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().StatefulSets().Informer()}, nil // Group=apps, Version=v1beta2 case v1beta2.SchemeGroupVersion.WithResource("controllerrevisions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().ControllerRevisions().Informer()}, nil case v1beta2.SchemeGroupVersion.WithResource("daemonsets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().DaemonSets().Informer()}, nil case v1beta2.SchemeGroupVersion.WithResource("deployments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().Deployments().Informer()}, nil case v1beta2.SchemeGroupVersion.WithResource("replicasets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().ReplicaSets().Informer()}, nil case v1beta2.SchemeGroupVersion.WithResource("statefulsets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().StatefulSets().Informer()}, nil // Group=autoscaling, Version=v1 case autoscalingv1.SchemeGroupVersion.WithResource("horizontalpodautoscalers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V1().HorizontalPodAutoscalers().Informer()}, nil // Group=autoscaling, Version=v2 case v2.SchemeGroupVersion.WithResource("horizontalpodautoscalers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V2().HorizontalPodAutoscalers().Informer()}, nil // Group=autoscaling, Version=v2beta1 case v2beta1.SchemeGroupVersion.WithResource("horizontalpodautoscalers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V2beta1().HorizontalPodAutoscalers().Informer()}, nil // Group=autoscaling, Version=v2beta2 case v2beta2.SchemeGroupVersion.WithResource("horizontalpodautoscalers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V2beta2().HorizontalPodAutoscalers().Informer()}, nil // Group=batch, Version=v1 case batchv1.SchemeGroupVersion.WithResource("cronjobs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Batch().V1().CronJobs().Informer()}, nil case batchv1.SchemeGroupVersion.WithResource("jobs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Batch().V1().Jobs().Informer()}, nil // Group=batch, Version=v1beta1 case batchv1beta1.SchemeGroupVersion.WithResource("cronjobs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Batch().V1beta1().CronJobs().Informer()}, nil // Group=certificates.k8s.io, Version=v1 case certificatesv1.SchemeGroupVersion.WithResource("certificatesigningrequests"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1().CertificateSigningRequests().Informer()}, nil // Group=certificates.k8s.io, Version=v1alpha1 case certificatesv1alpha1.SchemeGroupVersion.WithResource("clustertrustbundles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1alpha1().ClusterTrustBundles().Informer()}, nil // Group=certificates.k8s.io, Version=v1beta1 case certificatesv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequests"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1beta1().CertificateSigningRequests().Informer()}, nil // Group=coordination.k8s.io, Version=v1 case coordinationv1.SchemeGroupVersion.WithResource("leases"): return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1().Leases().Informer()}, nil // Group=coordination.k8s.io, Version=v1alpha1 case coordinationv1alpha1.SchemeGroupVersion.WithResource("leasecandidates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1alpha1().LeaseCandidates().Informer()}, nil // Group=coordination.k8s.io, Version=v1beta1 case coordinationv1beta1.SchemeGroupVersion.WithResource("leases"): return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1beta1().Leases().Informer()}, nil // Group=core, Version=v1 case corev1.SchemeGroupVersion.WithResource("componentstatuses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ComponentStatuses().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("configmaps"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ConfigMaps().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("endpoints"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Endpoints().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("events"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Events().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("limitranges"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().LimitRanges().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("namespaces"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Namespaces().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("nodes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Nodes().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("persistentvolumes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().PersistentVolumes().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("persistentvolumeclaims"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().PersistentVolumeClaims().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("pods"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Pods().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("podtemplates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().PodTemplates().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("replicationcontrollers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ReplicationControllers().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("resourcequotas"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ResourceQuotas().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("secrets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Secrets().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("services"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Services().Informer()}, nil case corev1.SchemeGroupVersion.WithResource("serviceaccounts"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceAccounts().Informer()}, nil // Group=discovery.k8s.io, Version=v1 case discoveryv1.SchemeGroupVersion.WithResource("endpointslices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Discovery().V1().EndpointSlices().Informer()}, nil // Group=discovery.k8s.io, Version=v1beta1 case discoveryv1beta1.SchemeGroupVersion.WithResource("endpointslices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Discovery().V1beta1().EndpointSlices().Informer()}, nil // Group=events.k8s.io, Version=v1 case eventsv1.SchemeGroupVersion.WithResource("events"): return &genericInformer{resource: resource.GroupResource(), informer: f.Events().V1().Events().Informer()}, nil // Group=events.k8s.io, Version=v1beta1 case eventsv1beta1.SchemeGroupVersion.WithResource("events"): return &genericInformer{resource: resource.GroupResource(), informer: f.Events().V1beta1().Events().Informer()}, nil // Group=extensions, Version=v1beta1 case extensionsv1beta1.SchemeGroupVersion.WithResource("daemonsets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().DaemonSets().Informer()}, nil case extensionsv1beta1.SchemeGroupVersion.WithResource("deployments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().Deployments().Informer()}, nil case extensionsv1beta1.SchemeGroupVersion.WithResource("ingresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().Ingresses().Informer()}, nil case extensionsv1beta1.SchemeGroupVersion.WithResource("networkpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().NetworkPolicies().Informer()}, nil case extensionsv1beta1.SchemeGroupVersion.WithResource("replicasets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().ReplicaSets().Informer()}, nil // Group=flowcontrol.apiserver.k8s.io, Version=v1 case flowcontrolv1.SchemeGroupVersion.WithResource("flowschemas"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().FlowSchemas().Informer()}, nil case flowcontrolv1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().PriorityLevelConfigurations().Informer()}, nil // Group=flowcontrol.apiserver.k8s.io, Version=v1beta1 case flowcontrolv1beta1.SchemeGroupVersion.WithResource("flowschemas"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta1().FlowSchemas().Informer()}, nil case flowcontrolv1beta1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta1().PriorityLevelConfigurations().Informer()}, nil // Group=flowcontrol.apiserver.k8s.io, Version=v1beta2 case flowcontrolv1beta2.SchemeGroupVersion.WithResource("flowschemas"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta2().FlowSchemas().Informer()}, nil case flowcontrolv1beta2.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta2().PriorityLevelConfigurations().Informer()}, nil // Group=flowcontrol.apiserver.k8s.io, Version=v1beta3 case v1beta3.SchemeGroupVersion.WithResource("flowschemas"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta3().FlowSchemas().Informer()}, nil case v1beta3.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1beta3().PriorityLevelConfigurations().Informer()}, nil // Group=internal.apiserver.k8s.io, Version=v1alpha1 case apiserverinternalv1alpha1.SchemeGroupVersion.WithResource("storageversions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Internal().V1alpha1().StorageVersions().Informer()}, nil // Group=networking.k8s.io, Version=v1 case networkingv1.SchemeGroupVersion.WithResource("ingresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().Ingresses().Informer()}, nil case networkingv1.SchemeGroupVersion.WithResource("ingressclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().IngressClasses().Informer()}, nil case networkingv1.SchemeGroupVersion.WithResource("networkpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().NetworkPolicies().Informer()}, nil // Group=networking.k8s.io, Version=v1alpha1 case networkingv1alpha1.SchemeGroupVersion.WithResource("ipaddresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().IPAddresses().Informer()}, nil case networkingv1alpha1.SchemeGroupVersion.WithResource("servicecidrs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ServiceCIDRs().Informer()}, nil // Group=networking.k8s.io, Version=v1beta1 case networkingv1beta1.SchemeGroupVersion.WithResource("ipaddresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().IPAddresses().Informer()}, nil case networkingv1beta1.SchemeGroupVersion.WithResource("ingresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().Ingresses().Informer()}, nil case networkingv1beta1.SchemeGroupVersion.WithResource("ingressclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().IngressClasses().Informer()}, nil case networkingv1beta1.SchemeGroupVersion.WithResource("servicecidrs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().ServiceCIDRs().Informer()}, nil // Group=node.k8s.io, Version=v1 case nodev1.SchemeGroupVersion.WithResource("runtimeclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Node().V1().RuntimeClasses().Informer()}, nil // Group=node.k8s.io, Version=v1alpha1 case nodev1alpha1.SchemeGroupVersion.WithResource("runtimeclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Node().V1alpha1().RuntimeClasses().Informer()}, nil // Group=node.k8s.io, Version=v1beta1 case nodev1beta1.SchemeGroupVersion.WithResource("runtimeclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Node().V1beta1().RuntimeClasses().Informer()}, nil // Group=policy, Version=v1 case policyv1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1().PodDisruptionBudgets().Informer()}, nil // Group=policy, Version=v1beta1 case policyv1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil // Group=rbac.authorization.k8s.io, Version=v1 case rbacv1.SchemeGroupVersion.WithResource("clusterroles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().ClusterRoles().Informer()}, nil case rbacv1.SchemeGroupVersion.WithResource("clusterrolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().ClusterRoleBindings().Informer()}, nil case rbacv1.SchemeGroupVersion.WithResource("roles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().Roles().Informer()}, nil case rbacv1.SchemeGroupVersion.WithResource("rolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().RoleBindings().Informer()}, nil // Group=rbac.authorization.k8s.io, Version=v1alpha1 case rbacv1alpha1.SchemeGroupVersion.WithResource("clusterroles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().ClusterRoles().Informer()}, nil case rbacv1alpha1.SchemeGroupVersion.WithResource("clusterrolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().ClusterRoleBindings().Informer()}, nil case rbacv1alpha1.SchemeGroupVersion.WithResource("roles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().Roles().Informer()}, nil case rbacv1alpha1.SchemeGroupVersion.WithResource("rolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().RoleBindings().Informer()}, nil // Group=rbac.authorization.k8s.io, Version=v1beta1 case rbacv1beta1.SchemeGroupVersion.WithResource("clusterroles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().ClusterRoles().Informer()}, nil case rbacv1beta1.SchemeGroupVersion.WithResource("clusterrolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().ClusterRoleBindings().Informer()}, nil case rbacv1beta1.SchemeGroupVersion.WithResource("roles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().Roles().Informer()}, nil case rbacv1beta1.SchemeGroupVersion.WithResource("rolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().RoleBindings().Informer()}, nil // Group=resource.k8s.io, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithResource("deviceclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().DeviceClasses().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().PodSchedulingContexts().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("resourceclaims"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaims().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaimTemplates().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("resourceslices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceSlices().Informer()}, nil // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1().PriorityClasses().Informer()}, nil // Group=scheduling.k8s.io, Version=v1alpha1 case schedulingv1alpha1.SchemeGroupVersion.WithResource("priorityclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha1().PriorityClasses().Informer()}, nil // Group=scheduling.k8s.io, Version=v1beta1 case schedulingv1beta1.SchemeGroupVersion.WithResource("priorityclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1beta1().PriorityClasses().Informer()}, nil // Group=storage.k8s.io, Version=v1 case storagev1.SchemeGroupVersion.WithResource("csidrivers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().CSIDrivers().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("csinodes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().CSINodes().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("csistoragecapacities"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().CSIStorageCapacities().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("storageclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().StorageClasses().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("volumeattachments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().VolumeAttachments().Informer()}, nil // Group=storage.k8s.io, Version=v1alpha1 case storagev1alpha1.SchemeGroupVersion.WithResource("csistoragecapacities"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().CSIStorageCapacities().Informer()}, nil case storagev1alpha1.SchemeGroupVersion.WithResource("volumeattachments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttachments().Informer()}, nil case storagev1alpha1.SchemeGroupVersion.WithResource("volumeattributesclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttributesClasses().Informer()}, nil // Group=storage.k8s.io, Version=v1beta1 case storagev1beta1.SchemeGroupVersion.WithResource("csidrivers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().CSIDrivers().Informer()}, nil case storagev1beta1.SchemeGroupVersion.WithResource("csinodes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().CSINodes().Informer()}, nil case storagev1beta1.SchemeGroupVersion.WithResource("csistoragecapacities"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().CSIStorageCapacities().Informer()}, nil case storagev1beta1.SchemeGroupVersion.WithResource("storageclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil case storagev1beta1.SchemeGroupVersion.WithResource("volumeattachments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttachments().Informer()}, nil case storagev1beta1.SchemeGroupVersion.WithResource("volumeattributesclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttributesClasses().Informer()}, nil // Group=storagemigration.k8s.io, Version=v1alpha1 case storagemigrationv1alpha1.SchemeGroupVersion.WithResource("storageversionmigrations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storagemigration().V1alpha1().StorageVersionMigrations().Informer()}, nil } return nil, fmt.Errorf("no informer found for %v", resource) } kubernetes-client-go-a2dfcab/informers/internalinterfaces/000077500000000000000000000000001472614177300242645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/internalinterfaces/factory_interfaces.go000066400000000000000000000025661472614177300304760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package internalinterfaces import ( time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" kubernetes "k8s.io/client-go/kubernetes" cache "k8s.io/client-go/tools/cache" ) // NewInformerFunc takes kubernetes.Interface and time.Duration to return a SharedIndexInformer. type NewInformerFunc func(kubernetes.Interface, time.Duration) cache.SharedIndexInformer // SharedInformerFactory a small interface to allow for adding an informer without an import cycle type SharedInformerFactory interface { Start(stopCh <-chan struct{}) InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer } // TweakListOptionsFunc is a function that transforms a v1.ListOptions. type TweakListOptionsFunc func(*v1.ListOptions) kubernetes-client-go-a2dfcab/informers/networking/000077500000000000000000000000001472614177300225735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/networking/interface.go000066400000000000000000000041341472614177300250640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package networking import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1 "k8s.io/client-go/informers/networking/v1" v1alpha1 "k8s.io/client-go/informers/networking/v1alpha1" v1beta1 "k8s.io/client-go/informers/networking/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/networking/v1/000077500000000000000000000000001472614177300231215ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/networking/v1/ingress.go000066400000000000000000000066301472614177300251270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/networking/v1" cache "k8s.io/client-go/tools/cache" ) // IngressInformer provides access to a shared informer and lister for // Ingresses. type IngressInformer interface { Informer() cache.SharedIndexInformer Lister() v1.IngressLister } type ingressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredIngressInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1().Ingresses(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1().Ingresses(namespace).Watch(context.TODO(), options) }, }, &networkingv1.Ingress{}, resyncPeriod, indexers, ) } func (f *ingressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredIngressInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *ingressInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1.Ingress{}, f.defaultInformer) } func (f *ingressInformer) Lister() v1.IngressLister { return v1.NewIngressLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/networking/v1/ingressclass.go000066400000000000000000000066371472614177300261640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/networking/v1" cache "k8s.io/client-go/tools/cache" ) // IngressClassInformer provides access to a shared informer and lister for // IngressClasses. type IngressClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1.IngressClassLister } type ingressClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewIngressClassInformer constructs a new informer for IngressClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredIngressClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredIngressClassInformer constructs a new informer for IngressClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1().IngressClasses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1().IngressClasses().Watch(context.TODO(), options) }, }, &networkingv1.IngressClass{}, resyncPeriod, indexers, ) } func (f *ingressClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredIngressClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *ingressClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1.IngressClass{}, f.defaultInformer) } func (f *ingressClassInformer) Lister() v1.IngressClassLister { return v1.NewIngressClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/networking/v1/interface.go000066400000000000000000000041061472614177300254110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // Ingresses returns a IngressInformer. Ingresses() IngressInformer // IngressClasses returns a IngressClassInformer. IngressClasses() IngressClassInformer // NetworkPolicies returns a NetworkPolicyInformer. NetworkPolicies() NetworkPolicyInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // Ingresses returns a IngressInformer. func (v *version) Ingresses() IngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // IngressClasses returns a IngressClassInformer. func (v *version) IngressClasses() IngressClassInformer { return &ingressClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // NetworkPolicies returns a NetworkPolicyInformer. func (v *version) NetworkPolicies() NetworkPolicyInformer { return &networkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/networking/v1/networkpolicy.go000066400000000000000000000070341472614177300263650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/networking/v1" cache "k8s.io/client-go/tools/cache" ) // NetworkPolicyInformer provides access to a shared informer and lister for // NetworkPolicies. type NetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() v1.NetworkPolicyLister } type networkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredNetworkPolicyInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1().NetworkPolicies(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1().NetworkPolicies(namespace).Watch(context.TODO(), options) }, }, &networkingv1.NetworkPolicy{}, resyncPeriod, indexers, ) } func (f *networkPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredNetworkPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1.NetworkPolicy{}, f.defaultInformer) } func (f *networkPolicyInformer) Lister() v1.NetworkPolicyLister { return v1.NewNetworkPolicyLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/networking/v1alpha1/000077500000000000000000000000001472614177300242105ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/networking/v1alpha1/interface.go000066400000000000000000000033671472614177300265100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // IPAddresses returns a IPAddressInformer. IPAddresses() IPAddressInformer // ServiceCIDRs returns a ServiceCIDRInformer. ServiceCIDRs() ServiceCIDRInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // IPAddresses returns a IPAddressInformer. func (v *version) IPAddresses() IPAddressInformer { return &iPAddressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ServiceCIDRs returns a ServiceCIDRInformer. func (v *version) ServiceCIDRs() ServiceCIDRInformer { return &serviceCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/networking/v1alpha1/ipaddress.go000066400000000000000000000066311472614177300265230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" networkingv1alpha1 "k8s.io/api/networking/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/networking/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // IPAddressInformer provides access to a shared informer and lister for // IPAddresses. type IPAddressInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.IPAddressLister } type iPAddressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewIPAddressInformer constructs a new informer for IPAddress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredIPAddressInformer(client, resyncPeriod, indexers, nil) } // NewFilteredIPAddressInformer constructs a new informer for IPAddress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1alpha1().IPAddresses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1alpha1().IPAddresses().Watch(context.TODO(), options) }, }, &networkingv1alpha1.IPAddress{}, resyncPeriod, indexers, ) } func (f *iPAddressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredIPAddressInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *iPAddressInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1alpha1.IPAddress{}, f.defaultInformer) } func (f *iPAddressInformer) Lister() v1alpha1.IPAddressLister { return v1alpha1.NewIPAddressLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/networking/v1alpha1/servicecidr.go000066400000000000000000000067021472614177300270460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" networkingv1alpha1 "k8s.io/api/networking/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/networking/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // ServiceCIDRInformer provides access to a shared informer and lister for // ServiceCIDRs. type ServiceCIDRInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.ServiceCIDRLister } type serviceCIDRInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewServiceCIDRInformer constructs a new informer for ServiceCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredServiceCIDRInformer(client, resyncPeriod, indexers, nil) } // NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1alpha1().ServiceCIDRs().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1alpha1().ServiceCIDRs().Watch(context.TODO(), options) }, }, &networkingv1alpha1.ServiceCIDR{}, resyncPeriod, indexers, ) } func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredServiceCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1alpha1.ServiceCIDR{}, f.defaultInformer) } func (f *serviceCIDRInformer) Lister() v1alpha1.ServiceCIDRLister { return v1alpha1.NewServiceCIDRLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/networking/v1beta1/000077500000000000000000000000001472614177300240365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/networking/v1beta1/ingress.go000066400000000000000000000067101472614177300260430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" networkingv1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/networking/v1beta1" cache "k8s.io/client-go/tools/cache" ) // IngressInformer provides access to a shared informer and lister for // Ingresses. type IngressInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.IngressLister } type ingressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredIngressInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1beta1().Ingresses(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1beta1().Ingresses(namespace).Watch(context.TODO(), options) }, }, &networkingv1beta1.Ingress{}, resyncPeriod, indexers, ) } func (f *ingressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredIngressInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *ingressInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1beta1.Ingress{}, f.defaultInformer) } func (f *ingressInformer) Lister() v1beta1.IngressLister { return v1beta1.NewIngressLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/networking/v1beta1/ingressclass.go000066400000000000000000000067171472614177300271000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" networkingv1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/networking/v1beta1" cache "k8s.io/client-go/tools/cache" ) // IngressClassInformer provides access to a shared informer and lister for // IngressClasses. type IngressClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.IngressClassLister } type ingressClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewIngressClassInformer constructs a new informer for IngressClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredIngressClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredIngressClassInformer constructs a new informer for IngressClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1beta1().IngressClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1beta1().IngressClasses().Watch(context.TODO(), options) }, }, &networkingv1beta1.IngressClass{}, resyncPeriod, indexers, ) } func (f *ingressClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredIngressClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *ingressClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1beta1.IngressClass{}, f.defaultInformer) } func (f *ingressClassInformer) Lister() v1beta1.IngressClassLister { return v1beta1.NewIngressClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/networking/v1beta1/interface.go000066400000000000000000000044431472614177300263320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // IPAddresses returns a IPAddressInformer. IPAddresses() IPAddressInformer // Ingresses returns a IngressInformer. Ingresses() IngressInformer // IngressClasses returns a IngressClassInformer. IngressClasses() IngressClassInformer // ServiceCIDRs returns a ServiceCIDRInformer. ServiceCIDRs() ServiceCIDRInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // IPAddresses returns a IPAddressInformer. func (v *version) IPAddresses() IPAddressInformer { return &iPAddressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // Ingresses returns a IngressInformer. func (v *version) Ingresses() IngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // IngressClasses returns a IngressClassInformer. func (v *version) IngressClasses() IngressClassInformer { return &ingressClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ServiceCIDRs returns a ServiceCIDRInformer. func (v *version) ServiceCIDRs() ServiceCIDRInformer { return &serviceCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/networking/v1beta1/ipaddress.go000066400000000000000000000066151472614177300263530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" networkingv1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/networking/v1beta1" cache "k8s.io/client-go/tools/cache" ) // IPAddressInformer provides access to a shared informer and lister for // IPAddresses. type IPAddressInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.IPAddressLister } type iPAddressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewIPAddressInformer constructs a new informer for IPAddress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredIPAddressInformer(client, resyncPeriod, indexers, nil) } // NewFilteredIPAddressInformer constructs a new informer for IPAddress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1beta1().IPAddresses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1beta1().IPAddresses().Watch(context.TODO(), options) }, }, &networkingv1beta1.IPAddress{}, resyncPeriod, indexers, ) } func (f *iPAddressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredIPAddressInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *iPAddressInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1beta1.IPAddress{}, f.defaultInformer) } func (f *iPAddressInformer) Lister() v1beta1.IPAddressLister { return v1beta1.NewIPAddressLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/networking/v1beta1/servicecidr.go000066400000000000000000000066661472614177300267050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" networkingv1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/networking/v1beta1" cache "k8s.io/client-go/tools/cache" ) // ServiceCIDRInformer provides access to a shared informer and lister for // ServiceCIDRs. type ServiceCIDRInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.ServiceCIDRLister } type serviceCIDRInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewServiceCIDRInformer constructs a new informer for ServiceCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredServiceCIDRInformer(client, resyncPeriod, indexers, nil) } // NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1beta1().ServiceCIDRs().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NetworkingV1beta1().ServiceCIDRs().Watch(context.TODO(), options) }, }, &networkingv1beta1.ServiceCIDR{}, resyncPeriod, indexers, ) } func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredServiceCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&networkingv1beta1.ServiceCIDR{}, f.defaultInformer) } func (f *serviceCIDRInformer) Lister() v1beta1.ServiceCIDRLister { return v1beta1.NewServiceCIDRLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/node/000077500000000000000000000000001472614177300213315ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/node/interface.go000066400000000000000000000041041472614177300236170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package node import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1 "k8s.io/client-go/informers/node/v1" v1alpha1 "k8s.io/client-go/informers/node/v1alpha1" v1beta1 "k8s.io/client-go/informers/node/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/node/v1/000077500000000000000000000000001472614177300216575ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/node/v1/interface.go000066400000000000000000000027701472614177300241540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // RuntimeClasses returns a RuntimeClassInformer. RuntimeClasses() RuntimeClassInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // RuntimeClasses returns a RuntimeClassInformer. func (v *version) RuntimeClasses() RuntimeClassInformer { return &runtimeClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/node/v1/runtimeclass.go000066400000000000000000000065651472614177300247330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" nodev1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/node/v1" cache "k8s.io/client-go/tools/cache" ) // RuntimeClassInformer provides access to a shared informer and lister for // RuntimeClasses. type RuntimeClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1.RuntimeClassLister } type runtimeClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRuntimeClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NodeV1().RuntimeClasses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NodeV1().RuntimeClasses().Watch(context.TODO(), options) }, }, &nodev1.RuntimeClass{}, resyncPeriod, indexers, ) } func (f *runtimeClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRuntimeClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *runtimeClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&nodev1.RuntimeClass{}, f.defaultInformer) } func (f *runtimeClassInformer) Lister() v1.RuntimeClassLister { return v1.NewRuntimeClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/node/v1alpha1/000077500000000000000000000000001472614177300227465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/node/v1alpha1/interface.go000066400000000000000000000027761472614177300252510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // RuntimeClasses returns a RuntimeClassInformer. RuntimeClasses() RuntimeClassInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // RuntimeClasses returns a RuntimeClassInformer. func (v *version) RuntimeClasses() RuntimeClassInformer { return &runtimeClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/node/v1alpha1/runtimeclass.go000066400000000000000000000066611472614177300260170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" nodev1alpha1 "k8s.io/api/node/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/node/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // RuntimeClassInformer provides access to a shared informer and lister for // RuntimeClasses. type RuntimeClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.RuntimeClassLister } type runtimeClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRuntimeClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NodeV1alpha1().RuntimeClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NodeV1alpha1().RuntimeClasses().Watch(context.TODO(), options) }, }, &nodev1alpha1.RuntimeClass{}, resyncPeriod, indexers, ) } func (f *runtimeClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRuntimeClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *runtimeClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&nodev1alpha1.RuntimeClass{}, f.defaultInformer) } func (f *runtimeClassInformer) Lister() v1alpha1.RuntimeClassLister { return v1alpha1.NewRuntimeClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/node/v1beta1/000077500000000000000000000000001472614177300225745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/node/v1beta1/interface.go000066400000000000000000000027751472614177300250760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // RuntimeClasses returns a RuntimeClassInformer. RuntimeClasses() RuntimeClassInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // RuntimeClasses returns a RuntimeClassInformer. func (v *version) RuntimeClasses() RuntimeClassInformer { return &runtimeClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/node/v1beta1/runtimeclass.go000066400000000000000000000066451472614177300256470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" nodev1beta1 "k8s.io/api/node/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/node/v1beta1" cache "k8s.io/client-go/tools/cache" ) // RuntimeClassInformer provides access to a shared informer and lister for // RuntimeClasses. type RuntimeClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.RuntimeClassLister } type runtimeClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRuntimeClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NodeV1beta1().RuntimeClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NodeV1beta1().RuntimeClasses().Watch(context.TODO(), options) }, }, &nodev1beta1.RuntimeClass{}, resyncPeriod, indexers, ) } func (f *runtimeClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRuntimeClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *runtimeClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&nodev1beta1.RuntimeClass{}, f.defaultInformer) } func (f *runtimeClassInformer) Lister() v1beta1.RuntimeClassLister { return v1beta1.NewRuntimeClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/policy/000077500000000000000000000000001472614177300217035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/policy/interface.go000066400000000000000000000034101472614177300241700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package policy import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1 "k8s.io/client-go/informers/policy/v1" v1beta1 "k8s.io/client-go/informers/policy/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/policy/v1/000077500000000000000000000000001472614177300222315ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/policy/v1/interface.go000066400000000000000000000031131472614177300245160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. PodDisruptionBudgets() PodDisruptionBudgetInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/policy/v1/poddisruptionbudget.go000066400000000000000000000072011472614177300266560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" policyv1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/policy/v1" cache "k8s.io/client-go/tools/cache" ) // PodDisruptionBudgetInformer provides access to a shared informer and lister for // PodDisruptionBudgets. type PodDisruptionBudgetInformer interface { Informer() cache.SharedIndexInformer Lister() v1.PodDisruptionBudgetLister } type podDisruptionBudgetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPodDisruptionBudgetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.PolicyV1().PodDisruptionBudgets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.PolicyV1().PodDisruptionBudgets(namespace).Watch(context.TODO(), options) }, }, &policyv1.PodDisruptionBudget{}, resyncPeriod, indexers, ) } func (f *podDisruptionBudgetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPodDisruptionBudgetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *podDisruptionBudgetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&policyv1.PodDisruptionBudget{}, f.defaultInformer) } func (f *podDisruptionBudgetInformer) Lister() v1.PodDisruptionBudgetLister { return v1.NewPodDisruptionBudgetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/policy/v1beta1/000077500000000000000000000000001472614177300231465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/policy/v1beta1/interface.go000066400000000000000000000031201472614177300254310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. PodDisruptionBudgets() PodDisruptionBudgetInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/policy/v1beta1/poddisruptionbudget.go000066400000000000000000000072611472614177300276010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" policyv1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/policy/v1beta1" cache "k8s.io/client-go/tools/cache" ) // PodDisruptionBudgetInformer provides access to a shared informer and lister for // PodDisruptionBudgets. type PodDisruptionBudgetInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.PodDisruptionBudgetLister } type podDisruptionBudgetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPodDisruptionBudgetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(context.TODO(), options) }, }, &policyv1beta1.PodDisruptionBudget{}, resyncPeriod, indexers, ) } func (f *podDisruptionBudgetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPodDisruptionBudgetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *podDisruptionBudgetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&policyv1beta1.PodDisruptionBudget{}, f.defaultInformer) } func (f *podDisruptionBudgetInformer) Lister() v1beta1.PodDisruptionBudgetLister { return v1beta1.NewPodDisruptionBudgetLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/000077500000000000000000000000001472614177300213135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/rbac/interface.go000066400000000000000000000041041472614177300236010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package rbac import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1 "k8s.io/client-go/informers/rbac/v1" v1alpha1 "k8s.io/client-go/informers/rbac/v1alpha1" v1beta1 "k8s.io/client-go/informers/rbac/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/rbac/v1/000077500000000000000000000000001472614177300216415ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/rbac/v1/clusterrole.go000066400000000000000000000065341472614177300245430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" ) // ClusterRoleInformer provides access to a shared informer and lister for // ClusterRoles. type ClusterRoleInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ClusterRoleLister } type clusterRoleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredClusterRoleInformer(client, resyncPeriod, indexers, nil) } // NewFilteredClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().ClusterRoles().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().ClusterRoles().Watch(context.TODO(), options) }, }, &rbacv1.ClusterRole{}, resyncPeriod, indexers, ) } func (f *clusterRoleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredClusterRoleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1.ClusterRole{}, f.defaultInformer) } func (f *clusterRoleInformer) Lister() v1.ClusterRoleLister { return v1.NewClusterRoleLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1/clusterrolebinding.go000066400000000000000000000067661472614177300261050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for // ClusterRoleBindings. type ClusterRoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1.ClusterRoleBindingLister } type clusterRoleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredClusterRoleBindingInformer(client, resyncPeriod, indexers, nil) } // NewFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().ClusterRoleBindings().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().ClusterRoleBindings().Watch(context.TODO(), options) }, }, &rbacv1.ClusterRoleBinding{}, resyncPeriod, indexers, ) } func (f *clusterRoleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredClusterRoleBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *clusterRoleBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1.ClusterRoleBinding{}, f.defaultInformer) } func (f *clusterRoleBindingInformer) Lister() v1.ClusterRoleBindingLister { return v1.NewClusterRoleBindingLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1/interface.go000066400000000000000000000045271472614177300241400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ClusterRoles returns a ClusterRoleInformer. ClusterRoles() ClusterRoleInformer // ClusterRoleBindings returns a ClusterRoleBindingInformer. ClusterRoleBindings() ClusterRoleBindingInformer // Roles returns a RoleInformer. Roles() RoleInformer // RoleBindings returns a RoleBindingInformer. RoleBindings() RoleBindingInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ClusterRoles returns a ClusterRoleInformer. func (v *version) ClusterRoles() ClusterRoleInformer { return &clusterRoleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ClusterRoleBindings returns a ClusterRoleBindingInformer. func (v *version) ClusterRoleBindings() ClusterRoleBindingInformer { return &clusterRoleBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // Roles returns a RoleInformer. func (v *version) Roles() RoleInformer { return &roleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // RoleBindings returns a RoleBindingInformer. func (v *version) RoleBindings() RoleBindingInformer { return &roleBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/rbac/v1/role.go000066400000000000000000000064511472614177300231370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" ) // RoleInformer provides access to a shared informer and lister for // Roles. type RoleInformer interface { Informer() cache.SharedIndexInformer Lister() v1.RoleLister } type roleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRoleInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().Roles(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().Roles(namespace).Watch(context.TODO(), options) }, }, &rbacv1.Role{}, resyncPeriod, indexers, ) } func (f *roleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRoleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *roleInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1.Role{}, f.defaultInformer) } func (f *roleInformer) Lister() v1.RoleLister { return v1.NewRoleLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1/rolebinding.go000066400000000000000000000067031472614177300244720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" ) // RoleBindingInformer provides access to a shared informer and lister for // RoleBindings. type RoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1.RoleBindingLister } type roleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRoleBindingInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().RoleBindings(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1().RoleBindings(namespace).Watch(context.TODO(), options) }, }, &rbacv1.RoleBinding{}, resyncPeriod, indexers, ) } func (f *roleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRoleBindingInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *roleBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1.RoleBinding{}, f.defaultInformer) } func (f *roleBindingInformer) Lister() v1.RoleBindingLister { return v1.NewRoleBindingLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1alpha1/000077500000000000000000000000001472614177300227305ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/rbac/v1alpha1/clusterrole.go000066400000000000000000000066301472614177300256270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // ClusterRoleInformer provides access to a shared informer and lister for // ClusterRoles. type ClusterRoleInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.ClusterRoleLister } type clusterRoleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredClusterRoleInformer(client, resyncPeriod, indexers, nil) } // NewFilteredClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1alpha1().ClusterRoles().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1alpha1().ClusterRoles().Watch(context.TODO(), options) }, }, &rbacv1alpha1.ClusterRole{}, resyncPeriod, indexers, ) } func (f *clusterRoleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredClusterRoleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1alpha1.ClusterRole{}, f.defaultInformer) } func (f *clusterRoleInformer) Lister() v1alpha1.ClusterRoleLister { return v1alpha1.NewClusterRoleLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1alpha1/clusterrolebinding.go000066400000000000000000000070621472614177300271620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for // ClusterRoleBindings. type ClusterRoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.ClusterRoleBindingLister } type clusterRoleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredClusterRoleBindingInformer(client, resyncPeriod, indexers, nil) } // NewFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1alpha1().ClusterRoleBindings().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1alpha1().ClusterRoleBindings().Watch(context.TODO(), options) }, }, &rbacv1alpha1.ClusterRoleBinding{}, resyncPeriod, indexers, ) } func (f *clusterRoleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredClusterRoleBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *clusterRoleBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1alpha1.ClusterRoleBinding{}, f.defaultInformer) } func (f *clusterRoleBindingInformer) Lister() v1alpha1.ClusterRoleBindingLister { return v1alpha1.NewClusterRoleBindingLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1alpha1/interface.go000066400000000000000000000045351472614177300252260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ClusterRoles returns a ClusterRoleInformer. ClusterRoles() ClusterRoleInformer // ClusterRoleBindings returns a ClusterRoleBindingInformer. ClusterRoleBindings() ClusterRoleBindingInformer // Roles returns a RoleInformer. Roles() RoleInformer // RoleBindings returns a RoleBindingInformer. RoleBindings() RoleBindingInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ClusterRoles returns a ClusterRoleInformer. func (v *version) ClusterRoles() ClusterRoleInformer { return &clusterRoleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ClusterRoleBindings returns a ClusterRoleBindingInformer. func (v *version) ClusterRoleBindings() ClusterRoleBindingInformer { return &clusterRoleBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // Roles returns a RoleInformer. func (v *version) Roles() RoleInformer { return &roleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // RoleBindings returns a RoleBindingInformer. func (v *version) RoleBindings() RoleBindingInformer { return &roleBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/rbac/v1alpha1/role.go000066400000000000000000000065451472614177300242320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // RoleInformer provides access to a shared informer and lister for // Roles. type RoleInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.RoleLister } type roleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRoleInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1alpha1().Roles(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1alpha1().Roles(namespace).Watch(context.TODO(), options) }, }, &rbacv1alpha1.Role{}, resyncPeriod, indexers, ) } func (f *roleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRoleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *roleInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1alpha1.Role{}, f.defaultInformer) } func (f *roleInformer) Lister() v1alpha1.RoleLister { return v1alpha1.NewRoleLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1alpha1/rolebinding.go000066400000000000000000000067771472614177300255740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // RoleBindingInformer provides access to a shared informer and lister for // RoleBindings. type RoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.RoleBindingLister } type roleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRoleBindingInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1alpha1().RoleBindings(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1alpha1().RoleBindings(namespace).Watch(context.TODO(), options) }, }, &rbacv1alpha1.RoleBinding{}, resyncPeriod, indexers, ) } func (f *roleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRoleBindingInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *roleBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1alpha1.RoleBinding{}, f.defaultInformer) } func (f *roleBindingInformer) Lister() v1alpha1.RoleBindingLister { return v1alpha1.NewRoleBindingLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1beta1/000077500000000000000000000000001472614177300225565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/rbac/v1beta1/clusterrole.go000066400000000000000000000066141472614177300254570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" rbacv1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" ) // ClusterRoleInformer provides access to a shared informer and lister for // ClusterRoles. type ClusterRoleInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.ClusterRoleLister } type clusterRoleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredClusterRoleInformer(client, resyncPeriod, indexers, nil) } // NewFilteredClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1beta1().ClusterRoles().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1beta1().ClusterRoles().Watch(context.TODO(), options) }, }, &rbacv1beta1.ClusterRole{}, resyncPeriod, indexers, ) } func (f *clusterRoleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredClusterRoleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1beta1.ClusterRole{}, f.defaultInformer) } func (f *clusterRoleInformer) Lister() v1beta1.ClusterRoleLister { return v1beta1.NewClusterRoleLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1beta1/clusterrolebinding.go000066400000000000000000000070461472614177300270120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" rbacv1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for // ClusterRoleBindings. type ClusterRoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.ClusterRoleBindingLister } type clusterRoleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredClusterRoleBindingInformer(client, resyncPeriod, indexers, nil) } // NewFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1beta1().ClusterRoleBindings().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1beta1().ClusterRoleBindings().Watch(context.TODO(), options) }, }, &rbacv1beta1.ClusterRoleBinding{}, resyncPeriod, indexers, ) } func (f *clusterRoleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredClusterRoleBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *clusterRoleBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1beta1.ClusterRoleBinding{}, f.defaultInformer) } func (f *clusterRoleBindingInformer) Lister() v1beta1.ClusterRoleBindingLister { return v1beta1.NewClusterRoleBindingLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1beta1/interface.go000066400000000000000000000045341472614177300250530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // ClusterRoles returns a ClusterRoleInformer. ClusterRoles() ClusterRoleInformer // ClusterRoleBindings returns a ClusterRoleBindingInformer. ClusterRoleBindings() ClusterRoleBindingInformer // Roles returns a RoleInformer. Roles() RoleInformer // RoleBindings returns a RoleBindingInformer. RoleBindings() RoleBindingInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // ClusterRoles returns a ClusterRoleInformer. func (v *version) ClusterRoles() ClusterRoleInformer { return &clusterRoleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // ClusterRoleBindings returns a ClusterRoleBindingInformer. func (v *version) ClusterRoleBindings() ClusterRoleBindingInformer { return &clusterRoleBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // Roles returns a RoleInformer. func (v *version) Roles() RoleInformer { return &roleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // RoleBindings returns a RoleBindingInformer. func (v *version) RoleBindings() RoleBindingInformer { return &roleBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/rbac/v1beta1/role.go000066400000000000000000000065311472614177300240530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" rbacv1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" ) // RoleInformer provides access to a shared informer and lister for // Roles. type RoleInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.RoleLister } type roleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRoleInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1beta1().Roles(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1beta1().Roles(namespace).Watch(context.TODO(), options) }, }, &rbacv1beta1.Role{}, resyncPeriod, indexers, ) } func (f *roleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRoleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *roleInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1beta1.Role{}, f.defaultInformer) } func (f *roleInformer) Lister() v1beta1.RoleLister { return v1beta1.NewRoleLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/rbac/v1beta1/rolebinding.go000066400000000000000000000067631472614177300254150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" rbacv1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" ) // RoleBindingInformer provides access to a shared informer and lister for // RoleBindings. type RoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.RoleBindingLister } type roleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRoleBindingInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1beta1().RoleBindings(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.RbacV1beta1().RoleBindings(namespace).Watch(context.TODO(), options) }, }, &rbacv1beta1.RoleBinding{}, resyncPeriod, indexers, ) } func (f *roleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRoleBindingInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *roleBindingInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&rbacv1beta1.RoleBinding{}, f.defaultInformer) } func (f *roleBindingInformer) Lister() v1beta1.RoleBindingLister { return v1beta1.NewRoleBindingLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/resource/000077500000000000000000000000001472614177300222335ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/resource/interface.go000066400000000000000000000030251472614177300245220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package resource import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1alpha3 "k8s.io/client-go/informers/resource/v1alpha3" ) // Interface provides access to each of this group's versions. type Interface interface { // V1alpha3 provides access to shared informers for resources in V1alpha3. V1alpha3() v1alpha3.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1alpha3 returns a new v1alpha3.Interface. func (g *group) V1alpha3() v1alpha3.Interface { return v1alpha3.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/resource/v1alpha3/000077500000000000000000000000001472614177300236525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/resource/v1alpha3/deviceclass.go000066400000000000000000000066671472614177300265050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha3 import ( "context" time "time" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) // DeviceClassInformer provides access to a shared informer and lister for // DeviceClasses. type DeviceClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha3.DeviceClassLister } type deviceClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredDeviceClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().DeviceClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().DeviceClasses().Watch(context.TODO(), options) }, }, &resourcev1alpha3.DeviceClass{}, resyncPeriod, indexers, ) } func (f *deviceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredDeviceClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *deviceClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&resourcev1alpha3.DeviceClass{}, f.defaultInformer) } func (f *deviceClassInformer) Lister() v1alpha3.DeviceClassLister { return v1alpha3.NewDeviceClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/resource/v1alpha3/interface.go000066400000000000000000000055341472614177300261500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha3 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // DeviceClasses returns a DeviceClassInformer. DeviceClasses() DeviceClassInformer // PodSchedulingContexts returns a PodSchedulingContextInformer. PodSchedulingContexts() PodSchedulingContextInformer // ResourceClaims returns a ResourceClaimInformer. ResourceClaims() ResourceClaimInformer // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. ResourceClaimTemplates() ResourceClaimTemplateInformer // ResourceSlices returns a ResourceSliceInformer. ResourceSlices() ResourceSliceInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // DeviceClasses returns a DeviceClassInformer. func (v *version) DeviceClasses() DeviceClassInformer { return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // PodSchedulingContexts returns a PodSchedulingContextInformer. func (v *version) PodSchedulingContexts() PodSchedulingContextInformer { return &podSchedulingContextInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ResourceClaims returns a ResourceClaimInformer. func (v *version) ResourceClaims() ResourceClaimInformer { return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer { return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // ResourceSlices returns a ResourceSliceInformer. func (v *version) ResourceSlices() ResourceSliceInformer { return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/resource/v1alpha3/podschedulingcontext.go000066400000000000000000000073411472614177300304430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha3 import ( "context" time "time" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) // PodSchedulingContextInformer provides access to a shared informer and lister for // PodSchedulingContexts. type PodSchedulingContextInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha3.PodSchedulingContextLister } type podSchedulingContextInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewPodSchedulingContextInformer constructs a new informer for PodSchedulingContext type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPodSchedulingContextInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPodSchedulingContextInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredPodSchedulingContextInformer constructs a new informer for PodSchedulingContext type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPodSchedulingContextInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().PodSchedulingContexts(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().PodSchedulingContexts(namespace).Watch(context.TODO(), options) }, }, &resourcev1alpha3.PodSchedulingContext{}, resyncPeriod, indexers, ) } func (f *podSchedulingContextInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPodSchedulingContextInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *podSchedulingContextInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&resourcev1alpha3.PodSchedulingContext{}, f.defaultInformer) } func (f *podSchedulingContextInformer) Lister() v1alpha3.PodSchedulingContextLister { return v1alpha3.NewPodSchedulingContextLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/resource/v1alpha3/resourceclaim.go000066400000000000000000000071071472614177300270430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha3 import ( "context" time "time" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) // ResourceClaimInformer provides access to a shared informer and lister for // ResourceClaims. type ResourceClaimInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha3.ResourceClaimLister } type resourceClaimInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewResourceClaimInformer constructs a new informer for ResourceClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredResourceClaimInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredResourceClaimInformer constructs a new informer for ResourceClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().ResourceClaims(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().ResourceClaims(namespace).Watch(context.TODO(), options) }, }, &resourcev1alpha3.ResourceClaim{}, resyncPeriod, indexers, ) } func (f *resourceClaimInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredResourceClaimInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&resourcev1alpha3.ResourceClaim{}, f.defaultInformer) } func (f *resourceClaimInformer) Lister() v1alpha3.ResourceClaimLister { return v1alpha3.NewResourceClaimLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/resource/v1alpha3/resourceclaimtemplate.go000066400000000000000000000073671472614177300306070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha3 import ( "context" time "time" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) // ResourceClaimTemplateInformer provides access to a shared informer and lister for // ResourceClaimTemplates. type ResourceClaimTemplateInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha3.ResourceClaimTemplateLister } type resourceClaimTemplateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredResourceClaimTemplateInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).Watch(context.TODO(), options) }, }, &resourcev1alpha3.ResourceClaimTemplate{}, resyncPeriod, indexers, ) } func (f *resourceClaimTemplateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredResourceClaimTemplateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&resourcev1alpha3.ResourceClaimTemplate{}, f.defaultInformer) } func (f *resourceClaimTemplateInformer) Lister() v1alpha3.ResourceClaimTemplateLister { return v1alpha3.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/resource/v1alpha3/resourceslice.go000066400000000000000000000067401472614177300270570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha3 import ( "context" time "time" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) // ResourceSliceInformer provides access to a shared informer and lister for // ResourceSlices. type ResourceSliceInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha3.ResourceSliceLister } type resourceSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewResourceSliceInformer constructs a new informer for ResourceSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredResourceSliceInformer(client, resyncPeriod, indexers, nil) } // NewFilteredResourceSliceInformer constructs a new informer for ResourceSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().ResourceSlices().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ResourceV1alpha3().ResourceSlices().Watch(context.TODO(), options) }, }, &resourcev1alpha3.ResourceSlice{}, resyncPeriod, indexers, ) } func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredResourceSliceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&resourcev1alpha3.ResourceSlice{}, f.defaultInformer) } func (f *resourceSliceInformer) Lister() v1alpha3.ResourceSliceLister { return v1alpha3.NewResourceSliceLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/scheduling/000077500000000000000000000000001472614177300225315ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/scheduling/interface.go000066400000000000000000000041341472614177300250220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package scheduling import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1 "k8s.io/client-go/informers/scheduling/v1" v1alpha1 "k8s.io/client-go/informers/scheduling/v1alpha1" v1beta1 "k8s.io/client-go/informers/scheduling/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/scheduling/v1/000077500000000000000000000000001472614177300230575ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/scheduling/v1/interface.go000066400000000000000000000030011472614177300253400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // PriorityClasses returns a PriorityClassInformer. PriorityClasses() PriorityClassInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // PriorityClasses returns a PriorityClassInformer. func (v *version) PriorityClasses() PriorityClassInformer { return &priorityClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/scheduling/v1/priorityclass.go000066400000000000000000000066651472614177300263320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" schedulingv1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/scheduling/v1" cache "k8s.io/client-go/tools/cache" ) // PriorityClassInformer provides access to a shared informer and lister for // PriorityClasses. type PriorityClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1.PriorityClassLister } type priorityClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPriorityClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SchedulingV1().PriorityClasses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SchedulingV1().PriorityClasses().Watch(context.TODO(), options) }, }, &schedulingv1.PriorityClass{}, resyncPeriod, indexers, ) } func (f *priorityClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPriorityClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *priorityClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&schedulingv1.PriorityClass{}, f.defaultInformer) } func (f *priorityClassInformer) Lister() v1.PriorityClassLister { return v1.NewPriorityClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/scheduling/v1alpha1/000077500000000000000000000000001472614177300241465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/scheduling/v1alpha1/interface.go000066400000000000000000000030071472614177300264350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // PriorityClasses returns a PriorityClassInformer. PriorityClasses() PriorityClassInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // PriorityClasses returns a PriorityClassInformer. func (v *version) PriorityClasses() PriorityClassInformer { return &priorityClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/scheduling/v1alpha1/priorityclass.go000066400000000000000000000067611472614177300274160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/scheduling/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // PriorityClassInformer provides access to a shared informer and lister for // PriorityClasses. type PriorityClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.PriorityClassLister } type priorityClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPriorityClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SchedulingV1alpha1().PriorityClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SchedulingV1alpha1().PriorityClasses().Watch(context.TODO(), options) }, }, &schedulingv1alpha1.PriorityClass{}, resyncPeriod, indexers, ) } func (f *priorityClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPriorityClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *priorityClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&schedulingv1alpha1.PriorityClass{}, f.defaultInformer) } func (f *priorityClassInformer) Lister() v1alpha1.PriorityClassLister { return v1alpha1.NewPriorityClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/scheduling/v1beta1/000077500000000000000000000000001472614177300237745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/scheduling/v1beta1/interface.go000066400000000000000000000030061472614177300262620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // PriorityClasses returns a PriorityClassInformer. PriorityClasses() PriorityClassInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // PriorityClasses returns a PriorityClassInformer. func (v *version) PriorityClasses() PriorityClassInformer { return &priorityClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/scheduling/v1beta1/priorityclass.go000066400000000000000000000067451472614177300272460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/scheduling/v1beta1" cache "k8s.io/client-go/tools/cache" ) // PriorityClassInformer provides access to a shared informer and lister for // PriorityClasses. type PriorityClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.PriorityClassLister } type priorityClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPriorityClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SchedulingV1beta1().PriorityClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SchedulingV1beta1().PriorityClasses().Watch(context.TODO(), options) }, }, &schedulingv1beta1.PriorityClass{}, resyncPeriod, indexers, ) } func (f *priorityClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPriorityClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *priorityClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&schedulingv1beta1.PriorityClass{}, f.defaultInformer) } func (f *priorityClassInformer) Lister() v1beta1.PriorityClassLister { return v1beta1.NewPriorityClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/000077500000000000000000000000001472614177300220505ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/storage/interface.go000066400000000000000000000041201472614177300243340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package storage import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1 "k8s.io/client-go/informers/storage/v1" v1alpha1 "k8s.io/client-go/informers/storage/v1alpha1" v1beta1 "k8s.io/client-go/informers/storage/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1 returns a new v1.Interface. func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/storage/v1/000077500000000000000000000000001472614177300223765ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/storage/v1/csidriver.go000066400000000000000000000065051472614177300247250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/storage/v1" cache "k8s.io/client-go/tools/cache" ) // CSIDriverInformer provides access to a shared informer and lister for // CSIDrivers. type CSIDriverInformer interface { Informer() cache.SharedIndexInformer Lister() v1.CSIDriverLister } type cSIDriverInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewCSIDriverInformer constructs a new informer for CSIDriver type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCSIDriverInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCSIDriverInformer constructs a new informer for CSIDriver type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().CSIDrivers().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().CSIDrivers().Watch(context.TODO(), options) }, }, &storagev1.CSIDriver{}, resyncPeriod, indexers, ) } func (f *cSIDriverInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCSIDriverInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cSIDriverInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1.CSIDriver{}, f.defaultInformer) } func (f *cSIDriverInformer) Lister() v1.CSIDriverLister { return v1.NewCSIDriverLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1/csinode.go000066400000000000000000000064311472614177300243550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/storage/v1" cache "k8s.io/client-go/tools/cache" ) // CSINodeInformer provides access to a shared informer and lister for // CSINodes. type CSINodeInformer interface { Informer() cache.SharedIndexInformer Lister() v1.CSINodeLister } type cSINodeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewCSINodeInformer constructs a new informer for CSINode type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCSINodeInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCSINodeInformer constructs a new informer for CSINode type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().CSINodes().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().CSINodes().Watch(context.TODO(), options) }, }, &storagev1.CSINode{}, resyncPeriod, indexers, ) } func (f *cSINodeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCSINodeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cSINodeInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1.CSINode{}, f.defaultInformer) } func (f *cSINodeInformer) Lister() v1.CSINodeLister { return v1.NewCSINodeLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1/csistoragecapacity.go000066400000000000000000000071651472614177300266170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/storage/v1" cache "k8s.io/client-go/tools/cache" ) // CSIStorageCapacityInformer provides access to a shared informer and lister for // CSIStorageCapacities. type CSIStorageCapacityInformer interface { Informer() cache.SharedIndexInformer Lister() v1.CSIStorageCapacityLister } type cSIStorageCapacityInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCSIStorageCapacityInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().CSIStorageCapacities(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().CSIStorageCapacities(namespace).Watch(context.TODO(), options) }, }, &storagev1.CSIStorageCapacity{}, resyncPeriod, indexers, ) } func (f *cSIStorageCapacityInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCSIStorageCapacityInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cSIStorageCapacityInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1.CSIStorageCapacity{}, f.defaultInformer) } func (f *cSIStorageCapacityInformer) Lister() v1.CSIStorageCapacityLister { return v1.NewCSIStorageCapacityLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1/interface.go000066400000000000000000000052321472614177300246670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // CSIDrivers returns a CSIDriverInformer. CSIDrivers() CSIDriverInformer // CSINodes returns a CSINodeInformer. CSINodes() CSINodeInformer // CSIStorageCapacities returns a CSIStorageCapacityInformer. CSIStorageCapacities() CSIStorageCapacityInformer // StorageClasses returns a StorageClassInformer. StorageClasses() StorageClassInformer // VolumeAttachments returns a VolumeAttachmentInformer. VolumeAttachments() VolumeAttachmentInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // CSIDrivers returns a CSIDriverInformer. func (v *version) CSIDrivers() CSIDriverInformer { return &cSIDriverInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // CSINodes returns a CSINodeInformer. func (v *version) CSINodes() CSINodeInformer { return &cSINodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // CSIStorageCapacities returns a CSIStorageCapacityInformer. func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer { return &cSIStorageCapacityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // StorageClasses returns a StorageClassInformer. func (v *version) StorageClasses() StorageClassInformer { return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // VolumeAttachments returns a VolumeAttachmentInformer. func (v *version) VolumeAttachments() VolumeAttachmentInformer { return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/storage/v1/storageclass.go000066400000000000000000000066121472614177300254240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/storage/v1" cache "k8s.io/client-go/tools/cache" ) // StorageClassInformer provides access to a shared informer and lister for // StorageClasses. type StorageClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1.StorageClassLister } type storageClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewStorageClassInformer constructs a new informer for StorageClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredStorageClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredStorageClassInformer constructs a new informer for StorageClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().StorageClasses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().StorageClasses().Watch(context.TODO(), options) }, }, &storagev1.StorageClass{}, resyncPeriod, indexers, ) } func (f *storageClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredStorageClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *storageClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1.StorageClass{}, f.defaultInformer) } func (f *storageClassInformer) Lister() v1.StorageClassLister { return v1.NewStorageClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1/volumeattachment.go000066400000000000000000000067371472614177300263220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1 import ( "context" time "time" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/storage/v1" cache "k8s.io/client-go/tools/cache" ) // VolumeAttachmentInformer provides access to a shared informer and lister for // VolumeAttachments. type VolumeAttachmentInformer interface { Informer() cache.SharedIndexInformer Lister() v1.VolumeAttachmentLister } type volumeAttachmentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, indexers, nil) } // NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().VolumeAttachments().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1().VolumeAttachments().Watch(context.TODO(), options) }, }, &storagev1.VolumeAttachment{}, resyncPeriod, indexers, ) } func (f *volumeAttachmentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1.VolumeAttachment{}, f.defaultInformer) } func (f *volumeAttachmentInformer) Lister() v1.VolumeAttachmentLister { return v1.NewVolumeAttachmentLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1alpha1/000077500000000000000000000000001472614177300234655ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/storage/v1alpha1/csistoragecapacity.go000066400000000000000000000072611472614177300277030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" storagev1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/storage/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // CSIStorageCapacityInformer provides access to a shared informer and lister for // CSIStorageCapacities. type CSIStorageCapacityInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.CSIStorageCapacityLister } type cSIStorageCapacityInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCSIStorageCapacityInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1alpha1().CSIStorageCapacities(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1alpha1().CSIStorageCapacities(namespace).Watch(context.TODO(), options) }, }, &storagev1alpha1.CSIStorageCapacity{}, resyncPeriod, indexers, ) } func (f *cSIStorageCapacityInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCSIStorageCapacityInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cSIStorageCapacityInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1alpha1.CSIStorageCapacity{}, f.defaultInformer) } func (f *cSIStorageCapacityInformer) Lister() v1alpha1.CSIStorageCapacityLister { return v1alpha1.NewCSIStorageCapacityLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1alpha1/interface.go000066400000000000000000000043771472614177300257670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // CSIStorageCapacities returns a CSIStorageCapacityInformer. CSIStorageCapacities() CSIStorageCapacityInformer // VolumeAttachments returns a VolumeAttachmentInformer. VolumeAttachments() VolumeAttachmentInformer // VolumeAttributesClasses returns a VolumeAttributesClassInformer. VolumeAttributesClasses() VolumeAttributesClassInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // CSIStorageCapacities returns a CSIStorageCapacityInformer. func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer { return &cSIStorageCapacityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // VolumeAttachments returns a VolumeAttachmentInformer. func (v *version) VolumeAttachments() VolumeAttachmentInformer { return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // VolumeAttributesClasses returns a VolumeAttributesClassInformer. func (v *version) VolumeAttributesClasses() VolumeAttributesClassInformer { return &volumeAttributesClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/storage/v1alpha1/volumeattachment.go000066400000000000000000000070331472614177300273770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" storagev1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/storage/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // VolumeAttachmentInformer provides access to a shared informer and lister for // VolumeAttachments. type VolumeAttachmentInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.VolumeAttachmentLister } type volumeAttachmentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, indexers, nil) } // NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1alpha1().VolumeAttachments().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1alpha1().VolumeAttachments().Watch(context.TODO(), options) }, }, &storagev1alpha1.VolumeAttachment{}, resyncPeriod, indexers, ) } func (f *volumeAttachmentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1alpha1.VolumeAttachment{}, f.defaultInformer) } func (f *volumeAttachmentInformer) Lister() v1alpha1.VolumeAttachmentLister { return v1alpha1.NewVolumeAttachmentLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1alpha1/volumeattributesclass.go000066400000000000000000000072141472614177300304640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" storagev1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/storage/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // VolumeAttributesClassInformer provides access to a shared informer and lister for // VolumeAttributesClasses. type VolumeAttributesClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.VolumeAttributesClassLister } type volumeAttributesClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1alpha1().VolumeAttributesClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1alpha1().VolumeAttributesClasses().Watch(context.TODO(), options) }, }, &storagev1alpha1.VolumeAttributesClass{}, resyncPeriod, indexers, ) } func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1alpha1.VolumeAttributesClass{}, f.defaultInformer) } func (f *volumeAttributesClassInformer) Lister() v1alpha1.VolumeAttributesClassLister { return v1alpha1.NewVolumeAttributesClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1beta1/000077500000000000000000000000001472614177300233135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/storage/v1beta1/csidriver.go000066400000000000000000000065651472614177300256500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/storage/v1beta1" cache "k8s.io/client-go/tools/cache" ) // CSIDriverInformer provides access to a shared informer and lister for // CSIDrivers. type CSIDriverInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.CSIDriverLister } type cSIDriverInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewCSIDriverInformer constructs a new informer for CSIDriver type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCSIDriverInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCSIDriverInformer constructs a new informer for CSIDriver type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().CSIDrivers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().CSIDrivers().Watch(context.TODO(), options) }, }, &storagev1beta1.CSIDriver{}, resyncPeriod, indexers, ) } func (f *cSIDriverInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCSIDriverInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cSIDriverInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1beta1.CSIDriver{}, f.defaultInformer) } func (f *cSIDriverInformer) Lister() v1beta1.CSIDriverLister { return v1beta1.NewCSIDriverLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1beta1/csinode.go000066400000000000000000000065111472614177300252710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/storage/v1beta1" cache "k8s.io/client-go/tools/cache" ) // CSINodeInformer provides access to a shared informer and lister for // CSINodes. type CSINodeInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.CSINodeLister } type cSINodeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewCSINodeInformer constructs a new informer for CSINode type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCSINodeInformer(client, resyncPeriod, indexers, nil) } // NewFilteredCSINodeInformer constructs a new informer for CSINode type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().CSINodes().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().CSINodes().Watch(context.TODO(), options) }, }, &storagev1beta1.CSINode{}, resyncPeriod, indexers, ) } func (f *cSINodeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCSINodeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cSINodeInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1beta1.CSINode{}, f.defaultInformer) } func (f *cSINodeInformer) Lister() v1beta1.CSINodeLister { return v1beta1.NewCSINodeLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1beta1/csistoragecapacity.go000066400000000000000000000072451472614177300275330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/storage/v1beta1" cache "k8s.io/client-go/tools/cache" ) // CSIStorageCapacityInformer provides access to a shared informer and lister for // CSIStorageCapacities. type CSIStorageCapacityInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.CSIStorageCapacityLister } type cSIStorageCapacityInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredCSIStorageCapacityInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().CSIStorageCapacities(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().CSIStorageCapacities(namespace).Watch(context.TODO(), options) }, }, &storagev1beta1.CSIStorageCapacity{}, resyncPeriod, indexers, ) } func (f *cSIStorageCapacityInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredCSIStorageCapacityInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *cSIStorageCapacityInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1beta1.CSIStorageCapacity{}, f.defaultInformer) } func (f *cSIStorageCapacityInformer) Lister() v1beta1.CSIStorageCapacityLister { return v1beta1.NewCSIStorageCapacityLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1beta1/interface.go000066400000000000000000000060211472614177300256010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // CSIDrivers returns a CSIDriverInformer. CSIDrivers() CSIDriverInformer // CSINodes returns a CSINodeInformer. CSINodes() CSINodeInformer // CSIStorageCapacities returns a CSIStorageCapacityInformer. CSIStorageCapacities() CSIStorageCapacityInformer // StorageClasses returns a StorageClassInformer. StorageClasses() StorageClassInformer // VolumeAttachments returns a VolumeAttachmentInformer. VolumeAttachments() VolumeAttachmentInformer // VolumeAttributesClasses returns a VolumeAttributesClassInformer. VolumeAttributesClasses() VolumeAttributesClassInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // CSIDrivers returns a CSIDriverInformer. func (v *version) CSIDrivers() CSIDriverInformer { return &cSIDriverInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // CSINodes returns a CSINodeInformer. func (v *version) CSINodes() CSINodeInformer { return &cSINodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // CSIStorageCapacities returns a CSIStorageCapacityInformer. func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer { return &cSIStorageCapacityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // StorageClasses returns a StorageClassInformer. func (v *version) StorageClasses() StorageClassInformer { return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // VolumeAttachments returns a VolumeAttachmentInformer. func (v *version) VolumeAttachments() VolumeAttachmentInformer { return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // VolumeAttributesClasses returns a VolumeAttributesClassInformer. func (v *version) VolumeAttributesClasses() VolumeAttributesClassInformer { return &volumeAttributesClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/storage/v1beta1/storageclass.go000066400000000000000000000066721472614177300263470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/storage/v1beta1" cache "k8s.io/client-go/tools/cache" ) // StorageClassInformer provides access to a shared informer and lister for // StorageClasses. type StorageClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.StorageClassLister } type storageClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewStorageClassInformer constructs a new informer for StorageClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredStorageClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredStorageClassInformer constructs a new informer for StorageClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().StorageClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().StorageClasses().Watch(context.TODO(), options) }, }, &storagev1beta1.StorageClass{}, resyncPeriod, indexers, ) } func (f *storageClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredStorageClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *storageClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1beta1.StorageClass{}, f.defaultInformer) } func (f *storageClassInformer) Lister() v1beta1.StorageClassLister { return v1beta1.NewStorageClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1beta1/volumeattachment.go000066400000000000000000000070171472614177300272270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/storage/v1beta1" cache "k8s.io/client-go/tools/cache" ) // VolumeAttachmentInformer provides access to a shared informer and lister for // VolumeAttachments. type VolumeAttachmentInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.VolumeAttachmentLister } type volumeAttachmentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, indexers, nil) } // NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().VolumeAttachments().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().VolumeAttachments().Watch(context.TODO(), options) }, }, &storagev1beta1.VolumeAttachment{}, resyncPeriod, indexers, ) } func (f *volumeAttachmentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1beta1.VolumeAttachment{}, f.defaultInformer) } func (f *volumeAttachmentInformer) Lister() v1beta1.VolumeAttachmentLister { return v1beta1.NewVolumeAttachmentLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storage/v1beta1/volumeattributesclass.go000066400000000000000000000072001472614177300303050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/storage/v1beta1" cache "k8s.io/client-go/tools/cache" ) // VolumeAttributesClassInformer provides access to a shared informer and lister for // VolumeAttributesClasses. type VolumeAttributesClassInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.VolumeAttributesClassLister } type volumeAttributesClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, indexers, nil) } // NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().VolumeAttributesClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StorageV1beta1().VolumeAttributesClasses().Watch(context.TODO(), options) }, }, &storagev1beta1.VolumeAttributesClass{}, resyncPeriod, indexers, ) } func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagev1beta1.VolumeAttributesClass{}, f.defaultInformer) } func (f *volumeAttributesClassInformer) Lister() v1beta1.VolumeAttributesClassLister { return v1beta1.NewVolumeAttributesClassLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/informers/storagemigration/000077500000000000000000000000001472614177300237625ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/storagemigration/interface.go000066400000000000000000000030451472614177300262530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package storagemigration import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1alpha1 "k8s.io/client-go/informers/storagemigration/v1alpha1" ) // Interface provides access to each of this group's versions. type Interface interface { // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface } type group struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // V1alpha1 returns a new v1alpha1.Interface. func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } kubernetes-client-go-a2dfcab/informers/storagemigration/v1alpha1/000077500000000000000000000000001472614177300253775ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/informers/storagemigration/v1alpha1/interface.go000066400000000000000000000031351472614177300276700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. type Interface interface { // StorageVersionMigrations returns a StorageVersionMigrationInformer. StorageVersionMigrations() StorageVersionMigrationInformer } type version struct { factory internalinterfaces.SharedInformerFactory namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc } // New returns a new Interface. func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } // StorageVersionMigrations returns a StorageVersionMigrationInformer. func (v *version) StorageVersionMigrations() StorageVersionMigrationInformer { return &storageVersionMigrationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } kubernetes-client-go-a2dfcab/informers/storagemigration/v1alpha1/storageversionmigration.go000066400000000000000000000073641472614177300327240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( "context" time "time" storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/storagemigration/v1alpha1" cache "k8s.io/client-go/tools/cache" ) // StorageVersionMigrationInformer provides access to a shared informer and lister for // StorageVersionMigrations. type StorageVersionMigrationInformer interface { Informer() cache.SharedIndexInformer Lister() v1alpha1.StorageVersionMigrationLister } type storageVersionMigrationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } // NewStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredStorageVersionMigrationInformer(client, resyncPeriod, indexers, nil) } // NewFilteredStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StoragemigrationV1alpha1().StorageVersionMigrations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.StoragemigrationV1alpha1().StorageVersionMigrations().Watch(context.TODO(), options) }, }, &storagemigrationv1alpha1.StorageVersionMigration{}, resyncPeriod, indexers, ) } func (f *storageVersionMigrationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredStorageVersionMigrationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *storageVersionMigrationInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&storagemigrationv1alpha1.StorageVersionMigration{}, f.defaultInformer) } func (f *storageVersionMigrationInformer) Lister() v1alpha1.StorageVersionMigrationLister { return v1alpha1.NewStorageVersionMigrationLister(f.Informer().GetIndexer()) } kubernetes-client-go-a2dfcab/kubernetes/000077500000000000000000000000001472614177300205475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/clientset.go000066400000000000000000000766411472614177300231060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package kubernetes import ( "fmt" "net/http" discovery "k8s.io/client-go/discovery" admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" admissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" internalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" appsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" authenticationv1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1" authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" authorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1" authorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" autoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" autoscalingv2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2" autoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1" batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" certificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1" certificatesv1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1" certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" coordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1" discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" flowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" networkingv1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" nodev1 "k8s.io/client-go/kubernetes/typed/node/v1" nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1" policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" storagemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" ) type Interface interface { Discovery() discovery.DiscoveryInterface AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface AdmissionregistrationV1alpha1() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface InternalV1alpha1() internalv1alpha1.InternalV1alpha1Interface AppsV1() appsv1.AppsV1Interface AppsV1beta1() appsv1beta1.AppsV1beta1Interface AppsV1beta2() appsv1beta2.AppsV1beta2Interface AuthenticationV1() authenticationv1.AuthenticationV1Interface AuthenticationV1alpha1() authenticationv1alpha1.AuthenticationV1alpha1Interface AuthenticationV1beta1() authenticationv1beta1.AuthenticationV1beta1Interface AuthorizationV1() authorizationv1.AuthorizationV1Interface AuthorizationV1beta1() authorizationv1beta1.AuthorizationV1beta1Interface AutoscalingV1() autoscalingv1.AutoscalingV1Interface AutoscalingV2() autoscalingv2.AutoscalingV2Interface AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1Interface AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface BatchV1() batchv1.BatchV1Interface BatchV1beta1() batchv1beta1.BatchV1beta1Interface CertificatesV1() certificatesv1.CertificatesV1Interface CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface CoordinationV1() coordinationv1.CoordinationV1Interface CoreV1() corev1.CoreV1Interface DiscoveryV1() discoveryv1.DiscoveryV1Interface DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface EventsV1() eventsv1.EventsV1Interface EventsV1beta1() eventsv1beta1.EventsV1beta1Interface ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface FlowcontrolV1beta3() flowcontrolv1beta3.FlowcontrolV1beta3Interface NetworkingV1() networkingv1.NetworkingV1Interface NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface NodeV1() nodev1.NodeV1Interface NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface NodeV1beta1() nodev1beta1.NodeV1beta1Interface PolicyV1() policyv1.PolicyV1Interface PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface RbacV1() rbacv1.RbacV1Interface RbacV1beta1() rbacv1beta1.RbacV1beta1Interface RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface SchedulingV1() schedulingv1.SchedulingV1Interface StorageV1beta1() storagev1beta1.StorageV1beta1Interface StorageV1() storagev1.StorageV1Interface StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1Interface } // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient admissionregistrationV1 *admissionregistrationv1.AdmissionregistrationV1Client admissionregistrationV1alpha1 *admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Client admissionregistrationV1beta1 *admissionregistrationv1beta1.AdmissionregistrationV1beta1Client internalV1alpha1 *internalv1alpha1.InternalV1alpha1Client appsV1 *appsv1.AppsV1Client appsV1beta1 *appsv1beta1.AppsV1beta1Client appsV1beta2 *appsv1beta2.AppsV1beta2Client authenticationV1 *authenticationv1.AuthenticationV1Client authenticationV1alpha1 *authenticationv1alpha1.AuthenticationV1alpha1Client authenticationV1beta1 *authenticationv1beta1.AuthenticationV1beta1Client authorizationV1 *authorizationv1.AuthorizationV1Client authorizationV1beta1 *authorizationv1beta1.AuthorizationV1beta1Client autoscalingV1 *autoscalingv1.AutoscalingV1Client autoscalingV2 *autoscalingv2.AutoscalingV2Client autoscalingV2beta1 *autoscalingv2beta1.AutoscalingV2beta1Client autoscalingV2beta2 *autoscalingv2beta2.AutoscalingV2beta2Client batchV1 *batchv1.BatchV1Client batchV1beta1 *batchv1beta1.BatchV1beta1Client certificatesV1 *certificatesv1.CertificatesV1Client certificatesV1beta1 *certificatesv1beta1.CertificatesV1beta1Client certificatesV1alpha1 *certificatesv1alpha1.CertificatesV1alpha1Client coordinationV1alpha1 *coordinationv1alpha1.CoordinationV1alpha1Client coordinationV1beta1 *coordinationv1beta1.CoordinationV1beta1Client coordinationV1 *coordinationv1.CoordinationV1Client coreV1 *corev1.CoreV1Client discoveryV1 *discoveryv1.DiscoveryV1Client discoveryV1beta1 *discoveryv1beta1.DiscoveryV1beta1Client eventsV1 *eventsv1.EventsV1Client eventsV1beta1 *eventsv1beta1.EventsV1beta1Client extensionsV1beta1 *extensionsv1beta1.ExtensionsV1beta1Client flowcontrolV1 *flowcontrolv1.FlowcontrolV1Client flowcontrolV1beta1 *flowcontrolv1beta1.FlowcontrolV1beta1Client flowcontrolV1beta2 *flowcontrolv1beta2.FlowcontrolV1beta2Client flowcontrolV1beta3 *flowcontrolv1beta3.FlowcontrolV1beta3Client networkingV1 *networkingv1.NetworkingV1Client networkingV1alpha1 *networkingv1alpha1.NetworkingV1alpha1Client networkingV1beta1 *networkingv1beta1.NetworkingV1beta1Client nodeV1 *nodev1.NodeV1Client nodeV1alpha1 *nodev1alpha1.NodeV1alpha1Client nodeV1beta1 *nodev1beta1.NodeV1beta1Client policyV1 *policyv1.PolicyV1Client policyV1beta1 *policyv1beta1.PolicyV1beta1Client rbacV1 *rbacv1.RbacV1Client rbacV1beta1 *rbacv1beta1.RbacV1beta1Client rbacV1alpha1 *rbacv1alpha1.RbacV1alpha1Client resourceV1alpha3 *resourcev1alpha3.ResourceV1alpha3Client schedulingV1alpha1 *schedulingv1alpha1.SchedulingV1alpha1Client schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1Client schedulingV1 *schedulingv1.SchedulingV1Client storageV1beta1 *storagev1beta1.StorageV1beta1Client storageV1 *storagev1.StorageV1Client storageV1alpha1 *storagev1alpha1.StorageV1alpha1Client storagemigrationV1alpha1 *storagemigrationv1alpha1.StoragemigrationV1alpha1Client } // AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface { return c.admissionregistrationV1 } // AdmissionregistrationV1alpha1 retrieves the AdmissionregistrationV1alpha1Client func (c *Clientset) AdmissionregistrationV1alpha1() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface { return c.admissionregistrationV1alpha1 } // AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { return c.admissionregistrationV1beta1 } // InternalV1alpha1 retrieves the InternalV1alpha1Client func (c *Clientset) InternalV1alpha1() internalv1alpha1.InternalV1alpha1Interface { return c.internalV1alpha1 } // AppsV1 retrieves the AppsV1Client func (c *Clientset) AppsV1() appsv1.AppsV1Interface { return c.appsV1 } // AppsV1beta1 retrieves the AppsV1beta1Client func (c *Clientset) AppsV1beta1() appsv1beta1.AppsV1beta1Interface { return c.appsV1beta1 } // AppsV1beta2 retrieves the AppsV1beta2Client func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { return c.appsV1beta2 } // AuthenticationV1 retrieves the AuthenticationV1Client func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { return c.authenticationV1 } // AuthenticationV1alpha1 retrieves the AuthenticationV1alpha1Client func (c *Clientset) AuthenticationV1alpha1() authenticationv1alpha1.AuthenticationV1alpha1Interface { return c.authenticationV1alpha1 } // AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client func (c *Clientset) AuthenticationV1beta1() authenticationv1beta1.AuthenticationV1beta1Interface { return c.authenticationV1beta1 } // AuthorizationV1 retrieves the AuthorizationV1Client func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface { return c.authorizationV1 } // AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client func (c *Clientset) AuthorizationV1beta1() authorizationv1beta1.AuthorizationV1beta1Interface { return c.authorizationV1beta1 } // AutoscalingV1 retrieves the AutoscalingV1Client func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface { return c.autoscalingV1 } // AutoscalingV2 retrieves the AutoscalingV2Client func (c *Clientset) AutoscalingV2() autoscalingv2.AutoscalingV2Interface { return c.autoscalingV2 } // AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client func (c *Clientset) AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1Interface { return c.autoscalingV2beta1 } // AutoscalingV2beta2 retrieves the AutoscalingV2beta2Client func (c *Clientset) AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface { return c.autoscalingV2beta2 } // BatchV1 retrieves the BatchV1Client func (c *Clientset) BatchV1() batchv1.BatchV1Interface { return c.batchV1 } // BatchV1beta1 retrieves the BatchV1beta1Client func (c *Clientset) BatchV1beta1() batchv1beta1.BatchV1beta1Interface { return c.batchV1beta1 } // CertificatesV1 retrieves the CertificatesV1Client func (c *Clientset) CertificatesV1() certificatesv1.CertificatesV1Interface { return c.certificatesV1 } // CertificatesV1beta1 retrieves the CertificatesV1beta1Client func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface { return c.certificatesV1beta1 } // CertificatesV1alpha1 retrieves the CertificatesV1alpha1Client func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface { return c.certificatesV1alpha1 } // CoordinationV1alpha1 retrieves the CoordinationV1alpha1Client func (c *Clientset) CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface { return c.coordinationV1alpha1 } // CoordinationV1beta1 retrieves the CoordinationV1beta1Client func (c *Clientset) CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface { return c.coordinationV1beta1 } // CoordinationV1 retrieves the CoordinationV1Client func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface { return c.coordinationV1 } // CoreV1 retrieves the CoreV1Client func (c *Clientset) CoreV1() corev1.CoreV1Interface { return c.coreV1 } // DiscoveryV1 retrieves the DiscoveryV1Client func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface { return c.discoveryV1 } // DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client func (c *Clientset) DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface { return c.discoveryV1beta1 } // EventsV1 retrieves the EventsV1Client func (c *Clientset) EventsV1() eventsv1.EventsV1Interface { return c.eventsV1 } // EventsV1beta1 retrieves the EventsV1beta1Client func (c *Clientset) EventsV1beta1() eventsv1beta1.EventsV1beta1Interface { return c.eventsV1beta1 } // ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface { return c.extensionsV1beta1 } // FlowcontrolV1 retrieves the FlowcontrolV1Client func (c *Clientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface { return c.flowcontrolV1 } // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client func (c *Clientset) FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface { return c.flowcontrolV1beta1 } // FlowcontrolV1beta2 retrieves the FlowcontrolV1beta2Client func (c *Clientset) FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface { return c.flowcontrolV1beta2 } // FlowcontrolV1beta3 retrieves the FlowcontrolV1beta3Client func (c *Clientset) FlowcontrolV1beta3() flowcontrolv1beta3.FlowcontrolV1beta3Interface { return c.flowcontrolV1beta3 } // NetworkingV1 retrieves the NetworkingV1Client func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { return c.networkingV1 } // NetworkingV1alpha1 retrieves the NetworkingV1alpha1Client func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface { return c.networkingV1alpha1 } // NetworkingV1beta1 retrieves the NetworkingV1beta1Client func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface { return c.networkingV1beta1 } // NodeV1 retrieves the NodeV1Client func (c *Clientset) NodeV1() nodev1.NodeV1Interface { return c.nodeV1 } // NodeV1alpha1 retrieves the NodeV1alpha1Client func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface { return c.nodeV1alpha1 } // NodeV1beta1 retrieves the NodeV1beta1Client func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface { return c.nodeV1beta1 } // PolicyV1 retrieves the PolicyV1Client func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface { return c.policyV1 } // PolicyV1beta1 retrieves the PolicyV1beta1Client func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { return c.policyV1beta1 } // RbacV1 retrieves the RbacV1Client func (c *Clientset) RbacV1() rbacv1.RbacV1Interface { return c.rbacV1 } // RbacV1beta1 retrieves the RbacV1beta1Client func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface { return c.rbacV1beta1 } // RbacV1alpha1 retrieves the RbacV1alpha1Client func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { return c.rbacV1alpha1 } // ResourceV1alpha3 retrieves the ResourceV1alpha3Client func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface { return c.resourceV1alpha3 } // SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface { return c.schedulingV1alpha1 } // SchedulingV1beta1 retrieves the SchedulingV1beta1Client func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface { return c.schedulingV1beta1 } // SchedulingV1 retrieves the SchedulingV1Client func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface { return c.schedulingV1 } // StorageV1beta1 retrieves the StorageV1beta1Client func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface { return c.storageV1beta1 } // StorageV1 retrieves the StorageV1Client func (c *Clientset) StorageV1() storagev1.StorageV1Interface { return c.storageV1 } // StorageV1alpha1 retrieves the StorageV1alpha1Client func (c *Clientset) StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface { return c.storageV1alpha1 } // StoragemigrationV1alpha1 retrieves the StoragemigrationV1alpha1Client func (c *Clientset) StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1Interface { return c.storagemigrationV1alpha1 } // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { return nil } return c.DiscoveryClient } // NewForConfig creates a new Clientset for the given config. // If config's RateLimiter is not set and QPS and Burst are acceptable, // NewForConfig will generate a rate-limiter in configShallowCopy. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.UserAgent == "" { configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() } // share the transport between all clients httpClient, err := rest.HTTPClientFor(&configShallowCopy) if err != nil { return nil, err } return NewForConfigAndClient(&configShallowCopy, httpClient) } // NewForConfigAndClient creates a new Clientset for the given config and http client. // Note the http client provided takes precedence over the configured transport values. // If config's RateLimiter is not set and QPS and Burst are acceptable, // NewForConfigAndClient will generate a rate-limiter in configShallowCopy. func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.Burst <= 0 { return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } var cs Clientset var err error cs.admissionregistrationV1, err = admissionregistrationv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.admissionregistrationV1alpha1, err = admissionregistrationv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.admissionregistrationV1beta1, err = admissionregistrationv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.internalV1alpha1, err = internalv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.appsV1, err = appsv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.appsV1beta1, err = appsv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.appsV1beta2, err = appsv1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.authenticationV1, err = authenticationv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.authenticationV1alpha1, err = authenticationv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.authenticationV1beta1, err = authenticationv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.authorizationV1, err = authorizationv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.authorizationV1beta1, err = authorizationv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.autoscalingV1, err = autoscalingv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.autoscalingV2, err = autoscalingv2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.autoscalingV2beta1, err = autoscalingv2beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.autoscalingV2beta2, err = autoscalingv2beta2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.batchV1, err = batchv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.batchV1beta1, err = batchv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.certificatesV1, err = certificatesv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.certificatesV1beta1, err = certificatesv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.certificatesV1alpha1, err = certificatesv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.coordinationV1alpha1, err = coordinationv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.coordinationV1beta1, err = coordinationv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.coordinationV1, err = coordinationv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.coreV1, err = corev1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.discoveryV1, err = discoveryv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.discoveryV1beta1, err = discoveryv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.eventsV1, err = eventsv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.eventsV1beta1, err = eventsv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.extensionsV1beta1, err = extensionsv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.flowcontrolV1, err = flowcontrolv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.flowcontrolV1beta1, err = flowcontrolv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.flowcontrolV1beta2, err = flowcontrolv1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.flowcontrolV1beta3, err = flowcontrolv1beta3.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.networkingV1, err = networkingv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.networkingV1alpha1, err = networkingv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.networkingV1beta1, err = networkingv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.nodeV1, err = nodev1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.nodeV1alpha1, err = nodev1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.nodeV1beta1, err = nodev1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.policyV1, err = policyv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.policyV1beta1, err = policyv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.rbacV1, err = rbacv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.rbacV1beta1, err = rbacv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.rbacV1alpha1, err = rbacv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.resourceV1alpha3, err = resourcev1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.schedulingV1alpha1, err = schedulingv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.schedulingV1beta1, err = schedulingv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.schedulingV1, err = schedulingv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.storageV1beta1, err = storagev1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.storageV1, err = storagev1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.storageV1alpha1, err = storagev1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.storagemigrationV1alpha1, err = storagemigrationv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } return &cs, nil } // NewForConfigOrDie creates a new Clientset for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { cs, err := NewForConfig(c) if err != nil { panic(err) } return cs } // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset cs.admissionregistrationV1 = admissionregistrationv1.New(c) cs.admissionregistrationV1alpha1 = admissionregistrationv1alpha1.New(c) cs.admissionregistrationV1beta1 = admissionregistrationv1beta1.New(c) cs.internalV1alpha1 = internalv1alpha1.New(c) cs.appsV1 = appsv1.New(c) cs.appsV1beta1 = appsv1beta1.New(c) cs.appsV1beta2 = appsv1beta2.New(c) cs.authenticationV1 = authenticationv1.New(c) cs.authenticationV1alpha1 = authenticationv1alpha1.New(c) cs.authenticationV1beta1 = authenticationv1beta1.New(c) cs.authorizationV1 = authorizationv1.New(c) cs.authorizationV1beta1 = authorizationv1beta1.New(c) cs.autoscalingV1 = autoscalingv1.New(c) cs.autoscalingV2 = autoscalingv2.New(c) cs.autoscalingV2beta1 = autoscalingv2beta1.New(c) cs.autoscalingV2beta2 = autoscalingv2beta2.New(c) cs.batchV1 = batchv1.New(c) cs.batchV1beta1 = batchv1beta1.New(c) cs.certificatesV1 = certificatesv1.New(c) cs.certificatesV1beta1 = certificatesv1beta1.New(c) cs.certificatesV1alpha1 = certificatesv1alpha1.New(c) cs.coordinationV1alpha1 = coordinationv1alpha1.New(c) cs.coordinationV1beta1 = coordinationv1beta1.New(c) cs.coordinationV1 = coordinationv1.New(c) cs.coreV1 = corev1.New(c) cs.discoveryV1 = discoveryv1.New(c) cs.discoveryV1beta1 = discoveryv1beta1.New(c) cs.eventsV1 = eventsv1.New(c) cs.eventsV1beta1 = eventsv1beta1.New(c) cs.extensionsV1beta1 = extensionsv1beta1.New(c) cs.flowcontrolV1 = flowcontrolv1.New(c) cs.flowcontrolV1beta1 = flowcontrolv1beta1.New(c) cs.flowcontrolV1beta2 = flowcontrolv1beta2.New(c) cs.flowcontrolV1beta3 = flowcontrolv1beta3.New(c) cs.networkingV1 = networkingv1.New(c) cs.networkingV1alpha1 = networkingv1alpha1.New(c) cs.networkingV1beta1 = networkingv1beta1.New(c) cs.nodeV1 = nodev1.New(c) cs.nodeV1alpha1 = nodev1alpha1.New(c) cs.nodeV1beta1 = nodev1beta1.New(c) cs.policyV1 = policyv1.New(c) cs.policyV1beta1 = policyv1beta1.New(c) cs.rbacV1 = rbacv1.New(c) cs.rbacV1beta1 = rbacv1beta1.New(c) cs.rbacV1alpha1 = rbacv1alpha1.New(c) cs.resourceV1alpha3 = resourcev1alpha3.New(c) cs.schedulingV1alpha1 = schedulingv1alpha1.New(c) cs.schedulingV1beta1 = schedulingv1beta1.New(c) cs.schedulingV1 = schedulingv1.New(c) cs.storageV1beta1 = storagev1beta1.New(c) cs.storageV1 = storagev1.New(c) cs.storageV1alpha1 = storagev1alpha1.New(c) cs.storagemigrationV1alpha1 = storagemigrationv1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs } kubernetes-client-go-a2dfcab/kubernetes/doc.go000066400000000000000000000013171472614177300216450ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package kubernetes holds packages which implement a clientset for Kubernetes // APIs. package kubernetes // import "k8s.io/client-go/kubernetes" kubernetes-client-go-a2dfcab/kubernetes/fake/000077500000000000000000000000001472614177300214555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/fake/clientset_generated.go000066400000000000000000000536431472614177300260270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" applyconfigurations "k8s.io/client-go/applyconfigurations" "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" clientset "k8s.io/client-go/kubernetes" admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" fakeadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake" admissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" fakeadmissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake" admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" fakeadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake" internalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" fakeinternalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake" appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" fakeappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1/fake" appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" fakeappsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake" appsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" fakeappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake" authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" fakeauthenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1/fake" authenticationv1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1" fakeauthenticationv1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake" authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" fakeauthenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake" authorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1" fakeauthorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1/fake" authorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" fakeauthorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake" autoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" fakeautoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake" autoscalingv2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2" fakeautoscalingv2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake" autoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" fakeautoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake" autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" fakeautoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake" batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1" fakebatchv1 "k8s.io/client-go/kubernetes/typed/batch/v1/fake" batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" fakebatchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake" certificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1" fakecertificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1/fake" certificatesv1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1" fakecertificatesv1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake" certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" fakecertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake" coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" fakecoordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1/fake" coordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" fakecoordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake" coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" fakecoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" fakecorev1 "k8s.io/client-go/kubernetes/typed/core/v1/fake" discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1" fakediscoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1/fake" discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" fakediscoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake" eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" fakeeventsv1 "k8s.io/client-go/kubernetes/typed/events/v1/fake" eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" fakeeventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1/fake" extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" fakeextensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake" flowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" fakeflowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake" flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" fakeflowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake" flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" fakeflowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake" flowcontrolv1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" fakeflowcontrolv1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake" networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" fakenetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1/fake" networkingv1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" fakenetworkingv1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake" networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" fakenetworkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake" nodev1 "k8s.io/client-go/kubernetes/typed/node/v1" fakenodev1 "k8s.io/client-go/kubernetes/typed/node/v1/fake" nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" fakenodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake" nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" fakenodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1/fake" policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1" fakepolicyv1 "k8s.io/client-go/kubernetes/typed/policy/v1/fake" policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" fakepolicyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake" rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" fakerbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1/fake" rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" fakerbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake" rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" fakerbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake" resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" fakeresourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" fakeschedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1/fake" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" fakeschedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake" schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" fakeschedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake" storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" fakestoragev1 "k8s.io/client-go/kubernetes/typed/storage/v1/fake" storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" fakestoragev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake" storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" fakestoragev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake" storagemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" fakestoragemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake" "k8s.io/client-go/testing" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, // without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. // // DEPRECATED: NewClientset replaces this with support for field management, which significantly improves // server side apply testing. NewClientset is only available when apply configurations are generated (e.g. // via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { if err := o.Add(obj); err != nil { panic(err) } } cs := &Clientset{tracker: o} cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { gvr := action.GetResource() ns := action.GetNamespace() watch, err := o.Watch(gvr, ns) if err != nil { return false, nil, err } return true, watch, nil }) return cs } // Clientset implements clientset.Interface. Meant to be embedded into a // struct to get a default implementation. This makes faking out just the method // you want to test easier. type Clientset struct { testing.Fake discovery *fakediscovery.FakeDiscovery tracker testing.ObjectTracker } func (c *Clientset) Discovery() discovery.DiscoveryInterface { return c.discovery } func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } // NewClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, // without applying any validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. func NewClientset(objects ...runtime.Object) *Clientset { o := testing.NewFieldManagedObjectTracker( scheme, codecs.UniversalDecoder(), applyconfigurations.NewTypeConverter(scheme), ) for _, obj := range objects { if err := o.Add(obj); err != nil { panic(err) } } cs := &Clientset{tracker: o} cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { gvr := action.GetResource() ns := action.GetNamespace() watch, err := o.Watch(gvr, ns) if err != nil { return false, nil, err } return true, watch, nil }) return cs } var ( _ clientset.Interface = &Clientset{} _ testing.FakeClient = &Clientset{} ) // AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface { return &fakeadmissionregistrationv1.FakeAdmissionregistrationV1{Fake: &c.Fake} } // AdmissionregistrationV1alpha1 retrieves the AdmissionregistrationV1alpha1Client func (c *Clientset) AdmissionregistrationV1alpha1() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface { return &fakeadmissionregistrationv1alpha1.FakeAdmissionregistrationV1alpha1{Fake: &c.Fake} } // AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { return &fakeadmissionregistrationv1beta1.FakeAdmissionregistrationV1beta1{Fake: &c.Fake} } // InternalV1alpha1 retrieves the InternalV1alpha1Client func (c *Clientset) InternalV1alpha1() internalv1alpha1.InternalV1alpha1Interface { return &fakeinternalv1alpha1.FakeInternalV1alpha1{Fake: &c.Fake} } // AppsV1 retrieves the AppsV1Client func (c *Clientset) AppsV1() appsv1.AppsV1Interface { return &fakeappsv1.FakeAppsV1{Fake: &c.Fake} } // AppsV1beta1 retrieves the AppsV1beta1Client func (c *Clientset) AppsV1beta1() appsv1beta1.AppsV1beta1Interface { return &fakeappsv1beta1.FakeAppsV1beta1{Fake: &c.Fake} } // AppsV1beta2 retrieves the AppsV1beta2Client func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { return &fakeappsv1beta2.FakeAppsV1beta2{Fake: &c.Fake} } // AuthenticationV1 retrieves the AuthenticationV1Client func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { return &fakeauthenticationv1.FakeAuthenticationV1{Fake: &c.Fake} } // AuthenticationV1alpha1 retrieves the AuthenticationV1alpha1Client func (c *Clientset) AuthenticationV1alpha1() authenticationv1alpha1.AuthenticationV1alpha1Interface { return &fakeauthenticationv1alpha1.FakeAuthenticationV1alpha1{Fake: &c.Fake} } // AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client func (c *Clientset) AuthenticationV1beta1() authenticationv1beta1.AuthenticationV1beta1Interface { return &fakeauthenticationv1beta1.FakeAuthenticationV1beta1{Fake: &c.Fake} } // AuthorizationV1 retrieves the AuthorizationV1Client func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface { return &fakeauthorizationv1.FakeAuthorizationV1{Fake: &c.Fake} } // AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client func (c *Clientset) AuthorizationV1beta1() authorizationv1beta1.AuthorizationV1beta1Interface { return &fakeauthorizationv1beta1.FakeAuthorizationV1beta1{Fake: &c.Fake} } // AutoscalingV1 retrieves the AutoscalingV1Client func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface { return &fakeautoscalingv1.FakeAutoscalingV1{Fake: &c.Fake} } // AutoscalingV2 retrieves the AutoscalingV2Client func (c *Clientset) AutoscalingV2() autoscalingv2.AutoscalingV2Interface { return &fakeautoscalingv2.FakeAutoscalingV2{Fake: &c.Fake} } // AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client func (c *Clientset) AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1Interface { return &fakeautoscalingv2beta1.FakeAutoscalingV2beta1{Fake: &c.Fake} } // AutoscalingV2beta2 retrieves the AutoscalingV2beta2Client func (c *Clientset) AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface { return &fakeautoscalingv2beta2.FakeAutoscalingV2beta2{Fake: &c.Fake} } // BatchV1 retrieves the BatchV1Client func (c *Clientset) BatchV1() batchv1.BatchV1Interface { return &fakebatchv1.FakeBatchV1{Fake: &c.Fake} } // BatchV1beta1 retrieves the BatchV1beta1Client func (c *Clientset) BatchV1beta1() batchv1beta1.BatchV1beta1Interface { return &fakebatchv1beta1.FakeBatchV1beta1{Fake: &c.Fake} } // CertificatesV1 retrieves the CertificatesV1Client func (c *Clientset) CertificatesV1() certificatesv1.CertificatesV1Interface { return &fakecertificatesv1.FakeCertificatesV1{Fake: &c.Fake} } // CertificatesV1beta1 retrieves the CertificatesV1beta1Client func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface { return &fakecertificatesv1beta1.FakeCertificatesV1beta1{Fake: &c.Fake} } // CertificatesV1alpha1 retrieves the CertificatesV1alpha1Client func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface { return &fakecertificatesv1alpha1.FakeCertificatesV1alpha1{Fake: &c.Fake} } // CoordinationV1alpha1 retrieves the CoordinationV1alpha1Client func (c *Clientset) CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface { return &fakecoordinationv1alpha1.FakeCoordinationV1alpha1{Fake: &c.Fake} } // CoordinationV1beta1 retrieves the CoordinationV1beta1Client func (c *Clientset) CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface { return &fakecoordinationv1beta1.FakeCoordinationV1beta1{Fake: &c.Fake} } // CoordinationV1 retrieves the CoordinationV1Client func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface { return &fakecoordinationv1.FakeCoordinationV1{Fake: &c.Fake} } // CoreV1 retrieves the CoreV1Client func (c *Clientset) CoreV1() corev1.CoreV1Interface { return &fakecorev1.FakeCoreV1{Fake: &c.Fake} } // DiscoveryV1 retrieves the DiscoveryV1Client func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface { return &fakediscoveryv1.FakeDiscoveryV1{Fake: &c.Fake} } // DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client func (c *Clientset) DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface { return &fakediscoveryv1beta1.FakeDiscoveryV1beta1{Fake: &c.Fake} } // EventsV1 retrieves the EventsV1Client func (c *Clientset) EventsV1() eventsv1.EventsV1Interface { return &fakeeventsv1.FakeEventsV1{Fake: &c.Fake} } // EventsV1beta1 retrieves the EventsV1beta1Client func (c *Clientset) EventsV1beta1() eventsv1beta1.EventsV1beta1Interface { return &fakeeventsv1beta1.FakeEventsV1beta1{Fake: &c.Fake} } // ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface { return &fakeextensionsv1beta1.FakeExtensionsV1beta1{Fake: &c.Fake} } // FlowcontrolV1 retrieves the FlowcontrolV1Client func (c *Clientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface { return &fakeflowcontrolv1.FakeFlowcontrolV1{Fake: &c.Fake} } // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client func (c *Clientset) FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface { return &fakeflowcontrolv1beta1.FakeFlowcontrolV1beta1{Fake: &c.Fake} } // FlowcontrolV1beta2 retrieves the FlowcontrolV1beta2Client func (c *Clientset) FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface { return &fakeflowcontrolv1beta2.FakeFlowcontrolV1beta2{Fake: &c.Fake} } // FlowcontrolV1beta3 retrieves the FlowcontrolV1beta3Client func (c *Clientset) FlowcontrolV1beta3() flowcontrolv1beta3.FlowcontrolV1beta3Interface { return &fakeflowcontrolv1beta3.FakeFlowcontrolV1beta3{Fake: &c.Fake} } // NetworkingV1 retrieves the NetworkingV1Client func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { return &fakenetworkingv1.FakeNetworkingV1{Fake: &c.Fake} } // NetworkingV1alpha1 retrieves the NetworkingV1alpha1Client func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface { return &fakenetworkingv1alpha1.FakeNetworkingV1alpha1{Fake: &c.Fake} } // NetworkingV1beta1 retrieves the NetworkingV1beta1Client func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface { return &fakenetworkingv1beta1.FakeNetworkingV1beta1{Fake: &c.Fake} } // NodeV1 retrieves the NodeV1Client func (c *Clientset) NodeV1() nodev1.NodeV1Interface { return &fakenodev1.FakeNodeV1{Fake: &c.Fake} } // NodeV1alpha1 retrieves the NodeV1alpha1Client func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface { return &fakenodev1alpha1.FakeNodeV1alpha1{Fake: &c.Fake} } // NodeV1beta1 retrieves the NodeV1beta1Client func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface { return &fakenodev1beta1.FakeNodeV1beta1{Fake: &c.Fake} } // PolicyV1 retrieves the PolicyV1Client func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface { return &fakepolicyv1.FakePolicyV1{Fake: &c.Fake} } // PolicyV1beta1 retrieves the PolicyV1beta1Client func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { return &fakepolicyv1beta1.FakePolicyV1beta1{Fake: &c.Fake} } // RbacV1 retrieves the RbacV1Client func (c *Clientset) RbacV1() rbacv1.RbacV1Interface { return &fakerbacv1.FakeRbacV1{Fake: &c.Fake} } // RbacV1beta1 retrieves the RbacV1beta1Client func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface { return &fakerbacv1beta1.FakeRbacV1beta1{Fake: &c.Fake} } // RbacV1alpha1 retrieves the RbacV1alpha1Client func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake} } // ResourceV1alpha3 retrieves the ResourceV1alpha3Client func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface { return &fakeresourcev1alpha3.FakeResourceV1alpha3{Fake: &c.Fake} } // SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface { return &fakeschedulingv1alpha1.FakeSchedulingV1alpha1{Fake: &c.Fake} } // SchedulingV1beta1 retrieves the SchedulingV1beta1Client func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface { return &fakeschedulingv1beta1.FakeSchedulingV1beta1{Fake: &c.Fake} } // SchedulingV1 retrieves the SchedulingV1Client func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface { return &fakeschedulingv1.FakeSchedulingV1{Fake: &c.Fake} } // StorageV1beta1 retrieves the StorageV1beta1Client func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface { return &fakestoragev1beta1.FakeStorageV1beta1{Fake: &c.Fake} } // StorageV1 retrieves the StorageV1Client func (c *Clientset) StorageV1() storagev1.StorageV1Interface { return &fakestoragev1.FakeStorageV1{Fake: &c.Fake} } // StorageV1alpha1 retrieves the StorageV1alpha1Client func (c *Clientset) StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface { return &fakestoragev1alpha1.FakeStorageV1alpha1{Fake: &c.Fake} } // StoragemigrationV1alpha1 retrieves the StoragemigrationV1alpha1Client func (c *Clientset) StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1Interface { return &fakestoragemigrationv1alpha1.FakeStoragemigrationV1alpha1{Fake: &c.Fake} } kubernetes-client-go-a2dfcab/kubernetes/fake/clientset_generated_test.go000066400000000000000000000120151472614177300270520ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" "github.com/stretchr/testify/assert" "testing" v1 "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1ac "k8s.io/client-go/applyconfigurations/core/v1" ) func TestNewSimpleClientset(t *testing.T) { client := NewSimpleClientset() client.CoreV1().Pods("default").Create(context.Background(), &v1.Pod{ ObjectMeta: meta_v1.ObjectMeta{ Name: "pod-1", Namespace: "default", }, }, meta_v1.CreateOptions{}) client.CoreV1().Pods("default").Create(context.Background(), &v1.Pod{ ObjectMeta: meta_v1.ObjectMeta{ Name: "pod-2", Namespace: "default", }, }, meta_v1.CreateOptions{}) err := client.CoreV1().Pods("default").EvictV1(context.Background(), &policy.Eviction{ ObjectMeta: meta_v1.ObjectMeta{ Name: "pod-2", }, }) if err != nil { t.Errorf("TestNewSimpleClientset() res = %v", err.Error()) } pods, err := client.CoreV1().Pods("default").List(context.Background(), meta_v1.ListOptions{}) // err: item[0]: can't assign or convert v1beta1.Eviction into v1.Pod if err != nil { t.Errorf("TestNewSimpleClientset() res = %v", err.Error()) } else { t.Logf("TestNewSimpleClientset() res = %v", pods) } } func TestManagedFieldClientset(t *testing.T) { client := NewClientset() name := "pod-1" namespace := "default" cm, err := client.CoreV1().ConfigMaps("default").Create(context.Background(), &v1.ConfigMap{ ObjectMeta: meta_v1.ObjectMeta{Name: name, Namespace: namespace}, Data: map[string]string{"k0": "v0"}, }, meta_v1.CreateOptions{FieldManager: "test-manager-0"}) if err != nil { t.Errorf("Failed to create pod: %v", err) } assert.Equal(t, map[string]string{"k0": "v0"}, cm.Data) // Apply with test-manager-1 // Expect data to be shared with initial create cm, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k1": "v1"}), meta_v1.ApplyOptions{FieldManager: "test-manager-1"}) if err != nil { t.Errorf("Failed to create pod: %v", err) } assert.Equal(t, map[string]string{"k0": "v0", "k1": "v1"}, cm.Data) // Apply conflicting with test-manager-2, expect apply to fail _, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k1": "xyz"}), meta_v1.ApplyOptions{FieldManager: "test-manager-2"}) if assert.Error(t, err) { assert.Equal(t, "Apply failed with 1 conflict: conflict with \"test-manager-1\": .data.k1", err.Error()) } // Apply with test-manager-2 // Expect data to be shared with initial create and test-manager-1 cm, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k2": "v2"}), meta_v1.ApplyOptions{FieldManager: "test-manager-2"}) if err != nil { t.Errorf("Failed to create pod: %v", err) } assert.Equal(t, map[string]string{"k0": "v0", "k1": "v1", "k2": "v2"}, cm.Data) // Apply with test-manager-1 // Expect owned data to be updated cm, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k1": "v101"}), meta_v1.ApplyOptions{FieldManager: "test-manager-1"}) if err != nil { t.Errorf("Failed to create pod: %v", err) } assert.Equal(t, map[string]string{"k0": "v0", "k1": "v101", "k2": "v2"}, cm.Data) // Force apply with test-manager-2 // Expect data owned by test-manager-1 to be updated, expect data already owned but not in apply configuration to be removed cm, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k1": "v202"}), meta_v1.ApplyOptions{FieldManager: "test-manager-2", Force: true}) if err != nil { t.Errorf("Failed to create pod: %v", err) } assert.Equal(t, map[string]string{"k0": "v0", "k1": "v202"}, cm.Data) // Update with test-manager-1 to perform a force update of the entire resource cm, err = client.CoreV1().ConfigMaps("default").Update(context.Background(), &v1.ConfigMap{ TypeMeta: meta_v1.TypeMeta{ APIVersion: "v1", Kind: "ConfigMap", }, ObjectMeta: meta_v1.ObjectMeta{ Name: name, Namespace: namespace, }, Data: map[string]string{ "k99": "v99", }, }, meta_v1.UpdateOptions{FieldManager: "test-manager-0"}) if err != nil { t.Errorf("Failed to update pod: %v", err) } assert.Equal(t, map[string]string{"k99": "v99"}, cm.Data) } kubernetes-client-go-a2dfcab/kubernetes/fake/doc.go000066400000000000000000000012621472614177300225520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated fake clientset. package fake kubernetes-client-go-a2dfcab/kubernetes/fake/register.go000066400000000000000000000133131472614177300236310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" internalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" appsv1beta2 "k8s.io/api/apps/v1beta2" authenticationv1 "k8s.io/api/authentication/v1" authenticationv1alpha1 "k8s.io/api/authentication/v1alpha1" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" authorizationv1 "k8s.io/api/authorization/v1" authorizationv1beta1 "k8s.io/api/authorization/v1beta1" autoscalingv1 "k8s.io/api/autoscaling/v1" autoscalingv2 "k8s.io/api/autoscaling/v2" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" batchv1 "k8s.io/api/batch/v1" batchv1beta1 "k8s.io/api/batch/v1beta1" certificatesv1 "k8s.io/api/certificates/v1" certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" flowcontrolv1 "k8s.io/api/flowcontrol/v1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" networkingv1 "k8s.io/api/networking/v1" networkingv1alpha1 "k8s.io/api/networking/v1alpha1" networkingv1beta1 "k8s.io/api/networking/v1beta1" nodev1 "k8s.io/api/node/v1" nodev1alpha1 "k8s.io/api/node/v1alpha1" nodev1beta1 "k8s.io/api/node/v1beta1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ admissionregistrationv1.AddToScheme, admissionregistrationv1alpha1.AddToScheme, admissionregistrationv1beta1.AddToScheme, internalv1alpha1.AddToScheme, appsv1.AddToScheme, appsv1beta1.AddToScheme, appsv1beta2.AddToScheme, authenticationv1.AddToScheme, authenticationv1alpha1.AddToScheme, authenticationv1beta1.AddToScheme, authorizationv1.AddToScheme, authorizationv1beta1.AddToScheme, autoscalingv1.AddToScheme, autoscalingv2.AddToScheme, autoscalingv2beta1.AddToScheme, autoscalingv2beta2.AddToScheme, batchv1.AddToScheme, batchv1beta1.AddToScheme, certificatesv1.AddToScheme, certificatesv1beta1.AddToScheme, certificatesv1alpha1.AddToScheme, coordinationv1alpha1.AddToScheme, coordinationv1beta1.AddToScheme, coordinationv1.AddToScheme, corev1.AddToScheme, discoveryv1.AddToScheme, discoveryv1beta1.AddToScheme, eventsv1.AddToScheme, eventsv1beta1.AddToScheme, extensionsv1beta1.AddToScheme, flowcontrolv1.AddToScheme, flowcontrolv1beta1.AddToScheme, flowcontrolv1beta2.AddToScheme, flowcontrolv1beta3.AddToScheme, networkingv1.AddToScheme, networkingv1alpha1.AddToScheme, networkingv1beta1.AddToScheme, nodev1.AddToScheme, nodev1alpha1.AddToScheme, nodev1beta1.AddToScheme, policyv1.AddToScheme, policyv1beta1.AddToScheme, rbacv1.AddToScheme, rbacv1beta1.AddToScheme, rbacv1alpha1.AddToScheme, resourcev1alpha3.AddToScheme, schedulingv1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, schedulingv1.AddToScheme, storagev1beta1.AddToScheme, storagev1.AddToScheme, storagev1alpha1.AddToScheme, storagemigrationv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // // import ( // "k8s.io/client-go/kubernetes" // clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // // kclientset, _ := kubernetes.NewForConfig(c) // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. var AddToScheme = localSchemeBuilder.AddToScheme func init() { v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) utilruntime.Must(AddToScheme(scheme)) } kubernetes-client-go-a2dfcab/kubernetes/import.go000066400000000000000000000012731472614177300224130ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // This file exists to enforce this clientset's vanity import path. package kubernetes // import "k8s.io/client-go/kubernetes" kubernetes-client-go-a2dfcab/kubernetes/scheme/000077500000000000000000000000001472614177300220135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/scheme/doc.go000066400000000000000000000013021472614177300231030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package contains the scheme of the automatically generated clientset. package scheme kubernetes-client-go-a2dfcab/kubernetes/scheme/register.go000066400000000000000000000134031472614177300241670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package scheme import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" internalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" appsv1beta2 "k8s.io/api/apps/v1beta2" authenticationv1 "k8s.io/api/authentication/v1" authenticationv1alpha1 "k8s.io/api/authentication/v1alpha1" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" authorizationv1 "k8s.io/api/authorization/v1" authorizationv1beta1 "k8s.io/api/authorization/v1beta1" autoscalingv1 "k8s.io/api/autoscaling/v1" autoscalingv2 "k8s.io/api/autoscaling/v2" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" batchv1 "k8s.io/api/batch/v1" batchv1beta1 "k8s.io/api/batch/v1beta1" certificatesv1 "k8s.io/api/certificates/v1" certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" flowcontrolv1 "k8s.io/api/flowcontrol/v1" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" networkingv1 "k8s.io/api/networking/v1" networkingv1alpha1 "k8s.io/api/networking/v1alpha1" networkingv1beta1 "k8s.io/api/networking/v1beta1" nodev1 "k8s.io/api/node/v1" nodev1alpha1 "k8s.io/api/node/v1alpha1" nodev1beta1 "k8s.io/api/node/v1beta1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ admissionregistrationv1.AddToScheme, admissionregistrationv1alpha1.AddToScheme, admissionregistrationv1beta1.AddToScheme, internalv1alpha1.AddToScheme, appsv1.AddToScheme, appsv1beta1.AddToScheme, appsv1beta2.AddToScheme, authenticationv1.AddToScheme, authenticationv1alpha1.AddToScheme, authenticationv1beta1.AddToScheme, authorizationv1.AddToScheme, authorizationv1beta1.AddToScheme, autoscalingv1.AddToScheme, autoscalingv2.AddToScheme, autoscalingv2beta1.AddToScheme, autoscalingv2beta2.AddToScheme, batchv1.AddToScheme, batchv1beta1.AddToScheme, certificatesv1.AddToScheme, certificatesv1beta1.AddToScheme, certificatesv1alpha1.AddToScheme, coordinationv1alpha1.AddToScheme, coordinationv1beta1.AddToScheme, coordinationv1.AddToScheme, corev1.AddToScheme, discoveryv1.AddToScheme, discoveryv1beta1.AddToScheme, eventsv1.AddToScheme, eventsv1beta1.AddToScheme, extensionsv1beta1.AddToScheme, flowcontrolv1.AddToScheme, flowcontrolv1beta1.AddToScheme, flowcontrolv1beta2.AddToScheme, flowcontrolv1beta3.AddToScheme, networkingv1.AddToScheme, networkingv1alpha1.AddToScheme, networkingv1beta1.AddToScheme, nodev1.AddToScheme, nodev1alpha1.AddToScheme, nodev1beta1.AddToScheme, policyv1.AddToScheme, policyv1beta1.AddToScheme, rbacv1.AddToScheme, rbacv1beta1.AddToScheme, rbacv1alpha1.AddToScheme, resourcev1alpha3.AddToScheme, schedulingv1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, schedulingv1.AddToScheme, storagev1beta1.AddToScheme, storagev1.AddToScheme, storagev1alpha1.AddToScheme, storagemigrationv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // // import ( // "k8s.io/client-go/kubernetes" // clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // // kclientset, _ := kubernetes.NewForConfig(c) // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. var AddToScheme = localSchemeBuilder.AddToScheme func init() { v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) utilruntime.Must(AddToScheme(Scheme)) } kubernetes-client-go-a2dfcab/kubernetes/typed/000077500000000000000000000000001472614177300216745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/000077500000000000000000000000001472614177300263155ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/000077500000000000000000000000001472614177300266435ustar00rootroot00000000000000admissionregistration_client.go000066400000000000000000000074771472614177300351110ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/admissionregistration/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AdmissionregistrationV1Interface interface { RESTClient() rest.Interface MutatingWebhookConfigurationsGetter ValidatingAdmissionPoliciesGetter ValidatingAdmissionPolicyBindingsGetter ValidatingWebhookConfigurationsGetter } // AdmissionregistrationV1Client is used to interact with features provided by the admissionregistration.k8s.io group. type AdmissionregistrationV1Client struct { restClient rest.Interface } func (c *AdmissionregistrationV1Client) MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface { return newMutatingWebhookConfigurations(c) } func (c *AdmissionregistrationV1Client) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface { return newValidatingAdmissionPolicies(c) } func (c *AdmissionregistrationV1Client) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface { return newValidatingAdmissionPolicyBindings(c) } func (c *AdmissionregistrationV1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface { return newValidatingWebhookConfigurations(c) } // NewForConfig creates a new AdmissionregistrationV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AdmissionregistrationV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AdmissionregistrationV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AdmissionregistrationV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AdmissionregistrationV1Client{client}, nil } // NewForConfigOrDie creates a new AdmissionregistrationV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AdmissionregistrationV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AdmissionregistrationV1Client for the given RESTClient. func New(c rest.Interface) *AdmissionregistrationV1Client { return &AdmissionregistrationV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AdmissionregistrationV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/doc.go000066400000000000000000000012571472614177300277440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/fake/000077500000000000000000000000001472614177300275515ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/fake/doc.go000066400000000000000000000012531472614177300306460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake fake_admissionregistration_client.go000066400000000000000000000032561472614177300367740ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAdmissionregistrationV1 struct { *testing.Fake } func (c *FakeAdmissionregistrationV1) MutatingWebhookConfigurations() v1.MutatingWebhookConfigurationInterface { return &FakeMutatingWebhookConfigurations{c} } func (c *FakeAdmissionregistrationV1) ValidatingAdmissionPolicies() v1.ValidatingAdmissionPolicyInterface { return &FakeValidatingAdmissionPolicies{c} } func (c *FakeAdmissionregistrationV1) ValidatingAdmissionPolicyBindings() v1.ValidatingAdmissionPolicyBindingInterface { return &FakeValidatingAdmissionPolicyBindings{c} } func (c *FakeAdmissionregistrationV1) ValidatingWebhookConfigurations() v1.ValidatingWebhookConfigurationInterface { return &FakeValidatingWebhookConfigurations{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAdmissionregistrationV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } fake_mutatingwebhookconfiguration.go000066400000000000000000000161161472614177300370130ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" testing "k8s.io/client-go/testing" ) // FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface type FakeMutatingWebhookConfigurations struct { Fake *FakeAdmissionregistrationV1 } var mutatingwebhookconfigurationsResource = v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations") var mutatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration") // Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) { emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(mutatingwebhookconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { emptyResult := &v1.MutatingWebhookConfigurationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.MutatingWebhookConfigurationList{ListMeta: obj.(*v1.MutatingWebhookConfigurationList).ListMeta} for _, item := range obj.(*v1.MutatingWebhookConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingwebhookconfigurationsResource, opts)) } // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.MutatingWebhookConfiguration, err error) { emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } // Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.MutatingWebhookConfiguration, err error) { emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(mutatingwebhookconfigurationsResource, name, opts), &v1.MutatingWebhookConfiguration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(mutatingwebhookconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.MutatingWebhookConfigurationList{}) return err } // Patch applies the patch and returns the patched mutatingWebhookConfiguration. func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration. func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MutatingWebhookConfiguration, err error) { if mutatingWebhookConfiguration == nil { return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil") } data, err := json.Marshal(mutatingWebhookConfiguration) if err != nil { return nil, err } name := mutatingWebhookConfiguration.Name if name == nil { return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") } emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } fake_validatingadmissionpolicy.go000066400000000000000000000212471472614177300362660ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" testing "k8s.io/client-go/testing" ) // FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type FakeValidatingAdmissionPolicies struct { Fake *FakeAdmissionregistrationV1 } var validatingadmissionpoliciesResource = v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies") var validatingadmissionpoliciesKind = v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy") // Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { emptyResult := &v1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1.ValidatingAdmissionPolicyList).ListMeta} for _, item := range obj.(*v1.ValidatingAdmissionPolicyList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) } // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } // Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } // Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1.ValidatingAdmissionPolicy{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyList{}) return err } // Patch applies the patch and returns the patched validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } // Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) { if validatingAdmissionPolicy == nil { return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicy) if err != nil { return nil, err } name := validatingAdmissionPolicy.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) { if validatingAdmissionPolicy == nil { return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicy) if err != nil { return nil, err } name := validatingAdmissionPolicy.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } fake_validatingadmissionpolicybinding.go000066400000000000000000000165561472614177300376300ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" testing "k8s.io/client-go/testing" ) // FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type FakeValidatingAdmissionPolicyBindings struct { Fake *FakeAdmissionregistrationV1 } var validatingadmissionpolicybindingsResource = v1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings") var validatingadmissionpolicybindingsKind = v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding") // Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1.ValidatingAdmissionPolicyBindingList).ListMeta} for _, item := range obj.(*v1.ValidatingAdmissionPolicyBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) } // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } // Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } // Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1.ValidatingAdmissionPolicyBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyBindingList{}) return err } // Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { if validatingAdmissionPolicyBinding == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicyBinding) if err != nil { return nil, err } name := validatingAdmissionPolicyBinding.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") } emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } fake_validatingwebhookconfiguration.go000066400000000000000000000163361472614177300373110ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" testing "k8s.io/client-go/testing" ) // FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface type FakeValidatingWebhookConfigurations struct { Fake *FakeAdmissionregistrationV1 } var validatingwebhookconfigurationsResource = v1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations") var validatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration") // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(validatingwebhookconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { emptyResult := &v1.ValidatingWebhookConfigurationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ValidatingWebhookConfigurationList{ListMeta: obj.(*v1.ValidatingWebhookConfigurationList).ListMeta} for _, item := range obj.(*v1.ValidatingWebhookConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(validatingwebhookconfigurationsResource, opts)) } // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(validatingwebhookconfigurationsResource, name, opts), &v1.ValidatingWebhookConfiguration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(validatingwebhookconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ValidatingWebhookConfigurationList{}) return err } // Patch applies the patch and returns the patched validatingWebhookConfiguration. func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration. func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingWebhookConfiguration, err error) { if validatingWebhookConfiguration == nil { return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil") } data, err := json.Marshal(validatingWebhookConfiguration) if err != nil { return nil, err } name := validatingWebhookConfiguration.Name if name == nil { return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") } emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/generated_expansion.go000066400000000000000000000015231472614177300332150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type MutatingWebhookConfigurationExpansion interface{} type ValidatingAdmissionPolicyExpansion interface{} type ValidatingAdmissionPolicyBindingExpansion interface{} type ValidatingWebhookConfigurationExpansion interface{} mutatingwebhookconfiguration.go000066400000000000000000000070551472614177300351210ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. // A group's client should implement this interface. type MutatingWebhookConfigurationsGetter interface { MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface } // MutatingWebhookConfigurationInterface has methods to work with MutatingWebhookConfiguration resources. type MutatingWebhookConfigurationInterface interface { Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.MutatingWebhookConfiguration, error) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.MutatingWebhookConfiguration, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.MutatingWebhookConfiguration, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MutatingWebhookConfiguration, err error) MutatingWebhookConfigurationExpansion } // mutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface type mutatingWebhookConfigurations struct { *gentype.ClientWithListAndApply[*v1.MutatingWebhookConfiguration, *v1.MutatingWebhookConfigurationList, *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration] } // newMutatingWebhookConfigurations returns a MutatingWebhookConfigurations func newMutatingWebhookConfigurations(c *AdmissionregistrationV1Client) *mutatingWebhookConfigurations { return &mutatingWebhookConfigurations{ gentype.NewClientWithListAndApply[*v1.MutatingWebhookConfiguration, *v1.MutatingWebhookConfigurationList, *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration]( "mutatingwebhookconfigurations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.MutatingWebhookConfiguration { return &v1.MutatingWebhookConfiguration{} }, func() *v1.MutatingWebhookConfigurationList { return &v1.MutatingWebhookConfigurationList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go000066400000000000000000000077351472614177300344570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. // A group's client should implement this interface. type ValidatingAdmissionPoliciesGetter interface { ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface } // ValidatingAdmissionPolicyInterface has methods to work with ValidatingAdmissionPolicy resources. type ValidatingAdmissionPolicyInterface interface { Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (*v1.ValidatingAdmissionPolicy, error) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (*v1.ValidatingAdmissionPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (*v1.ValidatingAdmissionPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingAdmissionPolicy, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) ValidatingAdmissionPolicyExpansion } // validatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type validatingAdmissionPolicies struct { *gentype.ClientWithListAndApply[*v1.ValidatingAdmissionPolicy, *v1.ValidatingAdmissionPolicyList, *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration] } // newValidatingAdmissionPolicies returns a ValidatingAdmissionPolicies func newValidatingAdmissionPolicies(c *AdmissionregistrationV1Client) *validatingAdmissionPolicies { return &validatingAdmissionPolicies{ gentype.NewClientWithListAndApply[*v1.ValidatingAdmissionPolicy, *v1.ValidatingAdmissionPolicyList, *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration]( "validatingadmissionpolicies", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.ValidatingAdmissionPolicy { return &v1.ValidatingAdmissionPolicy{} }, func() *v1.ValidatingAdmissionPolicyList { return &v1.ValidatingAdmissionPolicyList{} }), } } validatingadmissionpolicybinding.go000066400000000000000000000073151472614177300357250ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. // A group's client should implement this interface. type ValidatingAdmissionPolicyBindingsGetter interface { ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface } // ValidatingAdmissionPolicyBindingInterface has methods to work with ValidatingAdmissionPolicyBinding resources. type ValidatingAdmissionPolicyBindingInterface interface { Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (*v1.ValidatingAdmissionPolicyBinding, error) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (*v1.ValidatingAdmissionPolicyBinding, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingAdmissionPolicyBinding, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicyBinding, err error) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) ValidatingAdmissionPolicyBindingExpansion } // validatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type validatingAdmissionPolicyBindings struct { *gentype.ClientWithListAndApply[*v1.ValidatingAdmissionPolicyBinding, *v1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration] } // newValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindings func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1Client) *validatingAdmissionPolicyBindings { return &validatingAdmissionPolicyBindings{ gentype.NewClientWithListAndApply[*v1.ValidatingAdmissionPolicyBinding, *v1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration]( "validatingadmissionpolicybindings", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.ValidatingAdmissionPolicyBinding { return &v1.ValidatingAdmissionPolicyBinding{} }, func() *v1.ValidatingAdmissionPolicyBindingList { return &v1.ValidatingAdmissionPolicyBindingList{} }), } } validatingwebhookconfiguration.go000066400000000000000000000071751472614177300354160ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. // A group's client should implement this interface. type ValidatingWebhookConfigurationsGetter interface { ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface } // ValidatingWebhookConfigurationInterface has methods to work with ValidatingWebhookConfiguration resources. type ValidatingWebhookConfigurationInterface interface { Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.ValidatingWebhookConfiguration, error) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.ValidatingWebhookConfiguration, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingWebhookConfiguration, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingWebhookConfiguration, err error) ValidatingWebhookConfigurationExpansion } // validatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface type validatingWebhookConfigurations struct { *gentype.ClientWithListAndApply[*v1.ValidatingWebhookConfiguration, *v1.ValidatingWebhookConfigurationList, *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration] } // newValidatingWebhookConfigurations returns a ValidatingWebhookConfigurations func newValidatingWebhookConfigurations(c *AdmissionregistrationV1Client) *validatingWebhookConfigurations { return &validatingWebhookConfigurations{ gentype.NewClientWithListAndApply[*v1.ValidatingWebhookConfiguration, *v1.ValidatingWebhookConfigurationList, *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration]( "validatingwebhookconfigurations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.ValidatingWebhookConfiguration { return &v1.ValidatingWebhookConfiguration{} }, func() *v1.ValidatingWebhookConfigurationList { return &v1.ValidatingWebhookConfigurationList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/000077500000000000000000000000001472614177300277325ustar00rootroot00000000000000admissionregistration_client.go000066400000000000000000000070471472614177300361710ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AdmissionregistrationV1alpha1Interface interface { RESTClient() rest.Interface ValidatingAdmissionPoliciesGetter ValidatingAdmissionPolicyBindingsGetter } // AdmissionregistrationV1alpha1Client is used to interact with features provided by the admissionregistration.k8s.io group. type AdmissionregistrationV1alpha1Client struct { restClient rest.Interface } func (c *AdmissionregistrationV1alpha1Client) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface { return newValidatingAdmissionPolicies(c) } func (c *AdmissionregistrationV1alpha1Client) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface { return newValidatingAdmissionPolicyBindings(c) } // NewForConfig creates a new AdmissionregistrationV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AdmissionregistrationV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AdmissionregistrationV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AdmissionregistrationV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AdmissionregistrationV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new AdmissionregistrationV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AdmissionregistrationV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AdmissionregistrationV1alpha1Client for the given RESTClient. func New(c rest.Interface) *AdmissionregistrationV1alpha1Client { return &AdmissionregistrationV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AdmissionregistrationV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/doc.go000066400000000000000000000012651472614177300310320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/fake/000077500000000000000000000000001472614177300306405ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300317350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake fake_admissionregistration_client.go000066400000000000000000000026241472614177300400610ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAdmissionregistrationV1alpha1 struct { *testing.Fake } func (c *FakeAdmissionregistrationV1alpha1) ValidatingAdmissionPolicies() v1alpha1.ValidatingAdmissionPolicyInterface { return &FakeValidatingAdmissionPolicies{c} } func (c *FakeAdmissionregistrationV1alpha1) ValidatingAdmissionPolicyBindings() v1alpha1.ValidatingAdmissionPolicyBindingInterface { return &FakeValidatingAdmissionPolicyBindings{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAdmissionregistrationV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } fake_validatingadmissionpolicy.go000066400000000000000000000215431472614177300373540ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type FakeValidatingAdmissionPolicies struct { Fake *FakeAdmissionregistrationV1alpha1 } var validatingadmissionpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicies") var validatingadmissionpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy") // Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1alpha1.ValidatingAdmissionPolicyList).ListMeta} for _, item := range obj.(*v1alpha1.ValidatingAdmissionPolicyList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) } // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } // Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } // Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1alpha1.ValidatingAdmissionPolicy{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ValidatingAdmissionPolicyList{}) return err } // Patch applies the patch and returns the patched validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } // Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { if validatingAdmissionPolicy == nil { return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicy) if err != nil { return nil, err } name := validatingAdmissionPolicy.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { if validatingAdmissionPolicy == nil { return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicy) if err != nil { return nil, err } name := validatingAdmissionPolicy.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } fake_validatingadmissionpolicybinding.go000066400000000000000000000170021472614177300407020ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type FakeValidatingAdmissionPolicyBindings struct { Fake *FakeAdmissionregistrationV1alpha1 } var validatingadmissionpolicybindingsResource = v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings") var validatingadmissionpolicybindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding") // Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1alpha1.ValidatingAdmissionPolicyBindingList).ListMeta} for _, item := range obj.(*v1alpha1.ValidatingAdmissionPolicyBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) } // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } // Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } // Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1alpha1.ValidatingAdmissionPolicyBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ValidatingAdmissionPolicyBindingList{}) return err } // Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { if validatingAdmissionPolicyBinding == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicyBinding) if err != nil { return nil, err } name := validatingAdmissionPolicyBinding.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") } emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go000066400000000000000000000013471472614177300343100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type ValidatingAdmissionPolicyExpansion interface{} type ValidatingAdmissionPolicyBindingExpansion interface{} validatingadmissionpolicy.go000066400000000000000000000101271472614177300354540ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. // A group's client should implement this interface. type ValidatingAdmissionPoliciesGetter interface { ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface } // ValidatingAdmissionPolicyInterface has methods to work with ValidatingAdmissionPolicy resources. type ValidatingAdmissionPolicyInterface interface { Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicy, err error) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) ValidatingAdmissionPolicyExpansion } // validatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type validatingAdmissionPolicies struct { *gentype.ClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicy, *v1alpha1.ValidatingAdmissionPolicyList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration] } // newValidatingAdmissionPolicies returns a ValidatingAdmissionPolicies func newValidatingAdmissionPolicies(c *AdmissionregistrationV1alpha1Client) *validatingAdmissionPolicies { return &validatingAdmissionPolicies{ gentype.NewClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicy, *v1alpha1.ValidatingAdmissionPolicyList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration]( "validatingadmissionpolicies", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.ValidatingAdmissionPolicy { return &v1alpha1.ValidatingAdmissionPolicy{} }, func() *v1alpha1.ValidatingAdmissionPolicyList { return &v1alpha1.ValidatingAdmissionPolicyList{} }), } } validatingadmissionpolicybinding.go000066400000000000000000000074761472614177300370240ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. // A group's client should implement this interface. type ValidatingAdmissionPolicyBindingsGetter interface { ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface } // ValidatingAdmissionPolicyBindingInterface has methods to work with ValidatingAdmissionPolicyBinding resources. type ValidatingAdmissionPolicyBindingInterface interface { Create(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (*v1alpha1.ValidatingAdmissionPolicyBinding, error) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (*v1alpha1.ValidatingAdmissionPolicyBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ValidatingAdmissionPolicyBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) ValidatingAdmissionPolicyBindingExpansion } // validatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type validatingAdmissionPolicyBindings struct { *gentype.ClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicyBinding, *v1alpha1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration] } // newValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindings func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1alpha1Client) *validatingAdmissionPolicyBindings { return &validatingAdmissionPolicyBindings{ gentype.NewClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicyBinding, *v1alpha1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration]( "validatingadmissionpolicybindings", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.ValidatingAdmissionPolicyBinding { return &v1alpha1.ValidatingAdmissionPolicyBinding{} }, func() *v1alpha1.ValidatingAdmissionPolicyBindingList { return &v1alpha1.ValidatingAdmissionPolicyBindingList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/000077500000000000000000000000001472614177300275605ustar00rootroot00000000000000admissionregistration_client.go000066400000000000000000000076551472614177300360240ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/admissionregistration/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AdmissionregistrationV1beta1Interface interface { RESTClient() rest.Interface MutatingWebhookConfigurationsGetter ValidatingAdmissionPoliciesGetter ValidatingAdmissionPolicyBindingsGetter ValidatingWebhookConfigurationsGetter } // AdmissionregistrationV1beta1Client is used to interact with features provided by the admissionregistration.k8s.io group. type AdmissionregistrationV1beta1Client struct { restClient rest.Interface } func (c *AdmissionregistrationV1beta1Client) MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface { return newMutatingWebhookConfigurations(c) } func (c *AdmissionregistrationV1beta1Client) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface { return newValidatingAdmissionPolicies(c) } func (c *AdmissionregistrationV1beta1Client) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface { return newValidatingAdmissionPolicyBindings(c) } func (c *AdmissionregistrationV1beta1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface { return newValidatingWebhookConfigurations(c) } // NewForConfig creates a new AdmissionregistrationV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AdmissionregistrationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AdmissionregistrationV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AdmissionregistrationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AdmissionregistrationV1beta1Client{client}, nil } // NewForConfigOrDie creates a new AdmissionregistrationV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AdmissionregistrationV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AdmissionregistrationV1beta1Client for the given RESTClient. func New(c rest.Interface) *AdmissionregistrationV1beta1Client { return &AdmissionregistrationV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AdmissionregistrationV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/doc.go000066400000000000000000000012641472614177300306570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/fake/000077500000000000000000000000001472614177300304665ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go000066400000000000000000000012531472614177300315630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake fake_admissionregistration_client.go000066400000000000000000000033521472614177300377060ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAdmissionregistrationV1beta1 struct { *testing.Fake } func (c *FakeAdmissionregistrationV1beta1) MutatingWebhookConfigurations() v1beta1.MutatingWebhookConfigurationInterface { return &FakeMutatingWebhookConfigurations{c} } func (c *FakeAdmissionregistrationV1beta1) ValidatingAdmissionPolicies() v1beta1.ValidatingAdmissionPolicyInterface { return &FakeValidatingAdmissionPolicies{c} } func (c *FakeAdmissionregistrationV1beta1) ValidatingAdmissionPolicyBindings() v1beta1.ValidatingAdmissionPolicyBindingInterface { return &FakeValidatingAdmissionPolicyBindings{c} } func (c *FakeAdmissionregistrationV1beta1) ValidatingWebhookConfigurations() v1beta1.ValidatingWebhookConfigurationInterface { return &FakeValidatingWebhookConfigurations{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAdmissionregistrationV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } fake_mutatingwebhookconfiguration.go000066400000000000000000000163021472614177300377250ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" testing "k8s.io/client-go/testing" ) // FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface type FakeMutatingWebhookConfigurations struct { Fake *FakeAdmissionregistrationV1beta1 } var mutatingwebhookconfigurationsResource = v1beta1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations") var mutatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration") // Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(mutatingwebhookconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { emptyResult := &v1beta1.MutatingWebhookConfigurationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.MutatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.MutatingWebhookConfigurationList).ListMeta} for _, item := range obj.(*v1beta1.MutatingWebhookConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingwebhookconfigurationsResource, opts)) } // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } // Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(mutatingwebhookconfigurationsResource, name, opts), &v1beta1.MutatingWebhookConfiguration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(mutatingwebhookconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.MutatingWebhookConfigurationList{}) return err } // Patch applies the patch and returns the patched mutatingWebhookConfiguration. func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration. func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { if mutatingWebhookConfiguration == nil { return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil") } data, err := json.Marshal(mutatingWebhookConfiguration) if err != nil { return nil, err } name := mutatingWebhookConfiguration.Name if name == nil { return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") } emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } fake_validatingadmissionpolicy.go000066400000000000000000000214731472614177300372040ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" testing "k8s.io/client-go/testing" ) // FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type FakeValidatingAdmissionPolicies struct { Fake *FakeAdmissionregistrationV1beta1 } var validatingadmissionpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicies") var validatingadmissionpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy") // Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1beta1.ValidatingAdmissionPolicyList).ListMeta} for _, item := range obj.(*v1beta1.ValidatingAdmissionPolicyList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) } // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } // Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } // Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1beta1.ValidatingAdmissionPolicy{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyList{}) return err } // Patch applies the patch and returns the patched validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } // Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { if validatingAdmissionPolicy == nil { return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicy) if err != nil { return nil, err } name := validatingAdmissionPolicy.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { if validatingAdmissionPolicy == nil { return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicy) if err != nil { return nil, err } name := validatingAdmissionPolicy.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } fake_validatingadmissionpolicybinding.go000066400000000000000000000167421472614177300405420ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" testing "k8s.io/client-go/testing" ) // FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type FakeValidatingAdmissionPolicyBindings struct { Fake *FakeAdmissionregistrationV1beta1 } var validatingadmissionpolicybindingsResource = v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings") var validatingadmissionpolicybindingsKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding") // Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1beta1.ValidatingAdmissionPolicyBindingList).ListMeta} for _, item := range obj.(*v1beta1.ValidatingAdmissionPolicyBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) } // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } // Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } // Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1beta1.ValidatingAdmissionPolicyBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyBindingList{}) return err } // Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { if validatingAdmissionPolicyBinding == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") } data, err := json.Marshal(validatingAdmissionPolicyBinding) if err != nil { return nil, err } name := validatingAdmissionPolicyBinding.Name if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") } emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } fake_validatingwebhookconfiguration.go000066400000000000000000000165221472614177300402230ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" testing "k8s.io/client-go/testing" ) // FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface type FakeValidatingWebhookConfigurations struct { Fake *FakeAdmissionregistrationV1beta1 } var validatingwebhookconfigurationsResource = v1beta1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations") var validatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration") // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(validatingwebhookconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { emptyResult := &v1beta1.ValidatingWebhookConfigurationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.ValidatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.ValidatingWebhookConfigurationList).ListMeta} for _, item := range obj.(*v1beta1.ValidatingWebhookConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(validatingwebhookconfigurationsResource, opts)) } // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(validatingwebhookconfigurationsResource, name, opts), &v1beta1.ValidatingWebhookConfiguration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(validatingwebhookconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ValidatingWebhookConfigurationList{}) return err } // Patch applies the patch and returns the patched validatingWebhookConfiguration. func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration. func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { if validatingWebhookConfiguration == nil { return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil") } data, err := json.Marshal(validatingWebhookConfiguration) if err != nil { return nil, err } name := validatingWebhookConfiguration.Name if name == nil { return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") } emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go000066400000000000000000000015301472614177300341300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type MutatingWebhookConfigurationExpansion interface{} type ValidatingAdmissionPolicyExpansion interface{} type ValidatingAdmissionPolicyBindingExpansion interface{} type ValidatingWebhookConfigurationExpansion interface{} mutatingwebhookconfiguration.go000066400000000000000000000071761472614177300360420ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. // A group's client should implement this interface. type MutatingWebhookConfigurationsGetter interface { MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface } // MutatingWebhookConfigurationInterface has methods to work with MutatingWebhookConfiguration resources. type MutatingWebhookConfigurationInterface interface { Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (*v1beta1.MutatingWebhookConfiguration, error) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (*v1beta1.MutatingWebhookConfiguration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MutatingWebhookConfiguration, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) MutatingWebhookConfigurationExpansion } // mutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface type mutatingWebhookConfigurations struct { *gentype.ClientWithListAndApply[*v1beta1.MutatingWebhookConfiguration, *v1beta1.MutatingWebhookConfigurationList, *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration] } // newMutatingWebhookConfigurations returns a MutatingWebhookConfigurations func newMutatingWebhookConfigurations(c *AdmissionregistrationV1beta1Client) *mutatingWebhookConfigurations { return &mutatingWebhookConfigurations{ gentype.NewClientWithListAndApply[*v1beta1.MutatingWebhookConfiguration, *v1beta1.MutatingWebhookConfigurationList, *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration]( "mutatingwebhookconfigurations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.MutatingWebhookConfiguration { return &v1beta1.MutatingWebhookConfiguration{} }, func() *v1beta1.MutatingWebhookConfigurationList { return &v1beta1.MutatingWebhookConfigurationList{} }), } } validatingadmissionpolicy.go000066400000000000000000000100721472614177300353010ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. // A group's client should implement this interface. type ValidatingAdmissionPoliciesGetter interface { ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface } // ValidatingAdmissionPolicyInterface has methods to work with ValidatingAdmissionPolicy resources. type ValidatingAdmissionPolicyInterface interface { Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ValidatingAdmissionPolicy, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) ValidatingAdmissionPolicyExpansion } // validatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type validatingAdmissionPolicies struct { *gentype.ClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicy, *v1beta1.ValidatingAdmissionPolicyList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration] } // newValidatingAdmissionPolicies returns a ValidatingAdmissionPolicies func newValidatingAdmissionPolicies(c *AdmissionregistrationV1beta1Client) *validatingAdmissionPolicies { return &validatingAdmissionPolicies{ gentype.NewClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicy, *v1beta1.ValidatingAdmissionPolicyList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration]( "validatingadmissionpolicies", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.ValidatingAdmissionPolicy { return &v1beta1.ValidatingAdmissionPolicy{} }, func() *v1beta1.ValidatingAdmissionPolicyList { return &v1beta1.ValidatingAdmissionPolicyList{} }), } } validatingadmissionpolicybinding.go000066400000000000000000000074451472614177300366460ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. // A group's client should implement this interface. type ValidatingAdmissionPolicyBindingsGetter interface { ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface } // ValidatingAdmissionPolicyBindingInterface has methods to work with ValidatingAdmissionPolicyBinding resources. type ValidatingAdmissionPolicyBindingInterface interface { Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (*v1beta1.ValidatingAdmissionPolicyBinding, error) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicyBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ValidatingAdmissionPolicyBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) ValidatingAdmissionPolicyBindingExpansion } // validatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type validatingAdmissionPolicyBindings struct { *gentype.ClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicyBinding, *v1beta1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration] } // newValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindings func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1beta1Client) *validatingAdmissionPolicyBindings { return &validatingAdmissionPolicyBindings{ gentype.NewClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicyBinding, *v1beta1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration]( "validatingadmissionpolicybindings", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.ValidatingAdmissionPolicyBinding { return &v1beta1.ValidatingAdmissionPolicyBinding{} }, func() *v1beta1.ValidatingAdmissionPolicyBindingList { return &v1beta1.ValidatingAdmissionPolicyBindingList{} }), } } validatingwebhookconfiguration.go000066400000000000000000000073251472614177300363300ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. // A group's client should implement this interface. type ValidatingWebhookConfigurationsGetter interface { ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface } // ValidatingWebhookConfigurationInterface has methods to work with ValidatingWebhookConfiguration resources. type ValidatingWebhookConfigurationInterface interface { Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ValidatingWebhookConfiguration, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) ValidatingWebhookConfigurationExpansion } // validatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface type validatingWebhookConfigurations struct { *gentype.ClientWithListAndApply[*v1beta1.ValidatingWebhookConfiguration, *v1beta1.ValidatingWebhookConfigurationList, *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration] } // newValidatingWebhookConfigurations returns a ValidatingWebhookConfigurations func newValidatingWebhookConfigurations(c *AdmissionregistrationV1beta1Client) *validatingWebhookConfigurations { return &validatingWebhookConfigurations{ gentype.NewClientWithListAndApply[*v1beta1.ValidatingWebhookConfiguration, *v1beta1.ValidatingWebhookConfigurationList, *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration]( "validatingwebhookconfigurations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.ValidatingWebhookConfiguration { return &v1beta1.ValidatingWebhookConfiguration{} }, func() *v1beta1.ValidatingWebhookConfigurationList { return &v1beta1.ValidatingWebhookConfigurationList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/000077500000000000000000000000001472614177300254315ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/000077500000000000000000000000001472614177300270465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go000066400000000000000000000061241472614177300344730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type InternalV1alpha1Interface interface { RESTClient() rest.Interface StorageVersionsGetter } // InternalV1alpha1Client is used to interact with features provided by the internal.apiserver.k8s.io group. type InternalV1alpha1Client struct { restClient rest.Interface } func (c *InternalV1alpha1Client) StorageVersions() StorageVersionInterface { return newStorageVersions(c) } // NewForConfig creates a new InternalV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*InternalV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new InternalV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*InternalV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &InternalV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new InternalV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *InternalV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new InternalV1alpha1Client for the given RESTClient. func New(c rest.Interface) *InternalV1alpha1Client { return &InternalV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *InternalV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/doc.go000066400000000000000000000012651472614177300301460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/fake/000077500000000000000000000000001472614177300277545ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300310510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake fake_apiserverinternal_client.go000066400000000000000000000022141472614177300363040ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeInternalV1alpha1 struct { *testing.Fake } func (c *FakeInternalV1alpha1) StorageVersions() v1alpha1.StorageVersionInterface { return &FakeStorageVersions{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeInternalV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go000066400000000000000000000174601472614177300343530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeStorageVersions implements StorageVersionInterface type FakeStorageVersions struct { Fake *FakeInternalV1alpha1 } var storageversionsResource = v1alpha1.SchemeGroupVersion.WithResource("storageversions") var storageversionsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersion") // Get takes name of the storageVersion, and returns the corresponding storageVersion object, and an error if there is any. func (c *FakeStorageVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(storageversionsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } // List takes label and field selectors, and returns the list of StorageVersions that match those selectors. func (c *FakeStorageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { emptyResult := &v1alpha1.StorageVersionList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(storageversionsResource, storageversionsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.StorageVersionList{ListMeta: obj.(*v1alpha1.StorageVersionList).ListMeta} for _, item := range obj.(*v1alpha1.StorageVersionList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested storageVersions. func (c *FakeStorageVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(storageversionsResource, opts)) } // Create takes the representation of a storageVersion and creates it. Returns the server's representation of the storageVersion, and an error, if there is any. func (c *FakeStorageVersions) Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(storageversionsResource, storageVersion, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } // Update takes the representation of a storageVersion and updates it. Returns the server's representation of the storageVersion, and an error, if there is any. func (c *FakeStorageVersions) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(storageversionsResource, storageVersion, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(storageversionsResource, "status", storageVersion, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } // Delete takes name of the storageVersion and deletes it. Returns an error if one occurs. func (c *FakeStorageVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(storageversionsResource, name, opts), &v1alpha1.StorageVersion{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeStorageVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(storageversionsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionList{}) return err } // Patch applies the patch and returns the patched storageVersion. func (c *FakeStorageVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } // Apply takes the given apply declarative configuration, applies it and returns the applied storageVersion. func (c *FakeStorageVersions) Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) { if storageVersion == nil { return nil, fmt.Errorf("storageVersion provided to Apply must not be nil") } data, err := json.Marshal(storageVersion) if err != nil { return nil, err } name := storageVersion.Name if name == nil { return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") } emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeStorageVersions) ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) { if storageVersion == nil { return nil, fmt.Errorf("storageVersion provided to Apply must not be nil") } data, err := json.Marshal(storageVersion) if err != nil { return nil, err } name := storageVersion.Name if name == nil { return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") } emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/generated_expansion.go000066400000000000000000000012401472614177300334140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type StorageVersionExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go000066400000000000000000000070511472614177300324520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // StorageVersionsGetter has a method to return a StorageVersionInterface. // A group's client should implement this interface. type StorageVersionsGetter interface { StorageVersions() StorageVersionInterface } // StorageVersionInterface has methods to work with StorageVersion resources. type StorageVersionInterface interface { Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (*v1alpha1.StorageVersion, error) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (*v1alpha1.StorageVersion, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (*v1alpha1.StorageVersion, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.StorageVersion, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) StorageVersionExpansion } // storageVersions implements StorageVersionInterface type storageVersions struct { *gentype.ClientWithListAndApply[*v1alpha1.StorageVersion, *v1alpha1.StorageVersionList, *apiserverinternalv1alpha1.StorageVersionApplyConfiguration] } // newStorageVersions returns a StorageVersions func newStorageVersions(c *InternalV1alpha1Client) *storageVersions { return &storageVersions{ gentype.NewClientWithListAndApply[*v1alpha1.StorageVersion, *v1alpha1.StorageVersionList, *apiserverinternalv1alpha1.StorageVersionApplyConfiguration]( "storageversions", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.StorageVersion { return &v1alpha1.StorageVersion{} }, func() *v1alpha1.StorageVersionList { return &v1alpha1.StorageVersionList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/000077500000000000000000000000001472614177300226375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/000077500000000000000000000000001472614177300231655ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/apps_client.go000066400000000000000000000067071472614177300260270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/apps/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AppsV1Interface interface { RESTClient() rest.Interface ControllerRevisionsGetter DaemonSetsGetter DeploymentsGetter ReplicaSetsGetter StatefulSetsGetter } // AppsV1Client is used to interact with features provided by the apps group. type AppsV1Client struct { restClient rest.Interface } func (c *AppsV1Client) ControllerRevisions(namespace string) ControllerRevisionInterface { return newControllerRevisions(c, namespace) } func (c *AppsV1Client) DaemonSets(namespace string) DaemonSetInterface { return newDaemonSets(c, namespace) } func (c *AppsV1Client) Deployments(namespace string) DeploymentInterface { return newDeployments(c, namespace) } func (c *AppsV1Client) ReplicaSets(namespace string) ReplicaSetInterface { return newReplicaSets(c, namespace) } func (c *AppsV1Client) StatefulSets(namespace string) StatefulSetInterface { return newStatefulSets(c, namespace) } // NewForConfig creates a new AppsV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AppsV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AppsV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AppsV1Client{client}, nil } // NewForConfigOrDie creates a new AppsV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AppsV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AppsV1Client for the given RESTClient. func New(c rest.Interface) *AppsV1Client { return &AppsV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AppsV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/controllerrevision.go000066400000000000000000000061171472614177300274630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. // A group's client should implement this interface. type ControllerRevisionsGetter interface { ControllerRevisions(namespace string) ControllerRevisionInterface } // ControllerRevisionInterface has methods to work with ControllerRevision resources. type ControllerRevisionInterface interface { Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (*v1.ControllerRevision, error) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (*v1.ControllerRevision, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ControllerRevision, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) Apply(ctx context.Context, controllerRevision *appsv1.ControllerRevisionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControllerRevision, err error) ControllerRevisionExpansion } // controllerRevisions implements ControllerRevisionInterface type controllerRevisions struct { *gentype.ClientWithListAndApply[*v1.ControllerRevision, *v1.ControllerRevisionList, *appsv1.ControllerRevisionApplyConfiguration] } // newControllerRevisions returns a ControllerRevisions func newControllerRevisions(c *AppsV1Client, namespace string) *controllerRevisions { return &controllerRevisions{ gentype.NewClientWithListAndApply[*v1.ControllerRevision, *v1.ControllerRevisionList, *appsv1.ControllerRevisionApplyConfiguration]( "controllerrevisions", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.ControllerRevision { return &v1.ControllerRevision{} }, func() *v1.ControllerRevisionList { return &v1.ControllerRevisionList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/daemonset.go000066400000000000000000000062231472614177300254760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. // A group's client should implement this interface. type DaemonSetsGetter interface { DaemonSets(namespace string) DaemonSetInterface } // DaemonSetInterface has methods to work with DaemonSet resources. type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (*v1.DaemonSet, error) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DaemonSet, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) Apply(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) DaemonSetExpansion } // daemonSets implements DaemonSetInterface type daemonSets struct { *gentype.ClientWithListAndApply[*v1.DaemonSet, *v1.DaemonSetList, *appsv1.DaemonSetApplyConfiguration] } // newDaemonSets returns a DaemonSets func newDaemonSets(c *AppsV1Client, namespace string) *daemonSets { return &daemonSets{ gentype.NewClientWithListAndApply[*v1.DaemonSet, *v1.DaemonSetList, *appsv1.DaemonSetApplyConfiguration]( "daemonsets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.DaemonSet { return &v1.DaemonSet{} }, func() *v1.DaemonSetList { return &v1.DaemonSetList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/deployment.go000066400000000000000000000133671472614177300257060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // DeploymentsGetter has a method to return a DeploymentInterface. // A group's client should implement this interface. type DeploymentsGetter interface { Deployments(namespace string) DeploymentInterface } // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (*v1.Deployment, error) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Deployment, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) Apply(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (*autoscalingv1.Scale, error) DeploymentExpansion } // deployments implements DeploymentInterface type deployments struct { *gentype.ClientWithListAndApply[*v1.Deployment, *v1.DeploymentList, *appsv1.DeploymentApplyConfiguration] } // newDeployments returns a Deployments func newDeployments(c *AppsV1Client, namespace string) *deployments { return &deployments{ gentype.NewClientWithListAndApply[*v1.Deployment, *v1.DeploymentList, *appsv1.DeploymentApplyConfiguration]( "deployments", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Deployment { return &v1.Deployment{} }, func() *v1.DeploymentList { return &v1.DeploymentList{} }), } } // GetScale takes name of the deployment, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *deployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). VersionedParams(&opts, scheme.ParameterCodec). Body(scale). Do(ctx). Into(result) return } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *deployments) ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } patchOpts := opts.ToPatchOptions() data, err := json.Marshal(scale) if err != nil { return nil, err } result = &autoscalingv1.Scale{} err = c.GetClient().Patch(types.ApplyPatchType). Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). VersionedParams(&patchOpts, scheme.ParameterCodec). Body(data). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/doc.go000066400000000000000000000012571472614177300242660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/fake/000077500000000000000000000000001472614177300240735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/fake/doc.go000066400000000000000000000012531472614177300251700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/fake/fake_apps_client.go000066400000000000000000000031161472614177300277120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/apps/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAppsV1 struct { *testing.Fake } func (c *FakeAppsV1) ControllerRevisions(namespace string) v1.ControllerRevisionInterface { return &FakeControllerRevisions{c, namespace} } func (c *FakeAppsV1) DaemonSets(namespace string) v1.DaemonSetInterface { return &FakeDaemonSets{c, namespace} } func (c *FakeAppsV1) Deployments(namespace string) v1.DeploymentInterface { return &FakeDeployments{c, namespace} } func (c *FakeAppsV1) ReplicaSets(namespace string) v1.ReplicaSetInterface { return &FakeReplicaSets{c, namespace} } func (c *FakeAppsV1) StatefulSets(namespace string) v1.StatefulSetInterface { return &FakeStatefulSets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAppsV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go000066400000000000000000000145201472614177300313540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" testing "k8s.io/client-go/testing" ) // FakeControllerRevisions implements ControllerRevisionInterface type FakeControllerRevisions struct { Fake *FakeAppsV1 ns string } var controllerrevisionsResource = v1.SchemeGroupVersion.WithResource("controllerrevisions") var controllerrevisionsKind = v1.SchemeGroupVersion.WithKind("ControllerRevision") // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) { emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ControllerRevision), err } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *FakeControllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { emptyResult := &v1.ControllerRevisionList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ControllerRevisionList{ListMeta: obj.(*v1.ControllerRevisionList).ListMeta} for _, item := range obj.(*v1.ControllerRevisionList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *FakeControllerRevisions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) } // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (result *v1.ControllerRevision, err error) { emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ControllerRevision), err } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (result *v1.ControllerRevision, err error) { emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ControllerRevision), err } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1.ControllerRevision{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ControllerRevisionList{}) return err } // Patch applies the patch and returns the patched controllerRevision. func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) { emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ControllerRevision), err } // Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1.ControllerRevisionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControllerRevision, err error) { if controllerRevision == nil { return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") } data, err := json.Marshal(controllerRevision) if err != nil { return nil, err } name := controllerRevision.Name if name == nil { return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") } emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ControllerRevision), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/fake/fake_daemonset.go000066400000000000000000000162201472614177300273700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" testing "k8s.io/client-go/testing" ) // FakeDaemonSets implements DaemonSetInterface type FakeDaemonSets struct { Fake *FakeAppsV1 ns string } var daemonsetsResource = v1.SchemeGroupVersion.WithResource("daemonsets") var daemonsetsKind = v1.SchemeGroupVersion.WithKind("DaemonSet") // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. func (c *FakeDaemonSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.DaemonSet), err } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *FakeDaemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { emptyResult := &v1.DaemonSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.DaemonSetList{ListMeta: obj.(*v1.DaemonSetList).ListMeta} for _, item := range obj.(*v1.DaemonSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested daemonSets. func (c *FakeDaemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts)) } // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.DaemonSet), err } // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.DaemonSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.DaemonSet), err } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1.DaemonSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DaemonSetList{}) return err } // Patch applies the patch and returns the patched daemonSet. func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.DaemonSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet. func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) { if daemonSet == nil { return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") } data, err := json.Marshal(daemonSet) if err != nil { return nil, err } name := daemonSet.Name if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } emptyResult := &v1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.DaemonSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) { if daemonSet == nil { return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") } data, err := json.Marshal(daemonSet) if err != nil { return nil, err } name := daemonSet.Name if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } emptyResult := &v1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.DaemonSet), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/fake/fake_deployment.go000066400000000000000000000225231472614177300275740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" testing "k8s.io/client-go/testing" ) // FakeDeployments implements DeploymentInterface type FakeDeployments struct { Fake *FakeAppsV1 ns string } var deploymentsResource = v1.SchemeGroupVersion.WithResource("deployments") var deploymentsKind = v1.SchemeGroupVersion.WithKind("Deployment") // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. func (c *FakeDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Deployment), err } // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *FakeDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { emptyResult := &v1.DeploymentList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.DeploymentList{ListMeta: obj.(*v1.DeploymentList).ListMeta} for _, item := range obj.(*v1.DeploymentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested deployments. func (c *FakeDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) } // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Deployment), err } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Deployment), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Deployment), err } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. func (c *FakeDeployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1.Deployment{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DeploymentList{}) return err } // Patch applies the patch and returns the patched deployment. func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Deployment), err } // Apply takes the given apply declarative configuration, applies it and returns the applied deployment. func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) { if deployment == nil { return nil, fmt.Errorf("deployment provided to Apply must not be nil") } data, err := json.Marshal(deployment) if err != nil { return nil, err } name := deployment.Name if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } emptyResult := &v1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Deployment), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) { if deployment == nil { return nil, fmt.Errorf("deployment provided to Apply must not be nil") } data, err := json.Marshal(deployment) if err != nil { return nil, err } name := deployment.Name if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } emptyResult := &v1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Deployment), err } // GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any. func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewGetSubresourceActionWithOptions(deploymentsResource, c.ns, "scale", deploymentName, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } data, err := json.Marshal(scale) if err != nil { return nil, err } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/fake/fake_replicaset.go000066400000000000000000000225231472614177300275470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" testing "k8s.io/client-go/testing" ) // FakeReplicaSets implements ReplicaSetInterface type FakeReplicaSets struct { Fake *FakeAppsV1 ns string } var replicasetsResource = v1.SchemeGroupVersion.WithResource("replicasets") var replicasetsKind = v1.SchemeGroupVersion.WithKind("ReplicaSet") // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. func (c *FakeReplicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicaSet), err } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *FakeReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { emptyResult := &v1.ReplicaSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ReplicaSetList{ListMeta: obj.(*v1.ReplicaSetList).ListMeta} for _, item := range obj.(*v1.ReplicaSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested replicaSets. func (c *FakeReplicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) } // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicaSet), err } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicaSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicaSet), err } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(replicasetsResource, c.ns, name, opts), &v1.ReplicaSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ReplicaSetList{}) return err } // Patch applies the patch and returns the patched replicaSet. func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicaSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet. func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) { if replicaSet == nil { return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") } data, err := json.Marshal(replicaSet) if err != nil { return nil, err } name := replicaSet.Name if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicaSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) { if replicaSet == nil { return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") } data, err := json.Marshal(replicaSet) if err != nil { return nil, err } name := replicaSet.Name if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicaSet), err } // GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewGetSubresourceActionWithOptions(replicasetsResource, c.ns, "scale", replicaSetName, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } data, err := json.Marshal(scale) if err != nil { return nil, err } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/fake/fake_statefulset.go000066400000000000000000000226731472614177300277650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" testing "k8s.io/client-go/testing" ) // FakeStatefulSets implements StatefulSetInterface type FakeStatefulSets struct { Fake *FakeAppsV1 ns string } var statefulsetsResource = v1.SchemeGroupVersion.WithResource("statefulsets") var statefulsetsKind = v1.SchemeGroupVersion.WithKind("StatefulSet") // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. func (c *FakeStatefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StatefulSet), err } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *FakeStatefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { emptyResult := &v1.StatefulSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.StatefulSetList{ListMeta: obj.(*v1.StatefulSetList).ListMeta} for _, item := range obj.(*v1.StatefulSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested statefulSets. func (c *FakeStatefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) } // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StatefulSet), err } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StatefulSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StatefulSet), err } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1.StatefulSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.StatefulSetList{}) return err } // Patch applies the patch and returns the patched statefulSet. func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StatefulSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) { if statefulSet == nil { return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") } data, err := json.Marshal(statefulSet) if err != nil { return nil, err } name := statefulSet.Name if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } emptyResult := &v1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StatefulSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) { if statefulSet == nil { return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") } data, err := json.Marshal(statefulSet) if err != nil { return nil, err } name := statefulSet.Name if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } emptyResult := &v1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StatefulSet), err } // GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewGetSubresourceActionWithOptions(statefulsetsResource, c.ns, "scale", statefulSetName, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } data, err := json.Marshal(scale) if err != nil { return nil, err } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/generated_expansion.go000066400000000000000000000014661472614177300275450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type ControllerRevisionExpansion interface{} type DaemonSetExpansion interface{} type DeploymentExpansion interface{} type ReplicaSetExpansion interface{} type StatefulSetExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/replicaset.go000066400000000000000000000133671472614177300256610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. // A group's client should implement this interface. type ReplicaSetsGetter interface { ReplicaSets(namespace string) ReplicaSetInterface } // ReplicaSetInterface has methods to work with ReplicaSet resources. type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (*v1.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ReplicaSet, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) Apply(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (*autoscalingv1.Scale, error) ReplicaSetExpansion } // replicaSets implements ReplicaSetInterface type replicaSets struct { *gentype.ClientWithListAndApply[*v1.ReplicaSet, *v1.ReplicaSetList, *appsv1.ReplicaSetApplyConfiguration] } // newReplicaSets returns a ReplicaSets func newReplicaSets(c *AppsV1Client, namespace string) *replicaSets { return &replicaSets{ gentype.NewClientWithListAndApply[*v1.ReplicaSet, *v1.ReplicaSetList, *appsv1.ReplicaSetApplyConfiguration]( "replicasets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.ReplicaSet { return &v1.ReplicaSet{} }, func() *v1.ReplicaSetList { return &v1.ReplicaSetList{} }), } } // GetScale takes name of the replicaSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). VersionedParams(&opts, scheme.ParameterCodec). Body(scale). Do(ctx). Into(result) return } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *replicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } patchOpts := opts.ToPatchOptions() data, err := json.Marshal(scale) if err != nil { return nil, err } result = &autoscalingv1.Scale{} err = c.GetClient().Patch(types.ApplyPatchType). Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). VersionedParams(&patchOpts, scheme.ParameterCodec). Body(data). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1/statefulset.go000066400000000000000000000134651472614177300260700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. // A group's client should implement this interface. type StatefulSetsGetter interface { StatefulSets(namespace string) StatefulSetInterface } // StatefulSetInterface has methods to work with StatefulSet resources. type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (*v1.StatefulSet, error) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.StatefulSet, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) Apply(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (*autoscalingv1.Scale, error) StatefulSetExpansion } // statefulSets implements StatefulSetInterface type statefulSets struct { *gentype.ClientWithListAndApply[*v1.StatefulSet, *v1.StatefulSetList, *appsv1.StatefulSetApplyConfiguration] } // newStatefulSets returns a StatefulSets func newStatefulSets(c *AppsV1Client, namespace string) *statefulSets { return &statefulSets{ gentype.NewClientWithListAndApply[*v1.StatefulSet, *v1.StatefulSetList, *appsv1.StatefulSetApplyConfiguration]( "statefulsets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.StatefulSet { return &v1.StatefulSet{} }, func() *v1.StatefulSetList { return &v1.StatefulSetList{} }), } } // GetScale takes name of the statefulSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). VersionedParams(&opts, scheme.ParameterCodec). Body(scale). Do(ctx). Into(result) return } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *statefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } patchOpts := opts.ToPatchOptions() data, err := json.Marshal(scale) if err != nil { return nil, err } result = &autoscalingv1.Scale{} err = c.GetClient().Patch(types.ApplyPatchType). Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). VersionedParams(&patchOpts, scheme.ParameterCodec). Body(data). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/000077500000000000000000000000001472614177300241025ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/apps_client.go000066400000000000000000000064501472614177300267370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/apps/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AppsV1beta1Interface interface { RESTClient() rest.Interface ControllerRevisionsGetter DeploymentsGetter StatefulSetsGetter } // AppsV1beta1Client is used to interact with features provided by the apps group. type AppsV1beta1Client struct { restClient rest.Interface } func (c *AppsV1beta1Client) ControllerRevisions(namespace string) ControllerRevisionInterface { return newControllerRevisions(c, namespace) } func (c *AppsV1beta1Client) Deployments(namespace string) DeploymentInterface { return newDeployments(c, namespace) } func (c *AppsV1beta1Client) StatefulSets(namespace string) StatefulSetInterface { return newStatefulSets(c, namespace) } // NewForConfig creates a new AppsV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AppsV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AppsV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AppsV1beta1Client{client}, nil } // NewForConfigOrDie creates a new AppsV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AppsV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AppsV1beta1Client for the given RESTClient. func New(c rest.Interface) *AppsV1beta1Client { return &AppsV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AppsV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/controllerrevision.go000066400000000000000000000062401472614177300303750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. // A group's client should implement this interface. type ControllerRevisionsGetter interface { ControllerRevisions(namespace string) ControllerRevisionInterface } // ControllerRevisionInterface has methods to work with ControllerRevision resources. type ControllerRevisionInterface interface { Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (*v1beta1.ControllerRevision, error) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (*v1beta1.ControllerRevision, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ControllerRevision, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) Apply(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ControllerRevision, err error) ControllerRevisionExpansion } // controllerRevisions implements ControllerRevisionInterface type controllerRevisions struct { *gentype.ClientWithListAndApply[*v1beta1.ControllerRevision, *v1beta1.ControllerRevisionList, *appsv1beta1.ControllerRevisionApplyConfiguration] } // newControllerRevisions returns a ControllerRevisions func newControllerRevisions(c *AppsV1beta1Client, namespace string) *controllerRevisions { return &controllerRevisions{ gentype.NewClientWithListAndApply[*v1beta1.ControllerRevision, *v1beta1.ControllerRevisionList, *appsv1beta1.ControllerRevisionApplyConfiguration]( "controllerrevisions", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.ControllerRevision { return &v1beta1.ControllerRevision{} }, func() *v1beta1.ControllerRevisionList { return &v1beta1.ControllerRevisionList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/deployment.go000066400000000000000000000064361472614177300266220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // DeploymentsGetter has a method to return a DeploymentInterface. // A group's client should implement this interface. type DeploymentsGetter interface { Deployments(namespace string) DeploymentInterface } // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Deployment, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) DeploymentExpansion } // deployments implements DeploymentInterface type deployments struct { *gentype.ClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *appsv1beta1.DeploymentApplyConfiguration] } // newDeployments returns a Deployments func newDeployments(c *AppsV1beta1Client, namespace string) *deployments { return &deployments{ gentype.NewClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *appsv1beta1.DeploymentApplyConfiguration]( "deployments", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.Deployment { return &v1beta1.Deployment{} }, func() *v1beta1.DeploymentList { return &v1beta1.DeploymentList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/doc.go000066400000000000000000000012641472614177300252010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/fake/000077500000000000000000000000001472614177300250105ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/fake/doc.go000066400000000000000000000012531472614177300261050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go000066400000000000000000000026271472614177300306350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAppsV1beta1 struct { *testing.Fake } func (c *FakeAppsV1beta1) ControllerRevisions(namespace string) v1beta1.ControllerRevisionInterface { return &FakeControllerRevisions{c, namespace} } func (c *FakeAppsV1beta1) Deployments(namespace string) v1beta1.DeploymentInterface { return &FakeDeployments{c, namespace} } func (c *FakeAppsV1beta1) StatefulSets(namespace string) v1beta1.StatefulSetInterface { return &FakeStatefulSets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAppsV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go000066400000000000000000000147041472614177300322750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" testing "k8s.io/client-go/testing" ) // FakeControllerRevisions implements ControllerRevisionInterface type FakeControllerRevisions struct { Fake *FakeAppsV1beta1 ns string } var controllerrevisionsResource = v1beta1.SchemeGroupVersion.WithResource("controllerrevisions") var controllerrevisionsKind = v1beta1.SchemeGroupVersion.WithKind("ControllerRevision") // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) { emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { emptyResult := &v1beta1.ControllerRevisionList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.ControllerRevisionList{ListMeta: obj.(*v1beta1.ControllerRevisionList).ListMeta} for _, item := range obj.(*v1beta1.ControllerRevisionList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) } // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) { emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) { emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1beta1.ControllerRevision{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ControllerRevisionList{}) return err } // Patch applies the patch and returns the patched controllerRevision. func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) { emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } // Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ControllerRevision, err error) { if controllerRevision == nil { return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") } data, err := json.Marshal(controllerRevision) if err != nil { return nil, err } name := controllerRevision.Name if name == nil { return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") } emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go000066400000000000000000000166001472614177300305100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" testing "k8s.io/client-go/testing" ) // FakeDeployments implements DeploymentInterface type FakeDeployments struct { Fake *FakeAppsV1beta1 ns string } var deploymentsResource = v1beta1.SchemeGroupVersion.WithResource("deployments") var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment") // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { emptyResult := &v1beta1.DeploymentList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.DeploymentList{ListMeta: obj.(*v1beta1.DeploymentList).ListMeta} for _, item := range obj.(*v1beta1.DeploymentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested deployments. func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) } // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1beta1.Deployment{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{}) return err } // Patch applies the patch and returns the patched deployment. func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // Apply takes the given apply declarative configuration, applies it and returns the applied deployment. func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { if deployment == nil { return nil, fmt.Errorf("deployment provided to Apply must not be nil") } data, err := json.Marshal(deployment) if err != nil { return nil, err } name := deployment.Name if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { if deployment == nil { return nil, fmt.Errorf("deployment provided to Apply must not be nil") } data, err := json.Marshal(deployment) if err != nil { return nil, err } name := deployment.Name if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go000066400000000000000000000167341472614177300307030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" testing "k8s.io/client-go/testing" ) // FakeStatefulSets implements StatefulSetInterface type FakeStatefulSets struct { Fake *FakeAppsV1beta1 ns string } var statefulsetsResource = v1beta1.SchemeGroupVersion.WithResource("statefulsets") var statefulsetsKind = v1beta1.SchemeGroupVersion.WithKind("StatefulSet") // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { emptyResult := &v1beta1.StatefulSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.StatefulSetList{ListMeta: obj.(*v1beta1.StatefulSetList).ListMeta} for _, item := range obj.(*v1beta1.StatefulSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested statefulSets. func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) } // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1beta1.StatefulSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.StatefulSetList{}) return err } // Patch applies the patch and returns the patched statefulSet. func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) { if statefulSet == nil { return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") } data, err := json.Marshal(statefulSet) if err != nil { return nil, err } name := statefulSet.Name if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) { if statefulSet == nil { return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") } data, err := json.Marshal(statefulSet) if err != nil { return nil, err } name := statefulSet.Name if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/generated_expansion.go000066400000000000000000000013601472614177300304530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type ControllerRevisionExpansion interface{} type DeploymentExpansion interface{} type StatefulSetExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta1/statefulset.go000066400000000000000000000065141472614177300270020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. // A group's client should implement this interface. type StatefulSetsGetter interface { StatefulSets(namespace string) StatefulSetInterface } // StatefulSetInterface has methods to work with StatefulSet resources. type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (*v1beta1.StatefulSet, error) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.StatefulSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) StatefulSetExpansion } // statefulSets implements StatefulSetInterface type statefulSets struct { *gentype.ClientWithListAndApply[*v1beta1.StatefulSet, *v1beta1.StatefulSetList, *appsv1beta1.StatefulSetApplyConfiguration] } // newStatefulSets returns a StatefulSets func newStatefulSets(c *AppsV1beta1Client, namespace string) *statefulSets { return &statefulSets{ gentype.NewClientWithListAndApply[*v1beta1.StatefulSet, *v1beta1.StatefulSetList, *appsv1beta1.StatefulSetApplyConfiguration]( "statefulsets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.StatefulSet { return &v1beta1.StatefulSet{} }, func() *v1beta1.StatefulSetList { return &v1beta1.StatefulSetList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/000077500000000000000000000000001472614177300241035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/apps_client.go000066400000000000000000000070721472614177300267410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "net/http" v1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AppsV1beta2Interface interface { RESTClient() rest.Interface ControllerRevisionsGetter DaemonSetsGetter DeploymentsGetter ReplicaSetsGetter StatefulSetsGetter } // AppsV1beta2Client is used to interact with features provided by the apps group. type AppsV1beta2Client struct { restClient rest.Interface } func (c *AppsV1beta2Client) ControllerRevisions(namespace string) ControllerRevisionInterface { return newControllerRevisions(c, namespace) } func (c *AppsV1beta2Client) DaemonSets(namespace string) DaemonSetInterface { return newDaemonSets(c, namespace) } func (c *AppsV1beta2Client) Deployments(namespace string) DeploymentInterface { return newDeployments(c, namespace) } func (c *AppsV1beta2Client) ReplicaSets(namespace string) ReplicaSetInterface { return newReplicaSets(c, namespace) } func (c *AppsV1beta2Client) StatefulSets(namespace string) StatefulSetInterface { return newStatefulSets(c, namespace) } // NewForConfig creates a new AppsV1beta2Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AppsV1beta2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AppsV1beta2Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1beta2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AppsV1beta2Client{client}, nil } // NewForConfigOrDie creates a new AppsV1beta2Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AppsV1beta2Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AppsV1beta2Client for the given RESTClient. func New(c rest.Interface) *AppsV1beta2Client { return &AppsV1beta2Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AppsV1beta2Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/controllerrevision.go000066400000000000000000000062401472614177300303760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "context" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. // A group's client should implement this interface. type ControllerRevisionsGetter interface { ControllerRevisions(namespace string) ControllerRevisionInterface } // ControllerRevisionInterface has methods to work with ControllerRevision resources. type ControllerRevisionInterface interface { Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (*v1beta2.ControllerRevision, error) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (*v1beta2.ControllerRevision, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ControllerRevision, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) Apply(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ControllerRevision, err error) ControllerRevisionExpansion } // controllerRevisions implements ControllerRevisionInterface type controllerRevisions struct { *gentype.ClientWithListAndApply[*v1beta2.ControllerRevision, *v1beta2.ControllerRevisionList, *appsv1beta2.ControllerRevisionApplyConfiguration] } // newControllerRevisions returns a ControllerRevisions func newControllerRevisions(c *AppsV1beta2Client, namespace string) *controllerRevisions { return &controllerRevisions{ gentype.NewClientWithListAndApply[*v1beta2.ControllerRevision, *v1beta2.ControllerRevisionList, *appsv1beta2.ControllerRevisionApplyConfiguration]( "controllerrevisions", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta2.ControllerRevision { return &v1beta2.ControllerRevision{} }, func() *v1beta2.ControllerRevisionList { return &v1beta2.ControllerRevisionList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/daemonset.go000066400000000000000000000063601472614177300264160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "context" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. // A group's client should implement this interface. type DaemonSetsGetter interface { DaemonSets(namespace string) DaemonSetInterface } // DaemonSetInterface has methods to work with DaemonSet resources. type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (*v1beta2.DaemonSet, error) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.DaemonSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DaemonSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) Apply(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) DaemonSetExpansion } // daemonSets implements DaemonSetInterface type daemonSets struct { *gentype.ClientWithListAndApply[*v1beta2.DaemonSet, *v1beta2.DaemonSetList, *appsv1beta2.DaemonSetApplyConfiguration] } // newDaemonSets returns a DaemonSets func newDaemonSets(c *AppsV1beta2Client, namespace string) *daemonSets { return &daemonSets{ gentype.NewClientWithListAndApply[*v1beta2.DaemonSet, *v1beta2.DaemonSetList, *appsv1beta2.DaemonSetApplyConfiguration]( "daemonsets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta2.DaemonSet { return &v1beta2.DaemonSet{} }, func() *v1beta2.DaemonSetList { return &v1beta2.DaemonSetList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/deployment.go000066400000000000000000000064361472614177300266230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "context" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // DeploymentsGetter has a method to return a DeploymentInterface. // A group's client should implement this interface. type DeploymentsGetter interface { Deployments(namespace string) DeploymentInterface } // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (*v1beta2.Deployment, error) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.Deployment, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) DeploymentExpansion } // deployments implements DeploymentInterface type deployments struct { *gentype.ClientWithListAndApply[*v1beta2.Deployment, *v1beta2.DeploymentList, *appsv1beta2.DeploymentApplyConfiguration] } // newDeployments returns a Deployments func newDeployments(c *AppsV1beta2Client, namespace string) *deployments { return &deployments{ gentype.NewClientWithListAndApply[*v1beta2.Deployment, *v1beta2.DeploymentList, *appsv1beta2.DeploymentApplyConfiguration]( "deployments", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta2.Deployment { return &v1beta2.Deployment{} }, func() *v1beta2.DeploymentList { return &v1beta2.DeploymentList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/doc.go000066400000000000000000000012641472614177300252020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta2 kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/fake/000077500000000000000000000000001472614177300250115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/fake/doc.go000066400000000000000000000012531472614177300261060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go000066400000000000000000000032241472614177300306300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAppsV1beta2 struct { *testing.Fake } func (c *FakeAppsV1beta2) ControllerRevisions(namespace string) v1beta2.ControllerRevisionInterface { return &FakeControllerRevisions{c, namespace} } func (c *FakeAppsV1beta2) DaemonSets(namespace string) v1beta2.DaemonSetInterface { return &FakeDaemonSets{c, namespace} } func (c *FakeAppsV1beta2) Deployments(namespace string) v1beta2.DeploymentInterface { return &FakeDeployments{c, namespace} } func (c *FakeAppsV1beta2) ReplicaSets(namespace string) v1beta2.ReplicaSetInterface { return &FakeReplicaSets{c, namespace} } func (c *FakeAppsV1beta2) StatefulSets(namespace string) v1beta2.StatefulSetInterface { return &FakeStatefulSets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAppsV1beta2) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go000066400000000000000000000147041472614177300322760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" testing "k8s.io/client-go/testing" ) // FakeControllerRevisions implements ControllerRevisionInterface type FakeControllerRevisions struct { Fake *FakeAppsV1beta2 ns string } var controllerrevisionsResource = v1beta2.SchemeGroupVersion.WithResource("controllerrevisions") var controllerrevisionsKind = v1beta2.SchemeGroupVersion.WithKind("ControllerRevision") // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) { emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { emptyResult := &v1beta2.ControllerRevisionList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta2.ControllerRevisionList{ListMeta: obj.(*v1beta2.ControllerRevisionList).ListMeta} for _, item := range obj.(*v1beta2.ControllerRevisionList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) } // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) { emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) { emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1beta2.ControllerRevision{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.ControllerRevisionList{}) return err } // Patch applies the patch and returns the patched controllerRevision. func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) { emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } // Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ControllerRevision, err error) { if controllerRevision == nil { return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") } data, err := json.Marshal(controllerRevision) if err != nil { return nil, err } name := controllerRevision.Name if name == nil { return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") } emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go000066400000000000000000000164441472614177300303160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" testing "k8s.io/client-go/testing" ) // FakeDaemonSets implements DaemonSetInterface type FakeDaemonSets struct { Fake *FakeAppsV1beta2 ns string } var daemonsetsResource = v1beta2.SchemeGroupVersion.WithResource("daemonsets") var daemonsetsKind = v1beta2.SchemeGroupVersion.WithKind("DaemonSet") // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { emptyResult := &v1beta2.DaemonSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta2.DaemonSetList{ListMeta: obj.(*v1beta2.DaemonSetList).ListMeta} for _, item := range obj.(*v1beta2.DaemonSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested daemonSets. func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts)) } // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1beta2.DaemonSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.DaemonSetList{}) return err } // Patch applies the patch and returns the patched daemonSet. func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet. func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) { if daemonSet == nil { return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") } data, err := json.Marshal(daemonSet) if err != nil { return nil, err } name := daemonSet.Name if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) { if daemonSet == nil { return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") } data, err := json.Marshal(daemonSet) if err != nil { return nil, err } name := daemonSet.Name if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go000066400000000000000000000166001472614177300305110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" testing "k8s.io/client-go/testing" ) // FakeDeployments implements DeploymentInterface type FakeDeployments struct { Fake *FakeAppsV1beta2 ns string } var deploymentsResource = v1beta2.SchemeGroupVersion.WithResource("deployments") var deploymentsKind = v1beta2.SchemeGroupVersion.WithKind("Deployment") // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Deployment), err } // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { emptyResult := &v1beta2.DeploymentList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta2.DeploymentList{ListMeta: obj.(*v1beta2.DeploymentList).ListMeta} for _, item := range obj.(*v1beta2.DeploymentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested deployments. func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) } // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Deployment), err } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Deployment), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Deployment), err } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1beta2.Deployment{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.DeploymentList{}) return err } // Patch applies the patch and returns the patched deployment. func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Deployment), err } // Apply takes the given apply declarative configuration, applies it and returns the applied deployment. func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) { if deployment == nil { return nil, fmt.Errorf("deployment provided to Apply must not be nil") } data, err := json.Marshal(deployment) if err != nil { return nil, err } name := deployment.Name if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Deployment), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) { if deployment == nil { return nil, fmt.Errorf("deployment provided to Apply must not be nil") } data, err := json.Marshal(deployment) if err != nil { return nil, err } name := deployment.Name if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Deployment), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go000066400000000000000000000166001472614177300304640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" testing "k8s.io/client-go/testing" ) // FakeReplicaSets implements ReplicaSetInterface type FakeReplicaSets struct { Fake *FakeAppsV1beta2 ns string } var replicasetsResource = v1beta2.SchemeGroupVersion.WithResource("replicasets") var replicasetsKind = v1beta2.SchemeGroupVersion.WithKind("ReplicaSet") // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { emptyResult := &v1beta2.ReplicaSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta2.ReplicaSetList{ListMeta: obj.(*v1beta2.ReplicaSetList).ListMeta} for _, item := range obj.(*v1beta2.ReplicaSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested replicaSets. func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) } // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(replicasetsResource, c.ns, name, opts), &v1beta2.ReplicaSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.ReplicaSetList{}) return err } // Patch applies the patch and returns the patched replicaSet. func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet. func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) { if replicaSet == nil { return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") } data, err := json.Marshal(replicaSet) if err != nil { return nil, err } name := replicaSet.Name if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) { if replicaSet == nil { return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") } data, err := json.Marshal(replicaSet) if err != nil { return nil, err } name := replicaSet.Name if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go000066400000000000000000000225511472614177300306760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" testing "k8s.io/client-go/testing" ) // FakeStatefulSets implements StatefulSetInterface type FakeStatefulSets struct { Fake *FakeAppsV1beta2 ns string } var statefulsetsResource = v1beta2.SchemeGroupVersion.WithResource("statefulsets") var statefulsetsKind = v1beta2.SchemeGroupVersion.WithKind("StatefulSet") // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { emptyResult := &v1beta2.StatefulSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta2.StatefulSetList{ListMeta: obj.(*v1beta2.StatefulSetList).ListMeta} for _, item := range obj.(*v1beta2.StatefulSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested statefulSets. func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) } // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1beta2.StatefulSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.StatefulSetList{}) return err } // Patch applies the patch and returns the patched statefulSet. func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) { if statefulSet == nil { return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") } data, err := json.Marshal(statefulSet) if err != nil { return nil, err } name := statefulSet.Name if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) { if statefulSet == nil { return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") } data, err := json.Marshal(statefulSet) if err != nil { return nil, err } name := statefulSet.Name if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { emptyResult := &v1beta2.Scale{} obj, err := c.Fake. Invokes(testing.NewGetSubresourceActionWithOptions(statefulsetsResource, c.ns, "scale", statefulSetName, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) { emptyResult := &v1beta2.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "scale", c.ns, scale, opts), &v1beta2.Scale{}) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Scale), err } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } data, err := json.Marshal(scale) if err != nil { return nil, err } emptyResult := &v1beta2.Scale{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.Scale), err } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/generated_expansion.go000066400000000000000000000014731472614177300304610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 type ControllerRevisionExpansion interface{} type DaemonSetExpansion interface{} type DeploymentExpansion interface{} type ReplicaSetExpansion interface{} type StatefulSetExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/replicaset.go000066400000000000000000000064361472614177300265760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "context" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. // A group's client should implement this interface. type ReplicaSetsGetter interface { ReplicaSets(namespace string) ReplicaSetInterface } // ReplicaSetInterface has methods to work with ReplicaSet resources. type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (*v1beta2.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ReplicaSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) ReplicaSetExpansion } // replicaSets implements ReplicaSetInterface type replicaSets struct { *gentype.ClientWithListAndApply[*v1beta2.ReplicaSet, *v1beta2.ReplicaSetList, *appsv1beta2.ReplicaSetApplyConfiguration] } // newReplicaSets returns a ReplicaSets func newReplicaSets(c *AppsV1beta2Client, namespace string) *replicaSets { return &replicaSets{ gentype.NewClientWithListAndApply[*v1beta2.ReplicaSet, *v1beta2.ReplicaSetList, *appsv1beta2.ReplicaSetApplyConfiguration]( "replicasets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta2.ReplicaSet { return &v1beta2.ReplicaSet{} }, func() *v1beta2.ReplicaSetList { return &v1beta2.ReplicaSetList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/apps/v1beta2/statefulset.go000066400000000000000000000132051472614177300267760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "context" json "encoding/json" "fmt" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. // A group's client should implement this interface. type StatefulSetsGetter interface { StatefulSets(namespace string) StatefulSetInterface } // StatefulSetInterface has methods to work with StatefulSet resources. type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (*v1beta2.StatefulSet, error) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.StatefulSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (*v1beta2.Scale, error) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (*v1beta2.Scale, error) ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (*v1beta2.Scale, error) StatefulSetExpansion } // statefulSets implements StatefulSetInterface type statefulSets struct { *gentype.ClientWithListAndApply[*v1beta2.StatefulSet, *v1beta2.StatefulSetList, *appsv1beta2.StatefulSetApplyConfiguration] } // newStatefulSets returns a StatefulSets func newStatefulSets(c *AppsV1beta2Client, namespace string) *statefulSets { return &statefulSets{ gentype.NewClientWithListAndApply[*v1beta2.StatefulSet, *v1beta2.StatefulSetList, *appsv1beta2.StatefulSetApplyConfiguration]( "statefulsets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta2.StatefulSet { return &v1beta2.StatefulSet{} }, func() *v1beta2.StatefulSetList { return &v1beta2.StatefulSetList{} }), } } // GetScale takes name of the statefulSet, and returns the corresponding v1beta2.Scale object, and an error if there is any. func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { result = &v1beta2.Scale{} err = c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) { result = &v1beta2.Scale{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). VersionedParams(&opts, scheme.ParameterCodec). Body(scale). Do(ctx). Into(result) return } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *statefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } patchOpts := opts.ToPatchOptions() data, err := json.Marshal(scale) if err != nil { return nil, err } result = &v1beta2.Scale{} err = c.GetClient().Patch(types.ApplyPatchType). Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). VersionedParams(&patchOpts, scheme.ParameterCodec). Body(data). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/000077500000000000000000000000001472614177300247135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/OWNERS000066400000000000000000000002521472614177300256520ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-auth-authenticators-approvers reviewers: - sig-auth-authenticators-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/000077500000000000000000000000001472614177300252415ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/authentication_client.go000066400000000000000000000062721472614177300321540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/authentication/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AuthenticationV1Interface interface { RESTClient() rest.Interface SelfSubjectReviewsGetter TokenReviewsGetter } // AuthenticationV1Client is used to interact with features provided by the authentication.k8s.io group. type AuthenticationV1Client struct { restClient rest.Interface } func (c *AuthenticationV1Client) SelfSubjectReviews() SelfSubjectReviewInterface { return newSelfSubjectReviews(c) } func (c *AuthenticationV1Client) TokenReviews() TokenReviewInterface { return newTokenReviews(c) } // NewForConfig creates a new AuthenticationV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthenticationV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AuthenticationV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthenticationV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AuthenticationV1Client{client}, nil } // NewForConfigOrDie creates a new AuthenticationV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AuthenticationV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AuthenticationV1Client for the given RESTClient. func New(c rest.Interface) *AuthenticationV1Client { return &AuthenticationV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AuthenticationV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/doc.go000066400000000000000000000012571472614177300263420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/fake/000077500000000000000000000000001472614177300261475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/fake/doc.go000066400000000000000000000012531472614177300272440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go000066400000000000000000000023501472614177300340410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/authentication/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAuthenticationV1 struct { *testing.Fake } func (c *FakeAuthenticationV1) SelfSubjectReviews() v1.SelfSubjectReviewInterface { return &FakeSelfSubjectReviews{c} } func (c *FakeAuthenticationV1) TokenReviews() v1.TokenReviewInterface { return &FakeTokenReviews{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAuthenticationV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go000066400000000000000000000032211472614177300332150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSelfSubjectReviews implements SelfSubjectReviewInterface type FakeSelfSubjectReviews struct { Fake *FakeAuthenticationV1 } var selfsubjectreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectreviews") var selfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectReview") // Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) { emptyResult := &v1.SelfSubjectReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.SelfSubjectReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go000066400000000000000000000030531472614177300320270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeTokenReviews implements TokenReviewInterface type FakeTokenReviews struct { Fake *FakeAuthenticationV1 } var tokenreviewsResource = v1.SchemeGroupVersion.WithResource("tokenreviews") var tokenreviewsKind = v1.SchemeGroupVersion.WithKind("TokenReview") // Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) { emptyResult := &v1.TokenReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(tokenreviewsResource, tokenReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.TokenReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/generated_expansion.go000066400000000000000000000013041472614177300316100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type SelfSubjectReviewExpansion interface{} type TokenReviewExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/selfsubjectreview.go000066400000000000000000000034311472614177300313240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SelfSubjectReviewsGetter has a method to return a SelfSubjectReviewInterface. // A group's client should implement this interface. type SelfSubjectReviewsGetter interface { SelfSubjectReviews() SelfSubjectReviewInterface } // SelfSubjectReviewInterface has methods to work with SelfSubjectReview resources. type SelfSubjectReviewInterface interface { Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (*v1.SelfSubjectReview, error) SelfSubjectReviewExpansion } // selfSubjectReviews implements SelfSubjectReviewInterface type selfSubjectReviews struct { *gentype.Client[*v1.SelfSubjectReview] } // newSelfSubjectReviews returns a SelfSubjectReviews func newSelfSubjectReviews(c *AuthenticationV1Client) *selfSubjectReviews { return &selfSubjectReviews{ gentype.NewClient[*v1.SelfSubjectReview]( "selfsubjectreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.SelfSubjectReview { return &v1.SelfSubjectReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1/tokenreview.go000066400000000000000000000032031472614177300301300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // TokenReviewsGetter has a method to return a TokenReviewInterface. // A group's client should implement this interface. type TokenReviewsGetter interface { TokenReviews() TokenReviewInterface } // TokenReviewInterface has methods to work with TokenReview resources. type TokenReviewInterface interface { Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (*v1.TokenReview, error) TokenReviewExpansion } // tokenReviews implements TokenReviewInterface type tokenReviews struct { *gentype.Client[*v1.TokenReview] } // newTokenReviews returns a TokenReviews func newTokenReviews(c *AuthenticationV1Client) *tokenReviews { return &tokenReviews{ gentype.NewClient[*v1.TokenReview]( "tokenreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.TokenReview { return &v1.TokenReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/000077500000000000000000000000001472614177300263305ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/authentication_client.go000066400000000000000000000062631472614177300332430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/authentication/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AuthenticationV1alpha1Interface interface { RESTClient() rest.Interface SelfSubjectReviewsGetter } // AuthenticationV1alpha1Client is used to interact with features provided by the authentication.k8s.io group. type AuthenticationV1alpha1Client struct { restClient rest.Interface } func (c *AuthenticationV1alpha1Client) SelfSubjectReviews() SelfSubjectReviewInterface { return newSelfSubjectReviews(c) } // NewForConfig creates a new AuthenticationV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthenticationV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AuthenticationV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthenticationV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AuthenticationV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new AuthenticationV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AuthenticationV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AuthenticationV1alpha1Client for the given RESTClient. func New(c rest.Interface) *AuthenticationV1alpha1Client { return &AuthenticationV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AuthenticationV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/doc.go000066400000000000000000000012651472614177300274300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/fake/000077500000000000000000000000001472614177300272365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300303330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake fake_authentication_client.go000066400000000000000000000022441472614177300350530ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAuthenticationV1alpha1 struct { *testing.Fake } func (c *FakeAuthenticationV1alpha1) SelfSubjectReviews() v1alpha1.SelfSubjectReviewInterface { return &FakeSelfSubjectReviews{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAuthenticationV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go000066400000000000000000000032771472614177300343170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1alpha1 "k8s.io/api/authentication/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSelfSubjectReviews implements SelfSubjectReviewInterface type FakeSelfSubjectReviews struct { Fake *FakeAuthenticationV1alpha1 } var selfsubjectreviewsResource = v1alpha1.SchemeGroupVersion.WithResource("selfsubjectreviews") var selfsubjectreviewsKind = v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectReview") // Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1alpha1.SelfSubjectReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectReview, err error) { emptyResult := &v1alpha1.SelfSubjectReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.SelfSubjectReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/generated_expansion.go000066400000000000000000000012431472614177300327010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type SelfSubjectReviewExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1alpha1/selfsubjectreview.go000066400000000000000000000035151472614177300324160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/authentication/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SelfSubjectReviewsGetter has a method to return a SelfSubjectReviewInterface. // A group's client should implement this interface. type SelfSubjectReviewsGetter interface { SelfSubjectReviews() SelfSubjectReviewInterface } // SelfSubjectReviewInterface has methods to work with SelfSubjectReview resources. type SelfSubjectReviewInterface interface { Create(ctx context.Context, selfSubjectReview *v1alpha1.SelfSubjectReview, opts v1.CreateOptions) (*v1alpha1.SelfSubjectReview, error) SelfSubjectReviewExpansion } // selfSubjectReviews implements SelfSubjectReviewInterface type selfSubjectReviews struct { *gentype.Client[*v1alpha1.SelfSubjectReview] } // newSelfSubjectReviews returns a SelfSubjectReviews func newSelfSubjectReviews(c *AuthenticationV1alpha1Client) *selfSubjectReviews { return &selfSubjectReviews{ gentype.NewClient[*v1alpha1.SelfSubjectReview]( "selfsubjectreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.SelfSubjectReview { return &v1alpha1.SelfSubjectReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/000077500000000000000000000000001472614177300261565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/authentication_client.go000066400000000000000000000064361472614177300330730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/authentication/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AuthenticationV1beta1Interface interface { RESTClient() rest.Interface SelfSubjectReviewsGetter TokenReviewsGetter } // AuthenticationV1beta1Client is used to interact with features provided by the authentication.k8s.io group. type AuthenticationV1beta1Client struct { restClient rest.Interface } func (c *AuthenticationV1beta1Client) SelfSubjectReviews() SelfSubjectReviewInterface { return newSelfSubjectReviews(c) } func (c *AuthenticationV1beta1Client) TokenReviews() TokenReviewInterface { return newTokenReviews(c) } // NewForConfig creates a new AuthenticationV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthenticationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AuthenticationV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthenticationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AuthenticationV1beta1Client{client}, nil } // NewForConfigOrDie creates a new AuthenticationV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AuthenticationV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AuthenticationV1beta1Client for the given RESTClient. func New(c rest.Interface) *AuthenticationV1beta1Client { return &AuthenticationV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AuthenticationV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/doc.go000066400000000000000000000012641472614177300272550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/fake/000077500000000000000000000000001472614177300270645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/fake/doc.go000066400000000000000000000012531472614177300301610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake fake_authentication_client.go000066400000000000000000000024201472614177300346750ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAuthenticationV1beta1 struct { *testing.Fake } func (c *FakeAuthenticationV1beta1) SelfSubjectReviews() v1beta1.SelfSubjectReviewInterface { return &FakeSelfSubjectReviews{c} } func (c *FakeAuthenticationV1beta1) TokenReviews() v1beta1.TokenReviewInterface { return &FakeTokenReviews{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAuthenticationV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go000066400000000000000000000032661472614177300341430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1beta1 "k8s.io/api/authentication/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSelfSubjectReviews implements SelfSubjectReviewInterface type FakeSelfSubjectReviews struct { Fake *FakeAuthenticationV1beta1 } var selfsubjectreviewsResource = v1beta1.SchemeGroupVersion.WithResource("selfsubjectreviews") var selfsubjectreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectReview") // Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1beta1.SelfSubjectReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectReview, err error) { emptyResult := &v1beta1.SelfSubjectReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.SelfSubjectReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go000066400000000000000000000031201472614177300327370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1beta1 "k8s.io/api/authentication/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeTokenReviews implements TokenReviewInterface type FakeTokenReviews struct { Fake *FakeAuthenticationV1beta1 } var tokenreviewsResource = v1beta1.SchemeGroupVersion.WithResource("tokenreviews") var tokenreviewsKind = v1beta1.SchemeGroupVersion.WithKind("TokenReview") // Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) { emptyResult := &v1beta1.TokenReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(tokenreviewsResource, tokenReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.TokenReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/generated_expansion.go000066400000000000000000000013111472614177300325230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type SelfSubjectReviewExpansion interface{} type TokenReviewExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/selfsubjectreview.go000066400000000000000000000035031472614177300322410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/authentication/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SelfSubjectReviewsGetter has a method to return a SelfSubjectReviewInterface. // A group's client should implement this interface. type SelfSubjectReviewsGetter interface { SelfSubjectReviews() SelfSubjectReviewInterface } // SelfSubjectReviewInterface has methods to work with SelfSubjectReview resources. type SelfSubjectReviewInterface interface { Create(ctx context.Context, selfSubjectReview *v1beta1.SelfSubjectReview, opts v1.CreateOptions) (*v1beta1.SelfSubjectReview, error) SelfSubjectReviewExpansion } // selfSubjectReviews implements SelfSubjectReviewInterface type selfSubjectReviews struct { *gentype.Client[*v1beta1.SelfSubjectReview] } // newSelfSubjectReviews returns a SelfSubjectReviews func newSelfSubjectReviews(c *AuthenticationV1beta1Client) *selfSubjectReviews { return &selfSubjectReviews{ gentype.NewClient[*v1beta1.SelfSubjectReview]( "selfsubjectreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.SelfSubjectReview { return &v1beta1.SelfSubjectReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authentication/v1beta1/tokenreview.go000066400000000000000000000032551472614177300310540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/authentication/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // TokenReviewsGetter has a method to return a TokenReviewInterface. // A group's client should implement this interface. type TokenReviewsGetter interface { TokenReviews() TokenReviewInterface } // TokenReviewInterface has methods to work with TokenReview resources. type TokenReviewInterface interface { Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (*v1beta1.TokenReview, error) TokenReviewExpansion } // tokenReviews implements TokenReviewInterface type tokenReviews struct { *gentype.Client[*v1beta1.TokenReview] } // newTokenReviews returns a TokenReviews func newTokenReviews(c *AuthenticationV1beta1Client) *tokenReviews { return &tokenReviews{ gentype.NewClient[*v1beta1.TokenReview]( "tokenreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.TokenReview { return &v1beta1.TokenReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/000077500000000000000000000000001472614177300245745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/OWNERS000066400000000000000000000002441472614177300255340ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-auth-authorizers-approvers reviewers: - sig-auth-authorizers-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/000077500000000000000000000000001472614177300251225ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/authorization_client.go000066400000000000000000000071131472614177300317110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/authorization/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AuthorizationV1Interface interface { RESTClient() rest.Interface LocalSubjectAccessReviewsGetter SelfSubjectAccessReviewsGetter SelfSubjectRulesReviewsGetter SubjectAccessReviewsGetter } // AuthorizationV1Client is used to interact with features provided by the authorization.k8s.io group. type AuthorizationV1Client struct { restClient rest.Interface } func (c *AuthorizationV1Client) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface { return newLocalSubjectAccessReviews(c, namespace) } func (c *AuthorizationV1Client) SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface { return newSelfSubjectAccessReviews(c) } func (c *AuthorizationV1Client) SelfSubjectRulesReviews() SelfSubjectRulesReviewInterface { return newSelfSubjectRulesReviews(c) } func (c *AuthorizationV1Client) SubjectAccessReviews() SubjectAccessReviewInterface { return newSubjectAccessReviews(c) } // NewForConfig creates a new AuthorizationV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthorizationV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AuthorizationV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthorizationV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AuthorizationV1Client{client}, nil } // NewForConfigOrDie creates a new AuthorizationV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AuthorizationV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AuthorizationV1Client for the given RESTClient. func New(c rest.Interface) *AuthorizationV1Client { return &AuthorizationV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AuthorizationV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/doc.go000066400000000000000000000012571472614177300262230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/fake/000077500000000000000000000000001472614177300260305ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/fake/doc.go000066400000000000000000000012531472614177300271250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go000066400000000000000000000030761472614177300336110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/authorization/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAuthorizationV1 struct { *testing.Fake } func (c *FakeAuthorizationV1) LocalSubjectAccessReviews(namespace string) v1.LocalSubjectAccessReviewInterface { return &FakeLocalSubjectAccessReviews{c, namespace} } func (c *FakeAuthorizationV1) SelfSubjectAccessReviews() v1.SelfSubjectAccessReviewInterface { return &FakeSelfSubjectAccessReviews{c} } func (c *FakeAuthorizationV1) SelfSubjectRulesReviews() v1.SelfSubjectRulesReviewInterface { return &FakeSelfSubjectRulesReviews{c} } func (c *FakeAuthorizationV1) SubjectAccessReviews() v1.SubjectAccessReviewInterface { return &FakeSubjectAccessReviews{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAuthorizationV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go000066400000000000000000000034261472614177300344300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface type FakeLocalSubjectAccessReviews struct { Fake *FakeAuthorizationV1 ns string } var localsubjectaccessreviewsResource = v1.SchemeGroupVersion.WithResource("localsubjectaccessreviews") var localsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("LocalSubjectAccessReview") // Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (result *v1.LocalSubjectAccessReview, err error) { emptyResult := &v1.LocalSubjectAccessReview{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.LocalSubjectAccessReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go000066400000000000000000000033651472614177300342710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type FakeSelfSubjectAccessReviews struct { Fake *FakeAuthorizationV1 } var selfsubjectaccessreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectaccessreviews") var selfsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectAccessReview") // Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { emptyResult := &v1.SelfSubjectAccessReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(selfsubjectaccessreviewsResource, selfSubjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.SelfSubjectAccessReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go000066400000000000000000000033441472614177300341570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface type FakeSelfSubjectRulesReviews struct { Fake *FakeAuthorizationV1 } var selfsubjectrulesreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectrulesreviews") var selfsubjectrulesreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectRulesReview") // Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (result *v1.SelfSubjectRulesReview, err error) { emptyResult := &v1.SelfSubjectRulesReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(selfsubjectrulesreviewsResource, selfSubjectRulesReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.SelfSubjectRulesReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go000066400000000000000000000032611472614177300334120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSubjectAccessReviews implements SubjectAccessReviewInterface type FakeSubjectAccessReviews struct { Fake *FakeAuthorizationV1 } var subjectaccessreviewsResource = v1.SchemeGroupVersion.WithResource("subjectaccessreviews") var subjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SubjectAccessReview") // Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { emptyResult := &v1.SubjectAccessReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(subjectaccessreviewsResource, subjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.SubjectAccessReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/generated_expansion.go000066400000000000000000000014701472614177300314750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type LocalSubjectAccessReviewExpansion interface{} type SelfSubjectAccessReviewExpansion interface{} type SelfSubjectRulesReviewExpansion interface{} type SubjectAccessReviewExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/localsubjectaccessreview.go000066400000000000000000000037571472614177300325430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // LocalSubjectAccessReviewsGetter has a method to return a LocalSubjectAccessReviewInterface. // A group's client should implement this interface. type LocalSubjectAccessReviewsGetter interface { LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface } // LocalSubjectAccessReviewInterface has methods to work with LocalSubjectAccessReview resources. type LocalSubjectAccessReviewInterface interface { Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (*v1.LocalSubjectAccessReview, error) LocalSubjectAccessReviewExpansion } // localSubjectAccessReviews implements LocalSubjectAccessReviewInterface type localSubjectAccessReviews struct { *gentype.Client[*v1.LocalSubjectAccessReview] } // newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews func newLocalSubjectAccessReviews(c *AuthorizationV1Client, namespace string) *localSubjectAccessReviews { return &localSubjectAccessReviews{ gentype.NewClient[*v1.LocalSubjectAccessReview]( "localsubjectaccessreviews", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.LocalSubjectAccessReview { return &v1.LocalSubjectAccessReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go000066400000000000000000000036551472614177300323770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface. // A group's client should implement this interface. type SelfSubjectAccessReviewsGetter interface { SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface } // SelfSubjectAccessReviewInterface has methods to work with SelfSubjectAccessReview resources. type SelfSubjectAccessReviewInterface interface { Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (*v1.SelfSubjectAccessReview, error) SelfSubjectAccessReviewExpansion } // selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type selfSubjectAccessReviews struct { *gentype.Client[*v1.SelfSubjectAccessReview] } // newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews func newSelfSubjectAccessReviews(c *AuthorizationV1Client) *selfSubjectAccessReviews { return &selfSubjectAccessReviews{ gentype.NewClient[*v1.SelfSubjectAccessReview]( "selfsubjectaccessreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.SelfSubjectAccessReview { return &v1.SelfSubjectAccessReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go000066400000000000000000000036241472614177300322640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SelfSubjectRulesReviewsGetter has a method to return a SelfSubjectRulesReviewInterface. // A group's client should implement this interface. type SelfSubjectRulesReviewsGetter interface { SelfSubjectRulesReviews() SelfSubjectRulesReviewInterface } // SelfSubjectRulesReviewInterface has methods to work with SelfSubjectRulesReview resources. type SelfSubjectRulesReviewInterface interface { Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (*v1.SelfSubjectRulesReview, error) SelfSubjectRulesReviewExpansion } // selfSubjectRulesReviews implements SelfSubjectRulesReviewInterface type selfSubjectRulesReviews struct { *gentype.Client[*v1.SelfSubjectRulesReview] } // newSelfSubjectRulesReviews returns a SelfSubjectRulesReviews func newSelfSubjectRulesReviews(c *AuthorizationV1Client) *selfSubjectRulesReviews { return &selfSubjectRulesReviews{ gentype.NewClient[*v1.SelfSubjectRulesReview]( "selfsubjectrulesreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.SelfSubjectRulesReview { return &v1.SelfSubjectRulesReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1/subjectaccessreview.go000066400000000000000000000035111472614177300315140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface. // A group's client should implement this interface. type SubjectAccessReviewsGetter interface { SubjectAccessReviews() SubjectAccessReviewInterface } // SubjectAccessReviewInterface has methods to work with SubjectAccessReview resources. type SubjectAccessReviewInterface interface { Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (*v1.SubjectAccessReview, error) SubjectAccessReviewExpansion } // subjectAccessReviews implements SubjectAccessReviewInterface type subjectAccessReviews struct { *gentype.Client[*v1.SubjectAccessReview] } // newSubjectAccessReviews returns a SubjectAccessReviews func newSubjectAccessReviews(c *AuthorizationV1Client) *subjectAccessReviews { return &subjectAccessReviews{ gentype.NewClient[*v1.SubjectAccessReview]( "subjectaccessreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.SubjectAccessReview { return &v1.SubjectAccessReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/000077500000000000000000000000001472614177300260375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/authorization_client.go000066400000000000000000000072711472614177300326330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/authorization/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AuthorizationV1beta1Interface interface { RESTClient() rest.Interface LocalSubjectAccessReviewsGetter SelfSubjectAccessReviewsGetter SelfSubjectRulesReviewsGetter SubjectAccessReviewsGetter } // AuthorizationV1beta1Client is used to interact with features provided by the authorization.k8s.io group. type AuthorizationV1beta1Client struct { restClient rest.Interface } func (c *AuthorizationV1beta1Client) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface { return newLocalSubjectAccessReviews(c, namespace) } func (c *AuthorizationV1beta1Client) SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface { return newSelfSubjectAccessReviews(c) } func (c *AuthorizationV1beta1Client) SelfSubjectRulesReviews() SelfSubjectRulesReviewInterface { return newSelfSubjectRulesReviews(c) } func (c *AuthorizationV1beta1Client) SubjectAccessReviews() SubjectAccessReviewInterface { return newSubjectAccessReviews(c) } // NewForConfig creates a new AuthorizationV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthorizationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AuthorizationV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthorizationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AuthorizationV1beta1Client{client}, nil } // NewForConfigOrDie creates a new AuthorizationV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AuthorizationV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AuthorizationV1beta1Client for the given RESTClient. func New(c rest.Interface) *AuthorizationV1beta1Client { return &AuthorizationV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AuthorizationV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/doc.go000066400000000000000000000012641472614177300271360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/fake/000077500000000000000000000000001472614177300267455ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/fake/doc.go000066400000000000000000000012531472614177300300420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake fake_authorization_client.go000066400000000000000000000031721472614177300344440ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAuthorizationV1beta1 struct { *testing.Fake } func (c *FakeAuthorizationV1beta1) LocalSubjectAccessReviews(namespace string) v1beta1.LocalSubjectAccessReviewInterface { return &FakeLocalSubjectAccessReviews{c, namespace} } func (c *FakeAuthorizationV1beta1) SelfSubjectAccessReviews() v1beta1.SelfSubjectAccessReviewInterface { return &FakeSelfSubjectAccessReviews{c} } func (c *FakeAuthorizationV1beta1) SelfSubjectRulesReviews() v1beta1.SelfSubjectRulesReviewInterface { return &FakeSelfSubjectRulesReviews{c} } func (c *FakeAuthorizationV1beta1) SubjectAccessReviews() v1beta1.SubjectAccessReviewInterface { return &FakeSubjectAccessReviews{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAuthorizationV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } fake_localsubjectaccessreview.go000066400000000000000000000034731472614177300352700ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface type FakeLocalSubjectAccessReviews struct { Fake *FakeAuthorizationV1beta1 ns string } var localsubjectaccessreviewsResource = v1beta1.SchemeGroupVersion.WithResource("localsubjectaccessreviews") var localsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("LocalSubjectAccessReview") // Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.LocalSubjectAccessReview, err error) { emptyResult := &v1beta1.LocalSubjectAccessReview{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.LocalSubjectAccessReview), err } fake_selfsubjectaccessreview.go000066400000000000000000000034321472614177300351220ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type FakeSelfSubjectAccessReviews struct { Fake *FakeAuthorizationV1beta1 } var selfsubjectaccessreviewsResource = v1beta1.SchemeGroupVersion.WithResource("selfsubjectaccessreviews") var selfsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectAccessReview") // Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectAccessReview, err error) { emptyResult := &v1beta1.SelfSubjectAccessReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(selfsubjectaccessreviewsResource, selfSubjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.SelfSubjectAccessReview), err } fake_selfsubjectrulesreview.go000066400000000000000000000034111472614177300350100ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface type FakeSelfSubjectRulesReviews struct { Fake *FakeAuthorizationV1beta1 } var selfsubjectrulesreviewsResource = v1beta1.SchemeGroupVersion.WithResource("selfsubjectrulesreviews") var selfsubjectrulesreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectRulesReview") // Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectRulesReview, err error) { emptyResult := &v1beta1.SelfSubjectRulesReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(selfsubjectrulesreviewsResource, selfSubjectRulesReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.SelfSubjectRulesReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go000066400000000000000000000033261472614177300343310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" testing "k8s.io/client-go/testing" ) // FakeSubjectAccessReviews implements SubjectAccessReviewInterface type FakeSubjectAccessReviews struct { Fake *FakeAuthorizationV1beta1 } var subjectaccessreviewsResource = v1beta1.SchemeGroupVersion.WithResource("subjectaccessreviews") var subjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SubjectAccessReview") // Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) { emptyResult := &v1beta1.SubjectAccessReview{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(subjectaccessreviewsResource, subjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.SubjectAccessReview), err } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/generated_expansion.go000066400000000000000000000014751472614177300324170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type LocalSubjectAccessReviewExpansion interface{} type SelfSubjectAccessReviewExpansion interface{} type SelfSubjectRulesReviewExpansion interface{} type SubjectAccessReviewExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go000066400000000000000000000040311472614177300334420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // LocalSubjectAccessReviewsGetter has a method to return a LocalSubjectAccessReviewInterface. // A group's client should implement this interface. type LocalSubjectAccessReviewsGetter interface { LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface } // LocalSubjectAccessReviewInterface has methods to work with LocalSubjectAccessReview resources. type LocalSubjectAccessReviewInterface interface { Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (*v1beta1.LocalSubjectAccessReview, error) LocalSubjectAccessReviewExpansion } // localSubjectAccessReviews implements LocalSubjectAccessReviewInterface type localSubjectAccessReviews struct { *gentype.Client[*v1beta1.LocalSubjectAccessReview] } // newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews func newLocalSubjectAccessReviews(c *AuthorizationV1beta1Client, namespace string) *localSubjectAccessReviews { return &localSubjectAccessReviews{ gentype.NewClient[*v1beta1.LocalSubjectAccessReview]( "localsubjectaccessreviews", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.LocalSubjectAccessReview { return &v1beta1.LocalSubjectAccessReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go000066400000000000000000000037271472614177300333140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface. // A group's client should implement this interface. type SelfSubjectAccessReviewsGetter interface { SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface } // SelfSubjectAccessReviewInterface has methods to work with SelfSubjectAccessReview resources. type SelfSubjectAccessReviewInterface interface { Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (*v1beta1.SelfSubjectAccessReview, error) SelfSubjectAccessReviewExpansion } // selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type selfSubjectAccessReviews struct { *gentype.Client[*v1beta1.SelfSubjectAccessReview] } // newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews func newSelfSubjectAccessReviews(c *AuthorizationV1beta1Client) *selfSubjectAccessReviews { return &selfSubjectAccessReviews{ gentype.NewClient[*v1beta1.SelfSubjectAccessReview]( "selfsubjectaccessreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.SelfSubjectAccessReview { return &v1beta1.SelfSubjectAccessReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go000066400000000000000000000036761472614177300332100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SelfSubjectRulesReviewsGetter has a method to return a SelfSubjectRulesReviewInterface. // A group's client should implement this interface. type SelfSubjectRulesReviewsGetter interface { SelfSubjectRulesReviews() SelfSubjectRulesReviewInterface } // SelfSubjectRulesReviewInterface has methods to work with SelfSubjectRulesReview resources. type SelfSubjectRulesReviewInterface interface { Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (*v1beta1.SelfSubjectRulesReview, error) SelfSubjectRulesReviewExpansion } // selfSubjectRulesReviews implements SelfSubjectRulesReviewInterface type selfSubjectRulesReviews struct { *gentype.Client[*v1beta1.SelfSubjectRulesReview] } // newSelfSubjectRulesReviews returns a SelfSubjectRulesReviews func newSelfSubjectRulesReviews(c *AuthorizationV1beta1Client) *selfSubjectRulesReviews { return &selfSubjectRulesReviews{ gentype.NewClient[*v1beta1.SelfSubjectRulesReview]( "selfsubjectrulesreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.SelfSubjectRulesReview { return &v1beta1.SelfSubjectRulesReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go000066400000000000000000000035631472614177300324400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface. // A group's client should implement this interface. type SubjectAccessReviewsGetter interface { SubjectAccessReviews() SubjectAccessReviewInterface } // SubjectAccessReviewInterface has methods to work with SubjectAccessReview resources. type SubjectAccessReviewInterface interface { Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (*v1beta1.SubjectAccessReview, error) SubjectAccessReviewExpansion } // subjectAccessReviews implements SubjectAccessReviewInterface type subjectAccessReviews struct { *gentype.Client[*v1beta1.SubjectAccessReview] } // newSubjectAccessReviews returns a SubjectAccessReviews func newSubjectAccessReviews(c *AuthorizationV1beta1Client) *subjectAccessReviews { return &subjectAccessReviews{ gentype.NewClient[*v1beta1.SubjectAccessReview]( "subjectaccessreviews", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.SubjectAccessReview { return &v1beta1.SubjectAccessReview{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/000077500000000000000000000000001472614177300242055ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/000077500000000000000000000000001472614177300245335ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/autoscaling_client.go000066400000000000000000000060721472614177300307360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/autoscaling/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AutoscalingV1Interface interface { RESTClient() rest.Interface HorizontalPodAutoscalersGetter } // AutoscalingV1Client is used to interact with features provided by the autoscaling group. type AutoscalingV1Client struct { restClient rest.Interface } func (c *AutoscalingV1Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { return newHorizontalPodAutoscalers(c, namespace) } // NewForConfig creates a new AutoscalingV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AutoscalingV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AutoscalingV1Client{client}, nil } // NewForConfigOrDie creates a new AutoscalingV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AutoscalingV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AutoscalingV1Client for the given RESTClient. func New(c rest.Interface) *AutoscalingV1Client { return &AutoscalingV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AutoscalingV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/doc.go000066400000000000000000000012571472614177300256340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/fake/000077500000000000000000000000001472614177300254415ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/fake/doc.go000066400000000000000000000012531472614177300265360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go000066400000000000000000000022411472614177300326240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAutoscalingV1 struct { *testing.Fake } func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface { return &FakeHorizontalPodAutoscalers{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAutoscalingV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go000066400000000000000000000207021472614177300337360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" testing "k8s.io/client-go/testing" ) // FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type FakeHorizontalPodAutoscalers struct { Fake *FakeAutoscalingV1 ns string } var horizontalpodautoscalersResource = v1.SchemeGroupVersion.WithResource("horizontalpodautoscalers") var horizontalpodautoscalersKind = v1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { emptyResult := &v1.HorizontalPodAutoscalerList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.HorizontalPodAutoscalerList{ListMeta: obj.(*v1.HorizontalPodAutoscalerList).ListMeta} for _, item := range obj.(*v1.HorizontalPodAutoscalerList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) } // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(horizontalpodautoscalersResource, c.ns, name, opts), &v1.HorizontalPodAutoscaler{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.HorizontalPodAutoscalerList{}) return err } // Patch applies the patch and returns the patched horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } // Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) { if horizontalPodAutoscaler == nil { return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") } data, err := json.Marshal(horizontalPodAutoscaler) if err != nil { return nil, err } name := horizontalPodAutoscaler.Name if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) { if horizontalPodAutoscaler == nil { return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") } data, err := json.Marshal(horizontalPodAutoscaler) if err != nil { return nil, err } name := horizontalPodAutoscaler.Name if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/generated_expansion.go000066400000000000000000000012431472614177300311040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type HorizontalPodAutoscalerExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go000066400000000000000000000075171472614177300320530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. // A group's client should implement this interface. type HorizontalPodAutoscalersGetter interface { HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface } // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*v1.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HorizontalPodAutoscaler, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type horizontalPodAutoscalers struct { *gentype.ClientWithListAndApply[*v1.HorizontalPodAutoscaler, *v1.HorizontalPodAutoscalerList, *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration] } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ gentype.NewClientWithListAndApply[*v1.HorizontalPodAutoscaler, *v1.HorizontalPodAutoscalerList, *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration]( "horizontalpodautoscalers", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.HorizontalPodAutoscaler { return &v1.HorizontalPodAutoscaler{} }, func() *v1.HorizontalPodAutoscalerList { return &v1.HorizontalPodAutoscalerList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/000077500000000000000000000000001472614177300245345ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/autoscaling_client.go000066400000000000000000000060721472614177300307370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2 import ( "net/http" v2 "k8s.io/api/autoscaling/v2" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AutoscalingV2Interface interface { RESTClient() rest.Interface HorizontalPodAutoscalersGetter } // AutoscalingV2Client is used to interact with features provided by the autoscaling group. type AutoscalingV2Client struct { restClient rest.Interface } func (c *AutoscalingV2Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { return newHorizontalPodAutoscalers(c, namespace) } // NewForConfig creates a new AutoscalingV2Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AutoscalingV2Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AutoscalingV2Client{client}, nil } // NewForConfigOrDie creates a new AutoscalingV2Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AutoscalingV2Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AutoscalingV2Client for the given RESTClient. func New(c rest.Interface) *AutoscalingV2Client { return &AutoscalingV2Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AutoscalingV2Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/doc.go000066400000000000000000000012571472614177300256350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v2 kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/fake/000077500000000000000000000000001472614177300254425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/fake/doc.go000066400000000000000000000012531472614177300265370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/fake/fake_autoscaling_client.go000066400000000000000000000022411472614177300326250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAutoscalingV2 struct { *testing.Fake } func (c *FakeAutoscalingV2) HorizontalPodAutoscalers(namespace string) v2.HorizontalPodAutoscalerInterface { return &FakeHorizontalPodAutoscalers{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAutoscalingV2) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go000066400000000000000000000206161472614177300337430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v2 "k8s.io/api/autoscaling/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2 "k8s.io/client-go/applyconfigurations/autoscaling/v2" testing "k8s.io/client-go/testing" ) // FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type FakeHorizontalPodAutoscalers struct { Fake *FakeAutoscalingV2 ns string } var horizontalpodautoscalersResource = v2.SchemeGroupVersion.WithResource("horizontalpodautoscalers") var horizontalpodautoscalersKind = v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { emptyResult := &v2.HorizontalPodAutoscalerList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v2.HorizontalPodAutoscalerList{ListMeta: obj.(*v2.HorizontalPodAutoscalerList).ListMeta} for _, item := range obj.(*v2.HorizontalPodAutoscalerList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) } // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(horizontalpodautoscalersResource, c.ns, name, opts), &v2.HorizontalPodAutoscaler{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2.HorizontalPodAutoscalerList{}) return err } // Patch applies the patch and returns the patched horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } // Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) { if horizontalPodAutoscaler == nil { return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") } data, err := json.Marshal(horizontalPodAutoscaler) if err != nil { return nil, err } name := horizontalPodAutoscaler.Name if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) { if horizontalPodAutoscaler == nil { return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") } data, err := json.Marshal(horizontalPodAutoscaler) if err != nil { return nil, err } name := horizontalPodAutoscaler.Name if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/generated_expansion.go000066400000000000000000000012431472614177300311050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2 type HorizontalPodAutoscalerExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go000066400000000000000000000074331472614177300320510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2 import ( "context" v2 "k8s.io/api/autoscaling/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2 "k8s.io/client-go/applyconfigurations/autoscaling/v2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. // A group's client should implement this interface. type HorizontalPodAutoscalersGetter interface { HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface } // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2.HorizontalPodAutoscaler, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2.HorizontalPodAutoscaler, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.HorizontalPodAutoscaler, error) List(ctx context.Context, opts v1.ListOptions) (*v2.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.HorizontalPodAutoscaler, err error) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type horizontalPodAutoscalers struct { *gentype.ClientWithListAndApply[*v2.HorizontalPodAutoscaler, *v2.HorizontalPodAutoscalerList, *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration] } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers func newHorizontalPodAutoscalers(c *AutoscalingV2Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ gentype.NewClientWithListAndApply[*v2.HorizontalPodAutoscaler, *v2.HorizontalPodAutoscalerList, *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration]( "horizontalpodautoscalers", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v2.HorizontalPodAutoscaler { return &v2.HorizontalPodAutoscaler{} }, func() *v2.HorizontalPodAutoscalerList { return &v2.HorizontalPodAutoscalerList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/000077500000000000000000000000001472614177300254515ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go000066400000000000000000000062311472614177300316510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2beta1 import ( "net/http" v2beta1 "k8s.io/api/autoscaling/v2beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AutoscalingV2beta1Interface interface { RESTClient() rest.Interface HorizontalPodAutoscalersGetter } // AutoscalingV2beta1Client is used to interact with features provided by the autoscaling group. type AutoscalingV2beta1Client struct { restClient rest.Interface } func (c *AutoscalingV2beta1Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { return newHorizontalPodAutoscalers(c, namespace) } // NewForConfig creates a new AutoscalingV2beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV2beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AutoscalingV2beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AutoscalingV2beta1Client{client}, nil } // NewForConfigOrDie creates a new AutoscalingV2beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AutoscalingV2beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AutoscalingV2beta1Client for the given RESTClient. func New(c rest.Interface) *AutoscalingV2beta1Client { return &AutoscalingV2beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v2beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AutoscalingV2beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/doc.go000066400000000000000000000012641472614177300265500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v2beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/fake/000077500000000000000000000000001472614177300263575ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/fake/doc.go000066400000000000000000000012531472614177300274540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go000066400000000000000000000022771472614177300335530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAutoscalingV2beta1 struct { *testing.Fake } func (c *FakeAutoscalingV2beta1) HorizontalPodAutoscalers(namespace string) v2beta1.HorizontalPodAutoscalerInterface { return &FakeHorizontalPodAutoscalers{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAutoscalingV2beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } fake_horizontalpodautoscaler.go000066400000000000000000000211261472614177300345760ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v2beta1 "k8s.io/api/autoscaling/v2beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1" testing "k8s.io/client-go/testing" ) // FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type FakeHorizontalPodAutoscalers struct { Fake *FakeAutoscalingV2beta1 ns string } var horizontalpodautoscalersResource = v2beta1.SchemeGroupVersion.WithResource("horizontalpodautoscalers") var horizontalpodautoscalersKind = v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { emptyResult := &v2beta1.HorizontalPodAutoscalerList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v2beta1.HorizontalPodAutoscalerList{ListMeta: obj.(*v2beta1.HorizontalPodAutoscalerList).ListMeta} for _, item := range obj.(*v2beta1.HorizontalPodAutoscalerList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) } // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(horizontalpodautoscalersResource, c.ns, name, opts), &v2beta1.HorizontalPodAutoscaler{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2beta1.HorizontalPodAutoscalerList{}) return err } // Patch applies the patch and returns the patched horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } // Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { if horizontalPodAutoscaler == nil { return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") } data, err := json.Marshal(horizontalPodAutoscaler) if err != nil { return nil, err } name := horizontalPodAutoscaler.Name if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { if horizontalPodAutoscaler == nil { return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") } data, err := json.Marshal(horizontalPodAutoscaler) if err != nil { return nil, err } name := horizontalPodAutoscaler.Name if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go000066400000000000000000000012501472614177300320200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2beta1 type HorizontalPodAutoscalerExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go000066400000000000000000000076541472614177300327730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2beta1 import ( "context" v2beta1 "k8s.io/api/autoscaling/v2beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. // A group's client should implement this interface. type HorizontalPodAutoscalersGetter interface { HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface } // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta1.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta1.HorizontalPodAutoscaler, error) List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type horizontalPodAutoscalers struct { *gentype.ClientWithListAndApply[*v2beta1.HorizontalPodAutoscaler, *v2beta1.HorizontalPodAutoscalerList, *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration] } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers func newHorizontalPodAutoscalers(c *AutoscalingV2beta1Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ gentype.NewClientWithListAndApply[*v2beta1.HorizontalPodAutoscaler, *v2beta1.HorizontalPodAutoscalerList, *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration]( "horizontalpodautoscalers", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v2beta1.HorizontalPodAutoscaler { return &v2beta1.HorizontalPodAutoscaler{} }, func() *v2beta1.HorizontalPodAutoscalerList { return &v2beta1.HorizontalPodAutoscalerList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/000077500000000000000000000000001472614177300254525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go000066400000000000000000000062311472614177300316520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2beta2 import ( "net/http" v2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type AutoscalingV2beta2Interface interface { RESTClient() rest.Interface HorizontalPodAutoscalersGetter } // AutoscalingV2beta2Client is used to interact with features provided by the autoscaling group. type AutoscalingV2beta2Client struct { restClient rest.Interface } func (c *AutoscalingV2beta2Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { return newHorizontalPodAutoscalers(c, namespace) } // NewForConfig creates a new AutoscalingV2beta2Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV2beta2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new AutoscalingV2beta2Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2beta2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &AutoscalingV2beta2Client{client}, nil } // NewForConfigOrDie creates a new AutoscalingV2beta2Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AutoscalingV2beta2Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AutoscalingV2beta2Client for the given RESTClient. func New(c rest.Interface) *AutoscalingV2beta2Client { return &AutoscalingV2beta2Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v2beta2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AutoscalingV2beta2Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/doc.go000066400000000000000000000012641472614177300265510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v2beta2 kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/fake/000077500000000000000000000000001472614177300263605ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/fake/doc.go000066400000000000000000000012531472614177300274550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go000066400000000000000000000022771472614177300335540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeAutoscalingV2beta2 struct { *testing.Fake } func (c *FakeAutoscalingV2beta2) HorizontalPodAutoscalers(namespace string) v2beta2.HorizontalPodAutoscalerInterface { return &FakeHorizontalPodAutoscalers{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAutoscalingV2beta2) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } fake_horizontalpodautoscaler.go000066400000000000000000000211261472614177300345770ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v2beta2 "k8s.io/api/autoscaling/v2beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2" testing "k8s.io/client-go/testing" ) // FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type FakeHorizontalPodAutoscalers struct { Fake *FakeAutoscalingV2beta2 ns string } var horizontalpodautoscalersResource = v2beta2.SchemeGroupVersion.WithResource("horizontalpodautoscalers") var horizontalpodautoscalersKind = v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { emptyResult := &v2beta2.HorizontalPodAutoscalerList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v2beta2.HorizontalPodAutoscalerList{ListMeta: obj.(*v2beta2.HorizontalPodAutoscalerList).ListMeta} for _, item := range obj.(*v2beta2.HorizontalPodAutoscalerList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) } // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(horizontalpodautoscalersResource, c.ns, name, opts), &v2beta2.HorizontalPodAutoscaler{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2beta2.HorizontalPodAutoscalerList{}) return err } // Patch applies the patch and returns the patched horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } // Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { if horizontalPodAutoscaler == nil { return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") } data, err := json.Marshal(horizontalPodAutoscaler) if err != nil { return nil, err } name := horizontalPodAutoscaler.Name if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { if horizontalPodAutoscaler == nil { return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") } data, err := json.Marshal(horizontalPodAutoscaler) if err != nil { return nil, err } name := horizontalPodAutoscaler.Name if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/generated_expansion.go000066400000000000000000000012501472614177300320210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2beta2 type HorizontalPodAutoscalerExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go000066400000000000000000000076541472614177300327740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v2beta2 import ( "context" v2beta2 "k8s.io/api/autoscaling/v2beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. // A group's client should implement this interface. type HorizontalPodAutoscalersGetter interface { HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface } // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta2.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type horizontalPodAutoscalers struct { *gentype.ClientWithListAndApply[*v2beta2.HorizontalPodAutoscaler, *v2beta2.HorizontalPodAutoscalerList, *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration] } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers func newHorizontalPodAutoscalers(c *AutoscalingV2beta2Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ gentype.NewClientWithListAndApply[*v2beta2.HorizontalPodAutoscaler, *v2beta2.HorizontalPodAutoscalerList, *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration]( "horizontalpodautoscalers", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v2beta2.HorizontalPodAutoscaler { return &v2beta2.HorizontalPodAutoscaler{} }, func() *v2beta2.HorizontalPodAutoscalerList { return &v2beta2.HorizontalPodAutoscalerList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/000077500000000000000000000000001472614177300227555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/000077500000000000000000000000001472614177300233035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/batch_client.go000066400000000000000000000057771472614177300262710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/batch/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type BatchV1Interface interface { RESTClient() rest.Interface CronJobsGetter JobsGetter } // BatchV1Client is used to interact with features provided by the batch group. type BatchV1Client struct { restClient rest.Interface } func (c *BatchV1Client) CronJobs(namespace string) CronJobInterface { return newCronJobs(c, namespace) } func (c *BatchV1Client) Jobs(namespace string) JobInterface { return newJobs(c, namespace) } // NewForConfig creates a new BatchV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*BatchV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new BatchV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BatchV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &BatchV1Client{client}, nil } // NewForConfigOrDie creates a new BatchV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *BatchV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new BatchV1Client for the given RESTClient. func New(c rest.Interface) *BatchV1Client { return &BatchV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *BatchV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/cronjob.go000066400000000000000000000060771472614177300253000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CronJobsGetter has a method to return a CronJobInterface. // A group's client should implement this interface. type CronJobsGetter interface { CronJobs(namespace string) CronJobInterface } // CronJobInterface has methods to work with CronJob resources. type CronJobInterface interface { Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (*v1.CronJob, error) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (*v1.CronJob, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (*v1.CronJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CronJob, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.CronJobList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) CronJobExpansion } // cronJobs implements CronJobInterface type cronJobs struct { *gentype.ClientWithListAndApply[*v1.CronJob, *v1.CronJobList, *batchv1.CronJobApplyConfiguration] } // newCronJobs returns a CronJobs func newCronJobs(c *BatchV1Client, namespace string) *cronJobs { return &cronJobs{ gentype.NewClientWithListAndApply[*v1.CronJob, *v1.CronJobList, *batchv1.CronJobApplyConfiguration]( "cronjobs", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.CronJob { return &v1.CronJob{} }, func() *v1.CronJobList { return &v1.CronJobList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/doc.go000066400000000000000000000012571472614177300244040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/fake/000077500000000000000000000000001472614177300242115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/fake/doc.go000066400000000000000000000012531472614177300253060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/fake/fake_batch_client.go000066400000000000000000000022731472614177300301510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/batch/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeBatchV1 struct { *testing.Fake } func (c *FakeBatchV1) CronJobs(namespace string) v1.CronJobInterface { return &FakeCronJobs{c, namespace} } func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface { return &FakeJobs{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeBatchV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/fake/fake_cronjob.go000066400000000000000000000157361472614177300271760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" testing "k8s.io/client-go/testing" ) // FakeCronJobs implements CronJobInterface type FakeCronJobs struct { Fake *FakeBatchV1 ns string } var cronjobsResource = v1.SchemeGroupVersion.WithResource("cronjobs") var cronjobsKind = v1.SchemeGroupVersion.WithKind("CronJob") // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. func (c *FakeCronJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(cronjobsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CronJob), err } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *FakeCronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { emptyResult := &v1.CronJobList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.CronJobList{ListMeta: obj.(*v1.CronJobList).ListMeta} for _, item := range obj.(*v1.CronJobList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cronJobs. func (c *FakeCronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(cronjobsResource, c.ns, opts)) } // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CronJob), err } // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CronJob), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(cronjobsResource, "status", c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CronJob), err } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(cronjobsResource, c.ns, name, opts), &v1.CronJob{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(cronjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CronJobList{}) return err } // Patch applies the patch and returns the patched cronJob. func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CronJob), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cronJob. func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) { if cronJob == nil { return nil, fmt.Errorf("cronJob provided to Apply must not be nil") } data, err := json.Marshal(cronJob) if err != nil { return nil, err } name := cronJob.Name if name == nil { return nil, fmt.Errorf("cronJob.Name must be provided to Apply") } emptyResult := &v1.CronJob{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CronJob), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) { if cronJob == nil { return nil, fmt.Errorf("cronJob provided to Apply must not be nil") } data, err := json.Marshal(cronJob) if err != nil { return nil, err } name := cronJob.Name if name == nil { return nil, fmt.Errorf("cronJob.Name must be provided to Apply") } emptyResult := &v1.CronJob{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CronJob), err } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/fake/fake_job.go000066400000000000000000000151561472614177300263100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" testing "k8s.io/client-go/testing" ) // FakeJobs implements JobInterface type FakeJobs struct { Fake *FakeBatchV1 ns string } var jobsResource = v1.SchemeGroupVersion.WithResource("jobs") var jobsKind = v1.SchemeGroupVersion.WithKind("Job") // Get takes name of the job, and returns the corresponding job object, and an error if there is any. func (c *FakeJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(jobsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Job), err } // List takes label and field selectors, and returns the list of Jobs that match those selectors. func (c *FakeJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { emptyResult := &v1.JobList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(jobsResource, jobsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.JobList{ListMeta: obj.(*v1.JobList).ListMeta} for _, item := range obj.(*v1.JobList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested jobs. func (c *FakeJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(jobsResource, c.ns, opts)) } // Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. func (c *FakeJobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(jobsResource, c.ns, job, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Job), err } // Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. func (c *FakeJobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(jobsResource, c.ns, job, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Job), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeJobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(jobsResource, "status", c.ns, job, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Job), err } // Delete takes name of the job and deletes it. Returns an error if one occurs. func (c *FakeJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(jobsResource, c.ns, name, opts), &v1.Job{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(jobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.JobList{}) return err } // Patch applies the patch and returns the patched job. func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Job), err } // Apply takes the given apply declarative configuration, applies it and returns the applied job. func (c *FakeJobs) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) { if job == nil { return nil, fmt.Errorf("job provided to Apply must not be nil") } data, err := json.Marshal(job) if err != nil { return nil, err } name := job.Name if name == nil { return nil, fmt.Errorf("job.Name must be provided to Apply") } emptyResult := &v1.Job{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Job), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeJobs) ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) { if job == nil { return nil, fmt.Errorf("job provided to Apply must not be nil") } data, err := json.Marshal(job) if err != nil { return nil, err } name := job.Name if name == nil { return nil, fmt.Errorf("job.Name must be provided to Apply") } emptyResult := &v1.Job{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Job), err } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/generated_expansion.go000066400000000000000000000012621472614177300276550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type CronJobExpansion interface{} type JobExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1/job.go000066400000000000000000000056071472614177300244140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // JobsGetter has a method to return a JobInterface. // A group's client should implement this interface. type JobsGetter interface { Jobs(namespace string) JobInterface } // JobInterface has methods to work with Job resources. type JobInterface interface { Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (*v1.Job, error) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Job, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) JobExpansion } // jobs implements JobInterface type jobs struct { *gentype.ClientWithListAndApply[*v1.Job, *v1.JobList, *batchv1.JobApplyConfiguration] } // newJobs returns a Jobs func newJobs(c *BatchV1Client, namespace string) *jobs { return &jobs{ gentype.NewClientWithListAndApply[*v1.Job, *v1.JobList, *batchv1.JobApplyConfiguration]( "jobs", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Job { return &v1.Job{} }, func() *v1.JobList { return &v1.JobList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/000077500000000000000000000000001472614177300242205ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/batch_client.go000066400000000000000000000057631472614177300272010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/batch/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type BatchV1beta1Interface interface { RESTClient() rest.Interface CronJobsGetter } // BatchV1beta1Client is used to interact with features provided by the batch group. type BatchV1beta1Client struct { restClient rest.Interface } func (c *BatchV1beta1Client) CronJobs(namespace string) CronJobInterface { return newCronJobs(c, namespace) } // NewForConfig creates a new BatchV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*BatchV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new BatchV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BatchV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &BatchV1beta1Client{client}, nil } // NewForConfigOrDie creates a new BatchV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *BatchV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new BatchV1beta1Client for the given RESTClient. func New(c rest.Interface) *BatchV1beta1Client { return &BatchV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *BatchV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/cronjob.go000066400000000000000000000062341472614177300262100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/batch/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CronJobsGetter has a method to return a CronJobInterface. // A group's client should implement this interface. type CronJobsGetter interface { CronJobs(namespace string) CronJobInterface } // CronJobInterface has methods to work with CronJob resources. type CronJobInterface interface { Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (*v1beta1.CronJob, error) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CronJob, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CronJobList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) CronJobExpansion } // cronJobs implements CronJobInterface type cronJobs struct { *gentype.ClientWithListAndApply[*v1beta1.CronJob, *v1beta1.CronJobList, *batchv1beta1.CronJobApplyConfiguration] } // newCronJobs returns a CronJobs func newCronJobs(c *BatchV1beta1Client, namespace string) *cronJobs { return &cronJobs{ gentype.NewClientWithListAndApply[*v1beta1.CronJob, *v1beta1.CronJobList, *batchv1beta1.CronJobApplyConfiguration]( "cronjobs", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.CronJob { return &v1beta1.CronJob{} }, func() *v1beta1.CronJobList { return &v1beta1.CronJobList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/doc.go000066400000000000000000000012641472614177300253170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/fake/000077500000000000000000000000001472614177300251265ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/fake/doc.go000066400000000000000000000012531472614177300262230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go000066400000000000000000000021671472614177300310700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeBatchV1beta1 struct { *testing.Fake } func (c *FakeBatchV1beta1) CronJobs(namespace string) v1beta1.CronJobInterface { return &FakeCronJobs{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeBatchV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go000066400000000000000000000161621472614177300301050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/batch/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1" testing "k8s.io/client-go/testing" ) // FakeCronJobs implements CronJobInterface type FakeCronJobs struct { Fake *FakeBatchV1beta1 ns string } var cronjobsResource = v1beta1.SchemeGroupVersion.WithResource("cronjobs") var cronjobsKind = v1beta1.SchemeGroupVersion.WithKind("CronJob") // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(cronjobsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CronJob), err } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { emptyResult := &v1beta1.CronJobList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.CronJobList{ListMeta: obj.(*v1beta1.CronJobList).ListMeta} for _, item := range obj.(*v1beta1.CronJobList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cronJobs. func (c *FakeCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(cronjobsResource, c.ns, opts)) } // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CronJob), err } // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CronJob), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(cronjobsResource, "status", c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CronJob), err } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(cronjobsResource, c.ns, name, opts), &v1beta1.CronJob{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(cronjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CronJobList{}) return err } // Patch applies the patch and returns the patched cronJob. func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CronJob), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cronJob. func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) { if cronJob == nil { return nil, fmt.Errorf("cronJob provided to Apply must not be nil") } data, err := json.Marshal(cronJob) if err != nil { return nil, err } name := cronJob.Name if name == nil { return nil, fmt.Errorf("cronJob.Name must be provided to Apply") } emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CronJob), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) { if cronJob == nil { return nil, fmt.Errorf("cronJob provided to Apply must not be nil") } data, err := json.Marshal(cronJob) if err != nil { return nil, err } name := cronJob.Name if name == nil { return nil, fmt.Errorf("cronJob.Name must be provided to Apply") } emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CronJob), err } kubernetes-client-go-a2dfcab/kubernetes/typed/batch/v1beta1/generated_expansion.go000066400000000000000000000012301472614177300305650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type CronJobExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/000077500000000000000000000000001472614177300243415ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/000077500000000000000000000000001472614177300246675ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/certificates_client.go000066400000000000000000000060771472614177300312330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/certificates/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type CertificatesV1Interface interface { RESTClient() rest.Interface CertificateSigningRequestsGetter } // CertificatesV1Client is used to interact with features provided by the certificates.k8s.io group. type CertificatesV1Client struct { restClient rest.Interface } func (c *CertificatesV1Client) CertificateSigningRequests() CertificateSigningRequestInterface { return newCertificateSigningRequests(c) } // NewForConfig creates a new CertificatesV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CertificatesV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new CertificatesV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &CertificatesV1Client{client}, nil } // NewForConfigOrDie creates a new CertificatesV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *CertificatesV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new CertificatesV1Client for the given RESTClient. func New(c rest.Interface) *CertificatesV1Client { return &CertificatesV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *CertificatesV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/certificatesigningrequest.go000066400000000000000000000115141472614177300324720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. // A group's client should implement this interface. type CertificateSigningRequestsGetter interface { CertificateSigningRequests() CertificateSigningRequestInterface } // CertificateSigningRequestInterface has methods to work with CertificateSigningRequest resources. type CertificateSigningRequestInterface interface { Create(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.CreateOptions) (*v1.CertificateSigningRequest, error) Update(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (*v1.CertificateSigningRequest, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (*v1.CertificateSigningRequest, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CertificateSigningRequest, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateSigningRequestList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateSigningRequest, err error) Apply(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (*v1.CertificateSigningRequest, error) CertificateSigningRequestExpansion } // certificateSigningRequests implements CertificateSigningRequestInterface type certificateSigningRequests struct { *gentype.ClientWithListAndApply[*v1.CertificateSigningRequest, *v1.CertificateSigningRequestList, *certificatesv1.CertificateSigningRequestApplyConfiguration] } // newCertificateSigningRequests returns a CertificateSigningRequests func newCertificateSigningRequests(c *CertificatesV1Client) *certificateSigningRequests { return &certificateSigningRequests{ gentype.NewClientWithListAndApply[*v1.CertificateSigningRequest, *v1.CertificateSigningRequestList, *certificatesv1.CertificateSigningRequestApplyConfiguration]( "certificatesigningrequests", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.CertificateSigningRequest { return &v1.CertificateSigningRequest{} }, func() *v1.CertificateSigningRequestList { return &v1.CertificateSigningRequestList{} }), } } // UpdateApproval takes the top resource name and the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *certificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { result = &v1.CertificateSigningRequest{} err = c.GetClient().Put(). Resource("certificatesigningrequests"). Name(certificateSigningRequestName). SubResource("approval"). VersionedParams(&opts, scheme.ParameterCodec). Body(certificateSigningRequest). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/doc.go000066400000000000000000000012571472614177300257700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/fake/000077500000000000000000000000001472614177300255755ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/fake/doc.go000066400000000000000000000012531472614177300266720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/fake/fake_certificates_client.go000066400000000000000000000022201472614177300331110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/certificates/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeCertificatesV1 struct { *testing.Fake } func (c *FakeCertificatesV1) CertificateSigningRequests() v1.CertificateSigningRequestInterface { return &FakeCertificateSigningRequests{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCertificatesV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go000066400000000000000000000225171472614177300343730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" testing "k8s.io/client-go/testing" ) // FakeCertificateSigningRequests implements CertificateSigningRequestInterface type FakeCertificateSigningRequests struct { Fake *FakeCertificatesV1 } var certificatesigningrequestsResource = v1.SchemeGroupVersion.WithResource("certificatesigningrequests") var certificatesigningrequestsKind = v1.SchemeGroupVersion.WithKind("CertificateSigningRequest") // Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(certificatesigningrequestsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { emptyResult := &v1.CertificateSigningRequestList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.CertificateSigningRequestList{ListMeta: obj.(*v1.CertificateSigningRequestList).ListMeta} for _, item := range obj.(*v1.CertificateSigningRequestList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested certificateSigningRequests. func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(certificatesigningrequestsResource, opts)) } // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.CreateOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "status", certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(certificatesigningrequestsResource, name, opts), &v1.CertificateSigningRequest{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(certificatesigningrequestsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CertificateSigningRequestList{}) return err } // Patch applies the patch and returns the patched certificateSigningRequest. func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest. func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) { if certificateSigningRequest == nil { return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") } data, err := json.Marshal(certificateSigningRequest) if err != nil { return nil, err } name := certificateSigningRequest.Name if name == nil { return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") } emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) { if certificateSigningRequest == nil { return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") } data, err := json.Marshal(certificateSigningRequest) if err != nil { return nil, err } name := certificateSigningRequest.Name if name == nil { return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") } emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // UpdateApproval takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "approval", certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1/generated_expansion.go000066400000000000000000000012451472614177300312420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type CertificateSigningRequestExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/000077500000000000000000000000001472614177300257565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/certificates_client.go000066400000000000000000000062251472614177300323150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/certificates/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type CertificatesV1alpha1Interface interface { RESTClient() rest.Interface ClusterTrustBundlesGetter } // CertificatesV1alpha1Client is used to interact with features provided by the certificates.k8s.io group. type CertificatesV1alpha1Client struct { restClient rest.Interface } func (c *CertificatesV1alpha1Client) ClusterTrustBundles() ClusterTrustBundleInterface { return newClusterTrustBundles(c) } // NewForConfig creates a new CertificatesV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CertificatesV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new CertificatesV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &CertificatesV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new CertificatesV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *CertificatesV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new CertificatesV1alpha1Client for the given RESTClient. func New(c rest.Interface) *CertificatesV1alpha1Client { return &CertificatesV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *CertificatesV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go000066400000000000000000000063101472614177300322620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/certificates/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ClusterTrustBundlesGetter has a method to return a ClusterTrustBundleInterface. // A group's client should implement this interface. type ClusterTrustBundlesGetter interface { ClusterTrustBundles() ClusterTrustBundleInterface } // ClusterTrustBundleInterface has methods to work with ClusterTrustBundle resources. type ClusterTrustBundleInterface interface { Create(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.CreateOptions) (*v1alpha1.ClusterTrustBundle, error) Update(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.UpdateOptions) (*v1alpha1.ClusterTrustBundle, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterTrustBundle, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterTrustBundleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTrustBundle, err error) Apply(ctx context.Context, clusterTrustBundle *certificatesv1alpha1.ClusterTrustBundleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterTrustBundle, err error) ClusterTrustBundleExpansion } // clusterTrustBundles implements ClusterTrustBundleInterface type clusterTrustBundles struct { *gentype.ClientWithListAndApply[*v1alpha1.ClusterTrustBundle, *v1alpha1.ClusterTrustBundleList, *certificatesv1alpha1.ClusterTrustBundleApplyConfiguration] } // newClusterTrustBundles returns a ClusterTrustBundles func newClusterTrustBundles(c *CertificatesV1alpha1Client) *clusterTrustBundles { return &clusterTrustBundles{ gentype.NewClientWithListAndApply[*v1alpha1.ClusterTrustBundle, *v1alpha1.ClusterTrustBundleList, *certificatesv1alpha1.ClusterTrustBundleApplyConfiguration]( "clustertrustbundles", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.ClusterTrustBundle { return &v1alpha1.ClusterTrustBundle{} }, func() *v1alpha1.ClusterTrustBundleList { return &v1alpha1.ClusterTrustBundleList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/doc.go000066400000000000000000000012651472614177300270560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/fake/000077500000000000000000000000001472614177300266645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300277610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go000066400000000000000000000022371472614177300342100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeCertificatesV1alpha1 struct { *testing.Fake } func (c *FakeCertificatesV1alpha1) ClusterTrustBundles() v1alpha1.ClusterTrustBundleInterface { return &FakeClusterTrustBundles{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCertificatesV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go000066400000000000000000000147451472614177300341710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/certificates/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeClusterTrustBundles implements ClusterTrustBundleInterface type FakeClusterTrustBundles struct { Fake *FakeCertificatesV1alpha1 } var clustertrustbundlesResource = v1alpha1.SchemeGroupVersion.WithResource("clustertrustbundles") var clustertrustbundlesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterTrustBundle") // Get takes name of the clusterTrustBundle, and returns the corresponding clusterTrustBundle object, and an error if there is any. func (c *FakeClusterTrustBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterTrustBundle, err error) { emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(clustertrustbundlesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } // List takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. func (c *FakeClusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { emptyResult := &v1alpha1.ClusterTrustBundleList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(clustertrustbundlesResource, clustertrustbundlesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.ClusterTrustBundleList{ListMeta: obj.(*v1alpha1.ClusterTrustBundleList).ListMeta} for _, item := range obj.(*v1alpha1.ClusterTrustBundleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested clusterTrustBundles. func (c *FakeClusterTrustBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(clustertrustbundlesResource, opts)) } // Create takes the representation of a clusterTrustBundle and creates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. func (c *FakeClusterTrustBundles) Create(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.CreateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(clustertrustbundlesResource, clusterTrustBundle, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } // Update takes the representation of a clusterTrustBundle and updates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. func (c *FakeClusterTrustBundles) Update(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.UpdateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(clustertrustbundlesResource, clusterTrustBundle, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } // Delete takes name of the clusterTrustBundle and deletes it. Returns an error if one occurs. func (c *FakeClusterTrustBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(clustertrustbundlesResource, name, opts), &v1alpha1.ClusterTrustBundle{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeClusterTrustBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(clustertrustbundlesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterTrustBundleList{}) return err } // Patch applies the patch and returns the patched clusterTrustBundle. func (c *FakeClusterTrustBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTrustBundle, err error) { emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustertrustbundlesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } // Apply takes the given apply declarative configuration, applies it and returns the applied clusterTrustBundle. func (c *FakeClusterTrustBundles) Apply(ctx context.Context, clusterTrustBundle *certificatesv1alpha1.ClusterTrustBundleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterTrustBundle, err error) { if clusterTrustBundle == nil { return nil, fmt.Errorf("clusterTrustBundle provided to Apply must not be nil") } data, err := json.Marshal(clusterTrustBundle) if err != nil { return nil, err } name := clusterTrustBundle.Name if name == nil { return nil, fmt.Errorf("clusterTrustBundle.Name must be provided to Apply") } emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustertrustbundlesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1alpha1/generated_expansion.go000066400000000000000000000012441472614177300323300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type ClusterTrustBundleExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/000077500000000000000000000000001472614177300256045ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/certificates_client.go000066400000000000000000000062361472614177300321450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/certificates/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type CertificatesV1beta1Interface interface { RESTClient() rest.Interface CertificateSigningRequestsGetter } // CertificatesV1beta1Client is used to interact with features provided by the certificates.k8s.io group. type CertificatesV1beta1Client struct { restClient rest.Interface } func (c *CertificatesV1beta1Client) CertificateSigningRequests() CertificateSigningRequestInterface { return newCertificateSigningRequests(c) } // NewForConfig creates a new CertificatesV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CertificatesV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new CertificatesV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &CertificatesV1beta1Client{client}, nil } // NewForConfigOrDie creates a new CertificatesV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *CertificatesV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new CertificatesV1beta1Client for the given RESTClient. func New(c rest.Interface) *CertificatesV1beta1Client { return &CertificatesV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *CertificatesV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go000066400000000000000000000077471472614177300334240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. // A group's client should implement this interface. type CertificateSigningRequestsGetter interface { CertificateSigningRequests() CertificateSigningRequestInterface } // CertificateSigningRequestInterface has methods to work with CertificateSigningRequest resources. type CertificateSigningRequestInterface interface { Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (*v1beta1.CertificateSigningRequest, error) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CertificateSigningRequest, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) Apply(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) CertificateSigningRequestExpansion } // certificateSigningRequests implements CertificateSigningRequestInterface type certificateSigningRequests struct { *gentype.ClientWithListAndApply[*v1beta1.CertificateSigningRequest, *v1beta1.CertificateSigningRequestList, *certificatesv1beta1.CertificateSigningRequestApplyConfiguration] } // newCertificateSigningRequests returns a CertificateSigningRequests func newCertificateSigningRequests(c *CertificatesV1beta1Client) *certificateSigningRequests { return &certificateSigningRequests{ gentype.NewClientWithListAndApply[*v1beta1.CertificateSigningRequest, *v1beta1.CertificateSigningRequestList, *certificatesv1beta1.CertificateSigningRequestApplyConfiguration]( "certificatesigningrequests", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.CertificateSigningRequest { return &v1beta1.CertificateSigningRequest{} }, func() *v1beta1.CertificateSigningRequestList { return &v1beta1.CertificateSigningRequestList{} }), } } certificatesigningrequest_expansion.go000066400000000000000000000030001472614177300354030ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "context" certificates "k8s.io/api/certificates/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" scheme "k8s.io/client-go/kubernetes/scheme" ) type CertificateSigningRequestExpansion interface { UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) } func (c *certificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) { result = &certificates.CertificateSigningRequest{} err = c.GetClient().Put(). Resource("certificatesigningrequests"). Name(certificateSigningRequest.Name). VersionedParams(&opts, scheme.ParameterCodec). Body(certificateSigningRequest). SubResource("approval"). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/doc.go000066400000000000000000000012641472614177300267030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/fake/000077500000000000000000000000001472614177300265125ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/fake/doc.go000066400000000000000000000012531472614177300276070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go000066400000000000000000000022561472614177300340370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeCertificatesV1beta1 struct { *testing.Fake } func (c *FakeCertificatesV1beta1) CertificateSigningRequests() v1beta1.CertificateSigningRequestInterface { return &FakeCertificateSigningRequests{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCertificatesV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } fake_certificatesigningrequest.go000066400000000000000000000213471472614177300352310ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" testing "k8s.io/client-go/testing" ) // FakeCertificateSigningRequests implements CertificateSigningRequestInterface type FakeCertificateSigningRequests struct { Fake *FakeCertificatesV1beta1 } var certificatesigningrequestsResource = v1beta1.SchemeGroupVersion.WithResource("certificatesigningrequests") var certificatesigningrequestsKind = v1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequest") // Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(certificatesigningrequestsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { emptyResult := &v1beta1.CertificateSigningRequestList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.CertificateSigningRequestList{ListMeta: obj.(*v1beta1.CertificateSigningRequestList).ListMeta} for _, item := range obj.(*v1beta1.CertificateSigningRequestList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested certificateSigningRequests. func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(certificatesigningrequestsResource, opts)) } // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } // Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "status", certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } // Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(certificatesigningrequestsResource, name, opts), &v1beta1.CertificateSigningRequest{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(certificatesigningrequestsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CertificateSigningRequestList{}) return err } // Patch applies the patch and returns the patched certificateSigningRequest. func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } // Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest. func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) { if certificateSigningRequest == nil { return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") } data, err := json.Marshal(certificateSigningRequest) if err != nil { return nil, err } name := certificateSigningRequest.Name if name == nil { return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") } emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) { if certificateSigningRequest == nil { return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") } data, err := json.Marshal(certificateSigningRequest) if err != nil { return nil, err } name := certificateSigningRequest.Name if name == nil { return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") } emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } fake_certificatesigningrequest_expansion.go000066400000000000000000000023471472614177300373140ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/fake/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" certificates "k8s.io/api/certificates/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" core "k8s.io/client-go/testing" ) func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) { obj, err := c.Fake. Invokes(core.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), &certificates.CertificateSigningRequest{}) if obj == nil { return nil, err } return obj.(*certificates.CertificateSigningRequest), err } kubernetes-client-go-a2dfcab/kubernetes/typed/certificates/v1beta1/generated_expansion.go000066400000000000000000000011651472614177300321600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/000077500000000000000000000000001472614177300243645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/000077500000000000000000000000001472614177300247125ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/coordination_client.go000066400000000000000000000060121472614177300312660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/coordination/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type CoordinationV1Interface interface { RESTClient() rest.Interface LeasesGetter } // CoordinationV1Client is used to interact with features provided by the coordination.k8s.io group. type CoordinationV1Client struct { restClient rest.Interface } func (c *CoordinationV1Client) Leases(namespace string) LeaseInterface { return newLeases(c, namespace) } // NewForConfig creates a new CoordinationV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoordinationV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new CoordinationV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &CoordinationV1Client{client}, nil } // NewForConfigOrDie creates a new CoordinationV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *CoordinationV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new CoordinationV1Client for the given RESTClient. func New(c rest.Interface) *CoordinationV1Client { return &CoordinationV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *CoordinationV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/doc.go000066400000000000000000000012571472614177300260130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/fake/000077500000000000000000000000001472614177300256205ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/fake/doc.go000066400000000000000000000012531472614177300267150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/fake/fake_coordination_client.go000066400000000000000000000021571472614177300331700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/coordination/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeCoordinationV1 struct { *testing.Fake } func (c *FakeCoordinationV1) Leases(namespace string) v1.LeaseInterface { return &FakeLeases{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCoordinationV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/fake/fake_lease.go000066400000000000000000000127201472614177300302300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" coordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" testing "k8s.io/client-go/testing" ) // FakeLeases implements LeaseInterface type FakeLeases struct { Fake *FakeCoordinationV1 ns string } var leasesResource = v1.SchemeGroupVersion.WithResource("leases") var leasesKind = v1.SchemeGroupVersion.WithKind("Lease") // Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. func (c *FakeLeases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Lease, err error) { emptyResult := &v1.Lease{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(leasesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Lease), err } // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *FakeLeases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { emptyResult := &v1.LeaseList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(leasesResource, leasesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.LeaseList{ListMeta: obj.(*v1.LeaseList).ListMeta} for _, item := range obj.(*v1.LeaseList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested leases. func (c *FakeLeases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(leasesResource, c.ns, opts)) } // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. func (c *FakeLeases) Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (result *v1.Lease, err error) { emptyResult := &v1.Lease{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Lease), err } // Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. func (c *FakeLeases) Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (result *v1.Lease, err error) { emptyResult := &v1.Lease{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Lease), err } // Delete takes name of the lease and deletes it. Returns an error if one occurs. func (c *FakeLeases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(leasesResource, c.ns, name, opts), &v1.Lease{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeLeases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(leasesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.LeaseList{}) return err } // Patch applies the patch and returns the patched lease. func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error) { emptyResult := &v1.Lease{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Lease), err } // Apply takes the given apply declarative configuration, applies it and returns the applied lease. func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error) { if lease == nil { return nil, fmt.Errorf("lease provided to Apply must not be nil") } data, err := json.Marshal(lease) if err != nil { return nil, err } name := lease.Name if name == nil { return nil, fmt.Errorf("lease.Name must be provided to Apply") } emptyResult := &v1.Lease{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Lease), err } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/generated_expansion.go000066400000000000000000000012211472614177300312570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type LeaseExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1/lease.go000066400000000000000000000051771472614177300263440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" coordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // LeasesGetter has a method to return a LeaseInterface. // A group's client should implement this interface. type LeasesGetter interface { Leases(namespace string) LeaseInterface } // LeaseInterface has methods to work with Lease resources. type LeaseInterface interface { Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (*v1.Lease, error) Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (*v1.Lease, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Lease, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error) Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error) LeaseExpansion } // leases implements LeaseInterface type leases struct { *gentype.ClientWithListAndApply[*v1.Lease, *v1.LeaseList, *coordinationv1.LeaseApplyConfiguration] } // newLeases returns a Leases func newLeases(c *CoordinationV1Client, namespace string) *leases { return &leases{ gentype.NewClientWithListAndApply[*v1.Lease, *v1.LeaseList, *coordinationv1.LeaseApplyConfiguration]( "leases", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Lease { return &v1.Lease{} }, func() *v1.LeaseList { return &v1.LeaseList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/000077500000000000000000000000001472614177300260015ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/coordination_client.go000066400000000000000000000062401472614177300323600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/coordination/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type CoordinationV1alpha1Interface interface { RESTClient() rest.Interface LeaseCandidatesGetter } // CoordinationV1alpha1Client is used to interact with features provided by the coordination.k8s.io group. type CoordinationV1alpha1Client struct { restClient rest.Interface } func (c *CoordinationV1alpha1Client) LeaseCandidates(namespace string) LeaseCandidateInterface { return newLeaseCandidates(c, namespace) } // NewForConfig creates a new CoordinationV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoordinationV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new CoordinationV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &CoordinationV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new CoordinationV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *CoordinationV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new CoordinationV1alpha1Client for the given RESTClient. func New(c rest.Interface) *CoordinationV1alpha1Client { return &CoordinationV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *CoordinationV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/doc.go000066400000000000000000000012651472614177300271010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/fake/000077500000000000000000000000001472614177300267075ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300300040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go000066400000000000000000000022561472614177300342570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeCoordinationV1alpha1 struct { *testing.Fake } func (c *FakeCoordinationV1alpha1) LeaseCandidates(namespace string) v1alpha1.LeaseCandidateInterface { return &FakeLeaseCandidates{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCoordinationV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go000066400000000000000000000143541472614177300331610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/coordination/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" coordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeLeaseCandidates implements LeaseCandidateInterface type FakeLeaseCandidates struct { Fake *FakeCoordinationV1alpha1 ns string } var leasecandidatesResource = v1alpha1.SchemeGroupVersion.WithResource("leasecandidates") var leasecandidatesKind = v1alpha1.SchemeGroupVersion.WithKind("LeaseCandidate") // Get takes name of the leaseCandidate, and returns the corresponding leaseCandidate object, and an error if there is any. func (c *FakeLeaseCandidates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LeaseCandidate, err error) { emptyResult := &v1alpha1.LeaseCandidate{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(leasecandidatesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.LeaseCandidate), err } // List takes label and field selectors, and returns the list of LeaseCandidates that match those selectors. func (c *FakeLeaseCandidates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LeaseCandidateList, err error) { emptyResult := &v1alpha1.LeaseCandidateList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(leasecandidatesResource, leasecandidatesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.LeaseCandidateList{ListMeta: obj.(*v1alpha1.LeaseCandidateList).ListMeta} for _, item := range obj.(*v1alpha1.LeaseCandidateList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested leaseCandidates. func (c *FakeLeaseCandidates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(leasecandidatesResource, c.ns, opts)) } // Create takes the representation of a leaseCandidate and creates it. Returns the server's representation of the leaseCandidate, and an error, if there is any. func (c *FakeLeaseCandidates) Create(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.CreateOptions) (result *v1alpha1.LeaseCandidate, err error) { emptyResult := &v1alpha1.LeaseCandidate{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(leasecandidatesResource, c.ns, leaseCandidate, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.LeaseCandidate), err } // Update takes the representation of a leaseCandidate and updates it. Returns the server's representation of the leaseCandidate, and an error, if there is any. func (c *FakeLeaseCandidates) Update(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.UpdateOptions) (result *v1alpha1.LeaseCandidate, err error) { emptyResult := &v1alpha1.LeaseCandidate{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(leasecandidatesResource, c.ns, leaseCandidate, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.LeaseCandidate), err } // Delete takes name of the leaseCandidate and deletes it. Returns an error if one occurs. func (c *FakeLeaseCandidates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(leasecandidatesResource, c.ns, name, opts), &v1alpha1.LeaseCandidate{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeLeaseCandidates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(leasecandidatesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.LeaseCandidateList{}) return err } // Patch applies the patch and returns the patched leaseCandidate. func (c *FakeLeaseCandidates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LeaseCandidate, err error) { emptyResult := &v1alpha1.LeaseCandidate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(leasecandidatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.LeaseCandidate), err } // Apply takes the given apply declarative configuration, applies it and returns the applied leaseCandidate. func (c *FakeLeaseCandidates) Apply(ctx context.Context, leaseCandidate *coordinationv1alpha1.LeaseCandidateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LeaseCandidate, err error) { if leaseCandidate == nil { return nil, fmt.Errorf("leaseCandidate provided to Apply must not be nil") } data, err := json.Marshal(leaseCandidate) if err != nil { return nil, err } name := leaseCandidate.Name if name == nil { return nil, fmt.Errorf("leaseCandidate.Name must be provided to Apply") } emptyResult := &v1alpha1.LeaseCandidate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(leasecandidatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.LeaseCandidate), err } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/generated_expansion.go000066400000000000000000000012401472614177300323470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type LeaseCandidateExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1alpha1/leasecandidate.go000066400000000000000000000061211472614177300312560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/coordination/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" coordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // LeaseCandidatesGetter has a method to return a LeaseCandidateInterface. // A group's client should implement this interface. type LeaseCandidatesGetter interface { LeaseCandidates(namespace string) LeaseCandidateInterface } // LeaseCandidateInterface has methods to work with LeaseCandidate resources. type LeaseCandidateInterface interface { Create(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.CreateOptions) (*v1alpha1.LeaseCandidate, error) Update(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.UpdateOptions) (*v1alpha1.LeaseCandidate, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.LeaseCandidate, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.LeaseCandidateList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LeaseCandidate, err error) Apply(ctx context.Context, leaseCandidate *coordinationv1alpha1.LeaseCandidateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LeaseCandidate, err error) LeaseCandidateExpansion } // leaseCandidates implements LeaseCandidateInterface type leaseCandidates struct { *gentype.ClientWithListAndApply[*v1alpha1.LeaseCandidate, *v1alpha1.LeaseCandidateList, *coordinationv1alpha1.LeaseCandidateApplyConfiguration] } // newLeaseCandidates returns a LeaseCandidates func newLeaseCandidates(c *CoordinationV1alpha1Client, namespace string) *leaseCandidates { return &leaseCandidates{ gentype.NewClientWithListAndApply[*v1alpha1.LeaseCandidate, *v1alpha1.LeaseCandidateList, *coordinationv1alpha1.LeaseCandidateApplyConfiguration]( "leasecandidates", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1alpha1.LeaseCandidate { return &v1alpha1.LeaseCandidate{} }, func() *v1alpha1.LeaseCandidateList { return &v1alpha1.LeaseCandidateList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/000077500000000000000000000000001472614177300256275ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/coordination_client.go000066400000000000000000000061511472614177300322070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/coordination/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type CoordinationV1beta1Interface interface { RESTClient() rest.Interface LeasesGetter } // CoordinationV1beta1Client is used to interact with features provided by the coordination.k8s.io group. type CoordinationV1beta1Client struct { restClient rest.Interface } func (c *CoordinationV1beta1Client) Leases(namespace string) LeaseInterface { return newLeases(c, namespace) } // NewForConfig creates a new CoordinationV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoordinationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new CoordinationV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &CoordinationV1beta1Client{client}, nil } // NewForConfigOrDie creates a new CoordinationV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *CoordinationV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new CoordinationV1beta1Client for the given RESTClient. func New(c rest.Interface) *CoordinationV1beta1Client { return &CoordinationV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *CoordinationV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/doc.go000066400000000000000000000012641472614177300267260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/fake/000077500000000000000000000000001472614177300265355ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/fake/doc.go000066400000000000000000000012531472614177300276320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go000066400000000000000000000022151472614177300341000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeCoordinationV1beta1 struct { *testing.Fake } func (c *FakeCoordinationV1beta1) Leases(namespace string) v1beta1.LeaseInterface { return &FakeLeases{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCoordinationV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go000066400000000000000000000131041472614177300311420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/coordination/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" testing "k8s.io/client-go/testing" ) // FakeLeases implements LeaseInterface type FakeLeases struct { Fake *FakeCoordinationV1beta1 ns string } var leasesResource = v1beta1.SchemeGroupVersion.WithResource("leases") var leasesKind = v1beta1.SchemeGroupVersion.WithKind("Lease") // Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. func (c *FakeLeases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Lease, err error) { emptyResult := &v1beta1.Lease{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(leasesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Lease), err } // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *FakeLeases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { emptyResult := &v1beta1.LeaseList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(leasesResource, leasesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.LeaseList{ListMeta: obj.(*v1beta1.LeaseList).ListMeta} for _, item := range obj.(*v1beta1.LeaseList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested leases. func (c *FakeLeases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(leasesResource, c.ns, opts)) } // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. func (c *FakeLeases) Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (result *v1beta1.Lease, err error) { emptyResult := &v1beta1.Lease{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Lease), err } // Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. func (c *FakeLeases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (result *v1beta1.Lease, err error) { emptyResult := &v1beta1.Lease{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Lease), err } // Delete takes name of the lease and deletes it. Returns an error if one occurs. func (c *FakeLeases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(leasesResource, c.ns, name, opts), &v1beta1.Lease{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(leasesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.LeaseList{}) return err } // Patch applies the patch and returns the patched lease. func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) { emptyResult := &v1beta1.Lease{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Lease), err } // Apply takes the given apply declarative configuration, applies it and returns the applied lease. func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1beta1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Lease, err error) { if lease == nil { return nil, fmt.Errorf("lease provided to Apply must not be nil") } data, err := json.Marshal(lease) if err != nil { return nil, err } name := lease.Name if name == nil { return nil, fmt.Errorf("lease.Name must be provided to Apply") } emptyResult := &v1beta1.Lease{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Lease), err } kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/generated_expansion.go000066400000000000000000000012261472614177300322010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type LeaseExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/coordination/v1beta1/lease.go000066400000000000000000000053201472614177300272470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/coordination/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // LeasesGetter has a method to return a LeaseInterface. // A group's client should implement this interface. type LeasesGetter interface { Leases(namespace string) LeaseInterface } // LeaseInterface has methods to work with Lease resources. type LeaseInterface interface { Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (*v1beta1.Lease, error) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (*v1beta1.Lease, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Lease, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LeaseList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) Apply(ctx context.Context, lease *coordinationv1beta1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Lease, err error) LeaseExpansion } // leases implements LeaseInterface type leases struct { *gentype.ClientWithListAndApply[*v1beta1.Lease, *v1beta1.LeaseList, *coordinationv1beta1.LeaseApplyConfiguration] } // newLeases returns a Leases func newLeases(c *CoordinationV1beta1Client, namespace string) *leases { return &leases{ gentype.NewClientWithListAndApply[*v1beta1.Lease, *v1beta1.LeaseList, *coordinationv1beta1.LeaseApplyConfiguration]( "leases", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.Lease { return &v1beta1.Lease{} }, func() *v1beta1.LeaseList { return &v1beta1.LeaseList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/000077500000000000000000000000001472614177300226245ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/000077500000000000000000000000001472614177300231525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/componentstatus.go000066400000000000000000000056711472614177300267600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ComponentStatusesGetter has a method to return a ComponentStatusInterface. // A group's client should implement this interface. type ComponentStatusesGetter interface { ComponentStatuses() ComponentStatusInterface } // ComponentStatusInterface has methods to work with ComponentStatus resources. type ComponentStatusInterface interface { Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (*v1.ComponentStatus, error) Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (*v1.ComponentStatus, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ComponentStatus, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ComponentStatusList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error) Apply(ctx context.Context, componentStatus *corev1.ComponentStatusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ComponentStatus, err error) ComponentStatusExpansion } // componentStatuses implements ComponentStatusInterface type componentStatuses struct { *gentype.ClientWithListAndApply[*v1.ComponentStatus, *v1.ComponentStatusList, *corev1.ComponentStatusApplyConfiguration] } // newComponentStatuses returns a ComponentStatuses func newComponentStatuses(c *CoreV1Client) *componentStatuses { return &componentStatuses{ gentype.NewClientWithListAndApply[*v1.ComponentStatus, *v1.ComponentStatusList, *corev1.ComponentStatusApplyConfiguration]( "componentstatuses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.ComponentStatus { return &v1.ComponentStatus{} }, func() *v1.ComponentStatusList { return &v1.ComponentStatusList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/configmap.go000066400000000000000000000053471472614177300254550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ConfigMapsGetter has a method to return a ConfigMapInterface. // A group's client should implement this interface. type ConfigMapsGetter interface { ConfigMaps(namespace string) ConfigMapInterface } // ConfigMapInterface has methods to work with ConfigMap resources. type ConfigMapInterface interface { Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (*v1.ConfigMap, error) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (*v1.ConfigMap, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ConfigMap, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error) ConfigMapExpansion } // configMaps implements ConfigMapInterface type configMaps struct { *gentype.ClientWithListAndApply[*v1.ConfigMap, *v1.ConfigMapList, *corev1.ConfigMapApplyConfiguration] } // newConfigMaps returns a ConfigMaps func newConfigMaps(c *CoreV1Client, namespace string) *configMaps { return &configMaps{ gentype.NewClientWithListAndApply[*v1.ConfigMap, *v1.ConfigMapList, *corev1.ConfigMapApplyConfiguration]( "configmaps", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.ConfigMap { return &v1.ConfigMap{} }, func() *v1.ConfigMapList { return &v1.ConfigMapList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/core_client.go000066400000000000000000000114541472614177300257740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type CoreV1Interface interface { RESTClient() rest.Interface ComponentStatusesGetter ConfigMapsGetter EndpointsGetter EventsGetter LimitRangesGetter NamespacesGetter NodesGetter PersistentVolumesGetter PersistentVolumeClaimsGetter PodsGetter PodTemplatesGetter ReplicationControllersGetter ResourceQuotasGetter SecretsGetter ServicesGetter ServiceAccountsGetter } // CoreV1Client is used to interact with features provided by the group. type CoreV1Client struct { restClient rest.Interface } func (c *CoreV1Client) ComponentStatuses() ComponentStatusInterface { return newComponentStatuses(c) } func (c *CoreV1Client) ConfigMaps(namespace string) ConfigMapInterface { return newConfigMaps(c, namespace) } func (c *CoreV1Client) Endpoints(namespace string) EndpointsInterface { return newEndpoints(c, namespace) } func (c *CoreV1Client) Events(namespace string) EventInterface { return newEvents(c, namespace) } func (c *CoreV1Client) LimitRanges(namespace string) LimitRangeInterface { return newLimitRanges(c, namespace) } func (c *CoreV1Client) Namespaces() NamespaceInterface { return newNamespaces(c) } func (c *CoreV1Client) Nodes() NodeInterface { return newNodes(c) } func (c *CoreV1Client) PersistentVolumes() PersistentVolumeInterface { return newPersistentVolumes(c) } func (c *CoreV1Client) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface { return newPersistentVolumeClaims(c, namespace) } func (c *CoreV1Client) Pods(namespace string) PodInterface { return newPods(c, namespace) } func (c *CoreV1Client) PodTemplates(namespace string) PodTemplateInterface { return newPodTemplates(c, namespace) } func (c *CoreV1Client) ReplicationControllers(namespace string) ReplicationControllerInterface { return newReplicationControllers(c, namespace) } func (c *CoreV1Client) ResourceQuotas(namespace string) ResourceQuotaInterface { return newResourceQuotas(c, namespace) } func (c *CoreV1Client) Secrets(namespace string) SecretInterface { return newSecrets(c, namespace) } func (c *CoreV1Client) Services(namespace string) ServiceInterface { return newServices(c, namespace) } func (c *CoreV1Client) ServiceAccounts(namespace string) ServiceAccountInterface { return newServiceAccounts(c, namespace) } // NewForConfig creates a new CoreV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoreV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new CoreV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoreV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &CoreV1Client{client}, nil } // NewForConfigOrDie creates a new CoreV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *CoreV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new CoreV1Client for the given RESTClient. func New(c rest.Interface) *CoreV1Client { return &CoreV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/api" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *CoreV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/doc.go000066400000000000000000000012571472614177300242530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/endpoints.go000066400000000000000000000053341472614177300255110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // EndpointsGetter has a method to return a EndpointsInterface. // A group's client should implement this interface. type EndpointsGetter interface { Endpoints(namespace string) EndpointsInterface } // EndpointsInterface has methods to work with Endpoints resources. type EndpointsInterface interface { Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (*v1.Endpoints, error) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (*v1.Endpoints, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Endpoints, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) Apply(ctx context.Context, endpoints *corev1.EndpointsApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Endpoints, err error) EndpointsExpansion } // endpoints implements EndpointsInterface type endpoints struct { *gentype.ClientWithListAndApply[*v1.Endpoints, *v1.EndpointsList, *corev1.EndpointsApplyConfiguration] } // newEndpoints returns a Endpoints func newEndpoints(c *CoreV1Client, namespace string) *endpoints { return &endpoints{ gentype.NewClientWithListAndApply[*v1.Endpoints, *v1.EndpointsList, *corev1.EndpointsApplyConfiguration]( "endpoints", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Endpoints { return &v1.Endpoints{} }, func() *v1.EndpointsList { return &v1.EndpointsList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/event.go000066400000000000000000000051071472614177300246250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // EventsGetter has a method to return a EventInterface. // A group's client should implement this interface. type EventsGetter interface { Events(namespace string) EventInterface } // EventInterface has methods to work with Event resources. type EventInterface interface { Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (*v1.Event, error) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (*v1.Event, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Event, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) EventExpansion } // events implements EventInterface type events struct { *gentype.ClientWithListAndApply[*v1.Event, *v1.EventList, *corev1.EventApplyConfiguration] } // newEvents returns a Events func newEvents(c *CoreV1Client, namespace string) *events { return &events{ gentype.NewClientWithListAndApply[*v1.Event, *v1.EventList, *corev1.EventApplyConfiguration]( "events", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Event { return &v1.Event{} }, func() *v1.EventList { return &v1.EventList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/event_expansion.go000066400000000000000000000157641472614177300267230ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "context" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" ref "k8s.io/client-go/tools/reference" ) // The EventExpansion interface allows manually adding extra methods to the EventInterface. type EventExpansion interface { // CreateWithEventNamespace is the same as a Create, except that it sends the request to the event.Namespace. CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) // UpdateWithEventNamespace is the same as a Update, except that it sends the request to the event.Namespace. UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) // PatchWithEventNamespace is the same as a Patch, except that it sends the request to the event.Namespace. PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error) // Search finds events about the specified object Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) // Returns the appropriate field selector based on the API version being used to communicate with the server. // The returned field selector can be used with List and Watch to filter desired events. GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector } // CreateWithEventNamespace makes a new event. Returns the copy of the event the server returns, // or an error. The namespace to create the event within is deduced from the // event; it must either match this event client's namespace, or this event // client must have been created with the "" namespace. func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1.Event{} err := e.GetClient().Post(). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Body(event). Do(context.TODO()). Into(result) return result, err } // UpdateWithEventNamespace modifies an existing event. It returns the copy of the event that the server returns, // or an error. The namespace and key to update the event within is deduced from the event. The // namespace must either match this event client's namespace, or this event client must have been // created with the "" namespace. Update also requires the ResourceVersion to be set in the event // object. func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't update an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1.Event{} err := e.GetClient().Put(). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Name(event.Name). Body(event). Do(context.TODO()). Into(result) return result, err } // PatchWithEventNamespace modifies an existing event. It returns the copy of // the event that the server returns, or an error. The namespace and name of the // target event is deduced from the incompleteEvent. The namespace must either // match this event client's namespace, or this event client must have been // created with the "" namespace. func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte) (*v1.Event, error) { if e.GetNamespace() != "" && incompleteEvent.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", incompleteEvent.Namespace, e.GetNamespace()) } result := &v1.Event{} err := e.GetClient().Patch(types.StrategicMergePatchType). NamespaceIfScoped(incompleteEvent.Namespace, len(incompleteEvent.Namespace) > 0). Resource("events"). Name(incompleteEvent.Name). Body(data). Do(context.TODO()). Into(result) return result, err } // Search finds events about the specified object. The namespace of the // object must match this event's client namespace unless the event client // was made with the "" namespace. func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { ref, err := ref.GetReference(scheme, objOrRef) if err != nil { return nil, err } if len(e.GetNamespace()) > 0 && ref.Namespace != e.GetNamespace() { return nil, fmt.Errorf("won't be able to find any events of namespace '%v' in namespace '%v'", ref.Namespace, e.GetNamespace()) } stringRefKind := string(ref.Kind) var refKind *string if len(stringRefKind) > 0 { refKind = &stringRefKind } stringRefUID := string(ref.UID) var refUID *string if len(stringRefUID) > 0 { refUID = &stringRefUID } fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) return e.List(context.TODO(), metav1.ListOptions{FieldSelector: fieldSelector.String()}) } // Returns the appropriate field selector based on the API version being used to communicate with the server. // The returned field selector can be used with List and Watch to filter desired events. func (e *events) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector { field := fields.Set{} if involvedObjectName != nil { field["involvedObject.name"] = *involvedObjectName } if involvedObjectNamespace != nil { field["involvedObject.namespace"] = *involvedObjectNamespace } if involvedObjectKind != nil { field["involvedObject.kind"] = *involvedObjectKind } if involvedObjectUID != nil { field["involvedObject.uid"] = *involvedObjectUID } return field.AsSelector() } // Returns the appropriate field label to use for name of the involved object as per the given API version. // DEPRECATED: please use "involvedObject.name" inline. func GetInvolvedObjectNameFieldLabel(version string) string { return "involvedObject.name" } // TODO: This is a temporary arrangement and will be removed once all clients are moved to use the clientset. type EventSinkImpl struct { Interface EventInterface } func (e *EventSinkImpl) Create(event *v1.Event) (*v1.Event, error) { return e.Interface.CreateWithEventNamespace(event) } func (e *EventSinkImpl) Update(event *v1.Event) (*v1.Event, error) { return e.Interface.UpdateWithEventNamespace(event) } func (e *EventSinkImpl) Patch(event *v1.Event, data []byte) (*v1.Event, error) { return e.Interface.PatchWithEventNamespace(event, data) } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/event_expansion_test.go000066400000000000000000000077351472614177300277610ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "io" "net/http" "strings" "testing" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" restfake "k8s.io/client-go/rest/fake" ) func TestCreateWithEventNamespace(t *testing.T) { event := &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "default", }, } cli := &restfake.RESTClient{ Client: restfake.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader("{}")), } return resp, nil }), NegotiatedSerializer: scheme.Codecs.WithoutConversion(), } tests := []struct { name string ns string event *v1.Event wantErr bool }{ { name: "create event", ns: "default", event: event, }, { name: "create event with different namespace", ns: "other", event: event, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { e := newEvents(New(cli), tt.ns) _, err := e.CreateWithEventNamespace(tt.event) if (err != nil) != tt.wantErr { t.Errorf("CreateWithEventNamespace() error = %v, wantErr %v", err, tt.wantErr) return } }) } } func TestPatchWithEventNamespace(t *testing.T) { event := &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "default", }, } cli := &restfake.RESTClient{ Client: restfake.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader("{}")), } return resp, nil }), NegotiatedSerializer: scheme.Codecs.WithoutConversion(), } tests := []struct { name string ns string event *v1.Event data []byte wantErr bool }{ { name: "patch event", ns: "default", event: event, data: []byte{}, }, { name: "patch event with different namespace", ns: "other", event: event, data: []byte{}, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { e := newEvents(New(cli), tt.ns) _, err := e.PatchWithEventNamespace(tt.event, tt.data) if (err != nil) != tt.wantErr { t.Errorf("PatchWithEventNamespace() error = %v, wantErr %v", err, tt.wantErr) return } }) } } func TestUpdateWithEventNamespace(t *testing.T) { event := &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "default", }, } cli := &restfake.RESTClient{ Client: restfake.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader("{}")), } return resp, nil }), NegotiatedSerializer: scheme.Codecs.WithoutConversion(), } tests := []struct { name string ns string event *v1.Event wantErr bool }{ { name: "patch event", ns: "default", event: event, }, { name: "patch event with different namespace", ns: "other", event: event, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { e := newEvents(New(cli), tt.ns) _, err := e.UpdateWithEventNamespace(tt.event) if (err != nil) != tt.wantErr { t.Errorf("UpdateWithEventNamespace() error = %v, wantErr %v", err, tt.wantErr) return } }) } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/000077500000000000000000000000001472614177300240605ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/doc.go000066400000000000000000000012531472614177300251550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_componentstatus.go000066400000000000000000000141531472614177300306470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeComponentStatuses implements ComponentStatusInterface type FakeComponentStatuses struct { Fake *FakeCoreV1 } var componentstatusesResource = v1.SchemeGroupVersion.WithResource("componentstatuses") var componentstatusesKind = v1.SchemeGroupVersion.WithKind("ComponentStatus") // Get takes name of the componentStatus, and returns the corresponding componentStatus object, and an error if there is any. func (c *FakeComponentStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ComponentStatus, err error) { emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(componentstatusesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ComponentStatus), err } // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. func (c *FakeComponentStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { emptyResult := &v1.ComponentStatusList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(componentstatusesResource, componentstatusesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ComponentStatusList{ListMeta: obj.(*v1.ComponentStatusList).ListMeta} for _, item := range obj.(*v1.ComponentStatusList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested componentStatuses. func (c *FakeComponentStatuses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(componentstatusesResource, opts)) } // Create takes the representation of a componentStatus and creates it. Returns the server's representation of the componentStatus, and an error, if there is any. func (c *FakeComponentStatuses) Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (result *v1.ComponentStatus, err error) { emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(componentstatusesResource, componentStatus, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ComponentStatus), err } // Update takes the representation of a componentStatus and updates it. Returns the server's representation of the componentStatus, and an error, if there is any. func (c *FakeComponentStatuses) Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (result *v1.ComponentStatus, err error) { emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(componentstatusesResource, componentStatus, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ComponentStatus), err } // Delete takes name of the componentStatus and deletes it. Returns an error if one occurs. func (c *FakeComponentStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(componentstatusesResource, name, opts), &v1.ComponentStatus{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeComponentStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(componentstatusesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ComponentStatusList{}) return err } // Patch applies the patch and returns the patched componentStatus. func (c *FakeComponentStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error) { emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(componentstatusesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ComponentStatus), err } // Apply takes the given apply declarative configuration, applies it and returns the applied componentStatus. func (c *FakeComponentStatuses) Apply(ctx context.Context, componentStatus *corev1.ComponentStatusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ComponentStatus, err error) { if componentStatus == nil { return nil, fmt.Errorf("componentStatus provided to Apply must not be nil") } data, err := json.Marshal(componentStatus) if err != nil { return nil, err } name := componentStatus.Name if name == nil { return nil, fmt.Errorf("componentStatus.Name must be provided to Apply") } emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(componentstatusesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ComponentStatus), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_configmap.go000066400000000000000000000133101472614177300273360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeConfigMaps implements ConfigMapInterface type FakeConfigMaps struct { Fake *FakeCoreV1 ns string } var configmapsResource = v1.SchemeGroupVersion.WithResource("configmaps") var configmapsKind = v1.SchemeGroupVersion.WithKind("ConfigMap") // Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. func (c *FakeConfigMaps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) { emptyResult := &v1.ConfigMap{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(configmapsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ConfigMap), err } // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. func (c *FakeConfigMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { emptyResult := &v1.ConfigMapList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(configmapsResource, configmapsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ConfigMapList{ListMeta: obj.(*v1.ConfigMapList).ListMeta} for _, item := range obj.(*v1.ConfigMapList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested configMaps. func (c *FakeConfigMaps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(configmapsResource, c.ns, opts)) } // Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. func (c *FakeConfigMaps) Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (result *v1.ConfigMap, err error) { emptyResult := &v1.ConfigMap{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(configmapsResource, c.ns, configMap, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ConfigMap), err } // Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. func (c *FakeConfigMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (result *v1.ConfigMap, err error) { emptyResult := &v1.ConfigMap{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(configmapsResource, c.ns, configMap, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ConfigMap), err } // Delete takes name of the configMap and deletes it. Returns an error if one occurs. func (c *FakeConfigMaps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(configmapsResource, c.ns, name, opts), &v1.ConfigMap{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(configmapsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ConfigMapList{}) return err } // Patch applies the patch and returns the patched configMap. func (c *FakeConfigMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) { emptyResult := &v1.ConfigMap{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(configmapsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ConfigMap), err } // Apply takes the given apply declarative configuration, applies it and returns the applied configMap. func (c *FakeConfigMaps) Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error) { if configMap == nil { return nil, fmt.Errorf("configMap provided to Apply must not be nil") } data, err := json.Marshal(configMap) if err != nil { return nil, err } name := configMap.Name if name == nil { return nil, fmt.Errorf("configMap.Name must be provided to Apply") } emptyResult := &v1.ConfigMap{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(configmapsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ConfigMap), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_core_client.go000066400000000000000000000054031472614177300276650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/core/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeCoreV1 struct { *testing.Fake } func (c *FakeCoreV1) ComponentStatuses() v1.ComponentStatusInterface { return &FakeComponentStatuses{c} } func (c *FakeCoreV1) ConfigMaps(namespace string) v1.ConfigMapInterface { return &FakeConfigMaps{c, namespace} } func (c *FakeCoreV1) Endpoints(namespace string) v1.EndpointsInterface { return &FakeEndpoints{c, namespace} } func (c *FakeCoreV1) Events(namespace string) v1.EventInterface { return &FakeEvents{c, namespace} } func (c *FakeCoreV1) LimitRanges(namespace string) v1.LimitRangeInterface { return &FakeLimitRanges{c, namespace} } func (c *FakeCoreV1) Namespaces() v1.NamespaceInterface { return &FakeNamespaces{c} } func (c *FakeCoreV1) Nodes() v1.NodeInterface { return &FakeNodes{c} } func (c *FakeCoreV1) PersistentVolumes() v1.PersistentVolumeInterface { return &FakePersistentVolumes{c} } func (c *FakeCoreV1) PersistentVolumeClaims(namespace string) v1.PersistentVolumeClaimInterface { return &FakePersistentVolumeClaims{c, namespace} } func (c *FakeCoreV1) Pods(namespace string) v1.PodInterface { return &FakePods{c, namespace} } func (c *FakeCoreV1) PodTemplates(namespace string) v1.PodTemplateInterface { return &FakePodTemplates{c, namespace} } func (c *FakeCoreV1) ReplicationControllers(namespace string) v1.ReplicationControllerInterface { return &FakeReplicationControllers{c, namespace} } func (c *FakeCoreV1) ResourceQuotas(namespace string) v1.ResourceQuotaInterface { return &FakeResourceQuotas{c, namespace} } func (c *FakeCoreV1) Secrets(namespace string) v1.SecretInterface { return &FakeSecrets{c, namespace} } func (c *FakeCoreV1) Services(namespace string) v1.ServiceInterface { return &FakeServices{c, namespace} } func (c *FakeCoreV1) ServiceAccounts(namespace string) v1.ServiceAccountInterface { return &FakeServiceAccounts{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCoreV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_endpoints.go000066400000000000000000000132561472614177300274070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeEndpoints implements EndpointsInterface type FakeEndpoints struct { Fake *FakeCoreV1 ns string } var endpointsResource = v1.SchemeGroupVersion.WithResource("endpoints") var endpointsKind = v1.SchemeGroupVersion.WithKind("Endpoints") // Get takes name of the endpoints, and returns the corresponding endpoints object, and an error if there is any. func (c *FakeEndpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Endpoints, err error) { emptyResult := &v1.Endpoints{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(endpointsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Endpoints), err } // List takes label and field selectors, and returns the list of Endpoints that match those selectors. func (c *FakeEndpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { emptyResult := &v1.EndpointsList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(endpointsResource, endpointsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.EndpointsList{ListMeta: obj.(*v1.EndpointsList).ListMeta} for _, item := range obj.(*v1.EndpointsList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested endpoints. func (c *FakeEndpoints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(endpointsResource, c.ns, opts)) } // Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any. func (c *FakeEndpoints) Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (result *v1.Endpoints, err error) { emptyResult := &v1.Endpoints{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(endpointsResource, c.ns, endpoints, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Endpoints), err } // Update takes the representation of a endpoints and updates it. Returns the server's representation of the endpoints, and an error, if there is any. func (c *FakeEndpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (result *v1.Endpoints, err error) { emptyResult := &v1.Endpoints{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(endpointsResource, c.ns, endpoints, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Endpoints), err } // Delete takes name of the endpoints and deletes it. Returns an error if one occurs. func (c *FakeEndpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(endpointsResource, c.ns, name, opts), &v1.Endpoints{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeEndpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(endpointsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EndpointsList{}) return err } // Patch applies the patch and returns the patched endpoints. func (c *FakeEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) { emptyResult := &v1.Endpoints{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(endpointsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Endpoints), err } // Apply takes the given apply declarative configuration, applies it and returns the applied endpoints. func (c *FakeEndpoints) Apply(ctx context.Context, endpoints *corev1.EndpointsApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Endpoints, err error) { if endpoints == nil { return nil, fmt.Errorf("endpoints provided to Apply must not be nil") } data, err := json.Marshal(endpoints) if err != nil { return nil, err } name := endpoints.Name if name == nil { return nil, fmt.Errorf("endpoints.Name must be provided to Apply") } emptyResult := &v1.Endpoints{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(endpointsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Endpoints), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_event.go000066400000000000000000000126501472614177300265220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeEvents implements EventInterface type FakeEvents struct { Fake *FakeCoreV1 ns string } var eventsResource = v1.SchemeGroupVersion.WithResource("events") var eventsKind = v1.SchemeGroupVersion.WithKind("Event") // Get takes name of the event, and returns the corresponding event object, and an error if there is any. func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { emptyResult := &v1.EventList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.EventList{ListMeta: obj.(*v1.EventList).ListMeta} for _, item := range obj.(*v1.EventList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested events. func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) } // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } // Delete takes name of the event and deletes it. Returns an error if one occurs. func (c *FakeEvents) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(eventsResource, c.ns, name, opts), &v1.Event{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EventList{}) return err } // Patch applies the patch and returns the patched event. func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } // Apply takes the given apply declarative configuration, applies it and returns the applied event. func (c *FakeEvents) Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) { if event == nil { return nil, fmt.Errorf("event provided to Apply must not be nil") } data, err := json.Marshal(event) if err != nil { return nil, err } name := event.Name if name == nil { return nil, fmt.Errorf("event.Name must be provided to Apply") } emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_event_expansion.go000066400000000000000000000063361472614177300306120ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" core "k8s.io/client-go/testing" ) func (c *FakeEvents) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { var action core.CreateActionImpl if c.ns != "" { action = core.NewCreateAction(eventsResource, c.ns, event) } else { action = core.NewCreateAction(eventsResource, event.GetNamespace(), event) } obj, err := c.Fake.Invokes(action, event) if obj == nil { return nil, err } return obj.(*v1.Event), err } // Update replaces an existing event. Returns the copy of the event the server returns, or an error. func (c *FakeEvents) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { var action core.UpdateActionImpl if c.ns != "" { action = core.NewUpdateAction(eventsResource, c.ns, event) } else { action = core.NewUpdateAction(eventsResource, event.GetNamespace(), event) } obj, err := c.Fake.Invokes(action, event) if obj == nil { return nil, err } return obj.(*v1.Event), err } // PatchWithEventNamespace patches an existing event. Returns the copy of the event the server returns, or an error. // TODO: Should take a PatchType as an argument probably. func (c *FakeEvents) PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error) { // TODO: Should be configurable to support additional patch strategies. pt := types.StrategicMergePatchType var action core.PatchActionImpl if c.ns != "" { action = core.NewPatchAction(eventsResource, c.ns, event.Name, pt, data) } else { action = core.NewPatchAction(eventsResource, event.GetNamespace(), event.Name, pt, data) } obj, err := c.Fake.Invokes(action, event) if obj == nil { return nil, err } return obj.(*v1.Event), err } // Search returns a list of events matching the specified object. func (c *FakeEvents) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { var action core.ListActionImpl if c.ns != "" { action = core.NewListAction(eventsResource, eventsKind, c.ns, metav1.ListOptions{}) } else { action = core.NewListAction(eventsResource, eventsKind, v1.NamespaceDefault, metav1.ListOptions{}) } obj, err := c.Fake.Invokes(action, &v1.EventList{}) if obj == nil { return nil, err } return obj.(*v1.EventList), err } func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector { action := core.GenericActionImpl{} action.Verb = "get-field-selector" action.Resource = eventsResource c.Fake.Invokes(action, nil) return fields.Everything() } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_limitrange.go000066400000000000000000000134201472614177300275300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeLimitRanges implements LimitRangeInterface type FakeLimitRanges struct { Fake *FakeCoreV1 ns string } var limitrangesResource = v1.SchemeGroupVersion.WithResource("limitranges") var limitrangesKind = v1.SchemeGroupVersion.WithKind("LimitRange") // Get takes name of the limitRange, and returns the corresponding limitRange object, and an error if there is any. func (c *FakeLimitRanges) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LimitRange, err error) { emptyResult := &v1.LimitRange{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(limitrangesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.LimitRange), err } // List takes label and field selectors, and returns the list of LimitRanges that match those selectors. func (c *FakeLimitRanges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { emptyResult := &v1.LimitRangeList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(limitrangesResource, limitrangesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.LimitRangeList{ListMeta: obj.(*v1.LimitRangeList).ListMeta} for _, item := range obj.(*v1.LimitRangeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested limitRanges. func (c *FakeLimitRanges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(limitrangesResource, c.ns, opts)) } // Create takes the representation of a limitRange and creates it. Returns the server's representation of the limitRange, and an error, if there is any. func (c *FakeLimitRanges) Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (result *v1.LimitRange, err error) { emptyResult := &v1.LimitRange{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(limitrangesResource, c.ns, limitRange, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.LimitRange), err } // Update takes the representation of a limitRange and updates it. Returns the server's representation of the limitRange, and an error, if there is any. func (c *FakeLimitRanges) Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (result *v1.LimitRange, err error) { emptyResult := &v1.LimitRange{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(limitrangesResource, c.ns, limitRange, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.LimitRange), err } // Delete takes name of the limitRange and deletes it. Returns an error if one occurs. func (c *FakeLimitRanges) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(limitrangesResource, c.ns, name, opts), &v1.LimitRange{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(limitrangesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.LimitRangeList{}) return err } // Patch applies the patch and returns the patched limitRange. func (c *FakeLimitRanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error) { emptyResult := &v1.LimitRange{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(limitrangesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.LimitRange), err } // Apply takes the given apply declarative configuration, applies it and returns the applied limitRange. func (c *FakeLimitRanges) Apply(ctx context.Context, limitRange *corev1.LimitRangeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.LimitRange, err error) { if limitRange == nil { return nil, fmt.Errorf("limitRange provided to Apply must not be nil") } data, err := json.Marshal(limitRange) if err != nil { return nil, err } name := limitRange.Name if name == nil { return nil, fmt.Errorf("limitRange.Name must be provided to Apply") } emptyResult := &v1.LimitRange{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(limitrangesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.LimitRange), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_namespace.go000066400000000000000000000154101472614177300273320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeNamespaces implements NamespaceInterface type FakeNamespaces struct { Fake *FakeCoreV1 } var namespacesResource = v1.SchemeGroupVersion.WithResource("namespaces") var namespacesKind = v1.SchemeGroupVersion.WithKind("Namespace") // Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any. func (c *FakeNamespaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(namespacesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Namespace), err } // List takes label and field selectors, and returns the list of Namespaces that match those selectors. func (c *FakeNamespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { emptyResult := &v1.NamespaceList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(namespacesResource, namespacesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.NamespaceList{ListMeta: obj.(*v1.NamespaceList).ListMeta} for _, item := range obj.(*v1.NamespaceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested namespaces. func (c *FakeNamespaces) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(namespacesResource, opts)) } // Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. func (c *FakeNamespaces) Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(namespacesResource, namespace, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Namespace), err } // Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any. func (c *FakeNamespaces) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(namespacesResource, namespace, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Namespace), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeNamespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(namespacesResource, "status", namespace, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Namespace), err } // Delete takes name of the namespace and deletes it. Returns an error if one occurs. func (c *FakeNamespaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(namespacesResource, name, opts), &v1.Namespace{}) return err } // Patch applies the patch and returns the patched namespace. func (c *FakeNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Namespace), err } // Apply takes the given apply declarative configuration, applies it and returns the applied namespace. func (c *FakeNamespaces) Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { if namespace == nil { return nil, fmt.Errorf("namespace provided to Apply must not be nil") } data, err := json.Marshal(namespace) if err != nil { return nil, err } name := namespace.Name if name == nil { return nil, fmt.Errorf("namespace.Name must be provided to Apply") } emptyResult := &v1.Namespace{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Namespace), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeNamespaces) ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { if namespace == nil { return nil, fmt.Errorf("namespace provided to Apply must not be nil") } data, err := json.Marshal(namespace) if err != nil { return nil, err } name := namespace.Name if name == nil { return nil, fmt.Errorf("namespace.Name must be provided to Apply") } emptyResult := &v1.Namespace{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Namespace), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go000066400000000000000000000021421472614177300314140ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" core "k8s.io/client-go/testing" ) func (c *FakeNamespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) { action := core.CreateActionImpl{} action.Verb = "create" action.Resource = namespacesResource action.Subresource = "finalize" action.Object = namespace obj, err := c.Fake.Invokes(action, namespace) if obj == nil { return nil, err } return obj.(*v1.Namespace), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_node.go000066400000000000000000000152271472614177300263310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeNodes implements NodeInterface type FakeNodes struct { Fake *FakeCoreV1 } var nodesResource = v1.SchemeGroupVersion.WithResource("nodes") var nodesKind = v1.SchemeGroupVersion.WithKind("Node") // Get takes name of the node, and returns the corresponding node object, and an error if there is any. func (c *FakeNodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(nodesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Node), err } // List takes label and field selectors, and returns the list of Nodes that match those selectors. func (c *FakeNodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { emptyResult := &v1.NodeList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(nodesResource, nodesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.NodeList{ListMeta: obj.(*v1.NodeList).ListMeta} for _, item := range obj.(*v1.NodeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested nodes. func (c *FakeNodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(nodesResource, opts)) } // Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. func (c *FakeNodes) Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(nodesResource, node, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Node), err } // Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. func (c *FakeNodes) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(nodesResource, node, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Node), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(nodesResource, "status", node, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Node), err } // Delete takes name of the node and deletes it. Returns an error if one occurs. func (c *FakeNodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(nodesResource, name, opts), &v1.Node{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeNodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(nodesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.NodeList{}) return err } // Patch applies the patch and returns the patched node. func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Node), err } // Apply takes the given apply declarative configuration, applies it and returns the applied node. func (c *FakeNodes) Apply(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) { if node == nil { return nil, fmt.Errorf("node provided to Apply must not be nil") } data, err := json.Marshal(node) if err != nil { return nil, err } name := node.Name if name == nil { return nil, fmt.Errorf("node.Name must be provided to Apply") } emptyResult := &v1.Node{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Node), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeNodes) ApplyStatus(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) { if node == nil { return nil, fmt.Errorf("node provided to Apply must not be nil") } data, err := json.Marshal(node) if err != nil { return nil, err } name := node.Name if name == nil { return nil, fmt.Errorf("node.Name must be provided to Apply") } emptyResult := &v1.Node{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Node), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_node_expansion.go000066400000000000000000000022201472614177300304020ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" v1 "k8s.io/api/core/v1" types "k8s.io/apimachinery/pkg/types" core "k8s.io/client-go/testing" ) // TODO: Should take a PatchType as an argument probably. func (c *FakeNodes) PatchStatus(_ context.Context, nodeName string, data []byte) (*v1.Node, error) { // TODO: Should be configurable to support additional patch strategies. pt := types.StrategicMergePatchType obj, err := c.Fake.Invokes( core.NewRootPatchSubresourceAction(nodesResource, nodeName, pt, data, "status"), &v1.Node{}) if obj == nil { return nil, err } return obj.(*v1.Node), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_persistentvolume.go000066400000000000000000000173471472614177300310410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakePersistentVolumes implements PersistentVolumeInterface type FakePersistentVolumes struct { Fake *FakeCoreV1 } var persistentvolumesResource = v1.SchemeGroupVersion.WithResource("persistentvolumes") var persistentvolumesKind = v1.SchemeGroupVersion.WithKind("PersistentVolume") // Get takes name of the persistentVolume, and returns the corresponding persistentVolume object, and an error if there is any. func (c *FakePersistentVolumes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(persistentvolumesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolume), err } // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. func (c *FakePersistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { emptyResult := &v1.PersistentVolumeList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(persistentvolumesResource, persistentvolumesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.PersistentVolumeList{ListMeta: obj.(*v1.PersistentVolumeList).ListMeta} for _, item := range obj.(*v1.PersistentVolumeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested persistentVolumes. func (c *FakePersistentVolumes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(persistentvolumesResource, opts)) } // Create takes the representation of a persistentVolume and creates it. Returns the server's representation of the persistentVolume, and an error, if there is any. func (c *FakePersistentVolumes) Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(persistentvolumesResource, persistentVolume, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolume), err } // Update takes the representation of a persistentVolume and updates it. Returns the server's representation of the persistentVolume, and an error, if there is any. func (c *FakePersistentVolumes) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(persistentvolumesResource, persistentVolume, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolume), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePersistentVolumes) UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(persistentvolumesResource, "status", persistentVolume, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolume), err } // Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs. func (c *FakePersistentVolumes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(persistentvolumesResource, name, opts), &v1.PersistentVolume{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePersistentVolumes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(persistentvolumesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PersistentVolumeList{}) return err } // Patch applies the patch and returns the patched persistentVolume. func (c *FakePersistentVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolume), err } // Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolume. func (c *FakePersistentVolumes) Apply(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) { if persistentVolume == nil { return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil") } data, err := json.Marshal(persistentVolume) if err != nil { return nil, err } name := persistentVolume.Name if name == nil { return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") } emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolume), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePersistentVolumes) ApplyStatus(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) { if persistentVolume == nil { return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil") } data, err := json.Marshal(persistentVolume) if err != nil { return nil, err } name := persistentVolume.Name if name == nil { return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") } emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolume), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go000066400000000000000000000203401472614177300320320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakePersistentVolumeClaims implements PersistentVolumeClaimInterface type FakePersistentVolumeClaims struct { Fake *FakeCoreV1 ns string } var persistentvolumeclaimsResource = v1.SchemeGroupVersion.WithResource("persistentvolumeclaims") var persistentvolumeclaimsKind = v1.SchemeGroupVersion.WithKind("PersistentVolumeClaim") // Get takes name of the persistentVolumeClaim, and returns the corresponding persistentVolumeClaim object, and an error if there is any. func (c *FakePersistentVolumeClaims) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(persistentvolumeclaimsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. func (c *FakePersistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { emptyResult := &v1.PersistentVolumeClaimList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(persistentvolumeclaimsResource, persistentvolumeclaimsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.PersistentVolumeClaimList{ListMeta: obj.(*v1.PersistentVolumeClaimList).ListMeta} for _, item := range obj.(*v1.PersistentVolumeClaimList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested persistentVolumeClaims. func (c *FakePersistentVolumeClaims) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(persistentvolumeclaimsResource, c.ns, opts)) } // Create takes the representation of a persistentVolumeClaim and creates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. func (c *FakePersistentVolumeClaims) Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } // Update takes the representation of a persistentVolumeClaim and updates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. func (c *FakePersistentVolumeClaims) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePersistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(persistentvolumeclaimsResource, "status", c.ns, persistentVolumeClaim, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } // Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs. func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(persistentvolumeclaimsResource, c.ns, name, opts), &v1.PersistentVolumeClaim{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(persistentvolumeclaimsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PersistentVolumeClaimList{}) return err } // Patch applies the patch and returns the patched persistentVolumeClaim. func (c *FakePersistentVolumeClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } // Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolumeClaim. func (c *FakePersistentVolumeClaims) Apply(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) { if persistentVolumeClaim == nil { return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil") } data, err := json.Marshal(persistentVolumeClaim) if err != nil { return nil, err } name := persistentVolumeClaim.Name if name == nil { return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") } emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePersistentVolumeClaims) ApplyStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) { if persistentVolumeClaim == nil { return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil") } data, err := json.Marshal(persistentVolumeClaim) if err != nil { return nil, err } name := persistentVolumeClaim.Name if name == nil { return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") } emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_pod.go000066400000000000000000000162241472614177300261640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakePods implements PodInterface type FakePods struct { Fake *FakeCoreV1 ns string } var podsResource = v1.SchemeGroupVersion.WithResource("pods") var podsKind = v1.SchemeGroupVersion.WithKind("Pod") // Get takes name of the pod, and returns the corresponding pod object, and an error if there is any. func (c *FakePods) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(podsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Pod), err } // List takes label and field selectors, and returns the list of Pods that match those selectors. func (c *FakePods) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { emptyResult := &v1.PodList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(podsResource, podsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.PodList{ListMeta: obj.(*v1.PodList).ListMeta} for _, item := range obj.(*v1.PodList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested pods. func (c *FakePods) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(podsResource, c.ns, opts)) } // Create takes the representation of a pod and creates it. Returns the server's representation of the pod, and an error, if there is any. func (c *FakePods) Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(podsResource, c.ns, pod, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Pod), err } // Update takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. func (c *FakePods) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(podsResource, c.ns, pod, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Pod), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePods) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(podsResource, "status", c.ns, pod, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Pod), err } // Delete takes name of the pod and deletes it. Returns an error if one occurs. func (c *FakePods) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(podsResource, c.ns, name, opts), &v1.Pod{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePods) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(podsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PodList{}) return err } // Patch applies the patch and returns the patched pod. func (c *FakePods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Pod), err } // Apply takes the given apply declarative configuration, applies it and returns the applied pod. func (c *FakePods) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) { if pod == nil { return nil, fmt.Errorf("pod provided to Apply must not be nil") } data, err := json.Marshal(pod) if err != nil { return nil, err } name := pod.Name if name == nil { return nil, fmt.Errorf("pod.Name must be provided to Apply") } emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Pod), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) { if pod == nil { return nil, fmt.Errorf("pod provided to Apply must not be nil") } data, err := json.Marshal(pod) if err != nil { return nil, err } name := pod.Name if name == nil { return nil, fmt.Errorf("pod.Name must be provided to Apply") } emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Pod), err } // UpdateEphemeralContainers takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(podsResource, "ephemeralcontainers", c.ns, pod, opts), &v1.Pod{}) if obj == nil { return emptyResult, err } return obj.(*v1.Pod), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_pod_expansion.go000066400000000000000000000064261472614177300302530ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" "fmt" "io" "net/http" "strings" v1 "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" restclient "k8s.io/client-go/rest" fakerest "k8s.io/client-go/rest/fake" core "k8s.io/client-go/testing" ) func (c *FakePods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error { action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = binding.Namespace action.Resource = podsResource action.Subresource = "binding" action.Object = binding _, err := c.Fake.Invokes(action, binding) return err } func (c *FakePods) GetBinding(name string) (result *v1.Binding, err error) { obj, err := c.Fake. Invokes(core.NewGetSubresourceAction(podsResource, c.ns, "binding", name), &v1.Binding{}) if obj == nil { return nil, err } return obj.(*v1.Binding), err } func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request { action := core.GenericActionImpl{} action.Verb = "get" action.Namespace = c.ns action.Resource = podsResource action.Subresource = "log" action.Value = opts _, _ = c.Fake.Invokes(action, &v1.Pod{}) fakeClient := &fakerest.RESTClient{ Client: fakerest.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader("fake logs")), } return resp, nil }), NegotiatedSerializer: scheme.Codecs.WithoutConversion(), GroupVersion: podsKind.GroupVersion(), VersionedAPIPath: fmt.Sprintf("/api/v1/namespaces/%s/pods/%s/log", c.ns, name), } return fakeClient.Request() } func (c *FakePods) Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error { return c.EvictV1beta1(ctx, eviction) } func (c *FakePods) EvictV1(ctx context.Context, eviction *policyv1.Eviction) error { action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = c.ns action.Resource = podsResource action.Subresource = "eviction" action.Object = eviction _, err := c.Fake.Invokes(action, eviction) return err } func (c *FakePods) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error { action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = c.ns action.Resource = podsResource action.Subresource = "eviction" action.Object = eviction _, err := c.Fake.Invokes(action, eviction) return err } func (c *FakePods) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { return c.Fake.InvokesProxy(core.NewProxyGetAction(podsResource, c.ns, scheme, name, port, path, params)) } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_pod_expansion_test.go000066400000000000000000000022671472614177300313110ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "bytes" "context" "io" "testing" corev1 "k8s.io/api/core/v1" cgtesting "k8s.io/client-go/testing" ) func TestFakePodsGetLogs(t *testing.T) { fp := FakePods{ Fake: &FakeCoreV1{Fake: &cgtesting.Fake{}}, ns: "default", } req := fp.GetLogs("foo", &corev1.PodLogOptions{}) body, err := req.Stream(context.Background()) if err != nil { t.Fatal("Stream pod logs:", err) } var buf bytes.Buffer n, err := io.Copy(&buf, body) if err != nil { t.Fatal("Read pod logs:", err) } if n == 0 { t.Fatal("Empty log") } err = body.Close() if err != nil { t.Fatal("Close response body:", err) } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_podtemplate.go000066400000000000000000000135301472614177300277150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakePodTemplates implements PodTemplateInterface type FakePodTemplates struct { Fake *FakeCoreV1 ns string } var podtemplatesResource = v1.SchemeGroupVersion.WithResource("podtemplates") var podtemplatesKind = v1.SchemeGroupVersion.WithKind("PodTemplate") // Get takes name of the podTemplate, and returns the corresponding podTemplate object, and an error if there is any. func (c *FakePodTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodTemplate, err error) { emptyResult := &v1.PodTemplate{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(podtemplatesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodTemplate), err } // List takes label and field selectors, and returns the list of PodTemplates that match those selectors. func (c *FakePodTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { emptyResult := &v1.PodTemplateList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(podtemplatesResource, podtemplatesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.PodTemplateList{ListMeta: obj.(*v1.PodTemplateList).ListMeta} for _, item := range obj.(*v1.PodTemplateList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested podTemplates. func (c *FakePodTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(podtemplatesResource, c.ns, opts)) } // Create takes the representation of a podTemplate and creates it. Returns the server's representation of the podTemplate, and an error, if there is any. func (c *FakePodTemplates) Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (result *v1.PodTemplate, err error) { emptyResult := &v1.PodTemplate{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(podtemplatesResource, c.ns, podTemplate, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodTemplate), err } // Update takes the representation of a podTemplate and updates it. Returns the server's representation of the podTemplate, and an error, if there is any. func (c *FakePodTemplates) Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (result *v1.PodTemplate, err error) { emptyResult := &v1.PodTemplate{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(podtemplatesResource, c.ns, podTemplate, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodTemplate), err } // Delete takes name of the podTemplate and deletes it. Returns an error if one occurs. func (c *FakePodTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(podtemplatesResource, c.ns, name, opts), &v1.PodTemplate{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePodTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(podtemplatesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PodTemplateList{}) return err } // Patch applies the patch and returns the patched podTemplate. func (c *FakePodTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error) { emptyResult := &v1.PodTemplate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodTemplate), err } // Apply takes the given apply declarative configuration, applies it and returns the applied podTemplate. func (c *FakePodTemplates) Apply(ctx context.Context, podTemplate *corev1.PodTemplateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodTemplate, err error) { if podTemplate == nil { return nil, fmt.Errorf("podTemplate provided to Apply must not be nil") } data, err := json.Marshal(podTemplate) if err != nil { return nil, err } name := podTemplate.Name if name == nil { return nil, fmt.Errorf("podTemplate.Name must be provided to Apply") } emptyResult := &v1.PodTemplate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodTemplate), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go000066400000000000000000000227421472614177300320210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" autoscalingv1 "k8s.io/api/autoscaling/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeReplicationControllers implements ReplicationControllerInterface type FakeReplicationControllers struct { Fake *FakeCoreV1 ns string } var replicationcontrollersResource = v1.SchemeGroupVersion.WithResource("replicationcontrollers") var replicationcontrollersKind = v1.SchemeGroupVersion.WithKind("ReplicationController") // Get takes name of the replicationController, and returns the corresponding replicationController object, and an error if there is any. func (c *FakeReplicationControllers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(replicationcontrollersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicationController), err } // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. func (c *FakeReplicationControllers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { emptyResult := &v1.ReplicationControllerList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(replicationcontrollersResource, replicationcontrollersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ReplicationControllerList{ListMeta: obj.(*v1.ReplicationControllerList).ListMeta} for _, item := range obj.(*v1.ReplicationControllerList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested replicationControllers. func (c *FakeReplicationControllers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(replicationcontrollersResource, c.ns, opts)) } // Create takes the representation of a replicationController and creates it. Returns the server's representation of the replicationController, and an error, if there is any. func (c *FakeReplicationControllers) Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(replicationcontrollersResource, c.ns, replicationController, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicationController), err } // Update takes the representation of a replicationController and updates it. Returns the server's representation of the replicationController, and an error, if there is any. func (c *FakeReplicationControllers) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(replicationcontrollersResource, c.ns, replicationController, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicationController), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeReplicationControllers) UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(replicationcontrollersResource, "status", c.ns, replicationController, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicationController), err } // Delete takes name of the replicationController and deletes it. Returns an error if one occurs. func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(replicationcontrollersResource, c.ns, name, opts), &v1.ReplicationController{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(replicationcontrollersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ReplicationControllerList{}) return err } // Patch applies the patch and returns the patched replicationController. func (c *FakeReplicationControllers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicationController), err } // Apply takes the given apply declarative configuration, applies it and returns the applied replicationController. func (c *FakeReplicationControllers) Apply(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) { if replicationController == nil { return nil, fmt.Errorf("replicationController provided to Apply must not be nil") } data, err := json.Marshal(replicationController) if err != nil { return nil, err } name := replicationController.Name if name == nil { return nil, fmt.Errorf("replicationController.Name must be provided to Apply") } emptyResult := &v1.ReplicationController{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicationController), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeReplicationControllers) ApplyStatus(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) { if replicationController == nil { return nil, fmt.Errorf("replicationController provided to Apply must not be nil") } data, err := json.Marshal(replicationController) if err != nil { return nil, err } name := replicationController.Name if name == nil { return nil, fmt.Errorf("replicationController.Name must be provided to Apply") } emptyResult := &v1.ReplicationController{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ReplicationController), err } // GetScale takes name of the replicationController, and returns the corresponding scale object, and an error if there is any. func (c *FakeReplicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewGetSubresourceActionWithOptions(replicationcontrollersResource, c.ns, "scale", replicationControllerName, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeReplicationControllers) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(replicationcontrollersResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err } return obj.(*autoscalingv1.Scale), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_resourcequota.go000066400000000000000000000170001472614177300302740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeResourceQuotas implements ResourceQuotaInterface type FakeResourceQuotas struct { Fake *FakeCoreV1 ns string } var resourcequotasResource = v1.SchemeGroupVersion.WithResource("resourcequotas") var resourcequotasKind = v1.SchemeGroupVersion.WithKind("ResourceQuota") // Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any. func (c *FakeResourceQuotas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourcequotasResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ResourceQuota), err } // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. func (c *FakeResourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { emptyResult := &v1.ResourceQuotaList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourcequotasResource, resourcequotasKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ResourceQuotaList{ListMeta: obj.(*v1.ResourceQuotaList).ListMeta} for _, item := range obj.(*v1.ResourceQuotaList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested resourceQuotas. func (c *FakeResourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(resourcequotasResource, c.ns, opts)) } // Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any. func (c *FakeResourceQuotas) Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourcequotasResource, c.ns, resourceQuota, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ResourceQuota), err } // Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any. func (c *FakeResourceQuotas) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourcequotasResource, c.ns, resourceQuota, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ResourceQuota), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(resourcequotasResource, "status", c.ns, resourceQuota, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ResourceQuota), err } // Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(resourcequotasResource, c.ns, name, opts), &v1.ResourceQuota{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourcequotasResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ResourceQuotaList{}) return err } // Patch applies the patch and returns the patched resourceQuota. func (c *FakeResourceQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ResourceQuota), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceQuota. func (c *FakeResourceQuotas) Apply(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) { if resourceQuota == nil { return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil") } data, err := json.Marshal(resourceQuota) if err != nil { return nil, err } name := resourceQuota.Name if name == nil { return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") } emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ResourceQuota), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeResourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) { if resourceQuota == nil { return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil") } data, err := json.Marshal(resourceQuota) if err != nil { return nil, err } name := resourceQuota.Name if name == nil { return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") } emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ResourceQuota), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_secret.go000066400000000000000000000127601472614177300266700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeSecrets implements SecretInterface type FakeSecrets struct { Fake *FakeCoreV1 ns string } var secretsResource = v1.SchemeGroupVersion.WithResource("secrets") var secretsKind = v1.SchemeGroupVersion.WithKind("Secret") // Get takes name of the secret, and returns the corresponding secret object, and an error if there is any. func (c *FakeSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Secret, err error) { emptyResult := &v1.Secret{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(secretsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Secret), err } // List takes label and field selectors, and returns the list of Secrets that match those selectors. func (c *FakeSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { emptyResult := &v1.SecretList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(secretsResource, secretsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.SecretList{ListMeta: obj.(*v1.SecretList).ListMeta} for _, item := range obj.(*v1.SecretList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested secrets. func (c *FakeSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(secretsResource, c.ns, opts)) } // Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any. func (c *FakeSecrets) Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (result *v1.Secret, err error) { emptyResult := &v1.Secret{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(secretsResource, c.ns, secret, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Secret), err } // Update takes the representation of a secret and updates it. Returns the server's representation of the secret, and an error, if there is any. func (c *FakeSecrets) Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (result *v1.Secret, err error) { emptyResult := &v1.Secret{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(secretsResource, c.ns, secret, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Secret), err } // Delete takes name of the secret and deletes it. Returns an error if one occurs. func (c *FakeSecrets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(secretsResource, c.ns, name, opts), &v1.Secret{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(secretsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SecretList{}) return err } // Patch applies the patch and returns the patched secret. func (c *FakeSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) { emptyResult := &v1.Secret{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(secretsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Secret), err } // Apply takes the given apply declarative configuration, applies it and returns the applied secret. func (c *FakeSecrets) Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error) { if secret == nil { return nil, fmt.Errorf("secret provided to Apply must not be nil") } data, err := json.Marshal(secret) if err != nil { return nil, err } name := secret.Name if name == nil { return nil, fmt.Errorf("secret.Name must be provided to Apply") } emptyResult := &v1.Secret{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(secretsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Secret), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_service.go000066400000000000000000000152011472614177300270340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeServices implements ServiceInterface type FakeServices struct { Fake *FakeCoreV1 ns string } var servicesResource = v1.SchemeGroupVersion.WithResource("services") var servicesKind = v1.SchemeGroupVersion.WithKind("Service") // Get takes name of the service, and returns the corresponding service object, and an error if there is any. func (c *FakeServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(servicesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Service), err } // List takes label and field selectors, and returns the list of Services that match those selectors. func (c *FakeServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { emptyResult := &v1.ServiceList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(servicesResource, servicesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ServiceList{ListMeta: obj.(*v1.ServiceList).ListMeta} for _, item := range obj.(*v1.ServiceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested services. func (c *FakeServices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(servicesResource, c.ns, opts)) } // Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. func (c *FakeServices) Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(servicesResource, c.ns, service, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Service), err } // Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. func (c *FakeServices) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(servicesResource, c.ns, service, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Service), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeServices) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(servicesResource, "status", c.ns, service, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Service), err } // Delete takes name of the service and deletes it. Returns an error if one occurs. func (c *FakeServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(servicesResource, c.ns, name, opts), &v1.Service{}) return err } // Patch applies the patch and returns the patched service. func (c *FakeServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Service), err } // Apply takes the given apply declarative configuration, applies it and returns the applied service. func (c *FakeServices) Apply(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) { if service == nil { return nil, fmt.Errorf("service provided to Apply must not be nil") } data, err := json.Marshal(service) if err != nil { return nil, err } name := service.Name if name == nil { return nil, fmt.Errorf("service.Name must be provided to Apply") } emptyResult := &v1.Service{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Service), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeServices) ApplyStatus(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) { if service == nil { return nil, fmt.Errorf("service provided to Apply must not be nil") } data, err := json.Marshal(service) if err != nil { return nil, err } name := service.Name if name == nil { return nil, fmt.Errorf("service.Name must be provided to Apply") } emptyResult := &v1.Service{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Service), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_service_expansion.go000066400000000000000000000016021472614177300311200ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( restclient "k8s.io/client-go/rest" core "k8s.io/client-go/testing" ) func (c *FakeServices) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { return c.Fake.InvokesProxy(core.NewProxyGetAction(servicesResource, c.ns, scheme, name, port, path, params)) } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/fake/fake_serviceaccount.go000066400000000000000000000154331472614177300304200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" authenticationv1 "k8s.io/api/authentication/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" testing "k8s.io/client-go/testing" ) // FakeServiceAccounts implements ServiceAccountInterface type FakeServiceAccounts struct { Fake *FakeCoreV1 ns string } var serviceaccountsResource = v1.SchemeGroupVersion.WithResource("serviceaccounts") var serviceaccountsKind = v1.SchemeGroupVersion.WithKind("ServiceAccount") // Get takes name of the serviceAccount, and returns the corresponding serviceAccount object, and an error if there is any. func (c *FakeServiceAccounts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceAccount, err error) { emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(serviceaccountsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ServiceAccount), err } // List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. func (c *FakeServiceAccounts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { emptyResult := &v1.ServiceAccountList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(serviceaccountsResource, serviceaccountsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ServiceAccountList{ListMeta: obj.(*v1.ServiceAccountList).ListMeta} for _, item := range obj.(*v1.ServiceAccountList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested serviceAccounts. func (c *FakeServiceAccounts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(serviceaccountsResource, c.ns, opts)) } // Create takes the representation of a serviceAccount and creates it. Returns the server's representation of the serviceAccount, and an error, if there is any. func (c *FakeServiceAccounts) Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (result *v1.ServiceAccount, err error) { emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(serviceaccountsResource, c.ns, serviceAccount, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ServiceAccount), err } // Update takes the representation of a serviceAccount and updates it. Returns the server's representation of the serviceAccount, and an error, if there is any. func (c *FakeServiceAccounts) Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (result *v1.ServiceAccount, err error) { emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(serviceaccountsResource, c.ns, serviceAccount, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ServiceAccount), err } // Delete takes name of the serviceAccount and deletes it. Returns an error if one occurs. func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(serviceaccountsResource, c.ns, name, opts), &v1.ServiceAccount{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(serviceaccountsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ServiceAccountList{}) return err } // Patch applies the patch and returns the patched serviceAccount. func (c *FakeServiceAccounts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error) { emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(serviceaccountsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ServiceAccount), err } // Apply takes the given apply declarative configuration, applies it and returns the applied serviceAccount. func (c *FakeServiceAccounts) Apply(ctx context.Context, serviceAccount *corev1.ServiceAccountApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceAccount, err error) { if serviceAccount == nil { return nil, fmt.Errorf("serviceAccount provided to Apply must not be nil") } data, err := json.Marshal(serviceAccount) if err != nil { return nil, err } name := serviceAccount.Name if name == nil { return nil, fmt.Errorf("serviceAccount.Name must be provided to Apply") } emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(serviceaccountsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ServiceAccount), err } // CreateToken takes the representation of a tokenRequest and creates it. Returns the server's representation of the tokenRequest, and an error, if there is any. func (c *FakeServiceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) { emptyResult := &authenticationv1.TokenRequest{} obj, err := c.Fake. Invokes(testing.NewCreateSubresourceActionWithOptions(serviceaccountsResource, serviceAccountName, "token", c.ns, tokenRequest, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*authenticationv1.TokenRequest), err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/generated_expansion.go000066400000000000000000000020651472614177300275260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type ComponentStatusExpansion interface{} type ConfigMapExpansion interface{} type EndpointsExpansion interface{} type LimitRangeExpansion interface{} type PersistentVolumeExpansion interface{} type PersistentVolumeClaimExpansion interface{} type PodTemplateExpansion interface{} type ReplicationControllerExpansion interface{} type ResourceQuotaExpansion interface{} type SecretExpansion interface{} type ServiceAccountExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/limitrange.go000066400000000000000000000054171472614177300256430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // LimitRangesGetter has a method to return a LimitRangeInterface. // A group's client should implement this interface. type LimitRangesGetter interface { LimitRanges(namespace string) LimitRangeInterface } // LimitRangeInterface has methods to work with LimitRange resources. type LimitRangeInterface interface { Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (*v1.LimitRange, error) Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (*v1.LimitRange, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LimitRange, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.LimitRangeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error) Apply(ctx context.Context, limitRange *corev1.LimitRangeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.LimitRange, err error) LimitRangeExpansion } // limitRanges implements LimitRangeInterface type limitRanges struct { *gentype.ClientWithListAndApply[*v1.LimitRange, *v1.LimitRangeList, *corev1.LimitRangeApplyConfiguration] } // newLimitRanges returns a LimitRanges func newLimitRanges(c *CoreV1Client, namespace string) *limitRanges { return &limitRanges{ gentype.NewClientWithListAndApply[*v1.LimitRange, *v1.LimitRangeList, *corev1.LimitRangeApplyConfiguration]( "limitranges", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.LimitRange { return &v1.LimitRange{} }, func() *v1.LimitRangeList { return &v1.LimitRangeList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/namespace.go000066400000000000000000000060051472614177300254360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // NamespacesGetter has a method to return a NamespaceInterface. // A group's client should implement this interface. type NamespacesGetter interface { Namespaces() NamespaceInterface } // NamespaceInterface has methods to work with Namespace resources. type NamespaceInterface interface { Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (*v1.Namespace, error) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Namespace, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) NamespaceExpansion } // namespaces implements NamespaceInterface type namespaces struct { *gentype.ClientWithListAndApply[*v1.Namespace, *v1.NamespaceList, *corev1.NamespaceApplyConfiguration] } // newNamespaces returns a Namespaces func newNamespaces(c *CoreV1Client) *namespaces { return &namespaces{ gentype.NewClientWithListAndApply[*v1.Namespace, *v1.NamespaceList, *corev1.NamespaceApplyConfiguration]( "namespaces", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.Namespace { return &v1.Namespace{} }, func() *v1.NamespaceList { return &v1.NamespaceList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/namespace_expansion.go000066400000000000000000000026671472614177300275340ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" scheme "k8s.io/client-go/kubernetes/scheme" ) // The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface. type NamespaceExpansion interface { Finalize(ctx context.Context, item *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) } // Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs. func (c *namespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { result = &v1.Namespace{} err = c.GetClient().Put().Resource("namespaces").Name(namespace.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("finalize").Body(namespace).Do(ctx).Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/node.go000066400000000000000000000056041472614177300244330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // NodesGetter has a method to return a NodeInterface. // A group's client should implement this interface. type NodesGetter interface { Nodes() NodeInterface } // NodeInterface has methods to work with Node resources. type NodeInterface interface { Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (*v1.Node, error) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Node, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) Apply(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) NodeExpansion } // nodes implements NodeInterface type nodes struct { *gentype.ClientWithListAndApply[*v1.Node, *v1.NodeList, *corev1.NodeApplyConfiguration] } // newNodes returns a Nodes func newNodes(c *CoreV1Client) *nodes { return &nodes{ gentype.NewClientWithListAndApply[*v1.Node, *v1.NodeList, *corev1.NodeApplyConfiguration]( "nodes", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.Node { return &v1.Node{} }, func() *v1.NodeList { return &v1.NodeList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/node_expansion.go000066400000000000000000000026361472614177300265210ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "context" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" ) // The NodeExpansion interface allows manually adding extra methods to the NodeInterface. type NodeExpansion interface { // PatchStatus modifies the status of an existing node. It returns the copy // of the node that the server returns, or an error. PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) } // PatchStatus modifies the status of an existing node. It returns the copy of // the node that the server returns, or an error. func (c *nodes) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) { result := &v1.Node{} err := c.GetClient().Patch(types.StrategicMergePatchType). Resource("nodes"). Name(nodeName). SubResource("status"). Body(data). Do(ctx). Into(result) return result, err } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/persistentvolume.go000066400000000000000000000066541472614177300271440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PersistentVolumesGetter has a method to return a PersistentVolumeInterface. // A group's client should implement this interface. type PersistentVolumesGetter interface { PersistentVolumes() PersistentVolumeInterface } // PersistentVolumeInterface has methods to work with PersistentVolume resources. type PersistentVolumeInterface interface { Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (*v1.PersistentVolume, error) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PersistentVolume, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) Apply(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) PersistentVolumeExpansion } // persistentVolumes implements PersistentVolumeInterface type persistentVolumes struct { *gentype.ClientWithListAndApply[*v1.PersistentVolume, *v1.PersistentVolumeList, *corev1.PersistentVolumeApplyConfiguration] } // newPersistentVolumes returns a PersistentVolumes func newPersistentVolumes(c *CoreV1Client) *persistentVolumes { return &persistentVolumes{ gentype.NewClientWithListAndApply[*v1.PersistentVolume, *v1.PersistentVolumeList, *corev1.PersistentVolumeApplyConfiguration]( "persistentvolumes", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.PersistentVolume { return &v1.PersistentVolume{} }, func() *v1.PersistentVolumeList { return &v1.PersistentVolumeList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/persistentvolumeclaim.go000066400000000000000000000072731472614177300301500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface. // A group's client should implement this interface. type PersistentVolumeClaimsGetter interface { PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface } // PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources. type PersistentVolumeClaimInterface interface { Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (*v1.PersistentVolumeClaim, error) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PersistentVolumeClaim, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeClaimList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) Apply(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) PersistentVolumeClaimExpansion } // persistentVolumeClaims implements PersistentVolumeClaimInterface type persistentVolumeClaims struct { *gentype.ClientWithListAndApply[*v1.PersistentVolumeClaim, *v1.PersistentVolumeClaimList, *corev1.PersistentVolumeClaimApplyConfiguration] } // newPersistentVolumeClaims returns a PersistentVolumeClaims func newPersistentVolumeClaims(c *CoreV1Client, namespace string) *persistentVolumeClaims { return &persistentVolumeClaims{ gentype.NewClientWithListAndApply[*v1.PersistentVolumeClaim, *v1.PersistentVolumeClaimList, *corev1.PersistentVolumeClaimApplyConfiguration]( "persistentvolumeclaims", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.PersistentVolumeClaim { return &v1.PersistentVolumeClaim{} }, func() *v1.PersistentVolumeClaimList { return &v1.PersistentVolumeClaimList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/pod.go000066400000000000000000000071021472614177300242630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PodsGetter has a method to return a PodInterface. // A group's client should implement this interface. type PodsGetter interface { Pods(namespace string) PodInterface } // PodInterface has methods to work with Pod resources. type PodInterface interface { Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (*v1.Pod, error) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Pod, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) PodExpansion } // pods implements PodInterface type pods struct { *gentype.ClientWithListAndApply[*v1.Pod, *v1.PodList, *corev1.PodApplyConfiguration] } // newPods returns a Pods func newPods(c *CoreV1Client, namespace string) *pods { return &pods{ gentype.NewClientWithListAndApply[*v1.Pod, *v1.PodList, *corev1.PodApplyConfiguration]( "pods", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Pod { return &v1.Pod{} }, func() *v1.PodList { return &v1.PodList{} }), } } // UpdateEphemeralContainers takes the top resource name and the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { result = &v1.Pod{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("pods"). Name(podName). SubResource("ephemeralcontainers"). VersionedParams(&opts, scheme.ParameterCodec). Body(pod). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/pod_expansion.go000066400000000000000000000075001472614177300263510ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "context" v1 "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/net" "k8s.io/client-go/kubernetes/scheme" restclient "k8s.io/client-go/rest" ) // The PodExpansion interface allows manually adding extra methods to the PodInterface. type PodExpansion interface { Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error // Evict submits a policy/v1beta1 Eviction request to the pod's eviction subresource. // Equivalent to calling EvictV1beta1. // Deprecated: Use EvictV1() (supported in 1.22+) or EvictV1beta1(). Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error // EvictV1 submits a policy/v1 Eviction request to the pod's eviction subresource. // Supported in 1.22+. EvictV1(ctx context.Context, eviction *policyv1.Eviction) error // EvictV1beta1 submits a policy/v1beta1 Eviction request to the pod's eviction subresource. // Supported in 1.22+. EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper } // Bind applies the provided binding to the named pod in the current namespace (binding.Namespace is ignored). func (c *pods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error { return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(binding.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("binding").Body(binding).Do(ctx).Error() } // Evict submits a policy/v1beta1 Eviction request to the pod's eviction subresource. // Equivalent to calling EvictV1beta1. // Deprecated: Use EvictV1() (supported in 1.22+) or EvictV1beta1(). func (c *pods) Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error { return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() } func (c *pods) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error { return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() } func (c *pods) EvictV1(ctx context.Context, eviction *policyv1.Eviction) error { return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() } // Get constructs a request for getting the logs for a pod func (c *pods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request { return c.GetClient().Get().Namespace(c.GetNamespace()).Name(name).Resource("pods").SubResource("log").VersionedParams(opts, scheme.ParameterCodec) } // ProxyGet returns a response of the pod by calling it through the proxy. func (c *pods) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { request := c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("pods"). SubResource("proxy"). Name(net.JoinSchemeNamePort(scheme, name, port)). Suffix(path) for k, v := range params { request = request.Param(k, v) } return request } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/podtemplate.go000066400000000000000000000054671472614177300260330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PodTemplatesGetter has a method to return a PodTemplateInterface. // A group's client should implement this interface. type PodTemplatesGetter interface { PodTemplates(namespace string) PodTemplateInterface } // PodTemplateInterface has methods to work with PodTemplate resources. type PodTemplateInterface interface { Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (*v1.PodTemplate, error) Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (*v1.PodTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PodTemplate, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodTemplateList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error) Apply(ctx context.Context, podTemplate *corev1.PodTemplateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodTemplate, err error) PodTemplateExpansion } // podTemplates implements PodTemplateInterface type podTemplates struct { *gentype.ClientWithListAndApply[*v1.PodTemplate, *v1.PodTemplateList, *corev1.PodTemplateApplyConfiguration] } // newPodTemplates returns a PodTemplates func newPodTemplates(c *CoreV1Client, namespace string) *podTemplates { return &podTemplates{ gentype.NewClientWithListAndApply[*v1.PodTemplate, *v1.PodTemplateList, *corev1.PodTemplateApplyConfiguration]( "podtemplates", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.PodTemplate { return &v1.PodTemplate{} }, func() *v1.PodTemplateList { return &v1.PodTemplateList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/replicationcontroller.go000066400000000000000000000123321472614177300301170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" autoscalingv1 "k8s.io/api/autoscaling/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ReplicationControllersGetter has a method to return a ReplicationControllerInterface. // A group's client should implement this interface. type ReplicationControllersGetter interface { ReplicationControllers(namespace string) ReplicationControllerInterface } // ReplicationControllerInterface has methods to work with ReplicationController resources. type ReplicationControllerInterface interface { Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (*v1.ReplicationController, error) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ReplicationController, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicationControllerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) Apply(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) ReplicationControllerExpansion } // replicationControllers implements ReplicationControllerInterface type replicationControllers struct { *gentype.ClientWithListAndApply[*v1.ReplicationController, *v1.ReplicationControllerList, *corev1.ReplicationControllerApplyConfiguration] } // newReplicationControllers returns a ReplicationControllers func newReplicationControllers(c *CoreV1Client, namespace string) *replicationControllers { return &replicationControllers{ gentype.NewClientWithListAndApply[*v1.ReplicationController, *v1.ReplicationControllerList, *corev1.ReplicationControllerApplyConfiguration]( "replicationcontrollers", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.ReplicationController { return &v1.ReplicationController{} }, func() *v1.ReplicationControllerList { return &v1.ReplicationControllerList{} }), } } // GetScale takes name of the replicationController, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *replicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("replicationcontrollers"). Name(replicationControllerName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *replicationControllers) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("replicationcontrollers"). Name(replicationControllerName). SubResource("scale"). VersionedParams(&opts, scheme.ParameterCodec). Body(scale). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/resourcequota.go000066400000000000000000000065131472614177300264070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ResourceQuotasGetter has a method to return a ResourceQuotaInterface. // A group's client should implement this interface. type ResourceQuotasGetter interface { ResourceQuotas(namespace string) ResourceQuotaInterface } // ResourceQuotaInterface has methods to work with ResourceQuota resources. type ResourceQuotaInterface interface { Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (*v1.ResourceQuota, error) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ResourceQuota, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceQuotaList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) Apply(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) ResourceQuotaExpansion } // resourceQuotas implements ResourceQuotaInterface type resourceQuotas struct { *gentype.ClientWithListAndApply[*v1.ResourceQuota, *v1.ResourceQuotaList, *corev1.ResourceQuotaApplyConfiguration] } // newResourceQuotas returns a ResourceQuotas func newResourceQuotas(c *CoreV1Client, namespace string) *resourceQuotas { return &resourceQuotas{ gentype.NewClientWithListAndApply[*v1.ResourceQuota, *v1.ResourceQuotaList, *corev1.ResourceQuotaApplyConfiguration]( "resourcequotas", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.ResourceQuota { return &v1.ResourceQuota{} }, func() *v1.ResourceQuotaList { return &v1.ResourceQuotaList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/secret.go000066400000000000000000000051571472614177300247760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // SecretsGetter has a method to return a SecretInterface. // A group's client should implement this interface. type SecretsGetter interface { Secrets(namespace string) SecretInterface } // SecretInterface has methods to work with Secret resources. type SecretInterface interface { Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (*v1.Secret, error) Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (*v1.Secret, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Secret, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error) SecretExpansion } // secrets implements SecretInterface type secrets struct { *gentype.ClientWithListAndApply[*v1.Secret, *v1.SecretList, *corev1.SecretApplyConfiguration] } // newSecrets returns a Secrets func newSecrets(c *CoreV1Client, namespace string) *secrets { return &secrets{ gentype.NewClientWithListAndApply[*v1.Secret, *v1.SecretList, *corev1.SecretApplyConfiguration]( "secrets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Secret { return &v1.Secret{} }, func() *v1.SecretList { return &v1.SecretList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/service.go000066400000000000000000000057221472614177300251470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ServicesGetter has a method to return a ServiceInterface. // A group's client should implement this interface. type ServicesGetter interface { Services(namespace string) ServiceInterface } // ServiceInterface has methods to work with Service resources. type ServiceInterface interface { Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (*v1.Service, error) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Service, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) Apply(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) ServiceExpansion } // services implements ServiceInterface type services struct { *gentype.ClientWithListAndApply[*v1.Service, *v1.ServiceList, *corev1.ServiceApplyConfiguration] } // newServices returns a Services func newServices(c *CoreV1Client, namespace string) *services { return &services{ gentype.NewClientWithListAndApply[*v1.Service, *v1.ServiceList, *corev1.ServiceApplyConfiguration]( "services", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Service { return &v1.Service{} }, func() *v1.ServiceList { return &v1.ServiceList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/service_expansion.go000066400000000000000000000025071472614177300272310ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" ) // The ServiceExpansion interface allows manually adding extra methods to the ServiceInterface. type ServiceExpansion interface { ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper } // ProxyGet returns a response of the service by calling it through the proxy. func (c *services) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { request := c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("services"). SubResource("proxy"). Name(net.JoinSchemeNamePort(scheme, name, port)). Suffix(path) for k, v := range params { request = request.Param(k, v) } return request } kubernetes-client-go-a2dfcab/kubernetes/typed/core/v1/serviceaccount.go000066400000000000000000000074521472614177300265260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" authenticationv1 "k8s.io/api/authentication/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ServiceAccountsGetter has a method to return a ServiceAccountInterface. // A group's client should implement this interface. type ServiceAccountsGetter interface { ServiceAccounts(namespace string) ServiceAccountInterface } // ServiceAccountInterface has methods to work with ServiceAccount resources. type ServiceAccountInterface interface { Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (*v1.ServiceAccount, error) Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (*v1.ServiceAccount, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceAccount, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceAccountList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error) Apply(ctx context.Context, serviceAccount *corev1.ServiceAccountApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceAccount, err error) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (*authenticationv1.TokenRequest, error) ServiceAccountExpansion } // serviceAccounts implements ServiceAccountInterface type serviceAccounts struct { *gentype.ClientWithListAndApply[*v1.ServiceAccount, *v1.ServiceAccountList, *corev1.ServiceAccountApplyConfiguration] } // newServiceAccounts returns a ServiceAccounts func newServiceAccounts(c *CoreV1Client, namespace string) *serviceAccounts { return &serviceAccounts{ gentype.NewClientWithListAndApply[*v1.ServiceAccount, *v1.ServiceAccountList, *corev1.ServiceAccountApplyConfiguration]( "serviceaccounts", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.ServiceAccount { return &v1.ServiceAccount{} }, func() *v1.ServiceAccountList { return &v1.ServiceAccountList{} }), } } // CreateToken takes the representation of a tokenRequest and creates it. Returns the server's representation of the tokenRequest, and an error, if there is any. func (c *serviceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) { result = &authenticationv1.TokenRequest{} err = c.GetClient().Post(). Namespace(c.GetNamespace()). Resource("serviceaccounts"). Name(serviceAccountName). SubResource("token"). VersionedParams(&opts, scheme.ParameterCodec). Body(tokenRequest). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/000077500000000000000000000000001472614177300237035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/000077500000000000000000000000001472614177300242315ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/discovery_client.go000066400000000000000000000057671472614177300301440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/discovery/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type DiscoveryV1Interface interface { RESTClient() rest.Interface EndpointSlicesGetter } // DiscoveryV1Client is used to interact with features provided by the discovery.k8s.io group. type DiscoveryV1Client struct { restClient rest.Interface } func (c *DiscoveryV1Client) EndpointSlices(namespace string) EndpointSliceInterface { return newEndpointSlices(c, namespace) } // NewForConfig creates a new DiscoveryV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*DiscoveryV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new DiscoveryV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*DiscoveryV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &DiscoveryV1Client{client}, nil } // NewForConfigOrDie creates a new DiscoveryV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *DiscoveryV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new DiscoveryV1Client for the given RESTClient. func New(c rest.Interface) *DiscoveryV1Client { return &DiscoveryV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *DiscoveryV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/doc.go000066400000000000000000000012571472614177300253320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/endpointslice.go000066400000000000000000000056521472614177300274300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" discoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // EndpointSlicesGetter has a method to return a EndpointSliceInterface. // A group's client should implement this interface. type EndpointSlicesGetter interface { EndpointSlices(namespace string) EndpointSliceInterface } // EndpointSliceInterface has methods to work with EndpointSlice resources. type EndpointSliceInterface interface { Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (*v1.EndpointSlice, error) Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (*v1.EndpointSlice, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.EndpointSlice, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointSliceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) Apply(ctx context.Context, endpointSlice *discoveryv1.EndpointSliceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.EndpointSlice, err error) EndpointSliceExpansion } // endpointSlices implements EndpointSliceInterface type endpointSlices struct { *gentype.ClientWithListAndApply[*v1.EndpointSlice, *v1.EndpointSliceList, *discoveryv1.EndpointSliceApplyConfiguration] } // newEndpointSlices returns a EndpointSlices func newEndpointSlices(c *DiscoveryV1Client, namespace string) *endpointSlices { return &endpointSlices{ gentype.NewClientWithListAndApply[*v1.EndpointSlice, *v1.EndpointSliceList, *discoveryv1.EndpointSliceApplyConfiguration]( "endpointslices", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.EndpointSlice { return &v1.EndpointSlice{} }, func() *v1.EndpointSliceList { return &v1.EndpointSliceList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/fake/000077500000000000000000000000001472614177300251375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/fake/doc.go000066400000000000000000000012531472614177300262340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/fake/fake_discovery_client.go000066400000000000000000000021731472614177300320240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/discovery/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeDiscoveryV1 struct { *testing.Fake } func (c *FakeDiscoveryV1) EndpointSlices(namespace string) v1.EndpointSliceInterface { return &FakeEndpointSlices{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeDiscoveryV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go000066400000000000000000000140011472614177300313100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" discoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1" testing "k8s.io/client-go/testing" ) // FakeEndpointSlices implements EndpointSliceInterface type FakeEndpointSlices struct { Fake *FakeDiscoveryV1 ns string } var endpointslicesResource = v1.SchemeGroupVersion.WithResource("endpointslices") var endpointslicesKind = v1.SchemeGroupVersion.WithKind("EndpointSlice") // Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EndpointSlice, err error) { emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(endpointslicesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.EndpointSlice), err } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. func (c *FakeEndpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { emptyResult := &v1.EndpointSliceList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.EndpointSliceList{ListMeta: obj.(*v1.EndpointSliceList).ListMeta} for _, item := range obj.(*v1.EndpointSliceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested endpointSlices. func (c *FakeEndpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(endpointslicesResource, c.ns, opts)) } // Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (result *v1.EndpointSlice, err error) { emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.EndpointSlice), err } // Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (result *v1.EndpointSlice, err error) { emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.EndpointSlice), err } // Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(endpointslicesResource, c.ns, name, opts), &v1.EndpointSlice{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(endpointslicesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EndpointSliceList{}) return err } // Patch applies the patch and returns the patched endpointSlice. func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) { emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.EndpointSlice), err } // Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice. func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1.EndpointSliceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.EndpointSlice, err error) { if endpointSlice == nil { return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil") } data, err := json.Marshal(endpointSlice) if err != nil { return nil, err } name := endpointSlice.Name if name == nil { return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply") } emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.EndpointSlice), err } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1/generated_expansion.go000066400000000000000000000012311472614177300305770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type EndpointSliceExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/000077500000000000000000000000001472614177300251465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/discovery_client.go000066400000000000000000000061261472614177300310470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/discovery/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type DiscoveryV1beta1Interface interface { RESTClient() rest.Interface EndpointSlicesGetter } // DiscoveryV1beta1Client is used to interact with features provided by the discovery.k8s.io group. type DiscoveryV1beta1Client struct { restClient rest.Interface } func (c *DiscoveryV1beta1Client) EndpointSlices(namespace string) EndpointSliceInterface { return newEndpointSlices(c, namespace) } // NewForConfig creates a new DiscoveryV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*DiscoveryV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new DiscoveryV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*DiscoveryV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &DiscoveryV1beta1Client{client}, nil } // NewForConfigOrDie creates a new DiscoveryV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *DiscoveryV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new DiscoveryV1beta1Client for the given RESTClient. func New(c rest.Interface) *DiscoveryV1beta1Client { return &DiscoveryV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *DiscoveryV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/doc.go000066400000000000000000000012641472614177300262450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/endpointslice.go000066400000000000000000000057731472614177300303510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/discovery/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" discoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // EndpointSlicesGetter has a method to return a EndpointSliceInterface. // A group's client should implement this interface. type EndpointSlicesGetter interface { EndpointSlices(namespace string) EndpointSliceInterface } // EndpointSliceInterface has methods to work with EndpointSlice resources. type EndpointSliceInterface interface { Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (*v1beta1.EndpointSlice, error) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (*v1beta1.EndpointSlice, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.EndpointSlice, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error) EndpointSliceExpansion } // endpointSlices implements EndpointSliceInterface type endpointSlices struct { *gentype.ClientWithListAndApply[*v1beta1.EndpointSlice, *v1beta1.EndpointSliceList, *discoveryv1beta1.EndpointSliceApplyConfiguration] } // newEndpointSlices returns a EndpointSlices func newEndpointSlices(c *DiscoveryV1beta1Client, namespace string) *endpointSlices { return &endpointSlices{ gentype.NewClientWithListAndApply[*v1beta1.EndpointSlice, *v1beta1.EndpointSliceList, *discoveryv1beta1.EndpointSliceApplyConfiguration]( "endpointslices", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.EndpointSlice { return &v1beta1.EndpointSlice{} }, func() *v1beta1.EndpointSliceList { return &v1beta1.EndpointSliceList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/fake/000077500000000000000000000000001472614177300260545ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/fake/doc.go000066400000000000000000000012531472614177300271510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/fake/fake_discovery_client.go000066400000000000000000000022311472614177300327340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeDiscoveryV1beta1 struct { *testing.Fake } func (c *FakeDiscoveryV1beta1) EndpointSlices(namespace string) v1beta1.EndpointSliceInterface { return &FakeEndpointSlices{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeDiscoveryV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go000066400000000000000000000141651472614177300322400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/discovery/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" discoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1" testing "k8s.io/client-go/testing" ) // FakeEndpointSlices implements EndpointSliceInterface type FakeEndpointSlices struct { Fake *FakeDiscoveryV1beta1 ns string } var endpointslicesResource = v1beta1.SchemeGroupVersion.WithResource("endpointslices") var endpointslicesKind = v1beta1.SchemeGroupVersion.WithKind("EndpointSlice") // Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(endpointslicesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { emptyResult := &v1beta1.EndpointSliceList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.EndpointSliceList{ListMeta: obj.(*v1beta1.EndpointSliceList).ListMeta} for _, item := range obj.(*v1beta1.EndpointSliceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested endpointSlices. func (c *FakeEndpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(endpointslicesResource, c.ns, opts)) } // Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (result *v1beta1.EndpointSlice, err error) { emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } // Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (result *v1beta1.EndpointSlice, err error) { emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } // Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(endpointslicesResource, c.ns, name, opts), &v1beta1.EndpointSlice{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(endpointslicesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.EndpointSliceList{}) return err } // Patch applies the patch and returns the patched endpointSlice. func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) { emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } // Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice. func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error) { if endpointSlice == nil { return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil") } data, err := json.Marshal(endpointSlice) if err != nil { return nil, err } name := endpointSlice.Name if name == nil { return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply") } emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } kubernetes-client-go-a2dfcab/kubernetes/typed/discovery/v1beta1/generated_expansion.go000066400000000000000000000012361472614177300315210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type EndpointSliceExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/events/000077500000000000000000000000001472614177300232005ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/000077500000000000000000000000001472614177300235265ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/doc.go000066400000000000000000000012571472614177300246270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/event.go000066400000000000000000000051251472614177300252010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" eventsv1 "k8s.io/client-go/applyconfigurations/events/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // EventsGetter has a method to return a EventInterface. // A group's client should implement this interface. type EventsGetter interface { Events(namespace string) EventInterface } // EventInterface has methods to work with Event resources. type EventInterface interface { Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (*v1.Event, error) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (*v1.Event, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Event, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) Apply(ctx context.Context, event *eventsv1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) EventExpansion } // events implements EventInterface type events struct { *gentype.ClientWithListAndApply[*v1.Event, *v1.EventList, *eventsv1.EventApplyConfiguration] } // newEvents returns a Events func newEvents(c *EventsV1Client, namespace string) *events { return &events{ gentype.NewClientWithListAndApply[*v1.Event, *v1.EventList, *eventsv1.EventApplyConfiguration]( "events", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Event { return &v1.Event{} }, func() *v1.EventList { return &v1.EventList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/events_client.go000066400000000000000000000056441472614177300267300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/events/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type EventsV1Interface interface { RESTClient() rest.Interface EventsGetter } // EventsV1Client is used to interact with features provided by the events.k8s.io group. type EventsV1Client struct { restClient rest.Interface } func (c *EventsV1Client) Events(namespace string) EventInterface { return newEvents(c, namespace) } // NewForConfig creates a new EventsV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*EventsV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new EventsV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EventsV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &EventsV1Client{client}, nil } // NewForConfigOrDie creates a new EventsV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *EventsV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new EventsV1Client for the given RESTClient. func New(c rest.Interface) *EventsV1Client { return &EventsV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *EventsV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/fake/000077500000000000000000000000001472614177300244345ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/fake/doc.go000066400000000000000000000012531472614177300255310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/fake/fake_event.go000066400000000000000000000126621472614177300271010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" eventsv1 "k8s.io/client-go/applyconfigurations/events/v1" testing "k8s.io/client-go/testing" ) // FakeEvents implements EventInterface type FakeEvents struct { Fake *FakeEventsV1 ns string } var eventsResource = v1.SchemeGroupVersion.WithResource("events") var eventsKind = v1.SchemeGroupVersion.WithKind("Event") // Get takes name of the event, and returns the corresponding event object, and an error if there is any. func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { emptyResult := &v1.EventList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.EventList{ListMeta: obj.(*v1.EventList).ListMeta} for _, item := range obj.(*v1.EventList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested events. func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) } // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } // Delete takes name of the event and deletes it. Returns an error if one occurs. func (c *FakeEvents) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(eventsResource, c.ns, name, opts), &v1.Event{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EventList{}) return err } // Patch applies the patch and returns the patched event. func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } // Apply takes the given apply declarative configuration, applies it and returns the applied event. func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) { if event == nil { return nil, fmt.Errorf("event provided to Apply must not be nil") } data, err := json.Marshal(event) if err != nil { return nil, err } name := event.Name if name == nil { return nil, fmt.Errorf("event.Name must be provided to Apply") } emptyResult := &v1.Event{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Event), err } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/fake/fake_events_client.go000066400000000000000000000021271472614177300306150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/events/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeEventsV1 struct { *testing.Fake } func (c *FakeEventsV1) Events(namespace string) v1.EventInterface { return &FakeEvents{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeEventsV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1/generated_expansion.go000066400000000000000000000012211472614177300300730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type EventExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/000077500000000000000000000000001472614177300244435ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/doc.go000066400000000000000000000012641472614177300255420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/event.go000066400000000000000000000052461472614177300261220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/events/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" eventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // EventsGetter has a method to return a EventInterface. // A group's client should implement this interface. type EventsGetter interface { Events(namespace string) EventInterface } // EventInterface has methods to work with Event resources. type EventInterface interface { Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (*v1beta1.Event, error) Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (*v1beta1.Event, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Event, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EventList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error) Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error) EventExpansion } // events implements EventInterface type events struct { *gentype.ClientWithListAndApply[*v1beta1.Event, *v1beta1.EventList, *eventsv1beta1.EventApplyConfiguration] } // newEvents returns a Events func newEvents(c *EventsV1beta1Client, namespace string) *events { return &events{ gentype.NewClientWithListAndApply[*v1beta1.Event, *v1beta1.EventList, *eventsv1beta1.EventApplyConfiguration]( "events", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.Event { return &v1beta1.Event{} }, func() *v1beta1.EventList { return &v1beta1.EventList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/event_expansion.go000066400000000000000000000077651472614177300302160ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "context" "fmt" "k8s.io/api/events/v1beta1" "k8s.io/apimachinery/pkg/types" ) // The EventExpansion interface allows manually adding extra methods to the EventInterface. // TODO: Add querying functions to the event expansion type EventExpansion interface { // CreateWithEventNamespace is the same as a Create // except that it sends the request to the event.Namespace. CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) // UpdateWithEventNamespace is the same as a Update // except that it sends the request to the event.Namespace. UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) // PatchWithEventNamespace is the same as a Patch // except that it sends the request to the event.Namespace. PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1beta1.Event, error) } // CreateWithEventNamespace makes a new event. // Returns the copy of the event the server returns, or an error. // The namespace to create the event within is deduced from the event. // it must either match this event client's namespace, or this event client must // have been created with the "" namespace. func (e *events) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1beta1.Event{} err := e.GetClient().Post(). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Body(event). Do(context.TODO()). Into(result) return result, err } // UpdateWithEventNamespace modifies an existing event. // It returns the copy of the event that the server returns, or an error. // The namespace and key to update the event within is deduced from the event. // The namespace must either match this event client's namespace, or this event client must have been // created with the "" namespace. // Update also requires the ResourceVersion to be set in the event object. func (e *events) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't update an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1beta1.Event{} err := e.GetClient().Put(). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Name(event.Name). Body(event). Do(context.TODO()). Into(result) return result, err } // PatchWithEventNamespace modifies an existing event. // It returns the copy of the event that the server returns, or an error. // The namespace and name of the target event is deduced from the event. // The namespace must either match this event client's namespace, or this event client must // have been created with the "" namespace. func (e *events) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1beta1.Event, error) { if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1beta1.Event{} err := e.GetClient().Patch(types.StrategicMergePatchType). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Name(event.Name). Body(data). Do(context.TODO()). Into(result) return result, err } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/event_expansion_test.go000066400000000000000000000100041472614177300312310ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "io" "net/http" "strings" "testing" "k8s.io/api/events/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" restfake "k8s.io/client-go/rest/fake" ) func TestCreateWithEventNamespace(t *testing.T) { event := &v1beta1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "default", }, } cli := &restfake.RESTClient{ Client: restfake.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader("{}")), } return resp, nil }), NegotiatedSerializer: scheme.Codecs.WithoutConversion(), } tests := []struct { name string ns string event *v1beta1.Event wantErr bool }{ { name: "create event", ns: "default", event: event, }, { name: "create event with different namespace", ns: "other", event: event, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { e := newEvents(New(cli), tt.ns) _, err := e.CreateWithEventNamespace(tt.event) if (err != nil) != tt.wantErr { t.Errorf("CreateWithEventNamespace() error = %v, wantErr %v", err, tt.wantErr) return } }) } } func TestPatchWithEventNamespace(t *testing.T) { event := &v1beta1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "default", }, } cli := &restfake.RESTClient{ Client: restfake.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader("{}")), } return resp, nil }), NegotiatedSerializer: scheme.Codecs.WithoutConversion(), } tests := []struct { name string ns string event *v1beta1.Event data []byte wantErr bool }{ { name: "patch event", ns: "default", event: event, data: []byte{}, }, { name: "patch event with different namespace", ns: "other", event: event, data: []byte{}, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { e := newEvents(New(cli), tt.ns) _, err := e.PatchWithEventNamespace(tt.event, tt.data) if (err != nil) != tt.wantErr { t.Errorf("PatchWithEventNamespace() error = %v, wantErr %v", err, tt.wantErr) return } }) } } func TestUpdateWithEventNamespace(t *testing.T) { event := &v1beta1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "default", }, } cli := &restfake.RESTClient{ Client: restfake.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader("{}")), } return resp, nil }), NegotiatedSerializer: scheme.Codecs.WithoutConversion(), } tests := []struct { name string ns string event *v1beta1.Event wantErr bool }{ { name: "patch event", ns: "default", event: event, }, { name: "patch event with different namespace", ns: "other", event: event, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { e := newEvents(New(cli), tt.ns) _, err := e.UpdateWithEventNamespace(tt.event) if (err != nil) != tt.wantErr { t.Errorf("UpdateWithEventNamespace() error = %v, wantErr %v", err, tt.wantErr) return } }) } } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/events_client.go000066400000000000000000000060031472614177300276330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/events/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type EventsV1beta1Interface interface { RESTClient() rest.Interface EventsGetter } // EventsV1beta1Client is used to interact with features provided by the events.k8s.io group. type EventsV1beta1Client struct { restClient rest.Interface } func (c *EventsV1beta1Client) Events(namespace string) EventInterface { return newEvents(c, namespace) } // NewForConfig creates a new EventsV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*EventsV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new EventsV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EventsV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &EventsV1beta1Client{client}, nil } // NewForConfigOrDie creates a new EventsV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *EventsV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new EventsV1beta1Client for the given RESTClient. func New(c rest.Interface) *EventsV1beta1Client { return &EventsV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *EventsV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/fake/000077500000000000000000000000001472614177300253515ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/fake/doc.go000066400000000000000000000012531472614177300264460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/fake/fake_event.go000066400000000000000000000130461472614177300300130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/events/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" eventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1" testing "k8s.io/client-go/testing" ) // FakeEvents implements EventInterface type FakeEvents struct { Fake *FakeEventsV1beta1 ns string } var eventsResource = v1beta1.SchemeGroupVersion.WithResource("events") var eventsKind = v1beta1.SchemeGroupVersion.WithKind("Event") // Get takes name of the event, and returns the corresponding event object, and an error if there is any. func (c *FakeEvents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Event, err error) { emptyResult := &v1beta1.Event{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Event), err } // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *FakeEvents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { emptyResult := &v1beta1.EventList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.EventList{ListMeta: obj.(*v1beta1.EventList).ListMeta} for _, item := range obj.(*v1beta1.EventList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested events. func (c *FakeEvents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) } // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (result *v1beta1.Event, err error) { emptyResult := &v1beta1.Event{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Event), err } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (result *v1beta1.Event, err error) { emptyResult := &v1beta1.Event{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Event), err } // Delete takes name of the event and deletes it. Returns an error if one occurs. func (c *FakeEvents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(eventsResource, c.ns, name, opts), &v1beta1.Event{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeEvents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.EventList{}) return err } // Patch applies the patch and returns the patched event. func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error) { emptyResult := &v1beta1.Event{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Event), err } // Apply takes the given apply declarative configuration, applies it and returns the applied event. func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error) { if event == nil { return nil, fmt.Errorf("event provided to Apply must not be nil") } data, err := json.Marshal(event) if err != nil { return nil, err } name := event.Name if name == nil { return nil, fmt.Errorf("event.Name must be provided to Apply") } emptyResult := &v1beta1.Event{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Event), err } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go000066400000000000000000000042141472614177300320740ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( v1beta1 "k8s.io/api/events/v1beta1" types "k8s.io/apimachinery/pkg/types" core "k8s.io/client-go/testing" ) // CreateWithEventNamespace creats a new event. Returns the copy of the event the server returns, or an error. func (c *FakeEvents) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { action := core.NewRootCreateAction(eventsResource, event) if c.ns != "" { action = core.NewCreateAction(eventsResource, c.ns, event) } obj, err := c.Fake.Invokes(action, event) if obj == nil { return nil, err } return obj.(*v1beta1.Event), err } // UpdateWithEventNamespace replaces an existing event. Returns the copy of the event the server returns, or an error. func (c *FakeEvents) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { action := core.NewRootUpdateAction(eventsResource, event) if c.ns != "" { action = core.NewUpdateAction(eventsResource, c.ns, event) } obj, err := c.Fake.Invokes(action, event) if obj == nil { return nil, err } return obj.(*v1beta1.Event), err } // PatchWithEventNamespace patches an existing event. Returns the copy of the event the server returns, or an error. func (c *FakeEvents) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1beta1.Event, error) { pt := types.StrategicMergePatchType action := core.NewRootPatchAction(eventsResource, event.Name, pt, data) if c.ns != "" { action = core.NewPatchAction(eventsResource, c.ns, event.Name, pt, data) } obj, err := c.Fake.Invokes(action, event) if obj == nil { return nil, err } return obj.(*v1beta1.Event), err } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/fake/fake_events_client.go000066400000000000000000000021651472614177300315340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeEventsV1beta1 struct { *testing.Fake } func (c *FakeEventsV1beta1) Events(namespace string) v1beta1.EventInterface { return &FakeEvents{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeEventsV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/events/v1beta1/generated_expansion.go000066400000000000000000000011651472614177300310170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/000077500000000000000000000000001472614177300240735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/000077500000000000000000000000001472614177300253365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/daemonset.go000066400000000000000000000064401472614177300276500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. // A group's client should implement this interface. type DaemonSetsGetter interface { DaemonSets(namespace string) DaemonSetInterface } // DaemonSetInterface has methods to work with DaemonSet resources. type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (*v1beta1.DaemonSet, error) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.DaemonSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) Apply(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) DaemonSetExpansion } // daemonSets implements DaemonSetInterface type daemonSets struct { *gentype.ClientWithListAndApply[*v1beta1.DaemonSet, *v1beta1.DaemonSetList, *extensionsv1beta1.DaemonSetApplyConfiguration] } // newDaemonSets returns a DaemonSets func newDaemonSets(c *ExtensionsV1beta1Client, namespace string) *daemonSets { return &daemonSets{ gentype.NewClientWithListAndApply[*v1beta1.DaemonSet, *v1beta1.DaemonSetList, *extensionsv1beta1.DaemonSetApplyConfiguration]( "daemonsets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.DaemonSet { return &v1beta1.DaemonSet{} }, func() *v1beta1.DaemonSetList { return &v1beta1.DaemonSetList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/deployment.go000066400000000000000000000132031472614177300300440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // DeploymentsGetter has a method to return a DeploymentInterface. // A group's client should implement this interface. type DeploymentsGetter interface { Deployments(namespace string) DeploymentInterface } // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Deployment, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) Apply(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error) ApplyScale(ctx context.Context, deploymentName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (*v1beta1.Scale, error) DeploymentExpansion } // deployments implements DeploymentInterface type deployments struct { *gentype.ClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *extensionsv1beta1.DeploymentApplyConfiguration] } // newDeployments returns a Deployments func newDeployments(c *ExtensionsV1beta1Client, namespace string) *deployments { return &deployments{ gentype.NewClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *extensionsv1beta1.DeploymentApplyConfiguration]( "deployments", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.Deployment { return &v1beta1.Deployment{} }, func() *v1beta1.DeploymentList { return &v1beta1.DeploymentList{} }), } } // GetScale takes name of the deployment, and returns the corresponding v1beta1.Scale object, and an error if there is any. func (c *deployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} err = c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). VersionedParams(&opts, scheme.ParameterCodec). Body(scale). Do(ctx). Into(result) return } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *deployments) ApplyScale(ctx context.Context, deploymentName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } patchOpts := opts.ToPatchOptions() data, err := json.Marshal(scale) if err != nil { return nil, err } result = &v1beta1.Scale{} err = c.GetClient().Patch(types.ApplyPatchType). Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). VersionedParams(&patchOpts, scheme.ParameterCodec). Body(data). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/deployment_expansion.go000066400000000000000000000026201472614177300321310ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "context" "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" scheme "k8s.io/client-go/kubernetes/scheme" ) // The DeploymentExpansion interface allows manually adding extra methods to the DeploymentInterface. type DeploymentExpansion interface { Rollback(context.Context, *v1beta1.DeploymentRollback, metav1.CreateOptions) error } // Rollback applied the provided DeploymentRollback to the named deployment in the current namespace. func (c *deployments) Rollback(ctx context.Context, deploymentRollback *v1beta1.DeploymentRollback, opts metav1.CreateOptions) error { return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("deployments").Name(deploymentRollback.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("rollback").Body(deploymentRollback).Do(ctx).Error() } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/doc.go000066400000000000000000000012641472614177300264350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/extensions_client.go000066400000000000000000000072321472614177300314260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type ExtensionsV1beta1Interface interface { RESTClient() rest.Interface DaemonSetsGetter DeploymentsGetter IngressesGetter NetworkPoliciesGetter ReplicaSetsGetter } // ExtensionsV1beta1Client is used to interact with features provided by the extensions group. type ExtensionsV1beta1Client struct { restClient rest.Interface } func (c *ExtensionsV1beta1Client) DaemonSets(namespace string) DaemonSetInterface { return newDaemonSets(c, namespace) } func (c *ExtensionsV1beta1Client) Deployments(namespace string) DeploymentInterface { return newDeployments(c, namespace) } func (c *ExtensionsV1beta1Client) Ingresses(namespace string) IngressInterface { return newIngresses(c, namespace) } func (c *ExtensionsV1beta1Client) NetworkPolicies(namespace string) NetworkPolicyInterface { return newNetworkPolicies(c, namespace) } func (c *ExtensionsV1beta1Client) ReplicaSets(namespace string) ReplicaSetInterface { return newReplicaSets(c, namespace) } // NewForConfig creates a new ExtensionsV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*ExtensionsV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new ExtensionsV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ExtensionsV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &ExtensionsV1beta1Client{client}, nil } // NewForConfigOrDie creates a new ExtensionsV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *ExtensionsV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new ExtensionsV1beta1Client for the given RESTClient. func New(c rest.Interface) *ExtensionsV1beta1Client { return &ExtensionsV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *ExtensionsV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/000077500000000000000000000000001472614177300262445ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/doc.go000066400000000000000000000012531472614177300273410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go000066400000000000000000000165101472614177300315430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" testing "k8s.io/client-go/testing" ) // FakeDaemonSets implements DaemonSetInterface type FakeDaemonSets struct { Fake *FakeExtensionsV1beta1 ns string } var daemonsetsResource = v1beta1.SchemeGroupVersion.WithResource("daemonsets") var daemonsetsKind = v1beta1.SchemeGroupVersion.WithKind("DaemonSet") // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { emptyResult := &v1beta1.DaemonSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.DaemonSetList{ListMeta: obj.(*v1beta1.DaemonSetList).ListMeta} for _, item := range obj.(*v1beta1.DaemonSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested daemonSets. func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts)) } // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1beta1.DaemonSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.DaemonSetList{}) return err } // Patch applies the patch and returns the patched daemonSet. func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet. func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) { if daemonSet == nil { return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") } data, err := json.Marshal(daemonSet) if err != nil { return nil, err } name := daemonSet.Name if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) { if daemonSet == nil { return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") } data, err := json.Marshal(daemonSet) if err != nil { return nil, err } name := daemonSet.Name if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go000066400000000000000000000224531472614177300317470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" testing "k8s.io/client-go/testing" ) // FakeDeployments implements DeploymentInterface type FakeDeployments struct { Fake *FakeExtensionsV1beta1 ns string } var deploymentsResource = v1beta1.SchemeGroupVersion.WithResource("deployments") var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment") // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { emptyResult := &v1beta1.DeploymentList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.DeploymentList{ListMeta: obj.(*v1beta1.DeploymentList).ListMeta} for _, item := range obj.(*v1beta1.DeploymentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested deployments. func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) } // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1beta1.Deployment{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{}) return err } // Patch applies the patch and returns the patched deployment. func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // Apply takes the given apply declarative configuration, applies it and returns the applied deployment. func (c *FakeDeployments) Apply(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { if deployment == nil { return nil, fmt.Errorf("deployment provided to Apply must not be nil") } data, err := json.Marshal(deployment) if err != nil { return nil, err } name := deployment.Name if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { if deployment == nil { return nil, fmt.Errorf("deployment provided to Apply must not be nil") } data, err := json.Marshal(deployment) if err != nil { return nil, err } name := deployment.Name if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Deployment), err } // GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any. func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { emptyResult := &v1beta1.Scale{} obj, err := c.Fake. Invokes(testing.NewGetSubresourceActionWithOptions(deploymentsResource, c.ns, "scale", deploymentName, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { emptyResult := &v1beta1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "scale", c.ns, scale, opts), &v1beta1.Scale{}) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Scale), err } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } data, err := json.Marshal(scale) if err != nil { return nil, err } emptyResult := &v1beta1.Scale{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Scale), err } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go000066400000000000000000000021111472614177300340200ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" core "k8s.io/client-go/testing" ) func (c *FakeDeployments) Rollback(ctx context.Context, deploymentRollback *v1beta1.DeploymentRollback, opts metav1.CreateOptions) error { action := core.CreateActionImpl{} action.Verb = "create" action.Resource = deploymentsResource action.Subresource = "rollback" action.Object = deploymentRollback _, err := c.Fake.Invokes(action, deploymentRollback) return err } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go000066400000000000000000000032551472614177300333230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeExtensionsV1beta1 struct { *testing.Fake } func (c *FakeExtensionsV1beta1) DaemonSets(namespace string) v1beta1.DaemonSetInterface { return &FakeDaemonSets{c, namespace} } func (c *FakeExtensionsV1beta1) Deployments(namespace string) v1beta1.DeploymentInterface { return &FakeDeployments{c, namespace} } func (c *FakeExtensionsV1beta1) Ingresses(namespace string) v1beta1.IngressInterface { return &FakeIngresses{c, namespace} } func (c *FakeExtensionsV1beta1) NetworkPolicies(namespace string) v1beta1.NetworkPolicyInterface { return &FakeNetworkPolicies{c, namespace} } func (c *FakeExtensionsV1beta1) ReplicaSets(namespace string) v1beta1.ReplicaSetInterface { return &FakeReplicaSets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeExtensionsV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go000066400000000000000000000162561472614177300312450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" testing "k8s.io/client-go/testing" ) // FakeIngresses implements IngressInterface type FakeIngresses struct { Fake *FakeExtensionsV1beta1 ns string } var ingressesResource = v1beta1.SchemeGroupVersion.WithResource("ingresses") var ingressesKind = v1beta1.SchemeGroupVersion.WithKind("Ingress") // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { emptyResult := &v1beta1.IngressList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.IngressList{ListMeta: obj.(*v1beta1.IngressList).ListMeta} for _, item := range obj.(*v1beta1.IngressList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested ingresses. func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) } // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(ingressesResource, c.ns, name, opts), &v1beta1.Ingress{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) return err } // Patch applies the patch and returns the patched ingress. func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // Apply takes the given apply declarative configuration, applies it and returns the applied ingress. func (c *FakeIngresses) Apply(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { if ingress == nil { return nil, fmt.Errorf("ingress provided to Apply must not be nil") } data, err := json.Marshal(ingress) if err != nil { return nil, err } name := ingress.Name if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { if ingress == nil { return nil, fmt.Errorf("ingress provided to Apply must not be nil") } data, err := json.Marshal(ingress) if err != nil { return nil, err } name := ingress.Name if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go000066400000000000000000000142241472614177300324750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" testing "k8s.io/client-go/testing" ) // FakeNetworkPolicies implements NetworkPolicyInterface type FakeNetworkPolicies struct { Fake *FakeExtensionsV1beta1 ns string } var networkpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("networkpolicies") var networkpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("NetworkPolicy") // Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.NetworkPolicy, err error) { emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(networkpoliciesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.NetworkPolicy), err } // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. func (c *FakeNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) { emptyResult := &v1beta1.NetworkPolicyList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.NetworkPolicyList{ListMeta: obj.(*v1beta1.NetworkPolicyList).ListMeta} for _, item := range obj.(*v1beta1.NetworkPolicyList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested networkPolicies. func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(networkpoliciesResource, c.ns, opts)) } // Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.CreateOptions) (result *v1beta1.NetworkPolicy, err error) { emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.NetworkPolicy), err } // Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (result *v1beta1.NetworkPolicy, err error) { emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.NetworkPolicy), err } // Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(networkpoliciesResource, c.ns, name, opts), &v1beta1.NetworkPolicy{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(networkpoliciesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.NetworkPolicyList{}) return err } // Patch applies the patch and returns the patched networkPolicy. func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.NetworkPolicy, err error) { emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.NetworkPolicy), err } // Apply takes the given apply declarative configuration, applies it and returns the applied networkPolicy. func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *extensionsv1beta1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.NetworkPolicy, err error) { if networkPolicy == nil { return nil, fmt.Errorf("networkPolicy provided to Apply must not be nil") } data, err := json.Marshal(networkPolicy) if err != nil { return nil, err } name := networkPolicy.Name if name == nil { return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") } emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.NetworkPolicy), err } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go000066400000000000000000000224531472614177300317220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" testing "k8s.io/client-go/testing" ) // FakeReplicaSets implements ReplicaSetInterface type FakeReplicaSets struct { Fake *FakeExtensionsV1beta1 ns string } var replicasetsResource = v1beta1.SchemeGroupVersion.WithResource("replicasets") var replicasetsKind = v1beta1.SchemeGroupVersion.WithKind("ReplicaSet") // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { emptyResult := &v1beta1.ReplicaSetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.ReplicaSetList{ListMeta: obj.(*v1beta1.ReplicaSetList).ListMeta} for _, item := range obj.(*v1beta1.ReplicaSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested replicaSets. func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) } // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(replicasetsResource, c.ns, name, opts), &v1beta1.ReplicaSet{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ReplicaSetList{}) return err } // Patch applies the patch and returns the patched replicaSet. func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet. func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) { if replicaSet == nil { return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") } data, err := json.Marshal(replicaSet) if err != nil { return nil, err } name := replicaSet.Name if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) { if replicaSet == nil { return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") } data, err := json.Marshal(replicaSet) if err != nil { return nil, err } name := replicaSet.Name if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { emptyResult := &v1beta1.Scale{} obj, err := c.Fake. Invokes(testing.NewGetSubresourceActionWithOptions(replicasetsResource, c.ns, "scale", replicaSetName, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { emptyResult := &v1beta1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "scale", c.ns, scale, opts), &v1beta1.Scale{}) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Scale), err } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } data, err := json.Marshal(scale) if err != nil { return nil, err } emptyResult := &v1beta1.Scale{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Scale), err } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/generated_expansion.go000066400000000000000000000014141472614177300317070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type DaemonSetExpansion interface{} type IngressExpansion interface{} type NetworkPolicyExpansion interface{} type ReplicaSetExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/ingress.go000066400000000000000000000063171472614177300273460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // IngressesGetter has a method to return a IngressInterface. // A group's client should implement this interface. type IngressesGetter interface { Ingresses(namespace string) IngressInterface } // IngressInterface has methods to work with Ingress resources. type IngressInterface interface { Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Ingress, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) Apply(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) IngressExpansion } // ingresses implements IngressInterface type ingresses struct { *gentype.ClientWithListAndApply[*v1beta1.Ingress, *v1beta1.IngressList, *extensionsv1beta1.IngressApplyConfiguration] } // newIngresses returns a Ingresses func newIngresses(c *ExtensionsV1beta1Client, namespace string) *ingresses { return &ingresses{ gentype.NewClientWithListAndApply[*v1beta1.Ingress, *v1beta1.IngressList, *extensionsv1beta1.IngressApplyConfiguration]( "ingresses", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.Ingress { return &v1beta1.Ingress{} }, func() *v1beta1.IngressList { return &v1beta1.IngressList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/networkpolicy.go000066400000000000000000000060151472614177300306000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. // A group's client should implement this interface. type NetworkPoliciesGetter interface { NetworkPolicies(namespace string) NetworkPolicyInterface } // NetworkPolicyInterface has methods to work with NetworkPolicy resources. type NetworkPolicyInterface interface { Create(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.CreateOptions) (*v1beta1.NetworkPolicy, error) Update(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (*v1beta1.NetworkPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.NetworkPolicy, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.NetworkPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.NetworkPolicy, err error) Apply(ctx context.Context, networkPolicy *extensionsv1beta1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.NetworkPolicy, err error) NetworkPolicyExpansion } // networkPolicies implements NetworkPolicyInterface type networkPolicies struct { *gentype.ClientWithListAndApply[*v1beta1.NetworkPolicy, *v1beta1.NetworkPolicyList, *extensionsv1beta1.NetworkPolicyApplyConfiguration] } // newNetworkPolicies returns a NetworkPolicies func newNetworkPolicies(c *ExtensionsV1beta1Client, namespace string) *networkPolicies { return &networkPolicies{ gentype.NewClientWithListAndApply[*v1beta1.NetworkPolicy, *v1beta1.NetworkPolicyList, *extensionsv1beta1.NetworkPolicyApplyConfiguration]( "networkpolicies", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.NetworkPolicy { return &v1beta1.NetworkPolicy{} }, func() *v1beta1.NetworkPolicyList { return &v1beta1.NetworkPolicyList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/extensions/v1beta1/replicaset.go000066400000000000000000000132031472614177300300170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. // A group's client should implement this interface. type ReplicaSetsGetter interface { ReplicaSets(namespace string) ReplicaSetInterface } // ReplicaSetInterface has methods to work with ReplicaSet resources. type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (*v1beta1.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ReplicaSet, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReplicaSet, err error) Apply(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error) ApplyScale(ctx context.Context, replicaSetName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (*v1beta1.Scale, error) ReplicaSetExpansion } // replicaSets implements ReplicaSetInterface type replicaSets struct { *gentype.ClientWithListAndApply[*v1beta1.ReplicaSet, *v1beta1.ReplicaSetList, *extensionsv1beta1.ReplicaSetApplyConfiguration] } // newReplicaSets returns a ReplicaSets func newReplicaSets(c *ExtensionsV1beta1Client, namespace string) *replicaSets { return &replicaSets{ gentype.NewClientWithListAndApply[*v1beta1.ReplicaSet, *v1beta1.ReplicaSetList, *extensionsv1beta1.ReplicaSetApplyConfiguration]( "replicasets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.ReplicaSet { return &v1beta1.ReplicaSet{} }, func() *v1beta1.ReplicaSetList { return &v1beta1.ReplicaSetList{} }), } } // GetScale takes name of the replicaSet, and returns the corresponding v1beta1.Scale object, and an error if there is any. func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} err = c.GetClient().Get(). Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). VersionedParams(&opts, scheme.ParameterCodec). Body(scale). Do(ctx). Into(result) return } // ApplyScale takes top resource name and the apply declarative configuration for scale, // applies it and returns the applied scale, and an error, if there is any. func (c *replicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { if scale == nil { return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") } patchOpts := opts.ToPatchOptions() data, err := json.Marshal(scale) if err != nil { return nil, err } result = &v1beta1.Scale{} err = c.GetClient().Patch(types.ApplyPatchType). Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). VersionedParams(&patchOpts, scheme.ParameterCodec). Body(data). Do(ctx). Into(result) return } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/000077500000000000000000000000001472614177300242445ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/000077500000000000000000000000001472614177300245725ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/doc.go000066400000000000000000000012571472614177300256730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/fake/000077500000000000000000000000001472614177300255005ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/fake/doc.go000066400000000000000000000012531472614177300265750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go000066400000000000000000000023611472614177300327250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeFlowcontrolV1 struct { *testing.Fake } func (c *FakeFlowcontrolV1) FlowSchemas() v1.FlowSchemaInterface { return &FakeFlowSchemas{c} } func (c *FakeFlowcontrolV1) PriorityLevelConfigurations() v1.PriorityLevelConfigurationInterface { return &FakePriorityLevelConfigurations{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeFlowcontrolV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go000066400000000000000000000163511472614177300311530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" testing "k8s.io/client-go/testing" ) // FakeFlowSchemas implements FlowSchemaInterface type FakeFlowSchemas struct { Fake *FakeFlowcontrolV1 } var flowschemasResource = v1.SchemeGroupVersion.WithResource("flowschemas") var flowschemasKind = v1.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { emptyResult := &v1.FlowSchemaList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.FlowSchemaList{ListMeta: obj.(*v1.FlowSchemaList).ListMeta} for _, item := range obj.(*v1.FlowSchemaList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *FakeFlowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.FlowSchema), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.FlowSchema), err } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1.FlowSchema{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.FlowSchemaList{}) return err } // Patch applies the patch and returns the patched flowSchema. func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.FlowSchema), err } // Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } data, err := json.Marshal(flowSchema) if err != nil { return nil, err } name := flowSchema.Name if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } emptyResult := &v1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.FlowSchema), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } data, err := json.Marshal(flowSchema) if err != nil { return nil, err } name := flowSchema.Name if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } emptyResult := &v1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.FlowSchema), err } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go000066400000000000000000000212511472614177300345170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" testing "k8s.io/client-go/testing" ) // FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface type FakePriorityLevelConfigurations struct { Fake *FakeFlowcontrolV1 } var prioritylevelconfigurationsResource = v1.SchemeGroupVersion.WithResource("prioritylevelconfigurations") var prioritylevelconfigurationsKind = v1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { emptyResult := &v1.PriorityLevelConfigurationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.PriorityLevelConfigurationList{ListMeta: obj.(*v1.PriorityLevelConfigurationList).ListMeta} for _, item := range obj.(*v1.PriorityLevelConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1.PriorityLevelConfiguration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PriorityLevelConfigurationList{}) return err } // Patch applies the patch and returns the patched priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } data, err := json.Marshal(priorityLevelConfiguration) if err != nil { return nil, err } name := priorityLevelConfiguration.Name if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } data, err := json.Marshal(priorityLevelConfiguration) if err != nil { return nil, err } name := priorityLevelConfiguration.Name if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go000066400000000000000000000062561472614177300310400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/flowcontrol/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type FlowcontrolV1Interface interface { RESTClient() rest.Interface FlowSchemasGetter PriorityLevelConfigurationsGetter } // FlowcontrolV1Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. type FlowcontrolV1Client struct { restClient rest.Interface } func (c *FlowcontrolV1Client) FlowSchemas() FlowSchemaInterface { return newFlowSchemas(c) } func (c *FlowcontrolV1Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { return newPriorityLevelConfigurations(c) } // NewForConfig creates a new FlowcontrolV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*FlowcontrolV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new FlowcontrolV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &FlowcontrolV1Client{client}, nil } // NewForConfigOrDie creates a new FlowcontrolV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new FlowcontrolV1Client for the given RESTClient. func New(c rest.Interface) *FlowcontrolV1Client { return &FlowcontrolV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FlowcontrolV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/flowschema.go000066400000000000000000000063201472614177300272520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. // A group's client should implement this interface. type FlowSchemasGetter interface { FlowSchemas() FlowSchemaInterface } // FlowSchemaInterface has methods to work with FlowSchema resources. type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (*v1.FlowSchema, error) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FlowSchema, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.FlowSchemaList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) FlowSchemaExpansion } // flowSchemas implements FlowSchemaInterface type flowSchemas struct { *gentype.ClientWithListAndApply[*v1.FlowSchema, *v1.FlowSchemaList, *flowcontrolv1.FlowSchemaApplyConfiguration] } // newFlowSchemas returns a FlowSchemas func newFlowSchemas(c *FlowcontrolV1Client) *flowSchemas { return &flowSchemas{ gentype.NewClientWithListAndApply[*v1.FlowSchema, *v1.FlowSchemaList, *flowcontrolv1.FlowSchemaApplyConfiguration]( "flowschemas", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.FlowSchema { return &v1.FlowSchema{} }, func() *v1.FlowSchemaList { return &v1.FlowSchemaList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/generated_expansion.go000066400000000000000000000013141472614177300311420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type FlowSchemaExpansion interface{} type PriorityLevelConfigurationExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go000066400000000000000000000076601472614177300326330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. // A group's client should implement this interface. type PriorityLevelConfigurationsGetter interface { PriorityLevelConfigurations() PriorityLevelConfigurationInterface } // PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*v1.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PriorityLevelConfiguration, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } // priorityLevelConfigurations implements PriorityLevelConfigurationInterface type priorityLevelConfigurations struct { *gentype.ClientWithListAndApply[*v1.PriorityLevelConfiguration, *v1.PriorityLevelConfigurationList, *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration] } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations func newPriorityLevelConfigurations(c *FlowcontrolV1Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ gentype.NewClientWithListAndApply[*v1.PriorityLevelConfiguration, *v1.PriorityLevelConfigurationList, *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration]( "prioritylevelconfigurations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.PriorityLevelConfiguration { return &v1.PriorityLevelConfiguration{} }, func() *v1.PriorityLevelConfigurationList { return &v1.PriorityLevelConfigurationList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/000077500000000000000000000000001472614177300255075ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/doc.go000066400000000000000000000012641472614177300266060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/fake/000077500000000000000000000000001472614177300264155ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/fake/doc.go000066400000000000000000000012531472614177300275120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowcontrol_client.go000066400000000000000000000024311472614177300336400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeFlowcontrolV1beta1 struct { *testing.Fake } func (c *FakeFlowcontrolV1beta1) FlowSchemas() v1beta1.FlowSchemaInterface { return &FakeFlowSchemas{c} } func (c *FakeFlowcontrolV1beta1) PriorityLevelConfigurations() v1beta1.PriorityLevelConfigurationInterface { return &FakePriorityLevelConfigurations{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeFlowcontrolV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go000066400000000000000000000165751472614177300321000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" testing "k8s.io/client-go/testing" ) // FakeFlowSchemas implements FlowSchemaInterface type FakeFlowSchemas struct { Fake *FakeFlowcontrolV1beta1 } var flowschemasResource = v1beta1.SchemeGroupVersion.WithResource("flowschemas") var flowschemasKind = v1beta1.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { emptyResult := &v1beta1.FlowSchemaList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.FlowSchemaList{ListMeta: obj.(*v1beta1.FlowSchemaList).ListMeta} for _, item := range obj.(*v1beta1.FlowSchemaList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.CreateOptions) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1beta1.FlowSchema{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.FlowSchemaList{}) return err } // Patch applies the patch and returns the patched flowSchema. func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } // Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } data, err := json.Marshal(flowSchema) if err != nil { return nil, err } name := flowSchema.Name if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } data, err := json.Marshal(flowSchema) if err != nil { return nil, err } name := flowSchema.Name if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } fake_prioritylevelconfiguration.go000066400000000000000000000214751472614177300353650ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" testing "k8s.io/client-go/testing" ) // FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface type FakePriorityLevelConfigurations struct { Fake *FakeFlowcontrolV1beta1 } var prioritylevelconfigurationsResource = v1beta1.SchemeGroupVersion.WithResource("prioritylevelconfigurations") var prioritylevelconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { emptyResult := &v1beta1.PriorityLevelConfigurationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.PriorityLevelConfigurationList{ListMeta: obj.(*v1beta1.PriorityLevelConfigurationList).ListMeta} for _, item := range obj.(*v1beta1.PriorityLevelConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1beta1.PriorityLevelConfiguration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PriorityLevelConfigurationList{}) return err } // Patch applies the patch and returns the patched priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } data, err := json.Marshal(priorityLevelConfiguration) if err != nil { return nil, err } name := priorityLevelConfiguration.Name if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } data, err := json.Marshal(priorityLevelConfiguration) if err != nil { return nil, err } name := priorityLevelConfiguration.Name if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go000066400000000000000000000064221472614177300317500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/flowcontrol/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type FlowcontrolV1beta1Interface interface { RESTClient() rest.Interface FlowSchemasGetter PriorityLevelConfigurationsGetter } // FlowcontrolV1beta1Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. type FlowcontrolV1beta1Client struct { restClient rest.Interface } func (c *FlowcontrolV1beta1Client) FlowSchemas() FlowSchemaInterface { return newFlowSchemas(c) } func (c *FlowcontrolV1beta1Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { return newPriorityLevelConfigurations(c) } // NewForConfig creates a new FlowcontrolV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*FlowcontrolV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new FlowcontrolV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &FlowcontrolV1beta1Client{client}, nil } // NewForConfigOrDie creates a new FlowcontrolV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new FlowcontrolV1beta1Client for the given RESTClient. func New(c rest.Interface) *FlowcontrolV1beta1Client { return &FlowcontrolV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FlowcontrolV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/flowschema.go000066400000000000000000000064551472614177300302000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. // A group's client should implement this interface. type FlowSchemasGetter interface { FlowSchemas() FlowSchemaInterface } // FlowSchemaInterface has methods to work with FlowSchema resources. type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.CreateOptions) (*v1beta1.FlowSchema, error) Update(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (*v1beta1.FlowSchema, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (*v1beta1.FlowSchema, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.FlowSchema, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.FlowSchemaList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FlowSchema, err error) Apply(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) FlowSchemaExpansion } // flowSchemas implements FlowSchemaInterface type flowSchemas struct { *gentype.ClientWithListAndApply[*v1beta1.FlowSchema, *v1beta1.FlowSchemaList, *flowcontrolv1beta1.FlowSchemaApplyConfiguration] } // newFlowSchemas returns a FlowSchemas func newFlowSchemas(c *FlowcontrolV1beta1Client) *flowSchemas { return &flowSchemas{ gentype.NewClientWithListAndApply[*v1beta1.FlowSchema, *v1beta1.FlowSchemaList, *flowcontrolv1beta1.FlowSchemaApplyConfiguration]( "flowschemas", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.FlowSchema { return &v1beta1.FlowSchema{} }, func() *v1beta1.FlowSchemaList { return &v1beta1.FlowSchemaList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/generated_expansion.go000066400000000000000000000013211472614177300320550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type FlowSchemaExpansion interface{} type PriorityLevelConfigurationExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go000066400000000000000000000100151472614177300335340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. // A group's client should implement this interface. type PriorityLevelConfigurationsGetter interface { PriorityLevelConfigurations() PriorityLevelConfigurationInterface } // PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1beta1.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta1.PriorityLevelConfiguration, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta1.PriorityLevelConfiguration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PriorityLevelConfiguration, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityLevelConfiguration, err error) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } // priorityLevelConfigurations implements PriorityLevelConfigurationInterface type priorityLevelConfigurations struct { *gentype.ClientWithListAndApply[*v1beta1.PriorityLevelConfiguration, *v1beta1.PriorityLevelConfigurationList, *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration] } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations func newPriorityLevelConfigurations(c *FlowcontrolV1beta1Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ gentype.NewClientWithListAndApply[*v1beta1.PriorityLevelConfiguration, *v1beta1.PriorityLevelConfigurationList, *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration]( "prioritylevelconfigurations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.PriorityLevelConfiguration { return &v1beta1.PriorityLevelConfiguration{} }, func() *v1beta1.PriorityLevelConfigurationList { return &v1beta1.PriorityLevelConfigurationList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/000077500000000000000000000000001472614177300255105ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/doc.go000066400000000000000000000012641472614177300266070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta2 kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/fake/000077500000000000000000000000001472614177300264165ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/fake/doc.go000066400000000000000000000012531472614177300275130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowcontrol_client.go000066400000000000000000000024311472614177300336410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeFlowcontrolV1beta2 struct { *testing.Fake } func (c *FakeFlowcontrolV1beta2) FlowSchemas() v1beta2.FlowSchemaInterface { return &FakeFlowSchemas{c} } func (c *FakeFlowcontrolV1beta2) PriorityLevelConfigurations() v1beta2.PriorityLevelConfigurationInterface { return &FakePriorityLevelConfigurations{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeFlowcontrolV1beta2) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go000066400000000000000000000165751472614177300321010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" testing "k8s.io/client-go/testing" ) // FakeFlowSchemas implements FlowSchemaInterface type FakeFlowSchemas struct { Fake *FakeFlowcontrolV1beta2 } var flowschemasResource = v1beta2.SchemeGroupVersion.WithResource("flowschemas") var flowschemasKind = v1beta2.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { emptyResult := &v1beta2.FlowSchemaList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta2.FlowSchemaList{ListMeta: obj.(*v1beta2.FlowSchemaList).ListMeta} for _, item := range obj.(*v1beta2.FlowSchemaList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1beta2.FlowSchema{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.FlowSchemaList{}) return err } // Patch applies the patch and returns the patched flowSchema. func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } // Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } data, err := json.Marshal(flowSchema) if err != nil { return nil, err } name := flowSchema.Name if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } data, err := json.Marshal(flowSchema) if err != nil { return nil, err } name := flowSchema.Name if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } fake_prioritylevelconfiguration.go000066400000000000000000000214751472614177300353660ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" testing "k8s.io/client-go/testing" ) // FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface type FakePriorityLevelConfigurations struct { Fake *FakeFlowcontrolV1beta2 } var prioritylevelconfigurationsResource = v1beta2.SchemeGroupVersion.WithResource("prioritylevelconfigurations") var prioritylevelconfigurationsKind = v1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { emptyResult := &v1beta2.PriorityLevelConfigurationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta2.PriorityLevelConfigurationList{ListMeta: obj.(*v1beta2.PriorityLevelConfigurationList).ListMeta} for _, item := range obj.(*v1beta2.PriorityLevelConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1beta2.PriorityLevelConfiguration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.PriorityLevelConfigurationList{}) return err } // Patch applies the patch and returns the patched priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } data, err := json.Marshal(priorityLevelConfiguration) if err != nil { return nil, err } name := priorityLevelConfiguration.Name if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } data, err := json.Marshal(priorityLevelConfiguration) if err != nil { return nil, err } name := priorityLevelConfiguration.Name if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go000066400000000000000000000064221472614177300317510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "net/http" v1beta2 "k8s.io/api/flowcontrol/v1beta2" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type FlowcontrolV1beta2Interface interface { RESTClient() rest.Interface FlowSchemasGetter PriorityLevelConfigurationsGetter } // FlowcontrolV1beta2Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. type FlowcontrolV1beta2Client struct { restClient rest.Interface } func (c *FlowcontrolV1beta2Client) FlowSchemas() FlowSchemaInterface { return newFlowSchemas(c) } func (c *FlowcontrolV1beta2Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { return newPriorityLevelConfigurations(c) } // NewForConfig creates a new FlowcontrolV1beta2Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*FlowcontrolV1beta2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new FlowcontrolV1beta2Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1beta2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &FlowcontrolV1beta2Client{client}, nil } // NewForConfigOrDie creates a new FlowcontrolV1beta2Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1beta2Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new FlowcontrolV1beta2Client for the given RESTClient. func New(c rest.Interface) *FlowcontrolV1beta2Client { return &FlowcontrolV1beta2Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FlowcontrolV1beta2Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/flowschema.go000066400000000000000000000064551472614177300302010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "context" v1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. // A group's client should implement this interface. type FlowSchemasGetter interface { FlowSchemas() FlowSchemaInterface } // FlowSchemaInterface has methods to work with FlowSchema resources. type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (*v1beta2.FlowSchema, error) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (*v1beta2.FlowSchema, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (*v1beta2.FlowSchema, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.FlowSchema, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.FlowSchemaList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error) Apply(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) FlowSchemaExpansion } // flowSchemas implements FlowSchemaInterface type flowSchemas struct { *gentype.ClientWithListAndApply[*v1beta2.FlowSchema, *v1beta2.FlowSchemaList, *flowcontrolv1beta2.FlowSchemaApplyConfiguration] } // newFlowSchemas returns a FlowSchemas func newFlowSchemas(c *FlowcontrolV1beta2Client) *flowSchemas { return &flowSchemas{ gentype.NewClientWithListAndApply[*v1beta2.FlowSchema, *v1beta2.FlowSchemaList, *flowcontrolv1beta2.FlowSchemaApplyConfiguration]( "flowschemas", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta2.FlowSchema { return &v1beta2.FlowSchema{} }, func() *v1beta2.FlowSchemaList { return &v1beta2.FlowSchemaList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/generated_expansion.go000066400000000000000000000013211472614177300320560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 type FlowSchemaExpansion interface{} type PriorityLevelConfigurationExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go000066400000000000000000000100151472614177300335350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta2 import ( "context" v1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. // A group's client should implement this interface. type PriorityLevelConfigurationsGetter interface { PriorityLevelConfigurations() PriorityLevelConfigurationInterface } // PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1beta2.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta2.PriorityLevelConfiguration, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta2.PriorityLevelConfiguration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.PriorityLevelConfiguration, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } // priorityLevelConfigurations implements PriorityLevelConfigurationInterface type priorityLevelConfigurations struct { *gentype.ClientWithListAndApply[*v1beta2.PriorityLevelConfiguration, *v1beta2.PriorityLevelConfigurationList, *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration] } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations func newPriorityLevelConfigurations(c *FlowcontrolV1beta2Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ gentype.NewClientWithListAndApply[*v1beta2.PriorityLevelConfiguration, *v1beta2.PriorityLevelConfigurationList, *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration]( "prioritylevelconfigurations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta2.PriorityLevelConfiguration { return &v1beta2.PriorityLevelConfiguration{} }, func() *v1beta2.PriorityLevelConfigurationList { return &v1beta2.PriorityLevelConfigurationList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/000077500000000000000000000000001472614177300255115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/doc.go000066400000000000000000000012641472614177300266100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta3 kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/fake/000077500000000000000000000000001472614177300264175ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/fake/doc.go000066400000000000000000000012531472614177300275140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowcontrol_client.go000066400000000000000000000024311472614177300336420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeFlowcontrolV1beta3 struct { *testing.Fake } func (c *FakeFlowcontrolV1beta3) FlowSchemas() v1beta3.FlowSchemaInterface { return &FakeFlowSchemas{c} } func (c *FakeFlowcontrolV1beta3) PriorityLevelConfigurations() v1beta3.PriorityLevelConfigurationInterface { return &FakePriorityLevelConfigurations{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeFlowcontrolV1beta3) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go000066400000000000000000000165751472614177300321020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" testing "k8s.io/client-go/testing" ) // FakeFlowSchemas implements FlowSchemaInterface type FakeFlowSchemas struct { Fake *FakeFlowcontrolV1beta3 } var flowschemasResource = v1beta3.SchemeGroupVersion.WithResource("flowschemas") var flowschemasKind = v1beta3.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { emptyResult := &v1beta3.FlowSchemaList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta3.FlowSchemaList{ListMeta: obj.(*v1beta3.FlowSchemaList).ListMeta} for _, item := range obj.(*v1beta3.FlowSchemaList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.CreateOptions) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1beta3.FlowSchema{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta3.FlowSchemaList{}) return err } // Patch applies the patch and returns the patched flowSchema. func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } // Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } data, err := json.Marshal(flowSchema) if err != nil { return nil, err } name := flowSchema.Name if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) { if flowSchema == nil { return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") } data, err := json.Marshal(flowSchema) if err != nil { return nil, err } name := flowSchema.Name if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } fake_prioritylevelconfiguration.go000066400000000000000000000214751472614177300353670ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" testing "k8s.io/client-go/testing" ) // FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface type FakePriorityLevelConfigurations struct { Fake *FakeFlowcontrolV1beta3 } var prioritylevelconfigurationsResource = v1beta3.SchemeGroupVersion.WithResource("prioritylevelconfigurations") var prioritylevelconfigurationsKind = v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { emptyResult := &v1beta3.PriorityLevelConfigurationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta3.PriorityLevelConfigurationList{ListMeta: obj.(*v1beta3.PriorityLevelConfigurationList).ListMeta} for _, item := range obj.(*v1beta3.PriorityLevelConfigurationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1beta3.PriorityLevelConfiguration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta3.PriorityLevelConfigurationList{}) return err } // Patch applies the patch and returns the patched priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } data, err := json.Marshal(priorityLevelConfiguration) if err != nil { return nil, err } name := priorityLevelConfiguration.Name if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { if priorityLevelConfiguration == nil { return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") } data, err := json.Marshal(priorityLevelConfiguration) if err != nil { return nil, err } name := priorityLevelConfiguration.Name if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/flowcontrol_client.go000066400000000000000000000064221472614177300317520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta3 import ( "net/http" v1beta3 "k8s.io/api/flowcontrol/v1beta3" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type FlowcontrolV1beta3Interface interface { RESTClient() rest.Interface FlowSchemasGetter PriorityLevelConfigurationsGetter } // FlowcontrolV1beta3Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. type FlowcontrolV1beta3Client struct { restClient rest.Interface } func (c *FlowcontrolV1beta3Client) FlowSchemas() FlowSchemaInterface { return newFlowSchemas(c) } func (c *FlowcontrolV1beta3Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { return newPriorityLevelConfigurations(c) } // NewForConfig creates a new FlowcontrolV1beta3Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*FlowcontrolV1beta3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new FlowcontrolV1beta3Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1beta3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &FlowcontrolV1beta3Client{client}, nil } // NewForConfigOrDie creates a new FlowcontrolV1beta3Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1beta3Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new FlowcontrolV1beta3Client for the given RESTClient. func New(c rest.Interface) *FlowcontrolV1beta3Client { return &FlowcontrolV1beta3Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta3.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FlowcontrolV1beta3Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/flowschema.go000066400000000000000000000064551472614177300302020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta3 import ( "context" v1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. // A group's client should implement this interface. type FlowSchemasGetter interface { FlowSchemas() FlowSchemaInterface } // FlowSchemaInterface has methods to work with FlowSchema resources. type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.CreateOptions) (*v1beta3.FlowSchema, error) Update(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (*v1beta3.FlowSchema, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (*v1beta3.FlowSchema, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta3.FlowSchema, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta3.FlowSchemaList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.FlowSchema, err error) Apply(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) FlowSchemaExpansion } // flowSchemas implements FlowSchemaInterface type flowSchemas struct { *gentype.ClientWithListAndApply[*v1beta3.FlowSchema, *v1beta3.FlowSchemaList, *flowcontrolv1beta3.FlowSchemaApplyConfiguration] } // newFlowSchemas returns a FlowSchemas func newFlowSchemas(c *FlowcontrolV1beta3Client) *flowSchemas { return &flowSchemas{ gentype.NewClientWithListAndApply[*v1beta3.FlowSchema, *v1beta3.FlowSchemaList, *flowcontrolv1beta3.FlowSchemaApplyConfiguration]( "flowschemas", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta3.FlowSchema { return &v1beta3.FlowSchema{} }, func() *v1beta3.FlowSchemaList { return &v1beta3.FlowSchemaList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/generated_expansion.go000066400000000000000000000013211472614177300320570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta3 type FlowSchemaExpansion interface{} type PriorityLevelConfigurationExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go000066400000000000000000000100151472614177300335360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta3 import ( "context" v1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. // A group's client should implement this interface. type PriorityLevelConfigurationsGetter interface { PriorityLevelConfigurations() PriorityLevelConfigurationInterface } // PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1beta3.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta3.PriorityLevelConfiguration, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta3.PriorityLevelConfiguration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta3.PriorityLevelConfiguration, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta3.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.PriorityLevelConfiguration, err error) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } // priorityLevelConfigurations implements PriorityLevelConfigurationInterface type priorityLevelConfigurations struct { *gentype.ClientWithListAndApply[*v1beta3.PriorityLevelConfiguration, *v1beta3.PriorityLevelConfigurationList, *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration] } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations func newPriorityLevelConfigurations(c *FlowcontrolV1beta3Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ gentype.NewClientWithListAndApply[*v1beta3.PriorityLevelConfiguration, *v1beta3.PriorityLevelConfigurationList, *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration]( "prioritylevelconfigurations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta3.PriorityLevelConfiguration { return &v1beta3.PriorityLevelConfiguration{} }, func() *v1beta3.PriorityLevelConfigurationList { return &v1beta3.PriorityLevelConfigurationList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/000077500000000000000000000000001472614177300240635ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/000077500000000000000000000000001472614177300244115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/doc.go000066400000000000000000000012571472614177300255120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/fake/000077500000000000000000000000001472614177300253175ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/fake/doc.go000066400000000000000000000012531472614177300264140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/fake/fake_ingress.go000066400000000000000000000160321472614177300303100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" testing "k8s.io/client-go/testing" ) // FakeIngresses implements IngressInterface type FakeIngresses struct { Fake *FakeNetworkingV1 ns string } var ingressesResource = v1.SchemeGroupVersion.WithResource("ingresses") var ingressesKind = v1.SchemeGroupVersion.WithKind("Ingress") // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. func (c *FakeIngresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Ingress), err } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *FakeIngresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { emptyResult := &v1.IngressList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.IngressList{ListMeta: obj.(*v1.IngressList).ListMeta} for _, item := range obj.(*v1.IngressList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested ingresses. func (c *FakeIngresses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) } // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Ingress), err } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Ingress), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Ingress), err } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. func (c *FakeIngresses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(ingressesResource, c.ns, name, opts), &v1.Ingress{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.IngressList{}) return err } // Patch applies the patch and returns the patched ingress. func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Ingress), err } // Apply takes the given apply declarative configuration, applies it and returns the applied ingress. func (c *FakeIngresses) Apply(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) { if ingress == nil { return nil, fmt.Errorf("ingress provided to Apply must not be nil") } data, err := json.Marshal(ingress) if err != nil { return nil, err } name := ingress.Name if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } emptyResult := &v1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Ingress), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) { if ingress == nil { return nil, fmt.Errorf("ingress provided to Apply must not be nil") } data, err := json.Marshal(ingress) if err != nil { return nil, err } name := ingress.Name if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } emptyResult := &v1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Ingress), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/fake/fake_ingressclass.go000066400000000000000000000136611472614177300313430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" testing "k8s.io/client-go/testing" ) // FakeIngressClasses implements IngressClassInterface type FakeIngressClasses struct { Fake *FakeNetworkingV1 } var ingressclassesResource = v1.SchemeGroupVersion.WithResource("ingressclasses") var ingressclassesKind = v1.SchemeGroupVersion.WithKind("IngressClass") // Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. func (c *FakeIngressClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IngressClass, err error) { emptyResult := &v1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(ingressclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.IngressClass), err } // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. func (c *FakeIngressClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { emptyResult := &v1.IngressClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(ingressclassesResource, ingressclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.IngressClassList{ListMeta: obj.(*v1.IngressClassList).ListMeta} for _, item := range obj.(*v1.IngressClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested ingressClasses. func (c *FakeIngressClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(ingressclassesResource, opts)) } // Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.CreateOptions) (result *v1.IngressClass, err error) { emptyResult := &v1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.IngressClass), err } // Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.UpdateOptions) (result *v1.IngressClass, err error) { emptyResult := &v1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.IngressClass), err } // Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. func (c *FakeIngressClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(ingressclassesResource, name, opts), &v1.IngressClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(ingressclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.IngressClassList{}) return err } // Patch applies the patch and returns the patched ingressClass. func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error) { emptyResult := &v1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.IngressClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied ingressClass. func (c *FakeIngressClasses) Apply(ctx context.Context, ingressClass *networkingv1.IngressClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.IngressClass, err error) { if ingressClass == nil { return nil, fmt.Errorf("ingressClass provided to Apply must not be nil") } data, err := json.Marshal(ingressClass) if err != nil { return nil, err } name := ingressClass.Name if name == nil { return nil, fmt.Errorf("ingressClass.Name must be provided to Apply") } emptyResult := &v1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.IngressClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/fake/fake_networking_client.go000066400000000000000000000025371472614177300323700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/networking/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeNetworkingV1 struct { *testing.Fake } func (c *FakeNetworkingV1) Ingresses(namespace string) v1.IngressInterface { return &FakeIngresses{c, namespace} } func (c *FakeNetworkingV1) IngressClasses() v1.IngressClassInterface { return &FakeIngressClasses{c} } func (c *FakeNetworkingV1) NetworkPolicies(namespace string) v1.NetworkPolicyInterface { return &FakeNetworkPolicies{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeNetworkingV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go000066400000000000000000000140401472614177300315440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" testing "k8s.io/client-go/testing" ) // FakeNetworkPolicies implements NetworkPolicyInterface type FakeNetworkPolicies struct { Fake *FakeNetworkingV1 ns string } var networkpoliciesResource = v1.SchemeGroupVersion.WithResource("networkpolicies") var networkpoliciesKind = v1.SchemeGroupVersion.WithKind("NetworkPolicy") // Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkPolicy, err error) { emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(networkpoliciesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.NetworkPolicy), err } // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. func (c *FakeNetworkPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { emptyResult := &v1.NetworkPolicyList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.NetworkPolicyList{ListMeta: obj.(*v1.NetworkPolicyList).ListMeta} for _, item := range obj.(*v1.NetworkPolicyList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested networkPolicies. func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(networkpoliciesResource, c.ns, opts)) } // Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (result *v1.NetworkPolicy, err error) { emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.NetworkPolicy), err } // Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (result *v1.NetworkPolicy, err error) { emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.NetworkPolicy), err } // Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(networkpoliciesResource, c.ns, name, opts), &v1.NetworkPolicy{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(networkpoliciesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.NetworkPolicyList{}) return err } // Patch applies the patch and returns the patched networkPolicy. func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) { emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.NetworkPolicy), err } // Apply takes the given apply declarative configuration, applies it and returns the applied networkPolicy. func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *networkingv1.NetworkPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.NetworkPolicy, err error) { if networkPolicy == nil { return nil, fmt.Errorf("networkPolicy provided to Apply must not be nil") } data, err := json.Marshal(networkPolicy) if err != nil { return nil, err } name := networkPolicy.Name if name == nil { return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") } emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.NetworkPolicy), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/generated_expansion.go000066400000000000000000000013441472614177300307640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type IngressExpansion interface{} type IngressClassExpansion interface{} type NetworkPolicyExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/ingress.go000066400000000000000000000061621472614177300264170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // IngressesGetter has a method to return a IngressInterface. // A group's client should implement this interface. type IngressesGetter interface { Ingresses(namespace string) IngressInterface } // IngressInterface has methods to work with Ingress resources. type IngressInterface interface { Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (*v1.Ingress, error) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Ingress, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) Apply(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) IngressExpansion } // ingresses implements IngressInterface type ingresses struct { *gentype.ClientWithListAndApply[*v1.Ingress, *v1.IngressList, *networkingv1.IngressApplyConfiguration] } // newIngresses returns a Ingresses func newIngresses(c *NetworkingV1Client, namespace string) *ingresses { return &ingresses{ gentype.NewClientWithListAndApply[*v1.Ingress, *v1.IngressList, *networkingv1.IngressApplyConfiguration]( "ingresses", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Ingress { return &v1.Ingress{} }, func() *v1.IngressList { return &v1.IngressList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/ingressclass.go000066400000000000000000000055531472614177300274500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // IngressClassesGetter has a method to return a IngressClassInterface. // A group's client should implement this interface. type IngressClassesGetter interface { IngressClasses() IngressClassInterface } // IngressClassInterface has methods to work with IngressClass resources. type IngressClassInterface interface { Create(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.CreateOptions) (*v1.IngressClass, error) Update(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.UpdateOptions) (*v1.IngressClass, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.IngressClass, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error) Apply(ctx context.Context, ingressClass *networkingv1.IngressClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.IngressClass, err error) IngressClassExpansion } // ingressClasses implements IngressClassInterface type ingressClasses struct { *gentype.ClientWithListAndApply[*v1.IngressClass, *v1.IngressClassList, *networkingv1.IngressClassApplyConfiguration] } // newIngressClasses returns a IngressClasses func newIngressClasses(c *NetworkingV1Client) *ingressClasses { return &ingressClasses{ gentype.NewClientWithListAndApply[*v1.IngressClass, *v1.IngressClassList, *networkingv1.IngressClassApplyConfiguration]( "ingressclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.IngressClass { return &v1.IngressClass{} }, func() *v1.IngressClassList { return &v1.IngressClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/networking_client.go000066400000000000000000000064121472614177300304700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/networking/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type NetworkingV1Interface interface { RESTClient() rest.Interface IngressesGetter IngressClassesGetter NetworkPoliciesGetter } // NetworkingV1Client is used to interact with features provided by the networking.k8s.io group. type NetworkingV1Client struct { restClient rest.Interface } func (c *NetworkingV1Client) Ingresses(namespace string) IngressInterface { return newIngresses(c, namespace) } func (c *NetworkingV1Client) IngressClasses() IngressClassInterface { return newIngressClasses(c) } func (c *NetworkingV1Client) NetworkPolicies(namespace string) NetworkPolicyInterface { return newNetworkPolicies(c, namespace) } // NewForConfig creates a new NetworkingV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NetworkingV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new NetworkingV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &NetworkingV1Client{client}, nil } // NewForConfigOrDie creates a new NetworkingV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *NetworkingV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new NetworkingV1Client for the given RESTClient. func New(c rest.Interface) *NetworkingV1Client { return &NetworkingV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *NetworkingV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1/networkpolicy.go000066400000000000000000000056741472614177300276650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. // A group's client should implement this interface. type NetworkPoliciesGetter interface { NetworkPolicies(namespace string) NetworkPolicyInterface } // NetworkPolicyInterface has methods to work with NetworkPolicy resources. type NetworkPolicyInterface interface { Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (*v1.NetworkPolicy, error) Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (*v1.NetworkPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NetworkPolicy, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) Apply(ctx context.Context, networkPolicy *networkingv1.NetworkPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.NetworkPolicy, err error) NetworkPolicyExpansion } // networkPolicies implements NetworkPolicyInterface type networkPolicies struct { *gentype.ClientWithListAndApply[*v1.NetworkPolicy, *v1.NetworkPolicyList, *networkingv1.NetworkPolicyApplyConfiguration] } // newNetworkPolicies returns a NetworkPolicies func newNetworkPolicies(c *NetworkingV1Client, namespace string) *networkPolicies { return &networkPolicies{ gentype.NewClientWithListAndApply[*v1.NetworkPolicy, *v1.NetworkPolicyList, *networkingv1.NetworkPolicyApplyConfiguration]( "networkpolicies", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.NetworkPolicy { return &v1.NetworkPolicy{} }, func() *v1.NetworkPolicyList { return &v1.NetworkPolicyList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/000077500000000000000000000000001472614177300255005ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/doc.go000066400000000000000000000012651472614177300266000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/fake/000077500000000000000000000000001472614177300264065ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300275030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go000066400000000000000000000135551472614177300317120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/networking/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeIPAddresses implements IPAddressInterface type FakeIPAddresses struct { Fake *FakeNetworkingV1alpha1 } var ipaddressesResource = v1alpha1.SchemeGroupVersion.WithResource("ipaddresses") var ipaddressesKind = v1alpha1.SchemeGroupVersion.WithKind("IPAddress") // Get takes name of the iPAddress, and returns the corresponding iPAddress object, and an error if there is any. func (c *FakeIPAddresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IPAddress, err error) { emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(ipaddressesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } // List takes label and field selectors, and returns the list of IPAddresses that match those selectors. func (c *FakeIPAddresses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IPAddressList, err error) { emptyResult := &v1alpha1.IPAddressList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(ipaddressesResource, ipaddressesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.IPAddressList{ListMeta: obj.(*v1alpha1.IPAddressList).ListMeta} for _, item := range obj.(*v1alpha1.IPAddressList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested iPAddresses. func (c *FakeIPAddresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(ipaddressesResource, opts)) } // Create takes the representation of a iPAddress and creates it. Returns the server's representation of the iPAddress, and an error, if there is any. func (c *FakeIPAddresses) Create(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.CreateOptions) (result *v1alpha1.IPAddress, err error) { emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } // Update takes the representation of a iPAddress and updates it. Returns the server's representation of the iPAddress, and an error, if there is any. func (c *FakeIPAddresses) Update(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.UpdateOptions) (result *v1alpha1.IPAddress, err error) { emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } // Delete takes name of the iPAddress and deletes it. Returns an error if one occurs. func (c *FakeIPAddresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(ipaddressesResource, name, opts), &v1alpha1.IPAddress{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeIPAddresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(ipaddressesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.IPAddressList{}) return err } // Patch applies the patch and returns the patched iPAddress. func (c *FakeIPAddresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IPAddress, err error) { emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } // Apply takes the given apply declarative configuration, applies it and returns the applied iPAddress. func (c *FakeIPAddresses) Apply(ctx context.Context, iPAddress *networkingv1alpha1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.IPAddress, err error) { if iPAddress == nil { return nil, fmt.Errorf("iPAddress provided to Apply must not be nil") } data, err := json.Marshal(iPAddress) if err != nil { return nil, err } name := iPAddress.Name if name == nil { return nil, fmt.Errorf("iPAddress.Name must be provided to Apply") } emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go000066400000000000000000000023561472614177300334560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeNetworkingV1alpha1 struct { *testing.Fake } func (c *FakeNetworkingV1alpha1) IPAddresses() v1alpha1.IPAddressInterface { return &FakeIPAddresses{c} } func (c *FakeNetworkingV1alpha1) ServiceCIDRs() v1alpha1.ServiceCIDRInterface { return &FakeServiceCIDRs{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeNetworkingV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go000066400000000000000000000167731472614177300322430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/networking/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeServiceCIDRs implements ServiceCIDRInterface type FakeServiceCIDRs struct { Fake *FakeNetworkingV1alpha1 } var servicecidrsResource = v1alpha1.SchemeGroupVersion.WithResource("servicecidrs") var servicecidrsKind = v1alpha1.SchemeGroupVersion.WithKind("ServiceCIDR") // Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(servicecidrsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } // List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { emptyResult := &v1alpha1.ServiceCIDRList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(servicecidrsResource, servicecidrsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.ServiceCIDRList{ListMeta: obj.(*v1alpha1.ServiceCIDRList).ListMeta} for _, item := range obj.(*v1alpha1.ServiceCIDRList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested serviceCIDRs. func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(servicecidrsResource, opts)) } // Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } // Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(servicecidrsResource, "status", serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } // Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. func (c *FakeServiceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(servicecidrsResource, name, opts), &v1alpha1.ServiceCIDR{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(servicecidrsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ServiceCIDRList{}) return err } // Patch applies the patch and returns the patched serviceCIDR. func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } // Apply takes the given apply declarative configuration, applies it and returns the applied serviceCIDR. func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { if serviceCIDR == nil { return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") } data, err := json.Marshal(serviceCIDR) if err != nil { return nil, err } name := serviceCIDR.Name if name == nil { return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") } emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { if serviceCIDR == nil { return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") } data, err := json.Marshal(serviceCIDR) if err != nil { return nil, err } name := serviceCIDR.Name if name == nil { return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") } emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/generated_expansion.go000066400000000000000000000013021472614177300320450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type IPAddressExpansion interface{} type ServiceCIDRExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/ipaddress.go000066400000000000000000000055351472614177300300150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/networking/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // IPAddressesGetter has a method to return a IPAddressInterface. // A group's client should implement this interface. type IPAddressesGetter interface { IPAddresses() IPAddressInterface } // IPAddressInterface has methods to work with IPAddress resources. type IPAddressInterface interface { Create(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.CreateOptions) (*v1alpha1.IPAddress, error) Update(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.UpdateOptions) (*v1alpha1.IPAddress, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.IPAddress, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.IPAddressList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IPAddress, err error) Apply(ctx context.Context, iPAddress *networkingv1alpha1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.IPAddress, err error) IPAddressExpansion } // iPAddresses implements IPAddressInterface type iPAddresses struct { *gentype.ClientWithListAndApply[*v1alpha1.IPAddress, *v1alpha1.IPAddressList, *networkingv1alpha1.IPAddressApplyConfiguration] } // newIPAddresses returns a IPAddresses func newIPAddresses(c *NetworkingV1alpha1Client) *iPAddresses { return &iPAddresses{ gentype.NewClientWithListAndApply[*v1alpha1.IPAddress, *v1alpha1.IPAddressList, *networkingv1alpha1.IPAddressApplyConfiguration]( "ipaddresses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.IPAddress { return &v1alpha1.IPAddress{} }, func() *v1alpha1.IPAddressList { return &v1alpha1.IPAddressList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/networking_client.go000066400000000000000000000063151472614177300315610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/networking/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type NetworkingV1alpha1Interface interface { RESTClient() rest.Interface IPAddressesGetter ServiceCIDRsGetter } // NetworkingV1alpha1Client is used to interact with features provided by the networking.k8s.io group. type NetworkingV1alpha1Client struct { restClient rest.Interface } func (c *NetworkingV1alpha1Client) IPAddresses() IPAddressInterface { return newIPAddresses(c) } func (c *NetworkingV1alpha1Client) ServiceCIDRs() ServiceCIDRInterface { return newServiceCIDRs(c) } // NewForConfig creates a new NetworkingV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NetworkingV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new NetworkingV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &NetworkingV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new NetworkingV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *NetworkingV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new NetworkingV1alpha1Client for the given RESTClient. func New(c rest.Interface) *NetworkingV1alpha1Client { return &NetworkingV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *NetworkingV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1alpha1/servicecidr.go000066400000000000000000000065601472614177300303400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/networking/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. // A group's client should implement this interface. type ServiceCIDRsGetter interface { ServiceCIDRs() ServiceCIDRInterface } // ServiceCIDRInterface has methods to work with ServiceCIDR resources. type ServiceCIDRInterface interface { Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (*v1alpha1.ServiceCIDR, error) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ServiceCIDR, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ServiceCIDRList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) ServiceCIDRExpansion } // serviceCIDRs implements ServiceCIDRInterface type serviceCIDRs struct { *gentype.ClientWithListAndApply[*v1alpha1.ServiceCIDR, *v1alpha1.ServiceCIDRList, *networkingv1alpha1.ServiceCIDRApplyConfiguration] } // newServiceCIDRs returns a ServiceCIDRs func newServiceCIDRs(c *NetworkingV1alpha1Client) *serviceCIDRs { return &serviceCIDRs{ gentype.NewClientWithListAndApply[*v1alpha1.ServiceCIDR, *v1alpha1.ServiceCIDRList, *networkingv1alpha1.ServiceCIDRApplyConfiguration]( "servicecidrs", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.ServiceCIDR { return &v1alpha1.ServiceCIDR{} }, func() *v1alpha1.ServiceCIDRList { return &v1alpha1.ServiceCIDRList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/000077500000000000000000000000001472614177300253265ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/doc.go000066400000000000000000000012641472614177300264250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/fake/000077500000000000000000000000001472614177300262345ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/fake/doc.go000066400000000000000000000012531472614177300273310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go000066400000000000000000000162561472614177300312350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" testing "k8s.io/client-go/testing" ) // FakeIngresses implements IngressInterface type FakeIngresses struct { Fake *FakeNetworkingV1beta1 ns string } var ingressesResource = v1beta1.SchemeGroupVersion.WithResource("ingresses") var ingressesKind = v1beta1.SchemeGroupVersion.WithKind("Ingress") // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { emptyResult := &v1beta1.IngressList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.IngressList{ListMeta: obj.(*v1beta1.IngressList).ListMeta} for _, item := range obj.(*v1beta1.IngressList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested ingresses. func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) } // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(ingressesResource, c.ns, name, opts), &v1beta1.Ingress{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) return err } // Patch applies the patch and returns the patched ingress. func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // Apply takes the given apply declarative configuration, applies it and returns the applied ingress. func (c *FakeIngresses) Apply(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { if ingress == nil { return nil, fmt.Errorf("ingress provided to Apply must not be nil") } data, err := json.Marshal(ingress) if err != nil { return nil, err } name := ingress.Name if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { if ingress == nil { return nil, fmt.Errorf("ingress provided to Apply must not be nil") } data, err := json.Marshal(ingress) if err != nil { return nil, err } name := ingress.Name if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Ingress), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go000066400000000000000000000140451472614177300322550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" testing "k8s.io/client-go/testing" ) // FakeIngressClasses implements IngressClassInterface type FakeIngressClasses struct { Fake *FakeNetworkingV1beta1 } var ingressclassesResource = v1beta1.SchemeGroupVersion.WithResource("ingressclasses") var ingressclassesKind = v1beta1.SchemeGroupVersion.WithKind("IngressClass") // Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. func (c *FakeIngressClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.IngressClass, err error) { emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(ingressclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IngressClass), err } // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. func (c *FakeIngressClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { emptyResult := &v1beta1.IngressClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(ingressclassesResource, ingressclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.IngressClassList{ListMeta: obj.(*v1beta1.IngressClassList).ListMeta} for _, item := range obj.(*v1beta1.IngressClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested ingressClasses. func (c *FakeIngressClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(ingressclassesResource, opts)) } // Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (result *v1beta1.IngressClass, err error) { emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IngressClass), err } // Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (result *v1beta1.IngressClass, err error) { emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IngressClass), err } // Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. func (c *FakeIngressClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(ingressclassesResource, name, opts), &v1beta1.IngressClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(ingressclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressClassList{}) return err } // Patch applies the patch and returns the patched ingressClass. func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IngressClass, err error) { emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IngressClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied ingressClass. func (c *FakeIngressClasses) Apply(ctx context.Context, ingressClass *networkingv1beta1.IngressClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IngressClass, err error) { if ingressClass == nil { return nil, fmt.Errorf("ingressClass provided to Apply must not be nil") } data, err := json.Marshal(ingressClass) if err != nil { return nil, err } name := ingressClass.Name if name == nil { return nil, fmt.Errorf("ingressClass.Name must be provided to Apply") } emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IngressClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go000066400000000000000000000135151472614177300315340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" testing "k8s.io/client-go/testing" ) // FakeIPAddresses implements IPAddressInterface type FakeIPAddresses struct { Fake *FakeNetworkingV1beta1 } var ipaddressesResource = v1beta1.SchemeGroupVersion.WithResource("ipaddresses") var ipaddressesKind = v1beta1.SchemeGroupVersion.WithKind("IPAddress") // Get takes name of the iPAddress, and returns the corresponding iPAddress object, and an error if there is any. func (c *FakeIPAddresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.IPAddress, err error) { emptyResult := &v1beta1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(ipaddressesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IPAddress), err } // List takes label and field selectors, and returns the list of IPAddresses that match those selectors. func (c *FakeIPAddresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IPAddressList, err error) { emptyResult := &v1beta1.IPAddressList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(ipaddressesResource, ipaddressesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.IPAddressList{ListMeta: obj.(*v1beta1.IPAddressList).ListMeta} for _, item := range obj.(*v1beta1.IPAddressList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested iPAddresses. func (c *FakeIPAddresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(ipaddressesResource, opts)) } // Create takes the representation of a iPAddress and creates it. Returns the server's representation of the iPAddress, and an error, if there is any. func (c *FakeIPAddresses) Create(ctx context.Context, iPAddress *v1beta1.IPAddress, opts v1.CreateOptions) (result *v1beta1.IPAddress, err error) { emptyResult := &v1beta1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IPAddress), err } // Update takes the representation of a iPAddress and updates it. Returns the server's representation of the iPAddress, and an error, if there is any. func (c *FakeIPAddresses) Update(ctx context.Context, iPAddress *v1beta1.IPAddress, opts v1.UpdateOptions) (result *v1beta1.IPAddress, err error) { emptyResult := &v1beta1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IPAddress), err } // Delete takes name of the iPAddress and deletes it. Returns an error if one occurs. func (c *FakeIPAddresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(ipaddressesResource, name, opts), &v1beta1.IPAddress{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeIPAddresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(ipaddressesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IPAddressList{}) return err } // Patch applies the patch and returns the patched iPAddress. func (c *FakeIPAddresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IPAddress, err error) { emptyResult := &v1beta1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IPAddress), err } // Apply takes the given apply declarative configuration, applies it and returns the applied iPAddress. func (c *FakeIPAddresses) Apply(ctx context.Context, iPAddress *networkingv1beta1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IPAddress, err error) { if iPAddress == nil { return nil, fmt.Errorf("iPAddress provided to Apply must not be nil") } data, err := json.Marshal(iPAddress) if err != nil { return nil, err } name := iPAddress.Name if name == nil { return nil, fmt.Errorf("iPAddress.Name must be provided to Apply") } emptyResult := &v1beta1.IPAddress{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.IPAddress), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go000066400000000000000000000027301472614177300333000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeNetworkingV1beta1 struct { *testing.Fake } func (c *FakeNetworkingV1beta1) IPAddresses() v1beta1.IPAddressInterface { return &FakeIPAddresses{c} } func (c *FakeNetworkingV1beta1) Ingresses(namespace string) v1beta1.IngressInterface { return &FakeIngresses{c, namespace} } func (c *FakeNetworkingV1beta1) IngressClasses() v1beta1.IngressClassInterface { return &FakeIngressClasses{c} } func (c *FakeNetworkingV1beta1) ServiceCIDRs() v1beta1.ServiceCIDRInterface { return &FakeServiceCIDRs{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeNetworkingV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go000066400000000000000000000167231472614177300320640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" testing "k8s.io/client-go/testing" ) // FakeServiceCIDRs implements ServiceCIDRInterface type FakeServiceCIDRs struct { Fake *FakeNetworkingV1beta1 } var servicecidrsResource = v1beta1.SchemeGroupVersion.WithResource("servicecidrs") var servicecidrsKind = v1beta1.SchemeGroupVersion.WithKind("ServiceCIDR") // Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ServiceCIDR, err error) { emptyResult := &v1beta1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(servicecidrsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ServiceCIDR), err } // List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ServiceCIDRList, err error) { emptyResult := &v1beta1.ServiceCIDRList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(servicecidrsResource, servicecidrsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.ServiceCIDRList{ListMeta: obj.(*v1beta1.ServiceCIDRList).ListMeta} for _, item := range obj.(*v1beta1.ServiceCIDRList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested serviceCIDRs. func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(servicecidrsResource, opts)) } // Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.CreateOptions) (result *v1beta1.ServiceCIDR, err error) { emptyResult := &v1beta1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ServiceCIDR), err } // Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (result *v1beta1.ServiceCIDR, err error) { emptyResult := &v1beta1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ServiceCIDR), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (result *v1beta1.ServiceCIDR, err error) { emptyResult := &v1beta1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(servicecidrsResource, "status", serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ServiceCIDR), err } // Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. func (c *FakeServiceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(servicecidrsResource, name, opts), &v1beta1.ServiceCIDR{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(servicecidrsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ServiceCIDRList{}) return err } // Patch applies the patch and returns the patched serviceCIDR. func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ServiceCIDR, err error) { emptyResult := &v1beta1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ServiceCIDR), err } // Apply takes the given apply declarative configuration, applies it and returns the applied serviceCIDR. func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) { if serviceCIDR == nil { return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") } data, err := json.Marshal(serviceCIDR) if err != nil { return nil, err } name := serviceCIDR.Name if name == nil { return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") } emptyResult := &v1beta1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ServiceCIDR), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) { if serviceCIDR == nil { return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") } data, err := json.Marshal(serviceCIDR) if err != nil { return nil, err } name := serviceCIDR.Name if name == nil { return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") } emptyResult := &v1beta1.ServiceCIDR{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ServiceCIDR), err } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/generated_expansion.go000066400000000000000000000014141472614177300316770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type IPAddressExpansion interface{} type IngressExpansion interface{} type IngressClassExpansion interface{} type ServiceCIDRExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/ingress.go000066400000000000000000000063171472614177300273360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // IngressesGetter has a method to return a IngressInterface. // A group's client should implement this interface. type IngressesGetter interface { Ingresses(namespace string) IngressInterface } // IngressInterface has methods to work with Ingress resources. type IngressInterface interface { Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Ingress, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) Apply(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) IngressExpansion } // ingresses implements IngressInterface type ingresses struct { *gentype.ClientWithListAndApply[*v1beta1.Ingress, *v1beta1.IngressList, *networkingv1beta1.IngressApplyConfiguration] } // newIngresses returns a Ingresses func newIngresses(c *NetworkingV1beta1Client, namespace string) *ingresses { return &ingresses{ gentype.NewClientWithListAndApply[*v1beta1.Ingress, *v1beta1.IngressList, *networkingv1beta1.IngressApplyConfiguration]( "ingresses", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.Ingress { return &v1beta1.Ingress{} }, func() *v1beta1.IngressList { return &v1beta1.IngressList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/ingressclass.go000066400000000000000000000056741472614177300303710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // IngressClassesGetter has a method to return a IngressClassInterface. // A group's client should implement this interface. type IngressClassesGetter interface { IngressClasses() IngressClassInterface } // IngressClassInterface has methods to work with IngressClass resources. type IngressClassInterface interface { Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (*v1beta1.IngressClass, error) Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (*v1beta1.IngressClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.IngressClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IngressClass, err error) Apply(ctx context.Context, ingressClass *networkingv1beta1.IngressClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IngressClass, err error) IngressClassExpansion } // ingressClasses implements IngressClassInterface type ingressClasses struct { *gentype.ClientWithListAndApply[*v1beta1.IngressClass, *v1beta1.IngressClassList, *networkingv1beta1.IngressClassApplyConfiguration] } // newIngressClasses returns a IngressClasses func newIngressClasses(c *NetworkingV1beta1Client) *ingressClasses { return &ingressClasses{ gentype.NewClientWithListAndApply[*v1beta1.IngressClass, *v1beta1.IngressClassList, *networkingv1beta1.IngressClassApplyConfiguration]( "ingressclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.IngressClass { return &v1beta1.IngressClass{} }, func() *v1beta1.IngressClassList { return &v1beta1.IngressClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/ipaddress.go000066400000000000000000000055041472614177300276370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // IPAddressesGetter has a method to return a IPAddressInterface. // A group's client should implement this interface. type IPAddressesGetter interface { IPAddresses() IPAddressInterface } // IPAddressInterface has methods to work with IPAddress resources. type IPAddressInterface interface { Create(ctx context.Context, iPAddress *v1beta1.IPAddress, opts v1.CreateOptions) (*v1beta1.IPAddress, error) Update(ctx context.Context, iPAddress *v1beta1.IPAddress, opts v1.UpdateOptions) (*v1beta1.IPAddress, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.IPAddress, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IPAddressList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IPAddress, err error) Apply(ctx context.Context, iPAddress *networkingv1beta1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IPAddress, err error) IPAddressExpansion } // iPAddresses implements IPAddressInterface type iPAddresses struct { *gentype.ClientWithListAndApply[*v1beta1.IPAddress, *v1beta1.IPAddressList, *networkingv1beta1.IPAddressApplyConfiguration] } // newIPAddresses returns a IPAddresses func newIPAddresses(c *NetworkingV1beta1Client) *iPAddresses { return &iPAddresses{ gentype.NewClientWithListAndApply[*v1beta1.IPAddress, *v1beta1.IPAddressList, *networkingv1beta1.IPAddressApplyConfiguration]( "ipaddresses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.IPAddress { return &v1beta1.IPAddress{} }, func() *v1beta1.IPAddressList { return &v1beta1.IPAddressList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/networking_client.go000066400000000000000000000067021472614177300314070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/networking/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type NetworkingV1beta1Interface interface { RESTClient() rest.Interface IPAddressesGetter IngressesGetter IngressClassesGetter ServiceCIDRsGetter } // NetworkingV1beta1Client is used to interact with features provided by the networking.k8s.io group. type NetworkingV1beta1Client struct { restClient rest.Interface } func (c *NetworkingV1beta1Client) IPAddresses() IPAddressInterface { return newIPAddresses(c) } func (c *NetworkingV1beta1Client) Ingresses(namespace string) IngressInterface { return newIngresses(c, namespace) } func (c *NetworkingV1beta1Client) IngressClasses() IngressClassInterface { return newIngressClasses(c) } func (c *NetworkingV1beta1Client) ServiceCIDRs() ServiceCIDRInterface { return newServiceCIDRs(c) } // NewForConfig creates a new NetworkingV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NetworkingV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new NetworkingV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &NetworkingV1beta1Client{client}, nil } // NewForConfigOrDie creates a new NetworkingV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *NetworkingV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new NetworkingV1beta1Client for the given RESTClient. func New(c rest.Interface) *NetworkingV1beta1Client { return &NetworkingV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *NetworkingV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/networking/v1beta1/servicecidr.go000066400000000000000000000065231472614177300301650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. // A group's client should implement this interface. type ServiceCIDRsGetter interface { ServiceCIDRs() ServiceCIDRInterface } // ServiceCIDRInterface has methods to work with ServiceCIDR resources. type ServiceCIDRInterface interface { Create(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.CreateOptions) (*v1beta1.ServiceCIDR, error) Update(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (*v1beta1.ServiceCIDR, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (*v1beta1.ServiceCIDR, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ServiceCIDR, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ServiceCIDRList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ServiceCIDR, err error) Apply(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) ServiceCIDRExpansion } // serviceCIDRs implements ServiceCIDRInterface type serviceCIDRs struct { *gentype.ClientWithListAndApply[*v1beta1.ServiceCIDR, *v1beta1.ServiceCIDRList, *networkingv1beta1.ServiceCIDRApplyConfiguration] } // newServiceCIDRs returns a ServiceCIDRs func newServiceCIDRs(c *NetworkingV1beta1Client) *serviceCIDRs { return &serviceCIDRs{ gentype.NewClientWithListAndApply[*v1beta1.ServiceCIDR, *v1beta1.ServiceCIDRList, *networkingv1beta1.ServiceCIDRApplyConfiguration]( "servicecidrs", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.ServiceCIDR { return &v1beta1.ServiceCIDR{} }, func() *v1beta1.ServiceCIDRList { return &v1beta1.ServiceCIDRList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/node/000077500000000000000000000000001472614177300226215ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/000077500000000000000000000000001472614177300231475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/doc.go000066400000000000000000000012571472614177300242500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/fake/000077500000000000000000000000001472614177300240555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/fake/doc.go000066400000000000000000000012531472614177300251520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/fake/fake_node_client.go000066400000000000000000000021131472614177300276520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/node/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeNodeV1 struct { *testing.Fake } func (c *FakeNodeV1) RuntimeClasses() v1.RuntimeClassInterface { return &FakeRuntimeClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeNodeV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/fake/fake_runtimeclass.go000066400000000000000000000136231472614177300301100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1 "k8s.io/client-go/applyconfigurations/node/v1" testing "k8s.io/client-go/testing" ) // FakeRuntimeClasses implements RuntimeClassInterface type FakeRuntimeClasses struct { Fake *FakeNodeV1 } var runtimeclassesResource = v1.SchemeGroupVersion.WithResource("runtimeclasses") var runtimeclassesKind = v1.SchemeGroupVersion.WithKind("RuntimeClass") // Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RuntimeClass, err error) { emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RuntimeClass), err } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *FakeRuntimeClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { emptyResult := &v1.RuntimeClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.RuntimeClassList{ListMeta: obj.(*v1.RuntimeClassList).ListMeta} for _, item := range obj.(*v1.RuntimeClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) } // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.CreateOptions) (result *v1.RuntimeClass, err error) { emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RuntimeClass), err } // Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.UpdateOptions) (result *v1.RuntimeClass, err error) { emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RuntimeClass), err } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(runtimeclassesResource, name, opts), &v1.RuntimeClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RuntimeClassList{}) return err } // Patch applies the patch and returns the patched runtimeClass. func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error) { emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RuntimeClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass. func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1.RuntimeClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RuntimeClass, err error) { if runtimeClass == nil { return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") } data, err := json.Marshal(runtimeClass) if err != nil { return nil, err } name := runtimeClass.Name if name == nil { return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") } emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RuntimeClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/generated_expansion.go000066400000000000000000000012301472614177300275140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type RuntimeClassExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/node_client.go000066400000000000000000000056061472614177300257700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/node/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type NodeV1Interface interface { RESTClient() rest.Interface RuntimeClassesGetter } // NodeV1Client is used to interact with features provided by the node.k8s.io group. type NodeV1Client struct { restClient rest.Interface } func (c *NodeV1Client) RuntimeClasses() RuntimeClassInterface { return newRuntimeClasses(c) } // NewForConfig creates a new NodeV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NodeV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new NodeV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &NodeV1Client{client}, nil } // NewForConfigOrDie creates a new NodeV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *NodeV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new NodeV1Client for the given RESTClient. func New(c rest.Interface) *NodeV1Client { return &NodeV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *NodeV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1/runtimeclass.go000066400000000000000000000055011472614177300262100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1 "k8s.io/client-go/applyconfigurations/node/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. // A group's client should implement this interface. type RuntimeClassesGetter interface { RuntimeClasses() RuntimeClassInterface } // RuntimeClassInterface has methods to work with RuntimeClass resources. type RuntimeClassInterface interface { Create(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.CreateOptions) (*v1.RuntimeClass, error) Update(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.UpdateOptions) (*v1.RuntimeClass, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RuntimeClass, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.RuntimeClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error) Apply(ctx context.Context, runtimeClass *nodev1.RuntimeClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RuntimeClass, err error) RuntimeClassExpansion } // runtimeClasses implements RuntimeClassInterface type runtimeClasses struct { *gentype.ClientWithListAndApply[*v1.RuntimeClass, *v1.RuntimeClassList, *nodev1.RuntimeClassApplyConfiguration] } // newRuntimeClasses returns a RuntimeClasses func newRuntimeClasses(c *NodeV1Client) *runtimeClasses { return &runtimeClasses{ gentype.NewClientWithListAndApply[*v1.RuntimeClass, *v1.RuntimeClassList, *nodev1.RuntimeClassApplyConfiguration]( "runtimeclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.RuntimeClass { return &v1.RuntimeClass{} }, func() *v1.RuntimeClassList { return &v1.RuntimeClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/000077500000000000000000000000001472614177300242365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/doc.go000066400000000000000000000012651472614177300253360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/fake/000077500000000000000000000000001472614177300251445ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300262410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/fake/fake_node_client.go000066400000000000000000000021571472614177300307510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeNodeV1alpha1 struct { *testing.Fake } func (c *FakeNodeV1alpha1) RuntimeClasses() v1alpha1.RuntimeClassInterface { return &FakeRuntimeClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeNodeV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go000066400000000000000000000140471472614177300312000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/node/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1alpha1 "k8s.io/client-go/applyconfigurations/node/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeRuntimeClasses implements RuntimeClassInterface type FakeRuntimeClasses struct { Fake *FakeNodeV1alpha1 } var runtimeclassesResource = v1alpha1.SchemeGroupVersion.WithResource("runtimeclasses") var runtimeclassesKind = v1alpha1.SchemeGroupVersion.WithKind("RuntimeClass") // Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RuntimeClass, err error) { emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { emptyResult := &v1alpha1.RuntimeClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.RuntimeClassList{ListMeta: obj.(*v1alpha1.RuntimeClassList).ListMeta} for _, item := range obj.(*v1alpha1.RuntimeClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) } // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (result *v1alpha1.RuntimeClass, err error) { emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } // Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (result *v1alpha1.RuntimeClass, err error) { emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(runtimeclassesResource, name, opts), &v1alpha1.RuntimeClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RuntimeClassList{}) return err } // Patch applies the patch and returns the patched runtimeClass. func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error) { emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass. func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RuntimeClass, err error) { if runtimeClass == nil { return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") } data, err := json.Marshal(runtimeClass) if err != nil { return nil, err } name := runtimeClass.Name if name == nil { return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") } emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/generated_expansion.go000066400000000000000000000012361472614177300306110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type RuntimeClassExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/node_client.go000066400000000000000000000057701472614177300270610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/node/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type NodeV1alpha1Interface interface { RESTClient() rest.Interface RuntimeClassesGetter } // NodeV1alpha1Client is used to interact with features provided by the node.k8s.io group. type NodeV1alpha1Client struct { restClient rest.Interface } func (c *NodeV1alpha1Client) RuntimeClasses() RuntimeClassInterface { return newRuntimeClasses(c) } // NewForConfig creates a new NodeV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NodeV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new NodeV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &NodeV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new NodeV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *NodeV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new NodeV1alpha1Client for the given RESTClient. func New(c rest.Interface) *NodeV1alpha1Client { return &NodeV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *NodeV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1alpha1/runtimeclass.go000066400000000000000000000056531472614177300273070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/node/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1alpha1 "k8s.io/client-go/applyconfigurations/node/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. // A group's client should implement this interface. type RuntimeClassesGetter interface { RuntimeClasses() RuntimeClassInterface } // RuntimeClassInterface has methods to work with RuntimeClass resources. type RuntimeClassInterface interface { Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (*v1alpha1.RuntimeClass, error) Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (*v1alpha1.RuntimeClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RuntimeClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RuntimeClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error) Apply(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RuntimeClass, err error) RuntimeClassExpansion } // runtimeClasses implements RuntimeClassInterface type runtimeClasses struct { *gentype.ClientWithListAndApply[*v1alpha1.RuntimeClass, *v1alpha1.RuntimeClassList, *nodev1alpha1.RuntimeClassApplyConfiguration] } // newRuntimeClasses returns a RuntimeClasses func newRuntimeClasses(c *NodeV1alpha1Client) *runtimeClasses { return &runtimeClasses{ gentype.NewClientWithListAndApply[*v1alpha1.RuntimeClass, *v1alpha1.RuntimeClassList, *nodev1alpha1.RuntimeClassApplyConfiguration]( "runtimeclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.RuntimeClass { return &v1alpha1.RuntimeClass{} }, func() *v1alpha1.RuntimeClassList { return &v1alpha1.RuntimeClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/000077500000000000000000000000001472614177300240645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/doc.go000066400000000000000000000012641472614177300251630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/fake/000077500000000000000000000000001472614177300247725ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/fake/doc.go000066400000000000000000000012531472614177300260670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/fake/fake_node_client.go000066400000000000000000000021511472614177300305710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeNodeV1beta1 struct { *testing.Fake } func (c *FakeNodeV1beta1) RuntimeClasses() v1beta1.RuntimeClassInterface { return &FakeRuntimeClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeNodeV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go000066400000000000000000000140071472614177300310220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/node/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1beta1 "k8s.io/client-go/applyconfigurations/node/v1beta1" testing "k8s.io/client-go/testing" ) // FakeRuntimeClasses implements RuntimeClassInterface type FakeRuntimeClasses struct { Fake *FakeNodeV1beta1 } var runtimeclassesResource = v1beta1.SchemeGroupVersion.WithResource("runtimeclasses") var runtimeclassesKind = v1beta1.SchemeGroupVersion.WithKind("RuntimeClass") // Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RuntimeClass, err error) { emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { emptyResult := &v1beta1.RuntimeClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.RuntimeClassList{ListMeta: obj.(*v1beta1.RuntimeClassList).ListMeta} for _, item := range obj.(*v1beta1.RuntimeClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) } // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (result *v1beta1.RuntimeClass, err error) { emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } // Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (result *v1beta1.RuntimeClass, err error) { emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(runtimeclassesResource, name, opts), &v1beta1.RuntimeClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RuntimeClassList{}) return err } // Patch applies the patch and returns the patched runtimeClass. func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RuntimeClass, err error) { emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass. func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RuntimeClass, err error) { if runtimeClass == nil { return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") } data, err := json.Marshal(runtimeClass) if err != nil { return nil, err } name := runtimeClass.Name if name == nil { return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") } emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/generated_expansion.go000066400000000000000000000012351472614177300304360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type RuntimeClassExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/node_client.go000066400000000000000000000057451472614177300267110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/node/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type NodeV1beta1Interface interface { RESTClient() rest.Interface RuntimeClassesGetter } // NodeV1beta1Client is used to interact with features provided by the node.k8s.io group. type NodeV1beta1Client struct { restClient rest.Interface } func (c *NodeV1beta1Client) RuntimeClasses() RuntimeClassInterface { return newRuntimeClasses(c) } // NewForConfig creates a new NodeV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NodeV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new NodeV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &NodeV1beta1Client{client}, nil } // NewForConfigOrDie creates a new NodeV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *NodeV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new NodeV1beta1Client for the given RESTClient. func New(c rest.Interface) *NodeV1beta1Client { return &NodeV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *NodeV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/node/v1beta1/runtimeclass.go000066400000000000000000000056221472614177300271310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/node/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1beta1 "k8s.io/client-go/applyconfigurations/node/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. // A group's client should implement this interface. type RuntimeClassesGetter interface { RuntimeClasses() RuntimeClassInterface } // RuntimeClassInterface has methods to work with RuntimeClass resources. type RuntimeClassInterface interface { Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (*v1beta1.RuntimeClass, error) Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (*v1beta1.RuntimeClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.RuntimeClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RuntimeClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RuntimeClass, err error) Apply(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RuntimeClass, err error) RuntimeClassExpansion } // runtimeClasses implements RuntimeClassInterface type runtimeClasses struct { *gentype.ClientWithListAndApply[*v1beta1.RuntimeClass, *v1beta1.RuntimeClassList, *nodev1beta1.RuntimeClassApplyConfiguration] } // newRuntimeClasses returns a RuntimeClasses func newRuntimeClasses(c *NodeV1beta1Client) *runtimeClasses { return &runtimeClasses{ gentype.NewClientWithListAndApply[*v1beta1.RuntimeClass, *v1beta1.RuntimeClassList, *nodev1beta1.RuntimeClassApplyConfiguration]( "runtimeclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.RuntimeClass { return &v1beta1.RuntimeClass{} }, func() *v1beta1.RuntimeClassList { return &v1beta1.RuntimeClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/000077500000000000000000000000001472614177300231735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/000077500000000000000000000000001472614177300235215ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/doc.go000066400000000000000000000012571472614177300246220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/eviction.go000066400000000000000000000026611472614177300256750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/policy/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // EvictionsGetter has a method to return a EvictionInterface. // A group's client should implement this interface. type EvictionsGetter interface { Evictions(namespace string) EvictionInterface } // EvictionInterface has methods to work with Eviction resources. type EvictionInterface interface { EvictionExpansion } // evictions implements EvictionInterface type evictions struct { *gentype.Client[*v1.Eviction] } // newEvictions returns a Evictions func newEvictions(c *PolicyV1Client, namespace string) *evictions { return &evictions{ gentype.NewClient[*v1.Eviction]( "evictions", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Eviction { return &v1.Eviction{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/eviction_expansion.go000066400000000000000000000021261472614177300277550ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "context" policy "k8s.io/api/policy/v1" ) // The EvictionExpansion interface allows manually adding extra methods to the ScaleInterface. type EvictionExpansion interface { Evict(ctx context.Context, eviction *policy.Eviction) error } func (c *evictions) Evict(ctx context.Context, eviction *policy.Eviction) error { return c.GetClient().Post(). AbsPath("/api/v1"). Namespace(eviction.Namespace). Resource("pods"). Name(eviction.Name). SubResource("eviction"). Body(eviction). Do(ctx). Error() } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/fake/000077500000000000000000000000001472614177300244275ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/fake/doc.go000066400000000000000000000012531472614177300255240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/fake/fake_eviction.go000066400000000000000000000013401472614177300275620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake // FakeEvictions implements EvictionInterface type FakeEvictions struct { Fake *FakePolicyV1 ns string } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go000066400000000000000000000021061472614177300316470ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" policy "k8s.io/api/policy/v1" "k8s.io/apimachinery/pkg/runtime/schema" core "k8s.io/client-go/testing" ) func (c *FakeEvictions) Evict(ctx context.Context, eviction *policy.Eviction) error { action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = c.ns action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} action.Subresource = "eviction" action.Object = eviction _, err := c.Fake.Invokes(action, eviction) return err } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go000066400000000000000000000200641472614177300320440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" policyv1 "k8s.io/client-go/applyconfigurations/policy/v1" testing "k8s.io/client-go/testing" ) // FakePodDisruptionBudgets implements PodDisruptionBudgetInterface type FakePodDisruptionBudgets struct { Fake *FakePolicyV1 ns string } var poddisruptionbudgetsResource = v1.SchemeGroupVersion.WithResource("poddisruptionbudgets") var poddisruptionbudgetsKind = v1.SchemeGroupVersion.WithKind("PodDisruptionBudget") // Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(poddisruptionbudgetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { emptyResult := &v1.PodDisruptionBudgetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.PodDisruptionBudgetList{ListMeta: obj.(*v1.PodDisruptionBudgetList).ListMeta} for _, item := range obj.(*v1.PodDisruptionBudgetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(poddisruptionbudgetsResource, c.ns, opts)) } // Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } // Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } // Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(poddisruptionbudgetsResource, c.ns, name, opts), &v1.PodDisruptionBudget{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(poddisruptionbudgetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PodDisruptionBudgetList{}) return err } // Patch applies the patch and returns the patched podDisruptionBudget. func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } // Apply takes the given apply declarative configuration, applies it and returns the applied podDisruptionBudget. func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) { if podDisruptionBudget == nil { return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") } data, err := json.Marshal(podDisruptionBudget) if err != nil { return nil, err } name := podDisruptionBudget.Name if name == nil { return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") } emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) { if podDisruptionBudget == nil { return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") } data, err := json.Marshal(podDisruptionBudget) if err != nil { return nil, err } name := podDisruptionBudget.Name if name == nil { return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") } emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/fake/fake_policy_client.go000066400000000000000000000023631472614177300306050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/policy/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakePolicyV1 struct { *testing.Fake } func (c *FakePolicyV1) Evictions(namespace string) v1.EvictionInterface { return &FakeEvictions{c, namespace} } func (c *FakePolicyV1) PodDisruptionBudgets(namespace string) v1.PodDisruptionBudgetInterface { return &FakePodDisruptionBudgets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakePolicyV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/generated_expansion.go000066400000000000000000000012371472614177300300750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type PodDisruptionBudgetExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/poddisruptionbudget.go000066400000000000000000000071571472614177300301600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" policyv1 "k8s.io/client-go/applyconfigurations/policy/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. // A group's client should implement this interface. type PodDisruptionBudgetsGetter interface { PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface } // PodDisruptionBudgetInterface has methods to work with PodDisruptionBudget resources. type PodDisruptionBudgetInterface interface { Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (*v1.PodDisruptionBudget, error) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PodDisruptionBudget, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodDisruptionBudgetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) PodDisruptionBudgetExpansion } // podDisruptionBudgets implements PodDisruptionBudgetInterface type podDisruptionBudgets struct { *gentype.ClientWithListAndApply[*v1.PodDisruptionBudget, *v1.PodDisruptionBudgetList, *policyv1.PodDisruptionBudgetApplyConfiguration] } // newPodDisruptionBudgets returns a PodDisruptionBudgets func newPodDisruptionBudgets(c *PolicyV1Client, namespace string) *podDisruptionBudgets { return &podDisruptionBudgets{ gentype.NewClientWithListAndApply[*v1.PodDisruptionBudget, *v1.PodDisruptionBudgetList, *policyv1.PodDisruptionBudgetApplyConfiguration]( "poddisruptionbudgets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.PodDisruptionBudget { return &v1.PodDisruptionBudget{} }, func() *v1.PodDisruptionBudgetList { return &v1.PodDisruptionBudgetList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1/policy_client.go000066400000000000000000000061251472614177300267110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/policy/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type PolicyV1Interface interface { RESTClient() rest.Interface EvictionsGetter PodDisruptionBudgetsGetter } // PolicyV1Client is used to interact with features provided by the policy group. type PolicyV1Client struct { restClient rest.Interface } func (c *PolicyV1Client) Evictions(namespace string) EvictionInterface { return newEvictions(c, namespace) } func (c *PolicyV1Client) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface { return newPodDisruptionBudgets(c, namespace) } // NewForConfig creates a new PolicyV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*PolicyV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new PolicyV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicyV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &PolicyV1Client{client}, nil } // NewForConfigOrDie creates a new PolicyV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *PolicyV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new PolicyV1Client for the given RESTClient. func New(c rest.Interface) *PolicyV1Client { return &PolicyV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *PolicyV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/000077500000000000000000000000001472614177300244365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/doc.go000066400000000000000000000012641472614177300255350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/eviction.go000066400000000000000000000027311472614177300266100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/policy/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // EvictionsGetter has a method to return a EvictionInterface. // A group's client should implement this interface. type EvictionsGetter interface { Evictions(namespace string) EvictionInterface } // EvictionInterface has methods to work with Eviction resources. type EvictionInterface interface { EvictionExpansion } // evictions implements EvictionInterface type evictions struct { *gentype.Client[*v1beta1.Eviction] } // newEvictions returns a Evictions func newEvictions(c *PolicyV1beta1Client, namespace string) *evictions { return &evictions{ gentype.NewClient[*v1beta1.Eviction]( "evictions", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.Eviction { return &v1beta1.Eviction{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/eviction_expansion.go000066400000000000000000000021401472614177300306660ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "context" policy "k8s.io/api/policy/v1beta1" ) // The EvictionExpansion interface allows manually adding extra methods to the ScaleInterface. type EvictionExpansion interface { Evict(ctx context.Context, eviction *policy.Eviction) error } func (c *evictions) Evict(ctx context.Context, eviction *policy.Eviction) error { return c.GetClient().Post(). AbsPath("/api/v1"). Namespace(eviction.Namespace). Resource("pods"). Name(eviction.Name). SubResource("eviction"). Body(eviction). Do(ctx). Error() } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/fake/000077500000000000000000000000001472614177300253445ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/fake/doc.go000066400000000000000000000012531472614177300264410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go000066400000000000000000000013451472614177300305040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake // FakeEvictions implements EvictionInterface type FakeEvictions struct { Fake *FakePolicyV1beta1 ns string } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go000066400000000000000000000021131472614177300325620ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" policy "k8s.io/api/policy/v1beta1" "k8s.io/apimachinery/pkg/runtime/schema" core "k8s.io/client-go/testing" ) func (c *FakeEvictions) Evict(ctx context.Context, eviction *policy.Eviction) error { action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = c.ns action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} action.Subresource = "eviction" action.Object = eviction _, err := c.Fake.Invokes(action, eviction) return err } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go000066400000000000000000000203101472614177300327530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" testing "k8s.io/client-go/testing" ) // FakePodDisruptionBudgets implements PodDisruptionBudgetInterface type FakePodDisruptionBudgets struct { Fake *FakePolicyV1beta1 ns string } var poddisruptionbudgetsResource = v1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets") var poddisruptionbudgetsKind = v1beta1.SchemeGroupVersion.WithKind("PodDisruptionBudget") // Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(poddisruptionbudgetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { emptyResult := &v1beta1.PodDisruptionBudgetList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.PodDisruptionBudgetList{ListMeta: obj.(*v1beta1.PodDisruptionBudgetList).ListMeta} for _, item := range obj.(*v1beta1.PodDisruptionBudgetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(poddisruptionbudgetsResource, c.ns, opts)) } // Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } // Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } // Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(poddisruptionbudgetsResource, c.ns, name, opts), &v1beta1.PodDisruptionBudget{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(poddisruptionbudgetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PodDisruptionBudgetList{}) return err } // Patch applies the patch and returns the patched podDisruptionBudget. func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } // Apply takes the given apply declarative configuration, applies it and returns the applied podDisruptionBudget. func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) { if podDisruptionBudget == nil { return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") } data, err := json.Marshal(podDisruptionBudget) if err != nil { return nil, err } name := podDisruptionBudget.Name if name == nil { return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") } emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) { if podDisruptionBudget == nil { return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") } data, err := json.Marshal(podDisruptionBudget) if err != nil { return nil, err } name := podDisruptionBudget.Name if name == nil { return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") } emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go000066400000000000000000000024331472614177300315200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakePolicyV1beta1 struct { *testing.Fake } func (c *FakePolicyV1beta1) Evictions(namespace string) v1beta1.EvictionInterface { return &FakeEvictions{c, namespace} } func (c *FakePolicyV1beta1) PodDisruptionBudgets(namespace string) v1beta1.PodDisruptionBudgetInterface { return &FakePodDisruptionBudgets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakePolicyV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/generated_expansion.go000066400000000000000000000012441472614177300310100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type PodDisruptionBudgetExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go000066400000000000000000000073141472614177300310700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. // A group's client should implement this interface. type PodDisruptionBudgetsGetter interface { PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface } // PodDisruptionBudgetInterface has methods to work with PodDisruptionBudget resources. type PodDisruptionBudgetInterface interface { Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (*v1beta1.PodDisruptionBudget, error) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PodDisruptionBudget, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) Apply(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) PodDisruptionBudgetExpansion } // podDisruptionBudgets implements PodDisruptionBudgetInterface type podDisruptionBudgets struct { *gentype.ClientWithListAndApply[*v1beta1.PodDisruptionBudget, *v1beta1.PodDisruptionBudgetList, *policyv1beta1.PodDisruptionBudgetApplyConfiguration] } // newPodDisruptionBudgets returns a PodDisruptionBudgets func newPodDisruptionBudgets(c *PolicyV1beta1Client, namespace string) *podDisruptionBudgets { return &podDisruptionBudgets{ gentype.NewClientWithListAndApply[*v1beta1.PodDisruptionBudget, *v1beta1.PodDisruptionBudgetList, *policyv1beta1.PodDisruptionBudgetApplyConfiguration]( "poddisruptionbudgets", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.PodDisruptionBudget { return &v1beta1.PodDisruptionBudget{} }, func() *v1beta1.PodDisruptionBudgetList { return &v1beta1.PodDisruptionBudgetList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/policy/v1beta1/policy_client.go000066400000000000000000000062711472614177300276300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/policy/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type PolicyV1beta1Interface interface { RESTClient() rest.Interface EvictionsGetter PodDisruptionBudgetsGetter } // PolicyV1beta1Client is used to interact with features provided by the policy group. type PolicyV1beta1Client struct { restClient rest.Interface } func (c *PolicyV1beta1Client) Evictions(namespace string) EvictionInterface { return newEvictions(c, namespace) } func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface { return newPodDisruptionBudgets(c, namespace) } // NewForConfig creates a new PolicyV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new PolicyV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicyV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &PolicyV1beta1Client{client}, nil } // NewForConfigOrDie creates a new PolicyV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *PolicyV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new PolicyV1beta1Client for the given RESTClient. func New(c rest.Interface) *PolicyV1beta1Client { return &PolicyV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *PolicyV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/000077500000000000000000000000001472614177300226035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/OWNERS000066400000000000000000000002441472614177300235430ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-auth-authorizers-approvers reviewers: - sig-auth-authorizers-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/000077500000000000000000000000001472614177300231315ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/clusterrole.go000066400000000000000000000054161472614177300260310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. // A group's client should implement this interface. type ClusterRolesGetter interface { ClusterRoles() ClusterRoleInterface } // ClusterRoleInterface has methods to work with ClusterRole resources. type ClusterRoleInterface interface { Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (*v1.ClusterRole, error) Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (*v1.ClusterRole, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterRole, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error) Apply(ctx context.Context, clusterRole *rbacv1.ClusterRoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRole, err error) ClusterRoleExpansion } // clusterRoles implements ClusterRoleInterface type clusterRoles struct { *gentype.ClientWithListAndApply[*v1.ClusterRole, *v1.ClusterRoleList, *rbacv1.ClusterRoleApplyConfiguration] } // newClusterRoles returns a ClusterRoles func newClusterRoles(c *RbacV1Client) *clusterRoles { return &clusterRoles{ gentype.NewClientWithListAndApply[*v1.ClusterRole, *v1.ClusterRoleList, *rbacv1.ClusterRoleApplyConfiguration]( "clusterroles", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.ClusterRole { return &v1.ClusterRole{} }, func() *v1.ClusterRoleList { return &v1.ClusterRoleList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/clusterrolebinding.go000066400000000000000000000060461472614177300273640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. // A group's client should implement this interface. type ClusterRoleBindingsGetter interface { ClusterRoleBindings() ClusterRoleBindingInterface } // ClusterRoleBindingInterface has methods to work with ClusterRoleBinding resources. type ClusterRoleBindingInterface interface { Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (*v1.ClusterRoleBinding, error) Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (*v1.ClusterRoleBinding, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterRoleBinding, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error) Apply(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRoleBinding, err error) ClusterRoleBindingExpansion } // clusterRoleBindings implements ClusterRoleBindingInterface type clusterRoleBindings struct { *gentype.ClientWithListAndApply[*v1.ClusterRoleBinding, *v1.ClusterRoleBindingList, *rbacv1.ClusterRoleBindingApplyConfiguration] } // newClusterRoleBindings returns a ClusterRoleBindings func newClusterRoleBindings(c *RbacV1Client) *clusterRoleBindings { return &clusterRoleBindings{ gentype.NewClientWithListAndApply[*v1.ClusterRoleBinding, *v1.ClusterRoleBindingList, *rbacv1.ClusterRoleBindingApplyConfiguration]( "clusterrolebindings", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.ClusterRoleBinding { return &v1.ClusterRoleBinding{} }, func() *v1.ClusterRoleBindingList { return &v1.ClusterRoleBindingList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/doc.go000066400000000000000000000012571472614177300242320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/fake/000077500000000000000000000000001472614177300240375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/fake/doc.go000066400000000000000000000012531472614177300251340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go000066400000000000000000000134611472614177300277240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" testing "k8s.io/client-go/testing" ) // FakeClusterRoles implements ClusterRoleInterface type FakeClusterRoles struct { Fake *FakeRbacV1 } var clusterrolesResource = v1.SchemeGroupVersion.WithResource("clusterroles") var clusterrolesKind = v1.SchemeGroupVersion.WithKind("ClusterRole") // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. func (c *FakeClusterRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRole, err error) { emptyResult := &v1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRole), err } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *FakeClusterRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { emptyResult := &v1.ClusterRoleList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ClusterRoleList{ListMeta: obj.(*v1.ClusterRoleList).ListMeta} for _, item := range obj.(*v1.ClusterRoleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *FakeClusterRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (result *v1.ClusterRole, err error) { emptyResult := &v1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRole), err } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (result *v1.ClusterRole, err error) { emptyResult := &v1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRole), err } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(clusterrolesResource, name, opts), &v1.ClusterRole{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterRoleList{}) return err } // Patch applies the patch and returns the patched clusterRole. func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error) { emptyResult := &v1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRole), err } // Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole. func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1.ClusterRoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRole, err error) { if clusterRole == nil { return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") } data, err := json.Marshal(clusterRole) if err != nil { return nil, err } name := clusterRole.Name if name == nil { return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") } emptyResult := &v1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRole), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go000066400000000000000000000144511472614177300312570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" testing "k8s.io/client-go/testing" ) // FakeClusterRoleBindings implements ClusterRoleBindingInterface type FakeClusterRoleBindings struct { Fake *FakeRbacV1 } var clusterrolebindingsResource = v1.SchemeGroupVersion.WithResource("clusterrolebindings") var clusterrolebindingsKind = v1.SchemeGroupVersion.WithKind("ClusterRoleBinding") // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleBinding, err error) { emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *FakeClusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { emptyResult := &v1.ClusterRoleBindingList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.ClusterRoleBindingList{ListMeta: obj.(*v1.ClusterRoleBindingList).ListMeta} for _, item := range obj.(*v1.ClusterRoleBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (result *v1.ClusterRoleBinding, err error) { emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (result *v1.ClusterRoleBinding, err error) { emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(clusterrolebindingsResource, name, opts), &v1.ClusterRoleBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterRoleBindingList{}) return err } // Patch applies the patch and returns the patched clusterRoleBinding. func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error) { emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding. func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRoleBinding, err error) { if clusterRoleBinding == nil { return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") } data, err := json.Marshal(clusterRoleBinding) if err != nil { return nil, err } name := clusterRoleBinding.Name if name == nil { return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") } emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go000066400000000000000000000026261472614177300276270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/rbac/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeRbacV1 struct { *testing.Fake } func (c *FakeRbacV1) ClusterRoles() v1.ClusterRoleInterface { return &FakeClusterRoles{c} } func (c *FakeRbacV1) ClusterRoleBindings() v1.ClusterRoleBindingInterface { return &FakeClusterRoleBindings{c} } func (c *FakeRbacV1) Roles(namespace string) v1.RoleInterface { return &FakeRoles{c, namespace} } func (c *FakeRbacV1) RoleBindings(namespace string) v1.RoleBindingInterface { return &FakeRoleBindings{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeRbacV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/fake/fake_role.go000066400000000000000000000125401472614177300263170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" testing "k8s.io/client-go/testing" ) // FakeRoles implements RoleInterface type FakeRoles struct { Fake *FakeRbacV1 ns string } var rolesResource = v1.SchemeGroupVersion.WithResource("roles") var rolesKind = v1.SchemeGroupVersion.WithKind("Role") // Get takes name of the role, and returns the corresponding role object, and an error if there is any. func (c *FakeRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Role, err error) { emptyResult := &v1.Role{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Role), err } // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *FakeRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { emptyResult := &v1.RoleList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.RoleList{ListMeta: obj.(*v1.RoleList).ListMeta} for _, item := range obj.(*v1.RoleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested roles. func (c *FakeRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) } // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (result *v1.Role, err error) { emptyResult := &v1.Role{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Role), err } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (result *v1.Role, err error) { emptyResult := &v1.Role{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Role), err } // Delete takes name of the role and deletes it. Returns an error if one occurs. func (c *FakeRoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(rolesResource, c.ns, name, opts), &v1.Role{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RoleList{}) return err } // Patch applies the patch and returns the patched role. func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error) { emptyResult := &v1.Role{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Role), err } // Apply takes the given apply declarative configuration, applies it and returns the applied role. func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1.RoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Role, err error) { if role == nil { return nil, fmt.Errorf("role provided to Apply must not be nil") } data, err := json.Marshal(role) if err != nil { return nil, err } name := role.Name if name == nil { return nil, fmt.Errorf("role.Name must be provided to Apply") } emptyResult := &v1.Role{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.Role), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go000066400000000000000000000135301472614177300276520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" testing "k8s.io/client-go/testing" ) // FakeRoleBindings implements RoleBindingInterface type FakeRoleBindings struct { Fake *FakeRbacV1 ns string } var rolebindingsResource = v1.SchemeGroupVersion.WithResource("rolebindings") var rolebindingsKind = v1.SchemeGroupVersion.WithKind("RoleBinding") // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. func (c *FakeRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RoleBinding, err error) { emptyResult := &v1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RoleBinding), err } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *FakeRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { emptyResult := &v1.RoleBindingList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.RoleBindingList{ListMeta: obj.(*v1.RoleBindingList).ListMeta} for _, item := range obj.(*v1.RoleBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested roleBindings. func (c *FakeRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) } // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (result *v1.RoleBinding, err error) { emptyResult := &v1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RoleBinding), err } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (result *v1.RoleBinding, err error) { emptyResult := &v1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RoleBinding), err } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(rolebindingsResource, c.ns, name, opts), &v1.RoleBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RoleBindingList{}) return err } // Patch applies the patch and returns the patched roleBinding. func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error) { emptyResult := &v1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RoleBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding. func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1.RoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RoleBinding, err error) { if roleBinding == nil { return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") } data, err := json.Marshal(roleBinding) if err != nil { return nil, err } name := roleBinding.Name if name == nil { return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") } emptyResult := &v1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.RoleBinding), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/generated_expansion.go000066400000000000000000000014141472614177300275020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type ClusterRoleExpansion interface{} type ClusterRoleBindingExpansion interface{} type RoleExpansion interface{} type RoleBindingExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/rbac_client.go000066400000000000000000000064201472614177300257270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/rbac/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type RbacV1Interface interface { RESTClient() rest.Interface ClusterRolesGetter ClusterRoleBindingsGetter RolesGetter RoleBindingsGetter } // RbacV1Client is used to interact with features provided by the rbac.authorization.k8s.io group. type RbacV1Client struct { restClient rest.Interface } func (c *RbacV1Client) ClusterRoles() ClusterRoleInterface { return newClusterRoles(c) } func (c *RbacV1Client) ClusterRoleBindings() ClusterRoleBindingInterface { return newClusterRoleBindings(c) } func (c *RbacV1Client) Roles(namespace string) RoleInterface { return newRoles(c, namespace) } func (c *RbacV1Client) RoleBindings(namespace string) RoleBindingInterface { return newRoleBindings(c, namespace) } // NewForConfig creates a new RbacV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*RbacV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new RbacV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &RbacV1Client{client}, nil } // NewForConfigOrDie creates a new RbacV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *RbacV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new RbacV1Client for the given RESTClient. func New(c rest.Interface) *RbacV1Client { return &RbacV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *RbacV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/role.go000066400000000000000000000050371472614177300244260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RolesGetter has a method to return a RoleInterface. // A group's client should implement this interface. type RolesGetter interface { Roles(namespace string) RoleInterface } // RoleInterface has methods to work with Role resources. type RoleInterface interface { Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (*v1.Role, error) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (*v1.Role, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Role, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error) Apply(ctx context.Context, role *rbacv1.RoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Role, err error) RoleExpansion } // roles implements RoleInterface type roles struct { *gentype.ClientWithListAndApply[*v1.Role, *v1.RoleList, *rbacv1.RoleApplyConfiguration] } // newRoles returns a Roles func newRoles(c *RbacV1Client, namespace string) *roles { return &roles{ gentype.NewClientWithListAndApply[*v1.Role, *v1.RoleList, *rbacv1.RoleApplyConfiguration]( "roles", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.Role { return &v1.Role{} }, func() *v1.RoleList { return &v1.RoleList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1/rolebinding.go000066400000000000000000000054671472614177300257700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. // A group's client should implement this interface. type RoleBindingsGetter interface { RoleBindings(namespace string) RoleBindingInterface } // RoleBindingInterface has methods to work with RoleBinding resources. type RoleBindingInterface interface { Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (*v1.RoleBinding, error) Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (*v1.RoleBinding, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RoleBinding, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error) Apply(ctx context.Context, roleBinding *rbacv1.RoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RoleBinding, err error) RoleBindingExpansion } // roleBindings implements RoleBindingInterface type roleBindings struct { *gentype.ClientWithListAndApply[*v1.RoleBinding, *v1.RoleBindingList, *rbacv1.RoleBindingApplyConfiguration] } // newRoleBindings returns a RoleBindings func newRoleBindings(c *RbacV1Client, namespace string) *roleBindings { return &roleBindings{ gentype.NewClientWithListAndApply[*v1.RoleBinding, *v1.RoleBindingList, *rbacv1.RoleBindingApplyConfiguration]( "rolebindings", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.RoleBinding { return &v1.RoleBinding{} }, func() *v1.RoleBindingList { return &v1.RoleBindingList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/000077500000000000000000000000001472614177300242205ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/clusterrole.go000066400000000000000000000055701472614177300271210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. // A group's client should implement this interface. type ClusterRolesGetter interface { ClusterRoles() ClusterRoleInterface } // ClusterRoleInterface has methods to work with ClusterRole resources. type ClusterRoleInterface interface { Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (*v1alpha1.ClusterRole, error) Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (*v1alpha1.ClusterRole, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterRole, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error) Apply(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRole, err error) ClusterRoleExpansion } // clusterRoles implements ClusterRoleInterface type clusterRoles struct { *gentype.ClientWithListAndApply[*v1alpha1.ClusterRole, *v1alpha1.ClusterRoleList, *rbacv1alpha1.ClusterRoleApplyConfiguration] } // newClusterRoles returns a ClusterRoles func newClusterRoles(c *RbacV1alpha1Client) *clusterRoles { return &clusterRoles{ gentype.NewClientWithListAndApply[*v1alpha1.ClusterRole, *v1alpha1.ClusterRoleList, *rbacv1alpha1.ClusterRoleApplyConfiguration]( "clusterroles", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.ClusterRole { return &v1alpha1.ClusterRole{} }, func() *v1alpha1.ClusterRoleList { return &v1alpha1.ClusterRoleList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go000066400000000000000000000062201472614177300304450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. // A group's client should implement this interface. type ClusterRoleBindingsGetter interface { ClusterRoleBindings() ClusterRoleBindingInterface } // ClusterRoleBindingInterface has methods to work with ClusterRoleBinding resources. type ClusterRoleBindingInterface interface { Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (*v1alpha1.ClusterRoleBinding, error) Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (*v1alpha1.ClusterRoleBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterRoleBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) Apply(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRoleBinding, err error) ClusterRoleBindingExpansion } // clusterRoleBindings implements ClusterRoleBindingInterface type clusterRoleBindings struct { *gentype.ClientWithListAndApply[*v1alpha1.ClusterRoleBinding, *v1alpha1.ClusterRoleBindingList, *rbacv1alpha1.ClusterRoleBindingApplyConfiguration] } // newClusterRoleBindings returns a ClusterRoleBindings func newClusterRoleBindings(c *RbacV1alpha1Client) *clusterRoleBindings { return &clusterRoleBindings{ gentype.NewClientWithListAndApply[*v1alpha1.ClusterRoleBinding, *v1alpha1.ClusterRoleBindingList, *rbacv1alpha1.ClusterRoleBindingApplyConfiguration]( "clusterrolebindings", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.ClusterRoleBinding { return &v1alpha1.ClusterRoleBinding{} }, func() *v1alpha1.ClusterRoleBindingList { return &v1alpha1.ClusterRoleBindingList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/doc.go000066400000000000000000000012651472614177300253200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/fake/000077500000000000000000000000001472614177300251265ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300262230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go000066400000000000000000000137051472614177300310140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeClusterRoles implements ClusterRoleInterface type FakeClusterRoles struct { Fake *FakeRbacV1alpha1 } var clusterrolesResource = v1alpha1.SchemeGroupVersion.WithResource("clusterroles") var clusterrolesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterRole") // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRole, err error) { emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { emptyResult := &v1alpha1.ClusterRoleList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.ClusterRoleList{ListMeta: obj.(*v1alpha1.ClusterRoleList).ListMeta} for _, item := range obj.(*v1alpha1.ClusterRoleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *FakeClusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (result *v1alpha1.ClusterRole, err error) { emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (result *v1alpha1.ClusterRole, err error) { emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(clusterrolesResource, name, opts), &v1alpha1.ClusterRole{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterRoleList{}) return err } // Patch applies the patch and returns the patched clusterRole. func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error) { emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } // Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole. func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRole, err error) { if clusterRole == nil { return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") } data, err := json.Marshal(clusterRole) if err != nil { return nil, err } name := clusterRole.Name if name == nil { return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") } emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go000066400000000000000000000146751472614177300323560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeClusterRoleBindings implements ClusterRoleBindingInterface type FakeClusterRoleBindings struct { Fake *FakeRbacV1alpha1 } var clusterrolebindingsResource = v1alpha1.SchemeGroupVersion.WithResource("clusterrolebindings") var clusterrolebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterRoleBinding") // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRoleBinding, err error) { emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { emptyResult := &v1alpha1.ClusterRoleBindingList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.ClusterRoleBindingList{ListMeta: obj.(*v1alpha1.ClusterRoleBindingList).ListMeta} for _, item := range obj.(*v1alpha1.ClusterRoleBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(clusterrolebindingsResource, name, opts), &v1alpha1.ClusterRoleBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterRoleBindingList{}) return err } // Patch applies the patch and returns the patched clusterRoleBinding. func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding. func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRoleBinding, err error) { if clusterRoleBinding == nil { return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") } data, err := json.Marshal(clusterRoleBinding) if err != nil { return nil, err } name := clusterRoleBinding.Name if name == nil { return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") } emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go000066400000000000000000000027361472614177300307200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeRbacV1alpha1 struct { *testing.Fake } func (c *FakeRbacV1alpha1) ClusterRoles() v1alpha1.ClusterRoleInterface { return &FakeClusterRoles{c} } func (c *FakeRbacV1alpha1) ClusterRoleBindings() v1alpha1.ClusterRoleBindingInterface { return &FakeClusterRoleBindings{c} } func (c *FakeRbacV1alpha1) Roles(namespace string) v1alpha1.RoleInterface { return &FakeRoles{c, namespace} } func (c *FakeRbacV1alpha1) RoleBindings(namespace string) v1alpha1.RoleBindingInterface { return &FakeRoleBindings{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeRbacV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go000066400000000000000000000127641472614177300274160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeRoles implements RoleInterface type FakeRoles struct { Fake *FakeRbacV1alpha1 ns string } var rolesResource = v1alpha1.SchemeGroupVersion.WithResource("roles") var rolesKind = v1alpha1.SchemeGroupVersion.WithKind("Role") // Get takes name of the role, and returns the corresponding role object, and an error if there is any. func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Role, err error) { emptyResult := &v1alpha1.Role{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.Role), err } // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { emptyResult := &v1alpha1.RoleList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.RoleList{ListMeta: obj.(*v1alpha1.RoleList).ListMeta} for _, item := range obj.(*v1alpha1.RoleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested roles. func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) } // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (result *v1alpha1.Role, err error) { emptyResult := &v1alpha1.Role{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.Role), err } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (result *v1alpha1.Role, err error) { emptyResult := &v1alpha1.Role{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.Role), err } // Delete takes name of the role and deletes it. Returns an error if one occurs. func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(rolesResource, c.ns, name, opts), &v1alpha1.Role{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RoleList{}) return err } // Patch applies the patch and returns the patched role. func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error) { emptyResult := &v1alpha1.Role{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.Role), err } // Apply takes the given apply declarative configuration, applies it and returns the applied role. func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1alpha1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Role, err error) { if role == nil { return nil, fmt.Errorf("role provided to Apply must not be nil") } data, err := json.Marshal(role) if err != nil { return nil, err } name := role.Name if name == nil { return nil, fmt.Errorf("role.Name must be provided to Apply") } emptyResult := &v1alpha1.Role{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.Role), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go000066400000000000000000000137541472614177300307510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeRoleBindings implements RoleBindingInterface type FakeRoleBindings struct { Fake *FakeRbacV1alpha1 ns string } var rolebindingsResource = v1alpha1.SchemeGroupVersion.WithResource("rolebindings") var rolebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("RoleBinding") // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RoleBinding, err error) { emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { emptyResult := &v1alpha1.RoleBindingList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.RoleBindingList{ListMeta: obj.(*v1alpha1.RoleBindingList).ListMeta} for _, item := range obj.(*v1alpha1.RoleBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested roleBindings. func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) } // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (result *v1alpha1.RoleBinding, err error) { emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (result *v1alpha1.RoleBinding, err error) { emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(rolebindingsResource, c.ns, name, opts), &v1alpha1.RoleBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RoleBindingList{}) return err } // Patch applies the patch and returns the patched roleBinding. func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error) { emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding. func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1alpha1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RoleBinding, err error) { if roleBinding == nil { return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") } data, err := json.Marshal(roleBinding) if err != nil { return nil, err } name := roleBinding.Name if name == nil { return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") } emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/generated_expansion.go000066400000000000000000000014221472614177300305700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type ClusterRoleExpansion interface{} type ClusterRoleBindingExpansion interface{} type RoleExpansion interface{} type RoleBindingExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/rbac_client.go000066400000000000000000000066241472614177300270240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type RbacV1alpha1Interface interface { RESTClient() rest.Interface ClusterRolesGetter ClusterRoleBindingsGetter RolesGetter RoleBindingsGetter } // RbacV1alpha1Client is used to interact with features provided by the rbac.authorization.k8s.io group. type RbacV1alpha1Client struct { restClient rest.Interface } func (c *RbacV1alpha1Client) ClusterRoles() ClusterRoleInterface { return newClusterRoles(c) } func (c *RbacV1alpha1Client) ClusterRoleBindings() ClusterRoleBindingInterface { return newClusterRoleBindings(c) } func (c *RbacV1alpha1Client) Roles(namespace string) RoleInterface { return newRoles(c, namespace) } func (c *RbacV1alpha1Client) RoleBindings(namespace string) RoleBindingInterface { return newRoleBindings(c, namespace) } // NewForConfig creates a new RbacV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*RbacV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new RbacV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &RbacV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new RbacV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *RbacV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new RbacV1alpha1Client for the given RESTClient. func New(c rest.Interface) *RbacV1alpha1Client { return &RbacV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *RbacV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/role.go000066400000000000000000000052111472614177300255070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RolesGetter has a method to return a RoleInterface. // A group's client should implement this interface. type RolesGetter interface { Roles(namespace string) RoleInterface } // RoleInterface has methods to work with Role resources. type RoleInterface interface { Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (*v1alpha1.Role, error) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (*v1alpha1.Role, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Role, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error) Apply(ctx context.Context, role *rbacv1alpha1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Role, err error) RoleExpansion } // roles implements RoleInterface type roles struct { *gentype.ClientWithListAndApply[*v1alpha1.Role, *v1alpha1.RoleList, *rbacv1alpha1.RoleApplyConfiguration] } // newRoles returns a Roles func newRoles(c *RbacV1alpha1Client, namespace string) *roles { return &roles{ gentype.NewClientWithListAndApply[*v1alpha1.Role, *v1alpha1.RoleList, *rbacv1alpha1.RoleApplyConfiguration]( "roles", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1alpha1.Role { return &v1alpha1.Role{} }, func() *v1alpha1.RoleList { return &v1alpha1.RoleList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1alpha1/rolebinding.go000066400000000000000000000056411472614177300270510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. // A group's client should implement this interface. type RoleBindingsGetter interface { RoleBindings(namespace string) RoleBindingInterface } // RoleBindingInterface has methods to work with RoleBinding resources. type RoleBindingInterface interface { Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (*v1alpha1.RoleBinding, error) Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (*v1alpha1.RoleBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RoleBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error) Apply(ctx context.Context, roleBinding *rbacv1alpha1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RoleBinding, err error) RoleBindingExpansion } // roleBindings implements RoleBindingInterface type roleBindings struct { *gentype.ClientWithListAndApply[*v1alpha1.RoleBinding, *v1alpha1.RoleBindingList, *rbacv1alpha1.RoleBindingApplyConfiguration] } // newRoleBindings returns a RoleBindings func newRoleBindings(c *RbacV1alpha1Client, namespace string) *roleBindings { return &roleBindings{ gentype.NewClientWithListAndApply[*v1alpha1.RoleBinding, *v1alpha1.RoleBindingList, *rbacv1alpha1.RoleBindingApplyConfiguration]( "rolebindings", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1alpha1.RoleBinding { return &v1alpha1.RoleBinding{} }, func() *v1alpha1.RoleBindingList { return &v1alpha1.RoleBindingList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/000077500000000000000000000000001472614177300240465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/clusterrole.go000066400000000000000000000055371472614177300267520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. // A group's client should implement this interface. type ClusterRolesGetter interface { ClusterRoles() ClusterRoleInterface } // ClusterRoleInterface has methods to work with ClusterRole resources. type ClusterRoleInterface interface { Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (*v1beta1.ClusterRole, error) Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (*v1beta1.ClusterRole, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterRole, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRole, err error) Apply(ctx context.Context, clusterRole *rbacv1beta1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRole, err error) ClusterRoleExpansion } // clusterRoles implements ClusterRoleInterface type clusterRoles struct { *gentype.ClientWithListAndApply[*v1beta1.ClusterRole, *v1beta1.ClusterRoleList, *rbacv1beta1.ClusterRoleApplyConfiguration] } // newClusterRoles returns a ClusterRoles func newClusterRoles(c *RbacV1beta1Client) *clusterRoles { return &clusterRoles{ gentype.NewClientWithListAndApply[*v1beta1.ClusterRole, *v1beta1.ClusterRoleList, *rbacv1beta1.ClusterRoleApplyConfiguration]( "clusterroles", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.ClusterRole { return &v1beta1.ClusterRole{} }, func() *v1beta1.ClusterRoleList { return &v1beta1.ClusterRoleList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go000066400000000000000000000061671472614177300303050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. // A group's client should implement this interface. type ClusterRoleBindingsGetter interface { ClusterRoleBindings() ClusterRoleBindingInterface } // ClusterRoleBindingInterface has methods to work with ClusterRoleBinding resources. type ClusterRoleBindingInterface interface { Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (*v1beta1.ClusterRoleBinding, error) Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (*v1beta1.ClusterRoleBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterRoleBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) Apply(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRoleBinding, err error) ClusterRoleBindingExpansion } // clusterRoleBindings implements ClusterRoleBindingInterface type clusterRoleBindings struct { *gentype.ClientWithListAndApply[*v1beta1.ClusterRoleBinding, *v1beta1.ClusterRoleBindingList, *rbacv1beta1.ClusterRoleBindingApplyConfiguration] } // newClusterRoleBindings returns a ClusterRoleBindings func newClusterRoleBindings(c *RbacV1beta1Client) *clusterRoleBindings { return &clusterRoleBindings{ gentype.NewClientWithListAndApply[*v1beta1.ClusterRoleBinding, *v1beta1.ClusterRoleBindingList, *rbacv1beta1.ClusterRoleBindingApplyConfiguration]( "clusterrolebindings", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.ClusterRoleBinding { return &v1beta1.ClusterRoleBinding{} }, func() *v1beta1.ClusterRoleBindingList { return &v1beta1.ClusterRoleBindingList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/doc.go000066400000000000000000000012641472614177300251450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/fake/000077500000000000000000000000001472614177300247545ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/fake/doc.go000066400000000000000000000012531472614177300260510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go000066400000000000000000000136451472614177300306450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" testing "k8s.io/client-go/testing" ) // FakeClusterRoles implements ClusterRoleInterface type FakeClusterRoles struct { Fake *FakeRbacV1beta1 } var clusterrolesResource = v1beta1.SchemeGroupVersion.WithResource("clusterroles") var clusterrolesKind = v1beta1.SchemeGroupVersion.WithKind("ClusterRole") // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRole, err error) { emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { emptyResult := &v1beta1.ClusterRoleList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.ClusterRoleList{ListMeta: obj.(*v1beta1.ClusterRoleList).ListMeta} for _, item := range obj.(*v1beta1.ClusterRoleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *FakeClusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (result *v1beta1.ClusterRole, err error) { emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (result *v1beta1.ClusterRole, err error) { emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(clusterrolesResource, name, opts), &v1beta1.ClusterRole{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleList{}) return err } // Patch applies the patch and returns the patched clusterRole. func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRole, err error) { emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } // Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole. func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1beta1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRole, err error) { if clusterRole == nil { return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") } data, err := json.Marshal(clusterRole) if err != nil { return nil, err } name := clusterRole.Name if name == nil { return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") } emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go000066400000000000000000000146351472614177300322000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" testing "k8s.io/client-go/testing" ) // FakeClusterRoleBindings implements ClusterRoleBindingInterface type FakeClusterRoleBindings struct { Fake *FakeRbacV1beta1 } var clusterrolebindingsResource = v1beta1.SchemeGroupVersion.WithResource("clusterrolebindings") var clusterrolebindingsKind = v1beta1.SchemeGroupVersion.WithKind("ClusterRoleBinding") // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRoleBinding, err error) { emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { emptyResult := &v1beta1.ClusterRoleBindingList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.ClusterRoleBindingList{ListMeta: obj.(*v1beta1.ClusterRoleBindingList).ListMeta} for _, item := range obj.(*v1beta1.ClusterRoleBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1beta1.ClusterRoleBinding, err error) { emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1beta1.ClusterRoleBinding, err error) { emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(clusterrolebindingsResource, name, opts), &v1beta1.ClusterRoleBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleBindingList{}) return err } // Patch applies the patch and returns the patched clusterRoleBinding. func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) { emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding. func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRoleBinding, err error) { if clusterRoleBinding == nil { return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") } data, err := json.Marshal(clusterRoleBinding) if err != nil { return nil, err } name := clusterRoleBinding.Name if name == nil { return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") } emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go000066400000000000000000000027221472614177300305410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeRbacV1beta1 struct { *testing.Fake } func (c *FakeRbacV1beta1) ClusterRoles() v1beta1.ClusterRoleInterface { return &FakeClusterRoles{c} } func (c *FakeRbacV1beta1) ClusterRoleBindings() v1beta1.ClusterRoleBindingInterface { return &FakeClusterRoleBindings{c} } func (c *FakeRbacV1beta1) Roles(namespace string) v1beta1.RoleInterface { return &FakeRoles{c, namespace} } func (c *FakeRbacV1beta1) RoleBindings(namespace string) v1beta1.RoleBindingInterface { return &FakeRoleBindings{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeRbacV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/fake/fake_role.go000066400000000000000000000127241472614177300272400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" testing "k8s.io/client-go/testing" ) // FakeRoles implements RoleInterface type FakeRoles struct { Fake *FakeRbacV1beta1 ns string } var rolesResource = v1beta1.SchemeGroupVersion.WithResource("roles") var rolesKind = v1beta1.SchemeGroupVersion.WithKind("Role") // Get takes name of the role, and returns the corresponding role object, and an error if there is any. func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Role, err error) { emptyResult := &v1beta1.Role{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Role), err } // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { emptyResult := &v1beta1.RoleList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.RoleList{ListMeta: obj.(*v1beta1.RoleList).ListMeta} for _, item := range obj.(*v1beta1.RoleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested roles. func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) } // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (result *v1beta1.Role, err error) { emptyResult := &v1beta1.Role{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Role), err } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (result *v1beta1.Role, err error) { emptyResult := &v1beta1.Role{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Role), err } // Delete takes name of the role and deletes it. Returns an error if one occurs. func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(rolesResource, c.ns, name, opts), &v1beta1.Role{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RoleList{}) return err } // Patch applies the patch and returns the patched role. func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Role, err error) { emptyResult := &v1beta1.Role{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Role), err } // Apply takes the given apply declarative configuration, applies it and returns the applied role. func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1beta1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Role, err error) { if role == nil { return nil, fmt.Errorf("role provided to Apply must not be nil") } data, err := json.Marshal(role) if err != nil { return nil, err } name := role.Name if name == nil { return nil, fmt.Errorf("role.Name must be provided to Apply") } emptyResult := &v1beta1.Role{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.Role), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go000066400000000000000000000137141472614177300305730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" testing "k8s.io/client-go/testing" ) // FakeRoleBindings implements RoleBindingInterface type FakeRoleBindings struct { Fake *FakeRbacV1beta1 ns string } var rolebindingsResource = v1beta1.SchemeGroupVersion.WithResource("rolebindings") var rolebindingsKind = v1beta1.SchemeGroupVersion.WithKind("RoleBinding") // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RoleBinding, err error) { emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { emptyResult := &v1beta1.RoleBindingList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.RoleBindingList{ListMeta: obj.(*v1beta1.RoleBindingList).ListMeta} for _, item := range obj.(*v1beta1.RoleBindingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested roleBindings. func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) } // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (result *v1beta1.RoleBinding, err error) { emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (result *v1beta1.RoleBinding, err error) { emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(rolebindingsResource, c.ns, name, opts), &v1beta1.RoleBinding{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RoleBindingList{}) return err } // Patch applies the patch and returns the patched roleBinding. func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RoleBinding, err error) { emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } // Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding. func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1beta1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RoleBinding, err error) { if roleBinding == nil { return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") } data, err := json.Marshal(roleBinding) if err != nil { return nil, err } name := roleBinding.Name if name == nil { return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") } emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/generated_expansion.go000066400000000000000000000014211472614177300304150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type ClusterRoleExpansion interface{} type ClusterRoleBindingExpansion interface{} type RoleExpansion interface{} type RoleBindingExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/rbac_client.go000066400000000000000000000065761472614177300266600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type RbacV1beta1Interface interface { RESTClient() rest.Interface ClusterRolesGetter ClusterRoleBindingsGetter RolesGetter RoleBindingsGetter } // RbacV1beta1Client is used to interact with features provided by the rbac.authorization.k8s.io group. type RbacV1beta1Client struct { restClient rest.Interface } func (c *RbacV1beta1Client) ClusterRoles() ClusterRoleInterface { return newClusterRoles(c) } func (c *RbacV1beta1Client) ClusterRoleBindings() ClusterRoleBindingInterface { return newClusterRoleBindings(c) } func (c *RbacV1beta1Client) Roles(namespace string) RoleInterface { return newRoles(c, namespace) } func (c *RbacV1beta1Client) RoleBindings(namespace string) RoleBindingInterface { return newRoleBindings(c, namespace) } // NewForConfig creates a new RbacV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*RbacV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new RbacV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &RbacV1beta1Client{client}, nil } // NewForConfigOrDie creates a new RbacV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *RbacV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new RbacV1beta1Client for the given RESTClient. func New(c rest.Interface) *RbacV1beta1Client { return &RbacV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *RbacV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/role.go000066400000000000000000000051601472614177300253400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RolesGetter has a method to return a RoleInterface. // A group's client should implement this interface. type RolesGetter interface { Roles(namespace string) RoleInterface } // RoleInterface has methods to work with Role resources. type RoleInterface interface { Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (*v1beta1.Role, error) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (*v1beta1.Role, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Role, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Role, err error) Apply(ctx context.Context, role *rbacv1beta1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Role, err error) RoleExpansion } // roles implements RoleInterface type roles struct { *gentype.ClientWithListAndApply[*v1beta1.Role, *v1beta1.RoleList, *rbacv1beta1.RoleApplyConfiguration] } // newRoles returns a Roles func newRoles(c *RbacV1beta1Client, namespace string) *roles { return &roles{ gentype.NewClientWithListAndApply[*v1beta1.Role, *v1beta1.RoleList, *rbacv1beta1.RoleApplyConfiguration]( "roles", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.Role { return &v1beta1.Role{} }, func() *v1beta1.RoleList { return &v1beta1.RoleList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/rbac/v1beta1/rolebinding.go000066400000000000000000000056101472614177300266730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. // A group's client should implement this interface. type RoleBindingsGetter interface { RoleBindings(namespace string) RoleBindingInterface } // RoleBindingInterface has methods to work with RoleBinding resources. type RoleBindingInterface interface { Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (*v1beta1.RoleBinding, error) Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (*v1beta1.RoleBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.RoleBinding, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RoleBinding, err error) Apply(ctx context.Context, roleBinding *rbacv1beta1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RoleBinding, err error) RoleBindingExpansion } // roleBindings implements RoleBindingInterface type roleBindings struct { *gentype.ClientWithListAndApply[*v1beta1.RoleBinding, *v1beta1.RoleBindingList, *rbacv1beta1.RoleBindingApplyConfiguration] } // newRoleBindings returns a RoleBindings func newRoleBindings(c *RbacV1beta1Client, namespace string) *roleBindings { return &roleBindings{ gentype.NewClientWithListAndApply[*v1beta1.RoleBinding, *v1beta1.RoleBindingList, *rbacv1beta1.RoleBindingApplyConfiguration]( "rolebindings", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.RoleBinding { return &v1beta1.RoleBinding{} }, func() *v1beta1.RoleBindingList { return &v1beta1.RoleBindingList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/000077500000000000000000000000001472614177300235235ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/000077500000000000000000000000001472614177300251425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/deviceclass.go000066400000000000000000000056371472614177300277710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha3 import ( "context" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // DeviceClassesGetter has a method to return a DeviceClassInterface. // A group's client should implement this interface. type DeviceClassesGetter interface { DeviceClasses() DeviceClassInterface } // DeviceClassInterface has methods to work with DeviceClass resources. type DeviceClassInterface interface { Create(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.CreateOptions) (*v1alpha3.DeviceClass, error) Update(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.UpdateOptions) (*v1alpha3.DeviceClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.DeviceClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.DeviceClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.DeviceClass, err error) Apply(ctx context.Context, deviceClass *resourcev1alpha3.DeviceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.DeviceClass, err error) DeviceClassExpansion } // deviceClasses implements DeviceClassInterface type deviceClasses struct { *gentype.ClientWithListAndApply[*v1alpha3.DeviceClass, *v1alpha3.DeviceClassList, *resourcev1alpha3.DeviceClassApplyConfiguration] } // newDeviceClasses returns a DeviceClasses func newDeviceClasses(c *ResourceV1alpha3Client) *deviceClasses { return &deviceClasses{ gentype.NewClientWithListAndApply[*v1alpha3.DeviceClass, *v1alpha3.DeviceClassList, *resourcev1alpha3.DeviceClassApplyConfiguration]( "deviceclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha3.DeviceClass { return &v1alpha3.DeviceClass{} }, func() *v1alpha3.DeviceClassList { return &v1alpha3.DeviceClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/doc.go000066400000000000000000000012651472614177300262420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha3 kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/fake/000077500000000000000000000000001472614177300260505ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/fake/doc.go000066400000000000000000000012531472614177300271450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go000066400000000000000000000137631472614177300316640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeDeviceClasses implements DeviceClassInterface type FakeDeviceClasses struct { Fake *FakeResourceV1alpha3 } var deviceclassesResource = v1alpha3.SchemeGroupVersion.WithResource("deviceclasses") var deviceclassesKind = v1alpha3.SchemeGroupVersion.WithKind("DeviceClass") // Get takes name of the deviceClass, and returns the corresponding deviceClass object, and an error if there is any. func (c *FakeDeviceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.DeviceClass, err error) { emptyResult := &v1alpha3.DeviceClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(deviceclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.DeviceClass), err } // List takes label and field selectors, and returns the list of DeviceClasses that match those selectors. func (c *FakeDeviceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.DeviceClassList, err error) { emptyResult := &v1alpha3.DeviceClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(deviceclassesResource, deviceclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha3.DeviceClassList{ListMeta: obj.(*v1alpha3.DeviceClassList).ListMeta} for _, item := range obj.(*v1alpha3.DeviceClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested deviceClasses. func (c *FakeDeviceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(deviceclassesResource, opts)) } // Create takes the representation of a deviceClass and creates it. Returns the server's representation of the deviceClass, and an error, if there is any. func (c *FakeDeviceClasses) Create(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.CreateOptions) (result *v1alpha3.DeviceClass, err error) { emptyResult := &v1alpha3.DeviceClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(deviceclassesResource, deviceClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.DeviceClass), err } // Update takes the representation of a deviceClass and updates it. Returns the server's representation of the deviceClass, and an error, if there is any. func (c *FakeDeviceClasses) Update(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.UpdateOptions) (result *v1alpha3.DeviceClass, err error) { emptyResult := &v1alpha3.DeviceClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(deviceclassesResource, deviceClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.DeviceClass), err } // Delete takes name of the deviceClass and deletes it. Returns an error if one occurs. func (c *FakeDeviceClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(deviceclassesResource, name, opts), &v1alpha3.DeviceClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeDeviceClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(deviceclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha3.DeviceClassList{}) return err } // Patch applies the patch and returns the patched deviceClass. func (c *FakeDeviceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.DeviceClass, err error) { emptyResult := &v1alpha3.DeviceClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(deviceclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.DeviceClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied deviceClass. func (c *FakeDeviceClasses) Apply(ctx context.Context, deviceClass *resourcev1alpha3.DeviceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.DeviceClass, err error) { if deviceClass == nil { return nil, fmt.Errorf("deviceClass provided to Apply must not be nil") } data, err := json.Marshal(deviceClass) if err != nil { return nil, err } name := deviceClass.Name if name == nil { return nil, fmt.Errorf("deviceClass.Name must be provided to Apply") } emptyResult := &v1alpha3.DeviceClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(deviceclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.DeviceClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go000066400000000000000000000205301472614177300336220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakePodSchedulingContexts implements PodSchedulingContextInterface type FakePodSchedulingContexts struct { Fake *FakeResourceV1alpha3 ns string } var podschedulingcontextsResource = v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts") var podschedulingcontextsKind = v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext") // Get takes name of the podSchedulingContext, and returns the corresponding podSchedulingContext object, and an error if there is any. func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.PodSchedulingContext, err error) { emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(podschedulingcontextsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.PodSchedulingContext), err } // List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.PodSchedulingContextList, err error) { emptyResult := &v1alpha3.PodSchedulingContextList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(podschedulingcontextsResource, podschedulingcontextsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha3.PodSchedulingContextList{ListMeta: obj.(*v1alpha3.PodSchedulingContextList).ListMeta} for _, item := range obj.(*v1alpha3.PodSchedulingContextList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested podSchedulingContexts. func (c *FakePodSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(podschedulingcontextsResource, c.ns, opts)) } // Create takes the representation of a podSchedulingContext and creates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha3.PodSchedulingContext, err error) { emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.PodSchedulingContext), err } // Update takes the representation of a podSchedulingContext and updates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha3.PodSchedulingContext, err error) { emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.PodSchedulingContext), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha3.PodSchedulingContext, err error) { emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(podschedulingcontextsResource, "status", c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.PodSchedulingContext), err } // Delete takes name of the podSchedulingContext and deletes it. Returns an error if one occurs. func (c *FakePodSchedulingContexts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(podschedulingcontextsResource, c.ns, name, opts), &v1alpha3.PodSchedulingContext{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePodSchedulingContexts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(podschedulingcontextsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha3.PodSchedulingContextList{}) return err } // Patch applies the patch and returns the patched podSchedulingContext. func (c *FakePodSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.PodSchedulingContext, err error) { emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.PodSchedulingContext), err } // Apply takes the given apply declarative configuration, applies it and returns the applied podSchedulingContext. func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) { if podSchedulingContext == nil { return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") } data, err := json.Marshal(podSchedulingContext) if err != nil { return nil, err } name := podSchedulingContext.Name if name == nil { return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") } emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.PodSchedulingContext), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) { if podSchedulingContext == nil { return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") } data, err := json.Marshal(podSchedulingContext) if err != nil { return nil, err } name := podSchedulingContext.Name if name == nil { return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") } emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.PodSchedulingContext), err } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go000066400000000000000000000033121472614177300325510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeResourceV1alpha3 struct { *testing.Fake } func (c *FakeResourceV1alpha3) DeviceClasses() v1alpha3.DeviceClassInterface { return &FakeDeviceClasses{c} } func (c *FakeResourceV1alpha3) PodSchedulingContexts(namespace string) v1alpha3.PodSchedulingContextInterface { return &FakePodSchedulingContexts{c, namespace} } func (c *FakeResourceV1alpha3) ResourceClaims(namespace string) v1alpha3.ResourceClaimInterface { return &FakeResourceClaims{c, namespace} } func (c *FakeResourceV1alpha3) ResourceClaimTemplates(namespace string) v1alpha3.ResourceClaimTemplateInterface { return &FakeResourceClaimTemplates{c, namespace} } func (c *FakeResourceV1alpha3) ResourceSlices() v1alpha3.ResourceSliceInterface { return &FakeResourceSlices{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeResourceV1alpha3) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go000066400000000000000000000173241472614177300322310ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClaims implements ResourceClaimInterface type FakeResourceClaims struct { Fake *FakeResourceV1alpha3 ns string } var resourceclaimsResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaims") var resourceclaimsKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim") // Get takes name of the resourceClaim, and returns the corresponding resourceClaim object, and an error if there is any. func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaim, err error) { emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourceclaimsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaim), err } // List takes label and field selectors, and returns the list of ResourceClaims that match those selectors. func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimList, err error) { emptyResult := &v1alpha3.ResourceClaimList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourceclaimsResource, resourceclaimsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha3.ResourceClaimList{ListMeta: obj.(*v1alpha3.ResourceClaimList).ListMeta} for _, item := range obj.(*v1alpha3.ResourceClaimList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested resourceClaims. func (c *FakeResourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimsResource, c.ns, opts)) } // Create takes the representation of a resourceClaim and creates it. Returns the server's representation of the resourceClaim, and an error, if there is any. func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.CreateOptions) (result *v1alpha3.ResourceClaim, err error) { emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaim), err } // Update takes the representation of a resourceClaim and updates it. Returns the server's representation of the resourceClaim, and an error, if there is any. func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaim, err error) { emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaim), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaim, err error) { emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(resourceclaimsResource, "status", c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaim), err } // Delete takes name of the resourceClaim and deletes it. Returns an error if one occurs. func (c *FakeResourceClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(resourceclaimsResource, c.ns, name, opts), &v1alpha3.ResourceClaim{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeResourceClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourceclaimsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimList{}) return err } // Patch applies the patch and returns the patched resourceClaim. func (c *FakeResourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaim, err error) { emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaim), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaim. func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) { if resourceClaim == nil { return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") } data, err := json.Marshal(resourceClaim) if err != nil { return nil, err } name := resourceClaim.Name if name == nil { return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") } emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaim), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) { if resourceClaim == nil { return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") } data, err := json.Marshal(resourceClaim) if err != nil { return nil, err } name := resourceClaim.Name if name == nil { return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") } emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaim), err } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go000066400000000000000000000153201472614177300337570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClaimTemplates implements ResourceClaimTemplateInterface type FakeResourceClaimTemplates struct { Fake *FakeResourceV1alpha3 ns string } var resourceclaimtemplatesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates") var resourceclaimtemplatesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplate") // Get takes name of the resourceClaimTemplate, and returns the corresponding resourceClaimTemplate object, and an error if there is any. func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourceclaimtemplatesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaimTemplate), err } // List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimTemplateList, err error) { emptyResult := &v1alpha3.ResourceClaimTemplateList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourceclaimtemplatesResource, resourceclaimtemplatesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha3.ResourceClaimTemplateList{ListMeta: obj.(*v1alpha3.ResourceClaimTemplateList).ListMeta} for _, item := range obj.(*v1alpha3.ResourceClaimTemplateList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested resourceClaimTemplates. func (c *FakeResourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimtemplatesResource, c.ns, opts)) } // Create takes the representation of a resourceClaimTemplate and creates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaimTemplate), err } // Update takes the representation of a resourceClaimTemplate and updates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. func (c *FakeResourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaimTemplate), err } // Delete takes name of the resourceClaimTemplate and deletes it. Returns an error if one occurs. func (c *FakeResourceClaimTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(resourceclaimtemplatesResource, c.ns, name, opts), &v1alpha3.ResourceClaimTemplate{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeResourceClaimTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourceclaimtemplatesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimTemplateList{}) return err } // Patch applies the patch and returns the patched resourceClaimTemplate. func (c *FakeResourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimTemplate, err error) { emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaimTemplate), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaimTemplate. func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { if resourceClaimTemplate == nil { return nil, fmt.Errorf("resourceClaimTemplate provided to Apply must not be nil") } data, err := json.Marshal(resourceClaimTemplate) if err != nil { return nil, err } name := resourceClaimTemplate.Name if name == nil { return nil, fmt.Errorf("resourceClaimTemplate.Name must be provided to Apply") } emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceClaimTemplate), err } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go000066400000000000000000000141511472614177300322360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceSlices implements ResourceSliceInterface type FakeResourceSlices struct { Fake *FakeResourceV1alpha3 } var resourceslicesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceslices") var resourceslicesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice") // Get takes name of the resourceSlice, and returns the corresponding resourceSlice object, and an error if there is any. func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceSlice, err error) { emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(resourceslicesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceSlice), err } // List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceSliceList, err error) { emptyResult := &v1alpha3.ResourceSliceList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(resourceslicesResource, resourceslicesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha3.ResourceSliceList{ListMeta: obj.(*v1alpha3.ResourceSliceList).ListMeta} for _, item := range obj.(*v1alpha3.ResourceSliceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested resourceSlices. func (c *FakeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(resourceslicesResource, opts)) } // Create takes the representation of a resourceSlice and creates it. Returns the server's representation of the resourceSlice, and an error, if there is any. func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.CreateOptions) (result *v1alpha3.ResourceSlice, err error) { emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceSlice), err } // Update takes the representation of a resourceSlice and updates it. Returns the server's representation of the resourceSlice, and an error, if there is any. func (c *FakeResourceSlices) Update(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha3.ResourceSlice, err error) { emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceSlice), err } // Delete takes name of the resourceSlice and deletes it. Returns an error if one occurs. func (c *FakeResourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(resourceslicesResource, name, opts), &v1alpha3.ResourceSlice{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeResourceSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(resourceslicesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha3.ResourceSliceList{}) return err } // Patch applies the patch and returns the patched resourceSlice. func (c *FakeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceSlice, err error) { emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceSlice), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceSlice. func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev1alpha3.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceSlice, err error) { if resourceSlice == nil { return nil, fmt.Errorf("resourceSlice provided to Apply must not be nil") } data, err := json.Marshal(resourceSlice) if err != nil { return nil, err } name := resourceSlice.Name if name == nil { return nil, fmt.Errorf("resourceSlice.Name must be provided to Apply") } emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha3.ResourceSlice), err } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/generated_expansion.go000066400000000000000000000015201472614177300315110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha3 type DeviceClassExpansion interface{} type PodSchedulingContextExpansion interface{} type ResourceClaimExpansion interface{} type ResourceClaimTemplateExpansion interface{} type ResourceSliceExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/podschedulingcontext.go000066400000000000000000000074471472614177300317420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha3 import ( "context" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PodSchedulingContextsGetter has a method to return a PodSchedulingContextInterface. // A group's client should implement this interface. type PodSchedulingContextsGetter interface { PodSchedulingContexts(namespace string) PodSchedulingContextInterface } // PodSchedulingContextInterface has methods to work with PodSchedulingContext resources. type PodSchedulingContextInterface interface { Create(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.CreateOptions) (*v1alpha3.PodSchedulingContext, error) Update(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha3.PodSchedulingContext, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha3.PodSchedulingContext, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.PodSchedulingContext, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.PodSchedulingContextList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.PodSchedulingContext, err error) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) PodSchedulingContextExpansion } // podSchedulingContexts implements PodSchedulingContextInterface type podSchedulingContexts struct { *gentype.ClientWithListAndApply[*v1alpha3.PodSchedulingContext, *v1alpha3.PodSchedulingContextList, *resourcev1alpha3.PodSchedulingContextApplyConfiguration] } // newPodSchedulingContexts returns a PodSchedulingContexts func newPodSchedulingContexts(c *ResourceV1alpha3Client, namespace string) *podSchedulingContexts { return &podSchedulingContexts{ gentype.NewClientWithListAndApply[*v1alpha3.PodSchedulingContext, *v1alpha3.PodSchedulingContextList, *resourcev1alpha3.PodSchedulingContextApplyConfiguration]( "podschedulingcontexts", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1alpha3.PodSchedulingContext { return &v1alpha3.PodSchedulingContext{} }, func() *v1alpha3.PodSchedulingContextList { return &v1alpha3.PodSchedulingContextList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/resource_client.go000066400000000000000000000073111472614177300306600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha3 import ( "net/http" v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type ResourceV1alpha3Interface interface { RESTClient() rest.Interface DeviceClassesGetter PodSchedulingContextsGetter ResourceClaimsGetter ResourceClaimTemplatesGetter ResourceSlicesGetter } // ResourceV1alpha3Client is used to interact with features provided by the resource.k8s.io group. type ResourceV1alpha3Client struct { restClient rest.Interface } func (c *ResourceV1alpha3Client) DeviceClasses() DeviceClassInterface { return newDeviceClasses(c) } func (c *ResourceV1alpha3Client) PodSchedulingContexts(namespace string) PodSchedulingContextInterface { return newPodSchedulingContexts(c, namespace) } func (c *ResourceV1alpha3Client) ResourceClaims(namespace string) ResourceClaimInterface { return newResourceClaims(c, namespace) } func (c *ResourceV1alpha3Client) ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface { return newResourceClaimTemplates(c, namespace) } func (c *ResourceV1alpha3Client) ResourceSlices() ResourceSliceInterface { return newResourceSlices(c) } // NewForConfig creates a new ResourceV1alpha3Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*ResourceV1alpha3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new ResourceV1alpha3Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1alpha3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &ResourceV1alpha3Client{client}, nil } // NewForConfigOrDie creates a new ResourceV1alpha3Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *ResourceV1alpha3Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new ResourceV1alpha3Client for the given RESTClient. func New(c rest.Interface) *ResourceV1alpha3Client { return &ResourceV1alpha3Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha3.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *ResourceV1alpha3Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/resourceclaim.go000066400000000000000000000067451472614177300303420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha3 import ( "context" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ResourceClaimsGetter has a method to return a ResourceClaimInterface. // A group's client should implement this interface. type ResourceClaimsGetter interface { ResourceClaims(namespace string) ResourceClaimInterface } // ResourceClaimInterface has methods to work with ResourceClaim resources. type ResourceClaimInterface interface { Create(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.CreateOptions) (*v1alpha3.ResourceClaim, error) Update(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (*v1alpha3.ResourceClaim, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (*v1alpha3.ResourceClaim, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClaim, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClaimList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaim, err error) Apply(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) ResourceClaimExpansion } // resourceClaims implements ResourceClaimInterface type resourceClaims struct { *gentype.ClientWithListAndApply[*v1alpha3.ResourceClaim, *v1alpha3.ResourceClaimList, *resourcev1alpha3.ResourceClaimApplyConfiguration] } // newResourceClaims returns a ResourceClaims func newResourceClaims(c *ResourceV1alpha3Client, namespace string) *resourceClaims { return &resourceClaims{ gentype.NewClientWithListAndApply[*v1alpha3.ResourceClaim, *v1alpha3.ResourceClaimList, *resourcev1alpha3.ResourceClaimApplyConfiguration]( "resourceclaims", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1alpha3.ResourceClaim { return &v1alpha3.ResourceClaim{} }, func() *v1alpha3.ResourceClaimList { return &v1alpha3.ResourceClaimList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/resourceclaimtemplate.go000066400000000000000000000065151472614177300320710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha3 import ( "context" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ResourceClaimTemplatesGetter has a method to return a ResourceClaimTemplateInterface. // A group's client should implement this interface. type ResourceClaimTemplatesGetter interface { ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface } // ResourceClaimTemplateInterface has methods to work with ResourceClaimTemplate resources. type ResourceClaimTemplateInterface interface { Create(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.CreateOptions) (*v1alpha3.ResourceClaimTemplate, error) Update(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.UpdateOptions) (*v1alpha3.ResourceClaimTemplate, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClaimTemplate, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClaimTemplateList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimTemplate, err error) Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimTemplate, err error) ResourceClaimTemplateExpansion } // resourceClaimTemplates implements ResourceClaimTemplateInterface type resourceClaimTemplates struct { *gentype.ClientWithListAndApply[*v1alpha3.ResourceClaimTemplate, *v1alpha3.ResourceClaimTemplateList, *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration] } // newResourceClaimTemplates returns a ResourceClaimTemplates func newResourceClaimTemplates(c *ResourceV1alpha3Client, namespace string) *resourceClaimTemplates { return &resourceClaimTemplates{ gentype.NewClientWithListAndApply[*v1alpha3.ResourceClaimTemplate, *v1alpha3.ResourceClaimTemplateList, *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration]( "resourceclaimtemplates", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1alpha3.ResourceClaimTemplate { return &v1alpha3.ResourceClaimTemplate{} }, func() *v1alpha3.ResourceClaimTemplateList { return &v1alpha3.ResourceClaimTemplateList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/resource/v1alpha3/resourceslice.go000066400000000000000000000057441472614177300303520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha3 import ( "context" v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // ResourceSlicesGetter has a method to return a ResourceSliceInterface. // A group's client should implement this interface. type ResourceSlicesGetter interface { ResourceSlices() ResourceSliceInterface } // ResourceSliceInterface has methods to work with ResourceSlice resources. type ResourceSliceInterface interface { Create(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.CreateOptions) (*v1alpha3.ResourceSlice, error) Update(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.UpdateOptions) (*v1alpha3.ResourceSlice, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceSlice, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceSliceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceSlice, err error) Apply(ctx context.Context, resourceSlice *resourcev1alpha3.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceSlice, err error) ResourceSliceExpansion } // resourceSlices implements ResourceSliceInterface type resourceSlices struct { *gentype.ClientWithListAndApply[*v1alpha3.ResourceSlice, *v1alpha3.ResourceSliceList, *resourcev1alpha3.ResourceSliceApplyConfiguration] } // newResourceSlices returns a ResourceSlices func newResourceSlices(c *ResourceV1alpha3Client) *resourceSlices { return &resourceSlices{ gentype.NewClientWithListAndApply[*v1alpha3.ResourceSlice, *v1alpha3.ResourceSliceList, *resourcev1alpha3.ResourceSliceApplyConfiguration]( "resourceslices", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha3.ResourceSlice { return &v1alpha3.ResourceSlice{} }, func() *v1alpha3.ResourceSliceList { return &v1alpha3.ResourceSliceList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/000077500000000000000000000000001472614177300240215ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/000077500000000000000000000000001472614177300243475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/doc.go000066400000000000000000000012571472614177300254500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/fake/000077500000000000000000000000001472614177300252555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/fake/doc.go000066400000000000000000000012531472614177300263520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go000066400000000000000000000137711472614177300315120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" testing "k8s.io/client-go/testing" ) // FakePriorityClasses implements PriorityClassInterface type FakePriorityClasses struct { Fake *FakeSchedulingV1 } var priorityclassesResource = v1.SchemeGroupVersion.WithResource("priorityclasses") var priorityclassesKind = v1.SchemeGroupVersion.WithKind("PriorityClass") // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. func (c *FakePriorityClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) { emptyResult := &v1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityClass), err } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *FakePriorityClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { emptyResult := &v1.PriorityClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.PriorityClassList{ListMeta: obj.(*v1.PriorityClassList).ListMeta} for _, item := range obj.(*v1.PriorityClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *FakePriorityClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (result *v1.PriorityClass, err error) { emptyResult := &v1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityClass), err } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (result *v1.PriorityClass, err error) { emptyResult := &v1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityClass), err } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(priorityclassesResource, name, opts), &v1.PriorityClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PriorityClassList{}) return err } // Patch applies the patch and returns the patched priorityClass. func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error) { emptyResult := &v1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass. func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1.PriorityClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityClass, err error) { if priorityClass == nil { return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") } data, err := json.Marshal(priorityClass) if err != nil { return nil, err } name := priorityClass.Name if name == nil { return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") } emptyResult := &v1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.PriorityClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/fake/fake_scheduling_client.go000066400000000000000000000021461472614177300322600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeSchedulingV1 struct { *testing.Fake } func (c *FakeSchedulingV1) PriorityClasses() v1.PriorityClassInterface { return &FakePriorityClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeSchedulingV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/generated_expansion.go000066400000000000000000000012311472614177300307150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type PriorityClassExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/priorityclass.go000066400000000000000000000056231472614177300276130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. // A group's client should implement this interface. type PriorityClassesGetter interface { PriorityClasses() PriorityClassInterface } // PriorityClassInterface has methods to work with PriorityClass resources. type PriorityClassInterface interface { Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (*v1.PriorityClass, error) Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (*v1.PriorityClass, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PriorityClass, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error) Apply(ctx context.Context, priorityClass *schedulingv1.PriorityClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityClass, err error) PriorityClassExpansion } // priorityClasses implements PriorityClassInterface type priorityClasses struct { *gentype.ClientWithListAndApply[*v1.PriorityClass, *v1.PriorityClassList, *schedulingv1.PriorityClassApplyConfiguration] } // newPriorityClasses returns a PriorityClasses func newPriorityClasses(c *SchedulingV1Client) *priorityClasses { return &priorityClasses{ gentype.NewClientWithListAndApply[*v1.PriorityClass, *v1.PriorityClassList, *schedulingv1.PriorityClassApplyConfiguration]( "priorityclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.PriorityClass { return &v1.PriorityClass{} }, func() *v1.PriorityClassList { return &v1.PriorityClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1/scheduling_client.go000066400000000000000000000057601472614177300303710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/scheduling/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type SchedulingV1Interface interface { RESTClient() rest.Interface PriorityClassesGetter } // SchedulingV1Client is used to interact with features provided by the scheduling.k8s.io group. type SchedulingV1Client struct { restClient rest.Interface } func (c *SchedulingV1Client) PriorityClasses() PriorityClassInterface { return newPriorityClasses(c) } // NewForConfig creates a new SchedulingV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*SchedulingV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new SchedulingV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &SchedulingV1Client{client}, nil } // NewForConfigOrDie creates a new SchedulingV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *SchedulingV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new SchedulingV1Client for the given RESTClient. func New(c rest.Interface) *SchedulingV1Client { return &SchedulingV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *SchedulingV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/000077500000000000000000000000001472614177300254365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/doc.go000066400000000000000000000012651472614177300265360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/fake/000077500000000000000000000000001472614177300263445ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300274410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go000066400000000000000000000142151472614177300325730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/scheduling/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" testing "k8s.io/client-go/testing" ) // FakePriorityClasses implements PriorityClassInterface type FakePriorityClasses struct { Fake *FakeSchedulingV1alpha1 } var priorityclassesResource = v1alpha1.SchemeGroupVersion.WithResource("priorityclasses") var priorityclassesKind = v1alpha1.SchemeGroupVersion.WithKind("PriorityClass") // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) { emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { emptyResult := &v1alpha1.PriorityClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.PriorityClassList{ListMeta: obj.(*v1alpha1.PriorityClassList).ListMeta} for _, item := range obj.(*v1alpha1.PriorityClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (result *v1alpha1.PriorityClass, err error) { emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (result *v1alpha1.PriorityClass, err error) { emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(priorityclassesResource, name, opts), &v1alpha1.PriorityClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PriorityClassList{}) return err } // Patch applies the patch and returns the patched priorityClass. func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error) { emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass. func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityClass, err error) { if priorityClass == nil { return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") } data, err := json.Marshal(priorityClass) if err != nil { return nil, err } name := priorityClass.Name if name == nil { return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") } emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go000066400000000000000000000022121472614177300333410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeSchedulingV1alpha1 struct { *testing.Fake } func (c *FakeSchedulingV1alpha1) PriorityClasses() v1alpha1.PriorityClassInterface { return &FakePriorityClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeSchedulingV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go000066400000000000000000000012371472614177300320120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type PriorityClassExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/priorityclass.go000066400000000000000000000057751472614177300307120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/scheduling/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. // A group's client should implement this interface. type PriorityClassesGetter interface { PriorityClasses() PriorityClassInterface } // PriorityClassInterface has methods to work with PriorityClass resources. type PriorityClassInterface interface { Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (*v1alpha1.PriorityClass, error) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (*v1alpha1.PriorityClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PriorityClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error) Apply(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityClass, err error) PriorityClassExpansion } // priorityClasses implements PriorityClassInterface type priorityClasses struct { *gentype.ClientWithListAndApply[*v1alpha1.PriorityClass, *v1alpha1.PriorityClassList, *schedulingv1alpha1.PriorityClassApplyConfiguration] } // newPriorityClasses returns a PriorityClasses func newPriorityClasses(c *SchedulingV1alpha1Client) *priorityClasses { return &priorityClasses{ gentype.NewClientWithListAndApply[*v1alpha1.PriorityClass, *v1alpha1.PriorityClassList, *schedulingv1alpha1.PriorityClassApplyConfiguration]( "priorityclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.PriorityClass { return &v1alpha1.PriorityClass{} }, func() *v1alpha1.PriorityClassList { return &v1alpha1.PriorityClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go000066400000000000000000000061421472614177300314530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/scheduling/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type SchedulingV1alpha1Interface interface { RESTClient() rest.Interface PriorityClassesGetter } // SchedulingV1alpha1Client is used to interact with features provided by the scheduling.k8s.io group. type SchedulingV1alpha1Client struct { restClient rest.Interface } func (c *SchedulingV1alpha1Client) PriorityClasses() PriorityClassInterface { return newPriorityClasses(c) } // NewForConfig creates a new SchedulingV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*SchedulingV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new SchedulingV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &SchedulingV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new SchedulingV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *SchedulingV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new SchedulingV1alpha1Client for the given RESTClient. func New(c rest.Interface) *SchedulingV1alpha1Client { return &SchedulingV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *SchedulingV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/000077500000000000000000000000001472614177300252645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/doc.go000066400000000000000000000012641472614177300263630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/fake/000077500000000000000000000000001472614177300261725ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/fake/doc.go000066400000000000000000000012531472614177300272670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go000066400000000000000000000141551472614177300324240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/scheduling/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" testing "k8s.io/client-go/testing" ) // FakePriorityClasses implements PriorityClassInterface type FakePriorityClasses struct { Fake *FakeSchedulingV1beta1 } var priorityclassesResource = v1beta1.SchemeGroupVersion.WithResource("priorityclasses") var priorityclassesKind = v1beta1.SchemeGroupVersion.WithKind("PriorityClass") // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) { emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { emptyResult := &v1beta1.PriorityClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.PriorityClassList{ListMeta: obj.(*v1beta1.PriorityClassList).ListMeta} for _, item := range obj.(*v1beta1.PriorityClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (result *v1beta1.PriorityClass, err error) { emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (result *v1beta1.PriorityClass, err error) { emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(priorityclassesResource, name, opts), &v1beta1.PriorityClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PriorityClassList{}) return err } // Patch applies the patch and returns the patched priorityClass. func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) { emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass. func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityClass, err error) { if priorityClass == nil { return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") } data, err := json.Marshal(priorityClass) if err != nil { return nil, err } name := priorityClass.Name if name == nil { return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") } emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/fake/fake_scheduling_client.go000066400000000000000000000022041472614177300331700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeSchedulingV1beta1 struct { *testing.Fake } func (c *FakeSchedulingV1beta1) PriorityClasses() v1beta1.PriorityClassInterface { return &FakePriorityClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeSchedulingV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/generated_expansion.go000066400000000000000000000012361472614177300316370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type PriorityClassExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/priorityclass.go000066400000000000000000000057441472614177300305340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/scheduling/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. // A group's client should implement this interface. type PriorityClassesGetter interface { PriorityClasses() PriorityClassInterface } // PriorityClassInterface has methods to work with PriorityClass resources. type PriorityClassInterface interface { Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (*v1beta1.PriorityClass, error) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (*v1beta1.PriorityClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PriorityClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) Apply(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityClass, err error) PriorityClassExpansion } // priorityClasses implements PriorityClassInterface type priorityClasses struct { *gentype.ClientWithListAndApply[*v1beta1.PriorityClass, *v1beta1.PriorityClassList, *schedulingv1beta1.PriorityClassApplyConfiguration] } // newPriorityClasses returns a PriorityClasses func newPriorityClasses(c *SchedulingV1beta1Client) *priorityClasses { return &priorityClasses{ gentype.NewClientWithListAndApply[*v1beta1.PriorityClass, *v1beta1.PriorityClassList, *schedulingv1beta1.PriorityClassApplyConfiguration]( "priorityclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.PriorityClass { return &v1beta1.PriorityClass{} }, func() *v1beta1.PriorityClassList { return &v1beta1.PriorityClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/scheduling/v1beta1/scheduling_client.go000066400000000000000000000061171472614177300313030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/scheduling/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type SchedulingV1beta1Interface interface { RESTClient() rest.Interface PriorityClassesGetter } // SchedulingV1beta1Client is used to interact with features provided by the scheduling.k8s.io group. type SchedulingV1beta1Client struct { restClient rest.Interface } func (c *SchedulingV1beta1Client) PriorityClasses() PriorityClassInterface { return newPriorityClasses(c) } // NewForConfig creates a new SchedulingV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*SchedulingV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new SchedulingV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &SchedulingV1beta1Client{client}, nil } // NewForConfigOrDie creates a new SchedulingV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *SchedulingV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new SchedulingV1beta1Client for the given RESTClient. func New(c rest.Interface) *SchedulingV1beta1Client { return &SchedulingV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *SchedulingV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/000077500000000000000000000000001472614177300233405ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/000077500000000000000000000000001472614177300236665ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/csidriver.go000066400000000000000000000053231472614177300262120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CSIDriversGetter has a method to return a CSIDriverInterface. // A group's client should implement this interface. type CSIDriversGetter interface { CSIDrivers() CSIDriverInterface } // CSIDriverInterface has methods to work with CSIDriver resources. type CSIDriverInterface interface { Create(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.CreateOptions) (*v1.CSIDriver, error) Update(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.UpdateOptions) (*v1.CSIDriver, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CSIDriver, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSIDriverList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error) Apply(ctx context.Context, cSIDriver *storagev1.CSIDriverApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIDriver, err error) CSIDriverExpansion } // cSIDrivers implements CSIDriverInterface type cSIDrivers struct { *gentype.ClientWithListAndApply[*v1.CSIDriver, *v1.CSIDriverList, *storagev1.CSIDriverApplyConfiguration] } // newCSIDrivers returns a CSIDrivers func newCSIDrivers(c *StorageV1Client) *cSIDrivers { return &cSIDrivers{ gentype.NewClientWithListAndApply[*v1.CSIDriver, *v1.CSIDriverList, *storagev1.CSIDriverApplyConfiguration]( "csidrivers", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.CSIDriver { return &v1.CSIDriver{} }, func() *v1.CSIDriverList { return &v1.CSIDriverList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/csinode.go000066400000000000000000000052031472614177300256410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CSINodesGetter has a method to return a CSINodeInterface. // A group's client should implement this interface. type CSINodesGetter interface { CSINodes() CSINodeInterface } // CSINodeInterface has methods to work with CSINode resources. type CSINodeInterface interface { Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (*v1.CSINode, error) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (*v1.CSINode, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CSINode, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSINodeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) Apply(ctx context.Context, cSINode *storagev1.CSINodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSINode, err error) CSINodeExpansion } // cSINodes implements CSINodeInterface type cSINodes struct { *gentype.ClientWithListAndApply[*v1.CSINode, *v1.CSINodeList, *storagev1.CSINodeApplyConfiguration] } // newCSINodes returns a CSINodes func newCSINodes(c *StorageV1Client) *cSINodes { return &cSINodes{ gentype.NewClientWithListAndApply[*v1.CSINode, *v1.CSINodeList, *storagev1.CSINodeApplyConfiguration]( "csinodes", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.CSINode { return &v1.CSINode{} }, func() *v1.CSINodeList { return &v1.CSINodeList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/csistoragecapacity.go000066400000000000000000000061571472614177300301070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. // A group's client should implement this interface. type CSIStorageCapacitiesGetter interface { CSIStorageCapacities(namespace string) CSIStorageCapacityInterface } // CSIStorageCapacityInterface has methods to work with CSIStorageCapacity resources. type CSIStorageCapacityInterface interface { Create(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.CreateOptions) (*v1.CSIStorageCapacity, error) Update(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.UpdateOptions) (*v1.CSIStorageCapacity, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CSIStorageCapacity, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSIStorageCapacityList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIStorageCapacity, err error) Apply(ctx context.Context, cSIStorageCapacity *storagev1.CSIStorageCapacityApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIStorageCapacity, err error) CSIStorageCapacityExpansion } // cSIStorageCapacities implements CSIStorageCapacityInterface type cSIStorageCapacities struct { *gentype.ClientWithListAndApply[*v1.CSIStorageCapacity, *v1.CSIStorageCapacityList, *storagev1.CSIStorageCapacityApplyConfiguration] } // newCSIStorageCapacities returns a CSIStorageCapacities func newCSIStorageCapacities(c *StorageV1Client, namespace string) *cSIStorageCapacities { return &cSIStorageCapacities{ gentype.NewClientWithListAndApply[*v1.CSIStorageCapacity, *v1.CSIStorageCapacityList, *storagev1.CSIStorageCapacityApplyConfiguration]( "csistoragecapacities", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1.CSIStorageCapacity { return &v1.CSIStorageCapacity{} }, func() *v1.CSIStorageCapacityList { return &v1.CSIStorageCapacityList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/doc.go000066400000000000000000000012571472614177300247670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1 kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/fake/000077500000000000000000000000001472614177300245745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/fake/doc.go000066400000000000000000000012531472614177300256710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/fake/fake_csidriver.go000066400000000000000000000132601472614177300301050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" testing "k8s.io/client-go/testing" ) // FakeCSIDrivers implements CSIDriverInterface type FakeCSIDrivers struct { Fake *FakeStorageV1 } var csidriversResource = v1.SchemeGroupVersion.WithResource("csidrivers") var csidriversKind = v1.SchemeGroupVersion.WithKind("CSIDriver") // Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIDriver, err error) { emptyResult := &v1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(csidriversResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIDriver), err } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. func (c *FakeCSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { emptyResult := &v1.CSIDriverList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(csidriversResource, csidriversKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.CSIDriverList{ListMeta: obj.(*v1.CSIDriverList).ListMeta} for _, item := range obj.(*v1.CSIDriverList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cSIDrivers. func (c *FakeCSIDrivers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(csidriversResource, opts)) } // Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.CreateOptions) (result *v1.CSIDriver, err error) { emptyResult := &v1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIDriver), err } // Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.UpdateOptions) (result *v1.CSIDriver, err error) { emptyResult := &v1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIDriver), err } // Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. func (c *FakeCSIDrivers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(csidriversResource, name, opts), &v1.CSIDriver{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(csidriversResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CSIDriverList{}) return err } // Patch applies the patch and returns the patched cSIDriver. func (c *FakeCSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error) { emptyResult := &v1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIDriver), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cSIDriver. func (c *FakeCSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1.CSIDriverApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIDriver, err error) { if cSIDriver == nil { return nil, fmt.Errorf("cSIDriver provided to Apply must not be nil") } data, err := json.Marshal(cSIDriver) if err != nil { return nil, err } name := cSIDriver.Name if name == nil { return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply") } emptyResult := &v1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIDriver), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/fake/fake_csinode.go000066400000000000000000000130401472614177300275330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" testing "k8s.io/client-go/testing" ) // FakeCSINodes implements CSINodeInterface type FakeCSINodes struct { Fake *FakeStorageV1 } var csinodesResource = v1.SchemeGroupVersion.WithResource("csinodes") var csinodesKind = v1.SchemeGroupVersion.WithKind("CSINode") // Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. func (c *FakeCSINodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSINode, err error) { emptyResult := &v1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(csinodesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSINode), err } // List takes label and field selectors, and returns the list of CSINodes that match those selectors. func (c *FakeCSINodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { emptyResult := &v1.CSINodeList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(csinodesResource, csinodesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.CSINodeList{ListMeta: obj.(*v1.CSINodeList).ListMeta} for _, item := range obj.(*v1.CSINodeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cSINodes. func (c *FakeCSINodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(csinodesResource, opts)) } // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (result *v1.CSINode, err error) { emptyResult := &v1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSINode), err } // Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (result *v1.CSINode, err error) { emptyResult := &v1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSINode), err } // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. func (c *FakeCSINodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(csinodesResource, name, opts), &v1.CSINode{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(csinodesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CSINodeList{}) return err } // Patch applies the patch and returns the patched cSINode. func (c *FakeCSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) { emptyResult := &v1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSINode), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cSINode. func (c *FakeCSINodes) Apply(ctx context.Context, cSINode *storagev1.CSINodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSINode, err error) { if cSINode == nil { return nil, fmt.Errorf("cSINode provided to Apply must not be nil") } data, err := json.Marshal(cSINode) if err != nil { return nil, err } name := cSINode.Name if name == nil { return nil, fmt.Errorf("cSINode.Name must be provided to Apply") } emptyResult := &v1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSINode), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go000066400000000000000000000145711472614177300320020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" testing "k8s.io/client-go/testing" ) // FakeCSIStorageCapacities implements CSIStorageCapacityInterface type FakeCSIStorageCapacities struct { Fake *FakeStorageV1 ns string } var csistoragecapacitiesResource = v1.SchemeGroupVersion.WithResource("csistoragecapacities") var csistoragecapacitiesKind = v1.SchemeGroupVersion.WithKind("CSIStorageCapacity") // Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIStorageCapacity, err error) { emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { emptyResult := &v1.CSIStorageCapacityList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.CSIStorageCapacityList{ListMeta: obj.(*v1.CSIStorageCapacityList).ListMeta} for _, item := range obj.(*v1.CSIStorageCapacityList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) } // Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.CreateOptions) (result *v1.CSIStorageCapacity, err error) { emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } // Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.UpdateOptions) (result *v1.CSIStorageCapacity, err error) { emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } // Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(csistoragecapacitiesResource, c.ns, name, opts), &v1.CSIStorageCapacity{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CSIStorageCapacityList{}) return err } // Patch applies the patch and returns the patched cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIStorageCapacity, err error) { emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1.CSIStorageCapacityApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIStorageCapacity, err error) { if cSIStorageCapacity == nil { return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") } data, err := json.Marshal(cSIStorageCapacity) if err != nil { return nil, err } name := cSIStorageCapacity.Name if name == nil { return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") } emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/fake/fake_storage_client.go000066400000000000000000000030121472614177300311070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1 "k8s.io/client-go/kubernetes/typed/storage/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeStorageV1 struct { *testing.Fake } func (c *FakeStorageV1) CSIDrivers() v1.CSIDriverInterface { return &FakeCSIDrivers{c} } func (c *FakeStorageV1) CSINodes() v1.CSINodeInterface { return &FakeCSINodes{c} } func (c *FakeStorageV1) CSIStorageCapacities(namespace string) v1.CSIStorageCapacityInterface { return &FakeCSIStorageCapacities{c, namespace} } func (c *FakeStorageV1) StorageClasses() v1.StorageClassInterface { return &FakeStorageClasses{c} } func (c *FakeStorageV1) VolumeAttachments() v1.VolumeAttachmentInterface { return &FakeVolumeAttachments{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStorageV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/fake/fake_storageclass.go000066400000000000000000000136421472614177300306110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" testing "k8s.io/client-go/testing" ) // FakeStorageClasses implements StorageClassInterface type FakeStorageClasses struct { Fake *FakeStorageV1 } var storageclassesResource = v1.SchemeGroupVersion.WithResource("storageclasses") var storageclassesKind = v1.SchemeGroupVersion.WithKind("StorageClass") // Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. func (c *FakeStorageClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StorageClass, err error) { emptyResult := &v1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(storageclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StorageClass), err } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *FakeStorageClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { emptyResult := &v1.StorageClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(storageclassesResource, storageclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.StorageClassList{ListMeta: obj.(*v1.StorageClassList).ListMeta} for _, item := range obj.(*v1.StorageClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested storageClasses. func (c *FakeStorageClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(storageclassesResource, opts)) } // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (result *v1.StorageClass, err error) { emptyResult := &v1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StorageClass), err } // Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (result *v1.StorageClass, err error) { emptyResult := &v1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StorageClass), err } // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. func (c *FakeStorageClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(storageclassesResource, name, opts), &v1.StorageClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(storageclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.StorageClassList{}) return err } // Patch applies the patch and returns the patched storageClass. func (c *FakeStorageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error) { emptyResult := &v1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StorageClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied storageClass. func (c *FakeStorageClasses) Apply(ctx context.Context, storageClass *storagev1.StorageClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StorageClass, err error) { if storageClass == nil { return nil, fmt.Errorf("storageClass provided to Apply must not be nil") } data, err := json.Marshal(storageClass) if err != nil { return nil, err } name := storageClass.Name if name == nil { return nil, fmt.Errorf("storageClass.Name must be provided to Apply") } emptyResult := &v1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.StorageClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go000066400000000000000000000173711472614177300315020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" testing "k8s.io/client-go/testing" ) // FakeVolumeAttachments implements VolumeAttachmentInterface type FakeVolumeAttachments struct { Fake *FakeStorageV1 } var volumeattachmentsResource = v1.SchemeGroupVersion.WithResource("volumeattachments") var volumeattachmentsKind = v1.SchemeGroupVersion.WithKind("VolumeAttachment") // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.VolumeAttachment), err } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *FakeVolumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { emptyResult := &v1.VolumeAttachmentList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1.VolumeAttachmentList{ListMeta: obj.(*v1.VolumeAttachmentList).ListMeta} for _, item := range obj.(*v1.VolumeAttachmentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.VolumeAttachment), err } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.VolumeAttachment), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.VolumeAttachment), err } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(volumeattachmentsResource, name, opts), &v1.VolumeAttachment{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.VolumeAttachmentList{}) return err } // Patch applies the patch and returns the patched volumeAttachment. func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.VolumeAttachment), err } // Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttachment. func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) { if volumeAttachment == nil { return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") } data, err := json.Marshal(volumeAttachment) if err != nil { return nil, err } name := volumeAttachment.Name if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.VolumeAttachment), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) { if volumeAttachment == nil { return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") } data, err := json.Marshal(volumeAttachment) if err != nil { return nil, err } name := volumeAttachment.Name if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1.VolumeAttachment), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/generated_expansion.go000066400000000000000000000014721472614177300302430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 type CSIDriverExpansion interface{} type CSINodeExpansion interface{} type CSIStorageCapacityExpansion interface{} type StorageClassExpansion interface{} type VolumeAttachmentExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/storage_client.go000066400000000000000000000066671472614177300272360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "net/http" v1 "k8s.io/api/storage/v1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type StorageV1Interface interface { RESTClient() rest.Interface CSIDriversGetter CSINodesGetter CSIStorageCapacitiesGetter StorageClassesGetter VolumeAttachmentsGetter } // StorageV1Client is used to interact with features provided by the storage.k8s.io group. type StorageV1Client struct { restClient rest.Interface } func (c *StorageV1Client) CSIDrivers() CSIDriverInterface { return newCSIDrivers(c) } func (c *StorageV1Client) CSINodes() CSINodeInterface { return newCSINodes(c) } func (c *StorageV1Client) CSIStorageCapacities(namespace string) CSIStorageCapacityInterface { return newCSIStorageCapacities(c, namespace) } func (c *StorageV1Client) StorageClasses() StorageClassInterface { return newStorageClasses(c) } func (c *StorageV1Client) VolumeAttachments() VolumeAttachmentInterface { return newVolumeAttachments(c) } // NewForConfig creates a new StorageV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*StorageV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new StorageV1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &StorageV1Client{client}, nil } // NewForConfigOrDie creates a new StorageV1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *StorageV1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new StorageV1Client for the given RESTClient. func New(c rest.Interface) *StorageV1Client { return &StorageV1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *StorageV1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/storageclass.go000066400000000000000000000055261472614177300267170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // StorageClassesGetter has a method to return a StorageClassInterface. // A group's client should implement this interface. type StorageClassesGetter interface { StorageClasses() StorageClassInterface } // StorageClassInterface has methods to work with StorageClass resources. type StorageClassInterface interface { Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (*v1.StorageClass, error) Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (*v1.StorageClass, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.StorageClass, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.StorageClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error) Apply(ctx context.Context, storageClass *storagev1.StorageClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StorageClass, err error) StorageClassExpansion } // storageClasses implements StorageClassInterface type storageClasses struct { *gentype.ClientWithListAndApply[*v1.StorageClass, *v1.StorageClassList, *storagev1.StorageClassApplyConfiguration] } // newStorageClasses returns a StorageClasses func newStorageClasses(c *StorageV1Client) *storageClasses { return &storageClasses{ gentype.NewClientWithListAndApply[*v1.StorageClass, *v1.StorageClassList, *storagev1.StorageClassApplyConfiguration]( "storageclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.StorageClass { return &v1.StorageClass{} }, func() *v1.StorageClassList { return &v1.StorageClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1/volumeattachment.go000066400000000000000000000067041472614177300276040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( "context" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. // A group's client should implement this interface. type VolumeAttachmentsGetter interface { VolumeAttachments() VolumeAttachmentInterface } // VolumeAttachmentInterface has methods to work with VolumeAttachment resources. type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (*v1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VolumeAttachment, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.VolumeAttachmentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) Apply(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) VolumeAttachmentExpansion } // volumeAttachments implements VolumeAttachmentInterface type volumeAttachments struct { *gentype.ClientWithListAndApply[*v1.VolumeAttachment, *v1.VolumeAttachmentList, *storagev1.VolumeAttachmentApplyConfiguration] } // newVolumeAttachments returns a VolumeAttachments func newVolumeAttachments(c *StorageV1Client) *volumeAttachments { return &volumeAttachments{ gentype.NewClientWithListAndApply[*v1.VolumeAttachment, *v1.VolumeAttachmentList, *storagev1.VolumeAttachmentApplyConfiguration]( "volumeattachments", c.RESTClient(), scheme.ParameterCodec, "", func() *v1.VolumeAttachment { return &v1.VolumeAttachment{} }, func() *v1.VolumeAttachmentList { return &v1.VolumeAttachmentList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/000077500000000000000000000000001472614177300247555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go000066400000000000000000000063311472614177300311700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. // A group's client should implement this interface. type CSIStorageCapacitiesGetter interface { CSIStorageCapacities(namespace string) CSIStorageCapacityInterface } // CSIStorageCapacityInterface has methods to work with CSIStorageCapacity resources. type CSIStorageCapacityInterface interface { Create(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.CreateOptions) (*v1alpha1.CSIStorageCapacity, error) Update(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.UpdateOptions) (*v1alpha1.CSIStorageCapacity, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.CSIStorageCapacity, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.CSIStorageCapacityList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CSIStorageCapacity, err error) Apply(ctx context.Context, cSIStorageCapacity *storagev1alpha1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CSIStorageCapacity, err error) CSIStorageCapacityExpansion } // cSIStorageCapacities implements CSIStorageCapacityInterface type cSIStorageCapacities struct { *gentype.ClientWithListAndApply[*v1alpha1.CSIStorageCapacity, *v1alpha1.CSIStorageCapacityList, *storagev1alpha1.CSIStorageCapacityApplyConfiguration] } // newCSIStorageCapacities returns a CSIStorageCapacities func newCSIStorageCapacities(c *StorageV1alpha1Client, namespace string) *cSIStorageCapacities { return &cSIStorageCapacities{ gentype.NewClientWithListAndApply[*v1alpha1.CSIStorageCapacity, *v1alpha1.CSIStorageCapacityList, *storagev1alpha1.CSIStorageCapacityApplyConfiguration]( "csistoragecapacities", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1alpha1.CSIStorageCapacity { return &v1alpha1.CSIStorageCapacity{} }, func() *v1alpha1.CSIStorageCapacityList { return &v1alpha1.CSIStorageCapacityList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/doc.go000066400000000000000000000012651472614177300260550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/fake/000077500000000000000000000000001472614177300256635ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300267600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go000066400000000000000000000150151472614177300330630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeCSIStorageCapacities implements CSIStorageCapacityInterface type FakeCSIStorageCapacities struct { Fake *FakeStorageV1alpha1 ns string } var csistoragecapacitiesResource = v1alpha1.SchemeGroupVersion.WithResource("csistoragecapacities") var csistoragecapacitiesKind = v1alpha1.SchemeGroupVersion.WithKind("CSIStorageCapacity") // Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CSIStorageCapacity, err error) { emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { emptyResult := &v1alpha1.CSIStorageCapacityList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.CSIStorageCapacityList{ListMeta: obj.(*v1alpha1.CSIStorageCapacityList).ListMeta} for _, item := range obj.(*v1alpha1.CSIStorageCapacityList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) } // Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } // Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } // Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(csistoragecapacitiesResource, c.ns, name, opts), &v1alpha1.CSIStorageCapacity{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.CSIStorageCapacityList{}) return err } // Patch applies the patch and returns the patched cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CSIStorageCapacity, err error) { emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1alpha1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CSIStorageCapacity, err error) { if cSIStorageCapacity == nil { return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") } data, err := json.Marshal(cSIStorageCapacity) if err != nil { return nil, err } name := cSIStorageCapacity.Name if name == nil { return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") } emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go000066400000000000000000000026611472614177300322070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeStorageV1alpha1 struct { *testing.Fake } func (c *FakeStorageV1alpha1) CSIStorageCapacities(namespace string) v1alpha1.CSIStorageCapacityInterface { return &FakeCSIStorageCapacities{c, namespace} } func (c *FakeStorageV1alpha1) VolumeAttachments() v1alpha1.VolumeAttachmentInterface { return &FakeVolumeAttachments{c} } func (c *FakeStorageV1alpha1) VolumeAttributesClasses() v1alpha1.VolumeAttributesClassInterface { return &FakeVolumeAttributesClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStorageV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go000066400000000000000000000176651472614177300325770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeVolumeAttachments implements VolumeAttachmentInterface type FakeVolumeAttachments struct { Fake *FakeStorageV1alpha1 } var volumeattachmentsResource = v1alpha1.SchemeGroupVersion.WithResource("volumeattachments") var volumeattachmentsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAttachment") // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { emptyResult := &v1alpha1.VolumeAttachmentList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.VolumeAttachmentList{ListMeta: obj.(*v1alpha1.VolumeAttachmentList).ListMeta} for _, item := range obj.(*v1alpha1.VolumeAttachmentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(volumeattachmentsResource, name, opts), &v1alpha1.VolumeAttachment{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttachmentList{}) return err } // Patch applies the patch and returns the patched volumeAttachment. func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } // Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttachment. func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) { if volumeAttachment == nil { return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") } data, err := json.Marshal(volumeAttachment) if err != nil { return nil, err } name := volumeAttachment.Name if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) { if volumeAttachment == nil { return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") } data, err := json.Marshal(volumeAttachment) if err != nil { return nil, err } name := volumeAttachment.Name if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go000066400000000000000000000152761472614177300336570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeVolumeAttributesClasses implements VolumeAttributesClassInterface type FakeVolumeAttributesClasses struct { Fake *FakeStorageV1alpha1 } var volumeattributesclassesResource = v1alpha1.SchemeGroupVersion.WithResource("volumeattributesclasses") var volumeattributesclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAttributesClass") // Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(volumeattributesclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } // List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { emptyResult := &v1alpha1.VolumeAttributesClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(volumeattributesclassesResource, volumeattributesclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.VolumeAttributesClassList{ListMeta: obj.(*v1alpha1.VolumeAttributesClassList).ListMeta} for _, item := range obj.(*v1alpha1.VolumeAttributesClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested volumeAttributesClasses. func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattributesclassesResource, opts)) } // Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } // Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } // Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. func (c *FakeVolumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(volumeattributesclassesResource, name, opts), &v1alpha1.VolumeAttributesClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(volumeattributesclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttributesClassList{}) return err } // Patch applies the patch and returns the patched volumeAttributesClass. func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttributesClass. func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) { if volumeAttributesClass == nil { return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") } data, err := json.Marshal(volumeAttributesClass) if err != nil { return nil, err } name := volumeAttributesClass.Name if name == nil { return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") } emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/generated_expansion.go000066400000000000000000000014011472614177300313220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type CSIStorageCapacityExpansion interface{} type VolumeAttachmentExpansion interface{} type VolumeAttributesClassExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/storage_client.go000066400000000000000000000066151472614177300303160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/storage/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type StorageV1alpha1Interface interface { RESTClient() rest.Interface CSIStorageCapacitiesGetter VolumeAttachmentsGetter VolumeAttributesClassesGetter } // StorageV1alpha1Client is used to interact with features provided by the storage.k8s.io group. type StorageV1alpha1Client struct { restClient rest.Interface } func (c *StorageV1alpha1Client) CSIStorageCapacities(namespace string) CSIStorageCapacityInterface { return newCSIStorageCapacities(c, namespace) } func (c *StorageV1alpha1Client) VolumeAttachments() VolumeAttachmentInterface { return newVolumeAttachments(c) } func (c *StorageV1alpha1Client) VolumeAttributesClasses() VolumeAttributesClassInterface { return newVolumeAttributesClasses(c) } // NewForConfig creates a new StorageV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*StorageV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new StorageV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &StorageV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new StorageV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *StorageV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new StorageV1alpha1Client for the given RESTClient. func New(c rest.Interface) *StorageV1alpha1Client { return &StorageV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *StorageV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/volumeattachment.go000066400000000000000000000070761472614177300306760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. // A group's client should implement this interface. type VolumeAttachmentsGetter interface { VolumeAttachments() VolumeAttachmentInterface } // VolumeAttachmentInterface has methods to work with VolumeAttachment resources. type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (*v1alpha1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VolumeAttachment, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) Apply(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) VolumeAttachmentExpansion } // volumeAttachments implements VolumeAttachmentInterface type volumeAttachments struct { *gentype.ClientWithListAndApply[*v1alpha1.VolumeAttachment, *v1alpha1.VolumeAttachmentList, *storagev1alpha1.VolumeAttachmentApplyConfiguration] } // newVolumeAttachments returns a VolumeAttachments func newVolumeAttachments(c *StorageV1alpha1Client) *volumeAttachments { return &volumeAttachments{ gentype.NewClientWithListAndApply[*v1alpha1.VolumeAttachment, *v1alpha1.VolumeAttachmentList, *storagev1alpha1.VolumeAttachmentApplyConfiguration]( "volumeattachments", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.VolumeAttachment { return &v1alpha1.VolumeAttachment{} }, func() *v1alpha1.VolumeAttachmentList { return &v1alpha1.VolumeAttachmentList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go000066400000000000000000000064501472614177300317550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // VolumeAttributesClassesGetter has a method to return a VolumeAttributesClassInterface. // A group's client should implement this interface. type VolumeAttributesClassesGetter interface { VolumeAttributesClasses() VolumeAttributesClassInterface } // VolumeAttributesClassInterface has methods to work with VolumeAttributesClass resources. type VolumeAttributesClassInterface interface { Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (*v1alpha1.VolumeAttributesClass, error) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (*v1alpha1.VolumeAttributesClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VolumeAttributesClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttributesClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) VolumeAttributesClassExpansion } // volumeAttributesClasses implements VolumeAttributesClassInterface type volumeAttributesClasses struct { *gentype.ClientWithListAndApply[*v1alpha1.VolumeAttributesClass, *v1alpha1.VolumeAttributesClassList, *storagev1alpha1.VolumeAttributesClassApplyConfiguration] } // newVolumeAttributesClasses returns a VolumeAttributesClasses func newVolumeAttributesClasses(c *StorageV1alpha1Client) *volumeAttributesClasses { return &volumeAttributesClasses{ gentype.NewClientWithListAndApply[*v1alpha1.VolumeAttributesClass, *v1alpha1.VolumeAttributesClassList, *storagev1alpha1.VolumeAttributesClassApplyConfiguration]( "volumeattributesclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.VolumeAttributesClass { return &v1alpha1.VolumeAttributesClass{} }, func() *v1alpha1.VolumeAttributesClassList { return &v1alpha1.VolumeAttributesClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/000077500000000000000000000000001472614177300246035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/csidriver.go000066400000000000000000000054441472614177300271330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CSIDriversGetter has a method to return a CSIDriverInterface. // A group's client should implement this interface. type CSIDriversGetter interface { CSIDrivers() CSIDriverInterface } // CSIDriverInterface has methods to work with CSIDriver resources. type CSIDriverInterface interface { Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (*v1beta1.CSIDriver, error) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (*v1beta1.CSIDriver, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CSIDriver, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIDriverList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIDriver, err error) Apply(ctx context.Context, cSIDriver *storagev1beta1.CSIDriverApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIDriver, err error) CSIDriverExpansion } // cSIDrivers implements CSIDriverInterface type cSIDrivers struct { *gentype.ClientWithListAndApply[*v1beta1.CSIDriver, *v1beta1.CSIDriverList, *storagev1beta1.CSIDriverApplyConfiguration] } // newCSIDrivers returns a CSIDrivers func newCSIDrivers(c *StorageV1beta1Client) *cSIDrivers { return &cSIDrivers{ gentype.NewClientWithListAndApply[*v1beta1.CSIDriver, *v1beta1.CSIDriverList, *storagev1beta1.CSIDriverApplyConfiguration]( "csidrivers", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.CSIDriver { return &v1beta1.CSIDriver{} }, func() *v1beta1.CSIDriverList { return &v1beta1.CSIDriverList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/csinode.go000066400000000000000000000053241472614177300265620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CSINodesGetter has a method to return a CSINodeInterface. // A group's client should implement this interface. type CSINodesGetter interface { CSINodes() CSINodeInterface } // CSINodeInterface has methods to work with CSINode resources. type CSINodeInterface interface { Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (*v1beta1.CSINode, error) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (*v1beta1.CSINode, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CSINode, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSINodeList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSINode, err error) Apply(ctx context.Context, cSINode *storagev1beta1.CSINodeApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSINode, err error) CSINodeExpansion } // cSINodes implements CSINodeInterface type cSINodes struct { *gentype.ClientWithListAndApply[*v1beta1.CSINode, *v1beta1.CSINodeList, *storagev1beta1.CSINodeApplyConfiguration] } // newCSINodes returns a CSINodes func newCSINodes(c *StorageV1beta1Client) *cSINodes { return &cSINodes{ gentype.NewClientWithListAndApply[*v1beta1.CSINode, *v1beta1.CSINodeList, *storagev1beta1.CSINodeApplyConfiguration]( "csinodes", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.CSINode { return &v1beta1.CSINode{} }, func() *v1beta1.CSINodeList { return &v1beta1.CSINodeList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/csistoragecapacity.go000066400000000000000000000063001472614177300310120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. // A group's client should implement this interface. type CSIStorageCapacitiesGetter interface { CSIStorageCapacities(namespace string) CSIStorageCapacityInterface } // CSIStorageCapacityInterface has methods to work with CSIStorageCapacity resources. type CSIStorageCapacityInterface interface { Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (*v1beta1.CSIStorageCapacity, error) Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (*v1beta1.CSIStorageCapacity, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CSIStorageCapacity, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIStorageCapacityList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error) Apply(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIStorageCapacity, err error) CSIStorageCapacityExpansion } // cSIStorageCapacities implements CSIStorageCapacityInterface type cSIStorageCapacities struct { *gentype.ClientWithListAndApply[*v1beta1.CSIStorageCapacity, *v1beta1.CSIStorageCapacityList, *storagev1beta1.CSIStorageCapacityApplyConfiguration] } // newCSIStorageCapacities returns a CSIStorageCapacities func newCSIStorageCapacities(c *StorageV1beta1Client, namespace string) *cSIStorageCapacities { return &cSIStorageCapacities{ gentype.NewClientWithListAndApply[*v1beta1.CSIStorageCapacity, *v1beta1.CSIStorageCapacityList, *storagev1beta1.CSIStorageCapacityApplyConfiguration]( "csistoragecapacities", c.RESTClient(), scheme.ParameterCodec, namespace, func() *v1beta1.CSIStorageCapacity { return &v1beta1.CSIStorageCapacity{} }, func() *v1beta1.CSIStorageCapacityList { return &v1beta1.CSIStorageCapacityList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/doc.go000066400000000000000000000012641472614177300257020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/000077500000000000000000000000001472614177300255115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/doc.go000066400000000000000000000012531472614177300266060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go000066400000000000000000000134441472614177300310260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" testing "k8s.io/client-go/testing" ) // FakeCSIDrivers implements CSIDriverInterface type FakeCSIDrivers struct { Fake *FakeStorageV1beta1 } var csidriversResource = v1beta1.SchemeGroupVersion.WithResource("csidrivers") var csidriversKind = v1beta1.SchemeGroupVersion.WithKind("CSIDriver") // Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) { emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(csidriversResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. func (c *FakeCSIDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { emptyResult := &v1beta1.CSIDriverList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(csidriversResource, csidriversKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.CSIDriverList{ListMeta: obj.(*v1beta1.CSIDriverList).ListMeta} for _, item := range obj.(*v1beta1.CSIDriverList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cSIDrivers. func (c *FakeCSIDrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(csidriversResource, opts)) } // Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (result *v1beta1.CSIDriver, err error) { emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } // Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (result *v1beta1.CSIDriver, err error) { emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } // Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. func (c *FakeCSIDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(csidriversResource, name, opts), &v1beta1.CSIDriver{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(csidriversResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CSIDriverList{}) return err } // Patch applies the patch and returns the patched cSIDriver. func (c *FakeCSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIDriver, err error) { emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cSIDriver. func (c *FakeCSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1beta1.CSIDriverApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIDriver, err error) { if cSIDriver == nil { return nil, fmt.Errorf("cSIDriver provided to Apply must not be nil") } data, err := json.Marshal(cSIDriver) if err != nil { return nil, err } name := cSIDriver.Name if name == nil { return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply") } emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go000066400000000000000000000132241472614177300304540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" testing "k8s.io/client-go/testing" ) // FakeCSINodes implements CSINodeInterface type FakeCSINodes struct { Fake *FakeStorageV1beta1 } var csinodesResource = v1beta1.SchemeGroupVersion.WithResource("csinodes") var csinodesKind = v1beta1.SchemeGroupVersion.WithKind("CSINode") // Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. func (c *FakeCSINodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSINode, err error) { emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(csinodesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSINode), err } // List takes label and field selectors, and returns the list of CSINodes that match those selectors. func (c *FakeCSINodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { emptyResult := &v1beta1.CSINodeList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(csinodesResource, csinodesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.CSINodeList{ListMeta: obj.(*v1beta1.CSINodeList).ListMeta} for _, item := range obj.(*v1beta1.CSINodeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cSINodes. func (c *FakeCSINodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(csinodesResource, opts)) } // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (result *v1beta1.CSINode, err error) { emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSINode), err } // Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (result *v1beta1.CSINode, err error) { emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSINode), err } // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. func (c *FakeCSINodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(csinodesResource, name, opts), &v1beta1.CSINode{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(csinodesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CSINodeList{}) return err } // Patch applies the patch and returns the patched cSINode. func (c *FakeCSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSINode, err error) { emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSINode), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cSINode. func (c *FakeCSINodes) Apply(ctx context.Context, cSINode *storagev1beta1.CSINodeApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSINode, err error) { if cSINode == nil { return nil, fmt.Errorf("cSINode provided to Apply must not be nil") } data, err := json.Marshal(cSINode) if err != nil { return nil, err } name := cSINode.Name if name == nil { return nil, fmt.Errorf("cSINode.Name must be provided to Apply") } emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSINode), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go000066400000000000000000000147551472614177300327230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" testing "k8s.io/client-go/testing" ) // FakeCSIStorageCapacities implements CSIStorageCapacityInterface type FakeCSIStorageCapacities struct { Fake *FakeStorageV1beta1 ns string } var csistoragecapacitiesResource = v1beta1.SchemeGroupVersion.WithResource("csistoragecapacities") var csistoragecapacitiesKind = v1beta1.SchemeGroupVersion.WithKind("CSIStorageCapacity") // Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIStorageCapacity, err error) { emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { emptyResult := &v1beta1.CSIStorageCapacityList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.CSIStorageCapacityList{ListMeta: obj.(*v1beta1.CSIStorageCapacityList).ListMeta} for _, item := range obj.(*v1beta1.CSIStorageCapacityList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) } // Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1beta1.CSIStorageCapacity, err error) { emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } // Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1beta1.CSIStorageCapacity, err error) { emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } // Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteActionWithOptions(csistoragecapacitiesResource, c.ns, name, opts), &v1beta1.CSIStorageCapacity{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CSIStorageCapacityList{}) return err } // Patch applies the patch and returns the patched cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error) { emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } // Apply takes the given apply declarative configuration, applies it and returns the applied cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIStorageCapacity, err error) { if cSIStorageCapacity == nil { return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") } data, err := json.Marshal(cSIStorageCapacity) if err != nil { return nil, err } name := cSIStorageCapacity.Name if name == nil { return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") } emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go000066400000000000000000000033331472614177300320320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeStorageV1beta1 struct { *testing.Fake } func (c *FakeStorageV1beta1) CSIDrivers() v1beta1.CSIDriverInterface { return &FakeCSIDrivers{c} } func (c *FakeStorageV1beta1) CSINodes() v1beta1.CSINodeInterface { return &FakeCSINodes{c} } func (c *FakeStorageV1beta1) CSIStorageCapacities(namespace string) v1beta1.CSIStorageCapacityInterface { return &FakeCSIStorageCapacities{c, namespace} } func (c *FakeStorageV1beta1) StorageClasses() v1beta1.StorageClassInterface { return &FakeStorageClasses{c} } func (c *FakeStorageV1beta1) VolumeAttachments() v1beta1.VolumeAttachmentInterface { return &FakeVolumeAttachments{c} } func (c *FakeStorageV1beta1) VolumeAttributesClasses() v1beta1.VolumeAttributesClassInterface { return &FakeVolumeAttributesClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStorageV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go000066400000000000000000000140261472614177300315230ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" testing "k8s.io/client-go/testing" ) // FakeStorageClasses implements StorageClassInterface type FakeStorageClasses struct { Fake *FakeStorageV1beta1 } var storageclassesResource = v1beta1.SchemeGroupVersion.WithResource("storageclasses") var storageclassesKind = v1beta1.SchemeGroupVersion.WithKind("StorageClass") // Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. func (c *FakeStorageClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StorageClass, err error) { emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(storageclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StorageClass), err } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *FakeStorageClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { emptyResult := &v1beta1.StorageClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(storageclassesResource, storageclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.StorageClassList{ListMeta: obj.(*v1beta1.StorageClassList).ListMeta} for _, item := range obj.(*v1beta1.StorageClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested storageClasses. func (c *FakeStorageClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(storageclassesResource, opts)) } // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (result *v1beta1.StorageClass, err error) { emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StorageClass), err } // Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (result *v1beta1.StorageClass, err error) { emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StorageClass), err } // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. func (c *FakeStorageClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(storageclassesResource, name, opts), &v1beta1.StorageClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(storageclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.StorageClassList{}) return err } // Patch applies the patch and returns the patched storageClass. func (c *FakeStorageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageClass, err error) { emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StorageClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied storageClass. func (c *FakeStorageClasses) Apply(ctx context.Context, storageClass *storagev1beta1.StorageClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StorageClass, err error) { if storageClass == nil { return nil, fmt.Errorf("storageClass provided to Apply must not be nil") } data, err := json.Marshal(storageClass) if err != nil { return nil, err } name := storageClass.Name if name == nil { return nil, fmt.Errorf("storageClass.Name must be provided to Apply") } emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.StorageClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go000066400000000000000000000176151472614177300324200ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" testing "k8s.io/client-go/testing" ) // FakeVolumeAttachments implements VolumeAttachmentInterface type FakeVolumeAttachments struct { Fake *FakeStorageV1beta1 } var volumeattachmentsResource = v1beta1.SchemeGroupVersion.WithResource("volumeattachments") var volumeattachmentsKind = v1beta1.SchemeGroupVersion.WithKind("VolumeAttachment") // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { emptyResult := &v1beta1.VolumeAttachmentList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.VolumeAttachmentList{ListMeta: obj.(*v1beta1.VolumeAttachmentList).ListMeta} for _, item := range obj.(*v1beta1.VolumeAttachmentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(volumeattachmentsResource, name, opts), &v1beta1.VolumeAttachment{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VolumeAttachmentList{}) return err } // Patch applies the patch and returns the patched volumeAttachment. func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } // Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttachment. func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) { if volumeAttachment == nil { return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") } data, err := json.Marshal(volumeAttachment) if err != nil { return nil, err } name := volumeAttachment.Name if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) { if volumeAttachment == nil { return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") } data, err := json.Marshal(volumeAttachment) if err != nil { return nil, err } name := volumeAttachment.Name if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go000066400000000000000000000152361472614177300335010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" testing "k8s.io/client-go/testing" ) // FakeVolumeAttributesClasses implements VolumeAttributesClassInterface type FakeVolumeAttributesClasses struct { Fake *FakeStorageV1beta1 } var volumeattributesclassesResource = v1beta1.SchemeGroupVersion.WithResource("volumeattributesclasses") var volumeattributesclassesKind = v1beta1.SchemeGroupVersion.WithKind("VolumeAttributesClass") // Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttributesClass, err error) { emptyResult := &v1beta1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(volumeattributesclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttributesClass), err } // List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttributesClassList, err error) { emptyResult := &v1beta1.VolumeAttributesClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(volumeattributesclassesResource, volumeattributesclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1beta1.VolumeAttributesClassList{ListMeta: obj.(*v1beta1.VolumeAttributesClassList).ListMeta} for _, item := range obj.(*v1beta1.VolumeAttributesClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested volumeAttributesClasses. func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattributesclassesResource, opts)) } // Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1beta1.VolumeAttributesClass, err error) { emptyResult := &v1beta1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttributesClass), err } // Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1beta1.VolumeAttributesClass, err error) { emptyResult := &v1beta1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttributesClass), err } // Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. func (c *FakeVolumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(volumeattributesclassesResource, name, opts), &v1beta1.VolumeAttributesClass{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(volumeattributesclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VolumeAttributesClassList{}) return err } // Patch applies the patch and returns the patched volumeAttributesClass. func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttributesClass, err error) { emptyResult := &v1beta1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttributesClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttributesClass. func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1beta1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttributesClass, err error) { if volumeAttributesClass == nil { return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") } data, err := json.Marshal(volumeAttributesClass) if err != nil { return nil, err } name := volumeAttributesClass.Name if name == nil { return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") } emptyResult := &v1beta1.VolumeAttributesClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1beta1.VolumeAttributesClass), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/generated_expansion.go000066400000000000000000000015601472614177300311560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 type CSIDriverExpansion interface{} type CSINodeExpansion interface{} type CSIStorageCapacityExpansion interface{} type StorageClassExpansion interface{} type VolumeAttachmentExpansion interface{} type VolumeAttributesClassExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/storage_client.go000066400000000000000000000073141472614177300301410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "net/http" v1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type StorageV1beta1Interface interface { RESTClient() rest.Interface CSIDriversGetter CSINodesGetter CSIStorageCapacitiesGetter StorageClassesGetter VolumeAttachmentsGetter VolumeAttributesClassesGetter } // StorageV1beta1Client is used to interact with features provided by the storage.k8s.io group. type StorageV1beta1Client struct { restClient rest.Interface } func (c *StorageV1beta1Client) CSIDrivers() CSIDriverInterface { return newCSIDrivers(c) } func (c *StorageV1beta1Client) CSINodes() CSINodeInterface { return newCSINodes(c) } func (c *StorageV1beta1Client) CSIStorageCapacities(namespace string) CSIStorageCapacityInterface { return newCSIStorageCapacities(c, namespace) } func (c *StorageV1beta1Client) StorageClasses() StorageClassInterface { return newStorageClasses(c) } func (c *StorageV1beta1Client) VolumeAttachments() VolumeAttachmentInterface { return newVolumeAttachments(c) } func (c *StorageV1beta1Client) VolumeAttributesClasses() VolumeAttributesClassInterface { return newVolumeAttributesClasses(c) } // NewForConfig creates a new StorageV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*StorageV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new StorageV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &StorageV1beta1Client{client}, nil } // NewForConfigOrDie creates a new StorageV1beta1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *StorageV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new StorageV1beta1Client for the given RESTClient. func New(c rest.Interface) *StorageV1beta1Client { return &StorageV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *StorageV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/storageclass.go000066400000000000000000000056471472614177300276400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // StorageClassesGetter has a method to return a StorageClassInterface. // A group's client should implement this interface. type StorageClassesGetter interface { StorageClasses() StorageClassInterface } // StorageClassInterface has methods to work with StorageClass resources. type StorageClassInterface interface { Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (*v1beta1.StorageClass, error) Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (*v1beta1.StorageClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.StorageClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StorageClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageClass, err error) Apply(ctx context.Context, storageClass *storagev1beta1.StorageClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StorageClass, err error) StorageClassExpansion } // storageClasses implements StorageClassInterface type storageClasses struct { *gentype.ClientWithListAndApply[*v1beta1.StorageClass, *v1beta1.StorageClassList, *storagev1beta1.StorageClassApplyConfiguration] } // newStorageClasses returns a StorageClasses func newStorageClasses(c *StorageV1beta1Client) *storageClasses { return &storageClasses{ gentype.NewClientWithListAndApply[*v1beta1.StorageClass, *v1beta1.StorageClassList, *storagev1beta1.StorageClassApplyConfiguration]( "storageclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.StorageClass { return &v1beta1.StorageClass{} }, func() *v1beta1.StorageClassList { return &v1beta1.StorageClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/volumeattachment.go000066400000000000000000000070411472614177300305140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. // A group's client should implement this interface. type VolumeAttachmentsGetter interface { VolumeAttachments() VolumeAttachmentInterface } // VolumeAttachmentInterface has methods to work with VolumeAttachment resources. type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (*v1beta1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeAttachment, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeAttachmentList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttachment, err error) Apply(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) VolumeAttachmentExpansion } // volumeAttachments implements VolumeAttachmentInterface type volumeAttachments struct { *gentype.ClientWithListAndApply[*v1beta1.VolumeAttachment, *v1beta1.VolumeAttachmentList, *storagev1beta1.VolumeAttachmentApplyConfiguration] } // newVolumeAttachments returns a VolumeAttachments func newVolumeAttachments(c *StorageV1beta1Client) *volumeAttachments { return &volumeAttachments{ gentype.NewClientWithListAndApply[*v1beta1.VolumeAttachment, *v1beta1.VolumeAttachmentList, *storagev1beta1.VolumeAttachmentApplyConfiguration]( "volumeattachments", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.VolumeAttachment { return &v1beta1.VolumeAttachment{} }, func() *v1beta1.VolumeAttachmentList { return &v1beta1.VolumeAttachmentList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storage/v1beta1/volumeattributesclass.go000066400000000000000000000064171472614177300316060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // VolumeAttributesClassesGetter has a method to return a VolumeAttributesClassInterface. // A group's client should implement this interface. type VolumeAttributesClassesGetter interface { VolumeAttributesClasses() VolumeAttributesClassInterface } // VolumeAttributesClassInterface has methods to work with VolumeAttributesClass resources. type VolumeAttributesClassInterface interface { Create(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.CreateOptions) (*v1beta1.VolumeAttributesClass, error) Update(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.UpdateOptions) (*v1beta1.VolumeAttributesClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeAttributesClass, error) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeAttributesClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttributesClass, err error) Apply(ctx context.Context, volumeAttributesClass *storagev1beta1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttributesClass, err error) VolumeAttributesClassExpansion } // volumeAttributesClasses implements VolumeAttributesClassInterface type volumeAttributesClasses struct { *gentype.ClientWithListAndApply[*v1beta1.VolumeAttributesClass, *v1beta1.VolumeAttributesClassList, *storagev1beta1.VolumeAttributesClassApplyConfiguration] } // newVolumeAttributesClasses returns a VolumeAttributesClasses func newVolumeAttributesClasses(c *StorageV1beta1Client) *volumeAttributesClasses { return &volumeAttributesClasses{ gentype.NewClientWithListAndApply[*v1beta1.VolumeAttributesClass, *v1beta1.VolumeAttributesClassList, *storagev1beta1.VolumeAttributesClassApplyConfiguration]( "volumeattributesclasses", c.RESTClient(), scheme.ParameterCodec, "", func() *v1beta1.VolumeAttributesClass { return &v1beta1.VolumeAttributesClass{} }, func() *v1beta1.VolumeAttributesClassList { return &v1beta1.VolumeAttributesClassList{} }), } } kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/000077500000000000000000000000001472614177300252525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/000077500000000000000000000000001472614177300266675ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/doc.go000066400000000000000000000012651472614177300277670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/fake/000077500000000000000000000000001472614177300275755ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/fake/doc.go000066400000000000000000000012531472614177300306720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake fake_storagemigration_client.go000066400000000000000000000022761472614177300357560ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( v1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) type FakeStoragemigrationV1alpha1 struct { *testing.Fake } func (c *FakeStoragemigrationV1alpha1) StorageVersionMigrations() v1alpha1.StorageVersionMigrationInterface { return &FakeStorageVersionMigrations{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStoragemigrationV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } fake_storageversionmigration.go000066400000000000000000000211571472614177300360250ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/fake/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package fake import ( "context" json "encoding/json" "fmt" v1alpha1 "k8s.io/api/storagemigration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" testing "k8s.io/client-go/testing" ) // FakeStorageVersionMigrations implements StorageVersionMigrationInterface type FakeStorageVersionMigrations struct { Fake *FakeStoragemigrationV1alpha1 } var storageversionmigrationsResource = v1alpha1.SchemeGroupVersion.WithResource("storageversionmigrations") var storageversionmigrationsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigration") // Get takes name of the storageVersionMigration, and returns the corresponding storageVersionMigration object, and an error if there is any. func (c *FakeStorageVersionMigrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(storageversionmigrationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } // List takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. func (c *FakeStorageVersionMigrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { emptyResult := &v1alpha1.StorageVersionMigrationList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(storageversionmigrationsResource, storageversionmigrationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } list := &v1alpha1.StorageVersionMigrationList{ListMeta: obj.(*v1alpha1.StorageVersionMigrationList).ListMeta} for _, item := range obj.(*v1alpha1.StorageVersionMigrationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } } return list, err } // Watch returns a watch.Interface that watches the requested storageVersionMigrations. func (c *FakeStorageVersionMigrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchActionWithOptions(storageversionmigrationsResource, opts)) } // Create takes the representation of a storageVersionMigration and creates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. func (c *FakeStorageVersionMigrations) Create(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.CreateOptions) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(storageversionmigrationsResource, storageVersionMigration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } // Update takes the representation of a storageVersionMigration and updates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. func (c *FakeStorageVersionMigrations) Update(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(storageversionmigrationsResource, storageVersionMigration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *FakeStorageVersionMigrations) UpdateStatus(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceActionWithOptions(storageversionmigrationsResource, "status", storageVersionMigration, opts), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } // Delete takes name of the storageVersionMigration and deletes it. Returns an error if one occurs. func (c *FakeStorageVersionMigrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteActionWithOptions(storageversionmigrationsResource, name, opts), &v1alpha1.StorageVersionMigration{}) return err } // DeleteCollection deletes a collection of objects. func (c *FakeStorageVersionMigrations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(storageversionmigrationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionMigrationList{}) return err } // Patch applies the patch and returns the patched storageVersionMigration. func (c *FakeStorageVersionMigrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } // Apply takes the given apply declarative configuration, applies it and returns the applied storageVersionMigration. func (c *FakeStorageVersionMigrations) Apply(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) { if storageVersionMigration == nil { return nil, fmt.Errorf("storageVersionMigration provided to Apply must not be nil") } data, err := json.Marshal(storageVersionMigration) if err != nil { return nil, err } name := storageVersionMigration.Name if name == nil { return nil, fmt.Errorf("storageVersionMigration.Name must be provided to Apply") } emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). func (c *FakeStorageVersionMigrations) ApplyStatus(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) { if storageVersionMigration == nil { return nil, fmt.Errorf("storageVersionMigration provided to Apply must not be nil") } data, err := json.Marshal(storageVersionMigration) if err != nil { return nil, err } name := storageVersionMigration.Name if name == nil { return nil, fmt.Errorf("storageVersionMigration.Name must be provided to Apply") } emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/generated_expansion.go000066400000000000000000000012511472614177300332370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 type StorageVersionMigrationExpansion interface{} kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go000066400000000000000000000063551472614177300341430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "net/http" v1alpha1 "k8s.io/api/storagemigration/v1alpha1" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) type StoragemigrationV1alpha1Interface interface { RESTClient() rest.Interface StorageVersionMigrationsGetter } // StoragemigrationV1alpha1Client is used to interact with features provided by the storagemigration.k8s.io group. type StoragemigrationV1alpha1Client struct { restClient rest.Interface } func (c *StoragemigrationV1alpha1Client) StorageVersionMigrations() StorageVersionMigrationInterface { return newStorageVersionMigrations(c) } // NewForConfig creates a new StoragemigrationV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*StoragemigrationV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err } return NewForConfigAndClient(&config, httpClient) } // NewForConfigAndClient creates a new StoragemigrationV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StoragemigrationV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } return &StoragemigrationV1alpha1Client{client}, nil } // NewForConfigOrDie creates a new StoragemigrationV1alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *StoragemigrationV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new StoragemigrationV1alpha1Client for the given RESTClient. func New(c rest.Interface) *StoragemigrationV1alpha1Client { return &StoragemigrationV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *StoragemigrationV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient } kubernetes-client-go-a2dfcab/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go000066400000000000000000000077101472614177300342070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1alpha1 import ( "context" v1alpha1 "k8s.io/api/storagemigration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) // StorageVersionMigrationsGetter has a method to return a StorageVersionMigrationInterface. // A group's client should implement this interface. type StorageVersionMigrationsGetter interface { StorageVersionMigrations() StorageVersionMigrationInterface } // StorageVersionMigrationInterface has methods to work with StorageVersionMigration resources. type StorageVersionMigrationInterface interface { Create(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.CreateOptions) (*v1alpha1.StorageVersionMigration, error) Update(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (*v1alpha1.StorageVersionMigration, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (*v1alpha1.StorageVersionMigration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.StorageVersionMigration, error) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionMigrationList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersionMigration, err error) Apply(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) StorageVersionMigrationExpansion } // storageVersionMigrations implements StorageVersionMigrationInterface type storageVersionMigrations struct { *gentype.ClientWithListAndApply[*v1alpha1.StorageVersionMigration, *v1alpha1.StorageVersionMigrationList, *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration] } // newStorageVersionMigrations returns a StorageVersionMigrations func newStorageVersionMigrations(c *StoragemigrationV1alpha1Client) *storageVersionMigrations { return &storageVersionMigrations{ gentype.NewClientWithListAndApply[*v1alpha1.StorageVersionMigration, *v1alpha1.StorageVersionMigrationList, *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration]( "storageversionmigrations", c.RESTClient(), scheme.ParameterCodec, "", func() *v1alpha1.StorageVersionMigration { return &v1alpha1.StorageVersionMigration{} }, func() *v1alpha1.StorageVersionMigrationList { return &v1alpha1.StorageVersionMigrationList{} }), } } kubernetes-client-go-a2dfcab/kubernetes_test/000077500000000000000000000000001472614177300216065ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/kubernetes_test/clientset_test.go000066400000000000000000000043531472614177300251730ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package kubernetes_test import ( "context" "net/http" "net/http/httptest" "testing" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" ) func TestClientUserAgent(t *testing.T) { tests := []struct { name string userAgent string expect string }{ { name: "empty", expect: rest.DefaultKubernetesUserAgent(), }, { name: "custom", userAgent: "test-agent", expect: "test-agent", }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { userAgent := r.Header.Get("User-Agent") if userAgent != tc.expect { t.Errorf("User Agent expected: %s got: %s", tc.expect, userAgent) http.Error(w, "Unexpected user agent", http.StatusBadRequest) return } w.Header().Set("Content-Type", "application/json") w.Write([]byte("{}")) })) ts.Start() defer ts.Close() gv := v1.SchemeGroupVersion config := &rest.Config{ Host: ts.URL, } config.GroupVersion = &gv config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() config.UserAgent = tc.userAgent config.ContentType = "application/json" client, err := kubernetes.NewForConfig(config) if err != nil { t.Fatalf("failed to create REST client: %v", err) } _, err = client.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Error(err) } _, err = client.CoreV1().Secrets("").List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Error(err) } }) } } kubernetes-client-go-a2dfcab/kubernetes_test/fake_client_test.go000066400000000000000000000072121472614177300254420ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package kubernetes import ( "context" "testing" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/scheme" ) // This test proves that the kube fake client does not return GVKs. This is consistent with actual client (see tests below) // and should not be changed unless the decoding behavior and somehow literal creation (`&corev1.ConfigMap{}`) behavior change. func Test_ConfigMapFakeClient(t *testing.T) { fakeKubeClient := fake.NewSimpleClientset(&corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Namespace: "foo-ns", Name: "foo-name"}}) cm, err := fakeKubeClient.CoreV1().ConfigMaps("foo-ns").Get(context.TODO(), "foo-name", metav1.GetOptions{}) if err != nil { t.Fatal(err) } if cm.GetObjectKind().GroupVersionKind() != (schema.GroupVersionKind{}) { t.Fatal(cm.GetObjectKind().GroupVersionKind()) } cmList, err := fakeKubeClient.CoreV1().ConfigMaps("foo-ns").List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Fatal(err) } if cmList.GetObjectKind().GroupVersionKind() != (schema.GroupVersionKind{}) { t.Fatal(cmList.GetObjectKind().GroupVersionKind()) } } // This test checks decoding behavior for the actual client to ensure the fake client (tested above) is consistent. func TestGetDecoding(t *testing.T) { // this the duplication of logic from the real Get API for configmaps. This will prove that the generated client will not return a GVK mediaTypes := scheme.Codecs.WithoutConversion().SupportedMediaTypes() info, ok := runtime.SerializerInfoForMediaType(mediaTypes, "application/json") if !ok { t.Fatal("missing serializer") } decoder := scheme.Codecs.WithoutConversion().DecoderToVersion(info.Serializer, corev1.SchemeGroupVersion) body := []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata":{"Namespace":"foo","Name":"bar"}}`) obj := &corev1.ConfigMap{} out, _, err := decoder.Decode(body, nil, obj) if err != nil || out != obj { t.Fatal(err) } if obj.GetObjectKind().GroupVersionKind() != (schema.GroupVersionKind{}) { t.Fatal(obj.GetObjectKind().GroupVersionKind()) } } // This test checks decoding behavior for the actual client to ensure the fake client (tested above) is consistent. func TestListDecoding(t *testing.T) { // this the duplication of logic from the real Get API for configmaps. This will prove that the generated client will not return a GVK mediaTypes := scheme.Codecs.WithoutConversion().SupportedMediaTypes() info, ok := runtime.SerializerInfoForMediaType(mediaTypes, "application/json") if !ok { t.Fatal("missing serializer") } decoder := scheme.Codecs.WithoutConversion().DecoderToVersion(info.Serializer, corev1.SchemeGroupVersion) body := []byte(`{"apiVersion": "v1", "kind": "ConfigMapList", "items":[]}`) obj := &corev1.ConfigMapList{} out, _, err := decoder.Decode(body, nil, obj) if err != nil || out != obj { t.Fatal(err) } if obj.GetObjectKind().GroupVersionKind() != (schema.GroupVersionKind{}) { t.Fatal(obj.GetObjectKind().GroupVersionKind()) } } kubernetes-client-go-a2dfcab/kubernetes_test/timeout_test.go000066400000000000000000000035751472614177300246740ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package kubernetes_test import ( "bytes" "context" "io" "net/http" "testing" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/dump" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" manualfake "k8s.io/client-go/rest/fake" ) func TestListTimeout(t *testing.T) { fakeClient := &manualfake.RESTClient{ GroupVersion: appsv1.SchemeGroupVersion, NegotiatedSerializer: scheme.Codecs, Client: manualfake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { if req.URL.Query().Get("timeout") != "21s" { t.Fatal(dump.Pretty(req.URL.Query())) } return &http.Response{StatusCode: http.StatusNotFound, Body: io.NopCloser(&bytes.Buffer{})}, nil }), } clientConfig := &rest.Config{ APIPath: "/apis", ContentConfig: rest.ContentConfig{ NegotiatedSerializer: scheme.Codecs, GroupVersion: &appsv1.SchemeGroupVersion, }, } restClient, _ := rest.RESTClientFor(clientConfig) restClient.Client = fakeClient.Client realClient := kubernetes.New(restClient) timeout := int64(21) realClient.AppsV1().DaemonSets("").List(context.TODO(), metav1.ListOptions{TimeoutSeconds: &timeout}) realClient.AppsV1().DaemonSets("").Watch(context.TODO(), metav1.ListOptions{TimeoutSeconds: &timeout}) } kubernetes-client-go-a2dfcab/listers/000077500000000000000000000000001472614177300200655ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/admissionregistration/000077500000000000000000000000001472614177300245065ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/admissionregistration/v1/000077500000000000000000000000001472614177300250345ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/admissionregistration/v1/expansion_generated.go000066400000000000000000000025351472614177300314120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // MutatingWebhookConfigurationListerExpansion allows custom methods to be added to // MutatingWebhookConfigurationLister. type MutatingWebhookConfigurationListerExpansion interface{} // ValidatingAdmissionPolicyListerExpansion allows custom methods to be added to // ValidatingAdmissionPolicyLister. type ValidatingAdmissionPolicyListerExpansion interface{} // ValidatingAdmissionPolicyBindingListerExpansion allows custom methods to be added to // ValidatingAdmissionPolicyBindingLister. type ValidatingAdmissionPolicyBindingListerExpansion interface{} // ValidatingWebhookConfigurationListerExpansion allows custom methods to be added to // ValidatingWebhookConfigurationLister. type ValidatingWebhookConfigurationListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/admissionregistration/v1/mutatingwebhookconfiguration.go000066400000000000000000000036601472614177300333670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/admissionregistration/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // MutatingWebhookConfigurationLister helps list MutatingWebhookConfigurations. // All objects returned here must be treated as read-only. type MutatingWebhookConfigurationLister interface { // List lists all MutatingWebhookConfigurations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.MutatingWebhookConfiguration, err error) // Get retrieves the MutatingWebhookConfiguration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.MutatingWebhookConfiguration, error) MutatingWebhookConfigurationListerExpansion } // mutatingWebhookConfigurationLister implements the MutatingWebhookConfigurationLister interface. type mutatingWebhookConfigurationLister struct { listers.ResourceIndexer[*v1.MutatingWebhookConfiguration] } // NewMutatingWebhookConfigurationLister returns a new MutatingWebhookConfigurationLister. func NewMutatingWebhookConfigurationLister(indexer cache.Indexer) MutatingWebhookConfigurationLister { return &mutatingWebhookConfigurationLister{listers.New[*v1.MutatingWebhookConfiguration](indexer, v1.Resource("mutatingwebhookconfiguration"))} } kubernetes-client-go-a2dfcab/listers/admissionregistration/v1/validatingadmissionpolicy.go000066400000000000000000000035711472614177300326420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/admissionregistration/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyLister helps list ValidatingAdmissionPolicies. // All objects returned here must be treated as read-only. type ValidatingAdmissionPolicyLister interface { // List lists all ValidatingAdmissionPolicies in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ValidatingAdmissionPolicy, err error) // Get retrieves the ValidatingAdmissionPolicy from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ValidatingAdmissionPolicy, error) ValidatingAdmissionPolicyListerExpansion } // validatingAdmissionPolicyLister implements the ValidatingAdmissionPolicyLister interface. type validatingAdmissionPolicyLister struct { listers.ResourceIndexer[*v1.ValidatingAdmissionPolicy] } // NewValidatingAdmissionPolicyLister returns a new ValidatingAdmissionPolicyLister. func NewValidatingAdmissionPolicyLister(indexer cache.Indexer) ValidatingAdmissionPolicyLister { return &validatingAdmissionPolicyLister{listers.New[*v1.ValidatingAdmissionPolicy](indexer, v1.Resource("validatingadmissionpolicy"))} } kubernetes-client-go-a2dfcab/listers/admissionregistration/v1/validatingadmissionpolicybinding.go000066400000000000000000000037741472614177300342020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/admissionregistration/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyBindingLister helps list ValidatingAdmissionPolicyBindings. // All objects returned here must be treated as read-only. type ValidatingAdmissionPolicyBindingLister interface { // List lists all ValidatingAdmissionPolicyBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ValidatingAdmissionPolicyBinding, err error) // Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ValidatingAdmissionPolicyBinding, error) ValidatingAdmissionPolicyBindingListerExpansion } // validatingAdmissionPolicyBindingLister implements the ValidatingAdmissionPolicyBindingLister interface. type validatingAdmissionPolicyBindingLister struct { listers.ResourceIndexer[*v1.ValidatingAdmissionPolicyBinding] } // NewValidatingAdmissionPolicyBindingLister returns a new ValidatingAdmissionPolicyBindingLister. func NewValidatingAdmissionPolicyBindingLister(indexer cache.Indexer) ValidatingAdmissionPolicyBindingLister { return &validatingAdmissionPolicyBindingLister{listers.New[*v1.ValidatingAdmissionPolicyBinding](indexer, v1.Resource("validatingadmissionpolicybinding"))} } kubernetes-client-go-a2dfcab/listers/admissionregistration/v1/validatingwebhookconfiguration.go000066400000000000000000000037261472614177300336640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/admissionregistration/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ValidatingWebhookConfigurationLister helps list ValidatingWebhookConfigurations. // All objects returned here must be treated as read-only. type ValidatingWebhookConfigurationLister interface { // List lists all ValidatingWebhookConfigurations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ValidatingWebhookConfiguration, err error) // Get retrieves the ValidatingWebhookConfiguration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ValidatingWebhookConfiguration, error) ValidatingWebhookConfigurationListerExpansion } // validatingWebhookConfigurationLister implements the ValidatingWebhookConfigurationLister interface. type validatingWebhookConfigurationLister struct { listers.ResourceIndexer[*v1.ValidatingWebhookConfiguration] } // NewValidatingWebhookConfigurationLister returns a new ValidatingWebhookConfigurationLister. func NewValidatingWebhookConfigurationLister(indexer cache.Indexer) ValidatingWebhookConfigurationLister { return &validatingWebhookConfigurationLister{listers.New[*v1.ValidatingWebhookConfiguration](indexer, v1.Resource("validatingwebhookconfiguration"))} } kubernetes-client-go-a2dfcab/listers/admissionregistration/v1alpha1/000077500000000000000000000000001472614177300261235ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/admissionregistration/v1alpha1/expansion_generated.go000066400000000000000000000017531472614177300325020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // ValidatingAdmissionPolicyListerExpansion allows custom methods to be added to // ValidatingAdmissionPolicyLister. type ValidatingAdmissionPolicyListerExpansion interface{} // ValidatingAdmissionPolicyBindingListerExpansion allows custom methods to be added to // ValidatingAdmissionPolicyBindingLister. type ValidatingAdmissionPolicyBindingListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/admissionregistration/v1alpha1/validatingadmissionpolicy.go000066400000000000000000000036511472614177300337300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyLister helps list ValidatingAdmissionPolicies. // All objects returned here must be treated as read-only. type ValidatingAdmissionPolicyLister interface { // List lists all ValidatingAdmissionPolicies in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ValidatingAdmissionPolicy, err error) // Get retrieves the ValidatingAdmissionPolicy from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.ValidatingAdmissionPolicy, error) ValidatingAdmissionPolicyListerExpansion } // validatingAdmissionPolicyLister implements the ValidatingAdmissionPolicyLister interface. type validatingAdmissionPolicyLister struct { listers.ResourceIndexer[*v1alpha1.ValidatingAdmissionPolicy] } // NewValidatingAdmissionPolicyLister returns a new ValidatingAdmissionPolicyLister. func NewValidatingAdmissionPolicyLister(indexer cache.Indexer) ValidatingAdmissionPolicyLister { return &validatingAdmissionPolicyLister{listers.New[*v1alpha1.ValidatingAdmissionPolicy](indexer, v1alpha1.Resource("validatingadmissionpolicy"))} } validatingadmissionpolicybinding.go000066400000000000000000000040541472614177300352020ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/admissionregistration/v1alpha1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyBindingLister helps list ValidatingAdmissionPolicyBindings. // All objects returned here must be treated as read-only. type ValidatingAdmissionPolicyBindingLister interface { // List lists all ValidatingAdmissionPolicyBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ValidatingAdmissionPolicyBinding, err error) // Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.ValidatingAdmissionPolicyBinding, error) ValidatingAdmissionPolicyBindingListerExpansion } // validatingAdmissionPolicyBindingLister implements the ValidatingAdmissionPolicyBindingLister interface. type validatingAdmissionPolicyBindingLister struct { listers.ResourceIndexer[*v1alpha1.ValidatingAdmissionPolicyBinding] } // NewValidatingAdmissionPolicyBindingLister returns a new ValidatingAdmissionPolicyBindingLister. func NewValidatingAdmissionPolicyBindingLister(indexer cache.Indexer) ValidatingAdmissionPolicyBindingLister { return &validatingAdmissionPolicyBindingLister{listers.New[*v1alpha1.ValidatingAdmissionPolicyBinding](indexer, v1alpha1.Resource("validatingadmissionpolicybinding"))} } kubernetes-client-go-a2dfcab/listers/admissionregistration/v1beta1/000077500000000000000000000000001472614177300257515ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/admissionregistration/v1beta1/expansion_generated.go000066400000000000000000000025421472614177300323250ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // MutatingWebhookConfigurationListerExpansion allows custom methods to be added to // MutatingWebhookConfigurationLister. type MutatingWebhookConfigurationListerExpansion interface{} // ValidatingAdmissionPolicyListerExpansion allows custom methods to be added to // ValidatingAdmissionPolicyLister. type ValidatingAdmissionPolicyListerExpansion interface{} // ValidatingAdmissionPolicyBindingListerExpansion allows custom methods to be added to // ValidatingAdmissionPolicyBindingLister. type ValidatingAdmissionPolicyBindingListerExpansion interface{} // ValidatingWebhookConfigurationListerExpansion allows custom methods to be added to // ValidatingWebhookConfigurationLister. type ValidatingWebhookConfigurationListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go000066400000000000000000000037301472614177300343020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // MutatingWebhookConfigurationLister helps list MutatingWebhookConfigurations. // All objects returned here must be treated as read-only. type MutatingWebhookConfigurationLister interface { // List lists all MutatingWebhookConfigurations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.MutatingWebhookConfiguration, err error) // Get retrieves the MutatingWebhookConfiguration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.MutatingWebhookConfiguration, error) MutatingWebhookConfigurationListerExpansion } // mutatingWebhookConfigurationLister implements the MutatingWebhookConfigurationLister interface. type mutatingWebhookConfigurationLister struct { listers.ResourceIndexer[*v1beta1.MutatingWebhookConfiguration] } // NewMutatingWebhookConfigurationLister returns a new MutatingWebhookConfigurationLister. func NewMutatingWebhookConfigurationLister(indexer cache.Indexer) MutatingWebhookConfigurationLister { return &mutatingWebhookConfigurationLister{listers.New[*v1beta1.MutatingWebhookConfiguration](indexer, v1beta1.Resource("mutatingwebhookconfiguration"))} } kubernetes-client-go-a2dfcab/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go000066400000000000000000000036411472614177300335550ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyLister helps list ValidatingAdmissionPolicies. // All objects returned here must be treated as read-only. type ValidatingAdmissionPolicyLister interface { // List lists all ValidatingAdmissionPolicies in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ValidatingAdmissionPolicy, err error) // Get retrieves the ValidatingAdmissionPolicy from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.ValidatingAdmissionPolicy, error) ValidatingAdmissionPolicyListerExpansion } // validatingAdmissionPolicyLister implements the ValidatingAdmissionPolicyLister interface. type validatingAdmissionPolicyLister struct { listers.ResourceIndexer[*v1beta1.ValidatingAdmissionPolicy] } // NewValidatingAdmissionPolicyLister returns a new ValidatingAdmissionPolicyLister. func NewValidatingAdmissionPolicyLister(indexer cache.Indexer) ValidatingAdmissionPolicyLister { return &validatingAdmissionPolicyLister{listers.New[*v1beta1.ValidatingAdmissionPolicy](indexer, v1beta1.Resource("validatingadmissionpolicy"))} } validatingadmissionpolicybinding.go000066400000000000000000000040441472614177300350270ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/admissionregistration/v1beta1/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ValidatingAdmissionPolicyBindingLister helps list ValidatingAdmissionPolicyBindings. // All objects returned here must be treated as read-only. type ValidatingAdmissionPolicyBindingLister interface { // List lists all ValidatingAdmissionPolicyBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ValidatingAdmissionPolicyBinding, err error) // Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.ValidatingAdmissionPolicyBinding, error) ValidatingAdmissionPolicyBindingListerExpansion } // validatingAdmissionPolicyBindingLister implements the ValidatingAdmissionPolicyBindingLister interface. type validatingAdmissionPolicyBindingLister struct { listers.ResourceIndexer[*v1beta1.ValidatingAdmissionPolicyBinding] } // NewValidatingAdmissionPolicyBindingLister returns a new ValidatingAdmissionPolicyBindingLister. func NewValidatingAdmissionPolicyBindingLister(indexer cache.Indexer) ValidatingAdmissionPolicyBindingLister { return &validatingAdmissionPolicyBindingLister{listers.New[*v1beta1.ValidatingAdmissionPolicyBinding](indexer, v1beta1.Resource("validatingadmissionpolicybinding"))} } kubernetes-client-go-a2dfcab/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go000066400000000000000000000037761472614177300346060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ValidatingWebhookConfigurationLister helps list ValidatingWebhookConfigurations. // All objects returned here must be treated as read-only. type ValidatingWebhookConfigurationLister interface { // List lists all ValidatingWebhookConfigurations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ValidatingWebhookConfiguration, err error) // Get retrieves the ValidatingWebhookConfiguration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.ValidatingWebhookConfiguration, error) ValidatingWebhookConfigurationListerExpansion } // validatingWebhookConfigurationLister implements the ValidatingWebhookConfigurationLister interface. type validatingWebhookConfigurationLister struct { listers.ResourceIndexer[*v1beta1.ValidatingWebhookConfiguration] } // NewValidatingWebhookConfigurationLister returns a new ValidatingWebhookConfigurationLister. func NewValidatingWebhookConfigurationLister(indexer cache.Indexer) ValidatingWebhookConfigurationLister { return &validatingWebhookConfigurationLister{listers.New[*v1beta1.ValidatingWebhookConfiguration](indexer, v1beta1.Resource("validatingwebhookconfiguration"))} } kubernetes-client-go-a2dfcab/listers/apiserverinternal/000077500000000000000000000000001472614177300236225ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/apiserverinternal/v1alpha1/000077500000000000000000000000001472614177300252375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/apiserverinternal/v1alpha1/expansion_generated.go000066400000000000000000000014051472614177300316100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // StorageVersionListerExpansion allows custom methods to be added to // StorageVersionLister. type StorageVersionListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/apiserverinternal/v1alpha1/storageversion.go000066400000000000000000000033221472614177300306400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // StorageVersionLister helps list StorageVersions. // All objects returned here must be treated as read-only. type StorageVersionLister interface { // List lists all StorageVersions in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.StorageVersion, err error) // Get retrieves the StorageVersion from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.StorageVersion, error) StorageVersionListerExpansion } // storageVersionLister implements the StorageVersionLister interface. type storageVersionLister struct { listers.ResourceIndexer[*v1alpha1.StorageVersion] } // NewStorageVersionLister returns a new StorageVersionLister. func NewStorageVersionLister(indexer cache.Indexer) StorageVersionLister { return &storageVersionLister{listers.New[*v1alpha1.StorageVersion](indexer, v1alpha1.Resource("storageversion"))} } kubernetes-client-go-a2dfcab/listers/apps/000077500000000000000000000000001472614177300210305ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/apps/v1/000077500000000000000000000000001472614177300213565ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/apps/v1/controllerrevision.go000066400000000000000000000055131472614177300256530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ControllerRevisionLister helps list ControllerRevisions. // All objects returned here must be treated as read-only. type ControllerRevisionLister interface { // List lists all ControllerRevisions in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ControllerRevision, err error) // ControllerRevisions returns an object that can list and get ControllerRevisions. ControllerRevisions(namespace string) ControllerRevisionNamespaceLister ControllerRevisionListerExpansion } // controllerRevisionLister implements the ControllerRevisionLister interface. type controllerRevisionLister struct { listers.ResourceIndexer[*v1.ControllerRevision] } // NewControllerRevisionLister returns a new ControllerRevisionLister. func NewControllerRevisionLister(indexer cache.Indexer) ControllerRevisionLister { return &controllerRevisionLister{listers.New[*v1.ControllerRevision](indexer, v1.Resource("controllerrevision"))} } // ControllerRevisions returns an object that can list and get ControllerRevisions. func (s *controllerRevisionLister) ControllerRevisions(namespace string) ControllerRevisionNamespaceLister { return controllerRevisionNamespaceLister{listers.NewNamespaced[*v1.ControllerRevision](s.ResourceIndexer, namespace)} } // ControllerRevisionNamespaceLister helps list and get ControllerRevisions. // All objects returned here must be treated as read-only. type ControllerRevisionNamespaceLister interface { // List lists all ControllerRevisions in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ControllerRevision, err error) // Get retrieves the ControllerRevision from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ControllerRevision, error) ControllerRevisionNamespaceListerExpansion } // controllerRevisionNamespaceLister implements the ControllerRevisionNamespaceLister // interface. type controllerRevisionNamespaceLister struct { listers.ResourceIndexer[*v1.ControllerRevision] } kubernetes-client-go-a2dfcab/listers/apps/v1/daemonset.go000066400000000000000000000047431472614177300236740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // DaemonSetLister helps list DaemonSets. // All objects returned here must be treated as read-only. type DaemonSetLister interface { // List lists all DaemonSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.DaemonSet, err error) // DaemonSets returns an object that can list and get DaemonSets. DaemonSets(namespace string) DaemonSetNamespaceLister DaemonSetListerExpansion } // daemonSetLister implements the DaemonSetLister interface. type daemonSetLister struct { listers.ResourceIndexer[*v1.DaemonSet] } // NewDaemonSetLister returns a new DaemonSetLister. func NewDaemonSetLister(indexer cache.Indexer) DaemonSetLister { return &daemonSetLister{listers.New[*v1.DaemonSet](indexer, v1.Resource("daemonset"))} } // DaemonSets returns an object that can list and get DaemonSets. func (s *daemonSetLister) DaemonSets(namespace string) DaemonSetNamespaceLister { return daemonSetNamespaceLister{listers.NewNamespaced[*v1.DaemonSet](s.ResourceIndexer, namespace)} } // DaemonSetNamespaceLister helps list and get DaemonSets. // All objects returned here must be treated as read-only. type DaemonSetNamespaceLister interface { // List lists all DaemonSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.DaemonSet, err error) // Get retrieves the DaemonSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.DaemonSet, error) DaemonSetNamespaceListerExpansion } // daemonSetNamespaceLister implements the DaemonSetNamespaceLister // interface. type daemonSetNamespaceLister struct { listers.ResourceIndexer[*v1.DaemonSet] } kubernetes-client-go-a2dfcab/listers/apps/v1/daemonset_expansion.go000066400000000000000000000073441472614177300257600ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "fmt" apps "k8s.io/api/apps/v1" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // DaemonSetListerExpansion allows custom methods to be added to // DaemonSetLister. type DaemonSetListerExpansion interface { GetPodDaemonSets(pod *v1.Pod) ([]*apps.DaemonSet, error) GetHistoryDaemonSets(history *apps.ControllerRevision) ([]*apps.DaemonSet, error) } // DaemonSetNamespaceListerExpansion allows custom methods to be added to // DaemonSetNamespaceLister. type DaemonSetNamespaceListerExpansion interface{} // GetPodDaemonSets returns a list of DaemonSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching DaemonSets are found. func (s *daemonSetLister) GetPodDaemonSets(pod *v1.Pod) ([]*apps.DaemonSet, error) { var selector labels.Selector var daemonSet *apps.DaemonSet if len(pod.Labels) == 0 { return nil, fmt.Errorf("no daemon sets found for pod %v because it has no labels", pod.Name) } list, err := s.DaemonSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var daemonSets []*apps.DaemonSet for i := range list { daemonSet = list[i] if daemonSet.Namespace != pod.Namespace { continue } selector, err = metav1.LabelSelectorAsSelector(daemonSet.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a daemonSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } daemonSets = append(daemonSets, daemonSet) } if len(daemonSets) == 0 { return nil, fmt.Errorf("could not find daemon set for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return daemonSets, nil } // GetHistoryDaemonSets returns a list of DaemonSets that potentially // match a ControllerRevision. Only the one specified in the ControllerRevision's ControllerRef // will actually manage it. // Returns an error only if no matching DaemonSets are found. func (s *daemonSetLister) GetHistoryDaemonSets(history *apps.ControllerRevision) ([]*apps.DaemonSet, error) { if len(history.Labels) == 0 { return nil, fmt.Errorf("no DaemonSet found for ControllerRevision %s because it has no labels", history.Name) } list, err := s.DaemonSets(history.Namespace).List(labels.Everything()) if err != nil { return nil, err } var daemonSets []*apps.DaemonSet for _, ds := range list { selector, err := metav1.LabelSelectorAsSelector(ds.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the history continue } // If a DaemonSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(history.Labels)) { continue } daemonSets = append(daemonSets, ds) } if len(daemonSets) == 0 { return nil, fmt.Errorf("could not find DaemonSets for ControllerRevision %s in namespace %s with labels: %v", history.Name, history.Namespace, history.Labels) } return daemonSets, nil } kubernetes-client-go-a2dfcab/listers/apps/v1/deployment.go000066400000000000000000000050131472614177300240640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // DeploymentLister helps list Deployments. // All objects returned here must be treated as read-only. type DeploymentLister interface { // List lists all Deployments in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Deployment, err error) // Deployments returns an object that can list and get Deployments. Deployments(namespace string) DeploymentNamespaceLister DeploymentListerExpansion } // deploymentLister implements the DeploymentLister interface. type deploymentLister struct { listers.ResourceIndexer[*v1.Deployment] } // NewDeploymentLister returns a new DeploymentLister. func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { return &deploymentLister{listers.New[*v1.Deployment](indexer, v1.Resource("deployment"))} } // Deployments returns an object that can list and get Deployments. func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceLister { return deploymentNamespaceLister{listers.NewNamespaced[*v1.Deployment](s.ResourceIndexer, namespace)} } // DeploymentNamespaceLister helps list and get Deployments. // All objects returned here must be treated as read-only. type DeploymentNamespaceLister interface { // List lists all Deployments in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Deployment, err error) // Get retrieves the Deployment from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Deployment, error) DeploymentNamespaceListerExpansion } // deploymentNamespaceLister implements the DeploymentNamespaceLister // interface. type deploymentNamespaceLister struct { listers.ResourceIndexer[*v1.Deployment] } kubernetes-client-go-a2dfcab/listers/apps/v1/expansion_generated.go000066400000000000000000000023421472614177300257300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // ControllerRevisionListerExpansion allows custom methods to be added to // ControllerRevisionLister. type ControllerRevisionListerExpansion interface{} // ControllerRevisionNamespaceListerExpansion allows custom methods to be added to // ControllerRevisionNamespaceLister. type ControllerRevisionNamespaceListerExpansion interface{} // DeploymentListerExpansion allows custom methods to be added to // DeploymentLister. type DeploymentListerExpansion interface{} // DeploymentNamespaceListerExpansion allows custom methods to be added to // DeploymentNamespaceLister. type DeploymentNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/apps/v1/replicaset.go000066400000000000000000000050131472614177300240370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ReplicaSetLister helps list ReplicaSets. // All objects returned here must be treated as read-only. type ReplicaSetLister interface { // List lists all ReplicaSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ReplicaSet, err error) // ReplicaSets returns an object that can list and get ReplicaSets. ReplicaSets(namespace string) ReplicaSetNamespaceLister ReplicaSetListerExpansion } // replicaSetLister implements the ReplicaSetLister interface. type replicaSetLister struct { listers.ResourceIndexer[*v1.ReplicaSet] } // NewReplicaSetLister returns a new ReplicaSetLister. func NewReplicaSetLister(indexer cache.Indexer) ReplicaSetLister { return &replicaSetLister{listers.New[*v1.ReplicaSet](indexer, v1.Resource("replicaset"))} } // ReplicaSets returns an object that can list and get ReplicaSets. func (s *replicaSetLister) ReplicaSets(namespace string) ReplicaSetNamespaceLister { return replicaSetNamespaceLister{listers.NewNamespaced[*v1.ReplicaSet](s.ResourceIndexer, namespace)} } // ReplicaSetNamespaceLister helps list and get ReplicaSets. // All objects returned here must be treated as read-only. type ReplicaSetNamespaceLister interface { // List lists all ReplicaSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ReplicaSet, err error) // Get retrieves the ReplicaSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ReplicaSet, error) ReplicaSetNamespaceListerExpansion } // replicaSetNamespaceLister implements the ReplicaSetNamespaceLister // interface. type replicaSetNamespaceLister struct { listers.ResourceIndexer[*v1.ReplicaSet] } kubernetes-client-go-a2dfcab/listers/apps/v1/replicaset_expansion.go000066400000000000000000000043741472614177300261340ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "fmt" apps "k8s.io/api/apps/v1" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // ReplicaSetListerExpansion allows custom methods to be added to // ReplicaSetLister. type ReplicaSetListerExpansion interface { GetPodReplicaSets(pod *v1.Pod) ([]*apps.ReplicaSet, error) } // ReplicaSetNamespaceListerExpansion allows custom methods to be added to // ReplicaSetNamespaceLister. type ReplicaSetNamespaceListerExpansion interface{} // GetPodReplicaSets returns a list of ReplicaSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching ReplicaSets are found. func (s *replicaSetLister) GetPodReplicaSets(pod *v1.Pod) ([]*apps.ReplicaSet, error) { if len(pod.Labels) == 0 { return nil, fmt.Errorf("no ReplicaSets found for pod %v because it has no labels", pod.Name) } list, err := s.ReplicaSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var rss []*apps.ReplicaSet for _, rs := range list { if rs.Namespace != pod.Namespace { continue } selector, err := metav1.LabelSelectorAsSelector(rs.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a ReplicaSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } rss = append(rss, rs) } if len(rss) == 0 { return nil, fmt.Errorf("could not find ReplicaSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return rss, nil } kubernetes-client-go-a2dfcab/listers/apps/v1/statefulset.go000066400000000000000000000050631472614177300242540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // StatefulSetLister helps list StatefulSets. // All objects returned here must be treated as read-only. type StatefulSetLister interface { // List lists all StatefulSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.StatefulSet, err error) // StatefulSets returns an object that can list and get StatefulSets. StatefulSets(namespace string) StatefulSetNamespaceLister StatefulSetListerExpansion } // statefulSetLister implements the StatefulSetLister interface. type statefulSetLister struct { listers.ResourceIndexer[*v1.StatefulSet] } // NewStatefulSetLister returns a new StatefulSetLister. func NewStatefulSetLister(indexer cache.Indexer) StatefulSetLister { return &statefulSetLister{listers.New[*v1.StatefulSet](indexer, v1.Resource("statefulset"))} } // StatefulSets returns an object that can list and get StatefulSets. func (s *statefulSetLister) StatefulSets(namespace string) StatefulSetNamespaceLister { return statefulSetNamespaceLister{listers.NewNamespaced[*v1.StatefulSet](s.ResourceIndexer, namespace)} } // StatefulSetNamespaceLister helps list and get StatefulSets. // All objects returned here must be treated as read-only. type StatefulSetNamespaceLister interface { // List lists all StatefulSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.StatefulSet, err error) // Get retrieves the StatefulSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.StatefulSet, error) StatefulSetNamespaceListerExpansion } // statefulSetNamespaceLister implements the StatefulSetNamespaceLister // interface. type statefulSetNamespaceLister struct { listers.ResourceIndexer[*v1.StatefulSet] } kubernetes-client-go-a2dfcab/listers/apps/v1/statefulset_expansion.go000066400000000000000000000045411472614177300263400ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "fmt" apps "k8s.io/api/apps/v1" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // StatefulSetListerExpansion allows custom methods to be added to // StatefulSetLister. type StatefulSetListerExpansion interface { GetPodStatefulSets(pod *v1.Pod) ([]*apps.StatefulSet, error) } // StatefulSetNamespaceListerExpansion allows custom methods to be added to // StatefulSetNamespaceLister. type StatefulSetNamespaceListerExpansion interface{} // GetPodStatefulSets returns a list of StatefulSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching StatefulSets are found. func (s *statefulSetLister) GetPodStatefulSets(pod *v1.Pod) ([]*apps.StatefulSet, error) { var selector labels.Selector var ps *apps.StatefulSet if len(pod.Labels) == 0 { return nil, fmt.Errorf("no StatefulSets found for pod %v because it has no labels", pod.Name) } list, err := s.StatefulSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var psList []*apps.StatefulSet for i := range list { ps = list[i] if ps.Namespace != pod.Namespace { continue } selector, err = metav1.LabelSelectorAsSelector(ps.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a StatefulSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } psList = append(psList, ps) } if len(psList) == 0 { return nil, fmt.Errorf("could not find StatefulSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return psList, nil } kubernetes-client-go-a2dfcab/listers/apps/v1beta1/000077500000000000000000000000001472614177300222735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/apps/v1beta1/controllerrevision.go000066400000000000000000000056021472614177300265670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ControllerRevisionLister helps list ControllerRevisions. // All objects returned here must be treated as read-only. type ControllerRevisionLister interface { // List lists all ControllerRevisions in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ControllerRevision, err error) // ControllerRevisions returns an object that can list and get ControllerRevisions. ControllerRevisions(namespace string) ControllerRevisionNamespaceLister ControllerRevisionListerExpansion } // controllerRevisionLister implements the ControllerRevisionLister interface. type controllerRevisionLister struct { listers.ResourceIndexer[*v1beta1.ControllerRevision] } // NewControllerRevisionLister returns a new ControllerRevisionLister. func NewControllerRevisionLister(indexer cache.Indexer) ControllerRevisionLister { return &controllerRevisionLister{listers.New[*v1beta1.ControllerRevision](indexer, v1beta1.Resource("controllerrevision"))} } // ControllerRevisions returns an object that can list and get ControllerRevisions. func (s *controllerRevisionLister) ControllerRevisions(namespace string) ControllerRevisionNamespaceLister { return controllerRevisionNamespaceLister{listers.NewNamespaced[*v1beta1.ControllerRevision](s.ResourceIndexer, namespace)} } // ControllerRevisionNamespaceLister helps list and get ControllerRevisions. // All objects returned here must be treated as read-only. type ControllerRevisionNamespaceLister interface { // List lists all ControllerRevisions in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ControllerRevision, err error) // Get retrieves the ControllerRevision from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.ControllerRevision, error) ControllerRevisionNamespaceListerExpansion } // controllerRevisionNamespaceLister implements the ControllerRevisionNamespaceLister // interface. type controllerRevisionNamespaceLister struct { listers.ResourceIndexer[*v1beta1.ControllerRevision] } kubernetes-client-go-a2dfcab/listers/apps/v1beta1/deployment.go000066400000000000000000000051021472614177300250000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // DeploymentLister helps list Deployments. // All objects returned here must be treated as read-only. type DeploymentLister interface { // List lists all Deployments in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Deployment, err error) // Deployments returns an object that can list and get Deployments. Deployments(namespace string) DeploymentNamespaceLister DeploymentListerExpansion } // deploymentLister implements the DeploymentLister interface. type deploymentLister struct { listers.ResourceIndexer[*v1beta1.Deployment] } // NewDeploymentLister returns a new DeploymentLister. func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { return &deploymentLister{listers.New[*v1beta1.Deployment](indexer, v1beta1.Resource("deployment"))} } // Deployments returns an object that can list and get Deployments. func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceLister { return deploymentNamespaceLister{listers.NewNamespaced[*v1beta1.Deployment](s.ResourceIndexer, namespace)} } // DeploymentNamespaceLister helps list and get Deployments. // All objects returned here must be treated as read-only. type DeploymentNamespaceLister interface { // List lists all Deployments in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Deployment, err error) // Get retrieves the Deployment from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.Deployment, error) DeploymentNamespaceListerExpansion } // deploymentNamespaceLister implements the DeploymentNamespaceLister // interface. type deploymentNamespaceLister struct { listers.ResourceIndexer[*v1beta1.Deployment] } kubernetes-client-go-a2dfcab/listers/apps/v1beta1/expansion_generated.go000066400000000000000000000023471472614177300266520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // ControllerRevisionListerExpansion allows custom methods to be added to // ControllerRevisionLister. type ControllerRevisionListerExpansion interface{} // ControllerRevisionNamespaceListerExpansion allows custom methods to be added to // ControllerRevisionNamespaceLister. type ControllerRevisionNamespaceListerExpansion interface{} // DeploymentListerExpansion allows custom methods to be added to // DeploymentLister. type DeploymentListerExpansion interface{} // DeploymentNamespaceListerExpansion allows custom methods to be added to // DeploymentNamespaceLister. type DeploymentNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/apps/v1beta1/statefulset.go000066400000000000000000000051521472614177300251700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // StatefulSetLister helps list StatefulSets. // All objects returned here must be treated as read-only. type StatefulSetLister interface { // List lists all StatefulSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.StatefulSet, err error) // StatefulSets returns an object that can list and get StatefulSets. StatefulSets(namespace string) StatefulSetNamespaceLister StatefulSetListerExpansion } // statefulSetLister implements the StatefulSetLister interface. type statefulSetLister struct { listers.ResourceIndexer[*v1beta1.StatefulSet] } // NewStatefulSetLister returns a new StatefulSetLister. func NewStatefulSetLister(indexer cache.Indexer) StatefulSetLister { return &statefulSetLister{listers.New[*v1beta1.StatefulSet](indexer, v1beta1.Resource("statefulset"))} } // StatefulSets returns an object that can list and get StatefulSets. func (s *statefulSetLister) StatefulSets(namespace string) StatefulSetNamespaceLister { return statefulSetNamespaceLister{listers.NewNamespaced[*v1beta1.StatefulSet](s.ResourceIndexer, namespace)} } // StatefulSetNamespaceLister helps list and get StatefulSets. // All objects returned here must be treated as read-only. type StatefulSetNamespaceLister interface { // List lists all StatefulSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.StatefulSet, err error) // Get retrieves the StatefulSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.StatefulSet, error) StatefulSetNamespaceListerExpansion } // statefulSetNamespaceLister implements the StatefulSetNamespaceLister // interface. type statefulSetNamespaceLister struct { listers.ResourceIndexer[*v1beta1.StatefulSet] } kubernetes-client-go-a2dfcab/listers/apps/v1beta1/statefulset_expansion.go000066400000000000000000000045531472614177300272600ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "fmt" apps "k8s.io/api/apps/v1beta1" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // StatefulSetListerExpansion allows custom methods to be added to // StatefulSetLister. type StatefulSetListerExpansion interface { GetPodStatefulSets(pod *v1.Pod) ([]*apps.StatefulSet, error) } // StatefulSetNamespaceListerExpansion allows custom methods to be added to // StatefulSetNamespaceLister. type StatefulSetNamespaceListerExpansion interface{} // GetPodStatefulSets returns a list of StatefulSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching StatefulSets are found. func (s *statefulSetLister) GetPodStatefulSets(pod *v1.Pod) ([]*apps.StatefulSet, error) { var selector labels.Selector var ps *apps.StatefulSet if len(pod.Labels) == 0 { return nil, fmt.Errorf("no StatefulSets found for pod %v because it has no labels", pod.Name) } list, err := s.StatefulSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var psList []*apps.StatefulSet for i := range list { ps = list[i] if ps.Namespace != pod.Namespace { continue } selector, err = metav1.LabelSelectorAsSelector(ps.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a StatefulSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } psList = append(psList, ps) } if len(psList) == 0 { return nil, fmt.Errorf("could not find StatefulSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return psList, nil } kubernetes-client-go-a2dfcab/listers/apps/v1beta2/000077500000000000000000000000001472614177300222745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/apps/v1beta2/controllerrevision.go000066400000000000000000000056021472614177300265700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ControllerRevisionLister helps list ControllerRevisions. // All objects returned here must be treated as read-only. type ControllerRevisionLister interface { // List lists all ControllerRevisions in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.ControllerRevision, err error) // ControllerRevisions returns an object that can list and get ControllerRevisions. ControllerRevisions(namespace string) ControllerRevisionNamespaceLister ControllerRevisionListerExpansion } // controllerRevisionLister implements the ControllerRevisionLister interface. type controllerRevisionLister struct { listers.ResourceIndexer[*v1beta2.ControllerRevision] } // NewControllerRevisionLister returns a new ControllerRevisionLister. func NewControllerRevisionLister(indexer cache.Indexer) ControllerRevisionLister { return &controllerRevisionLister{listers.New[*v1beta2.ControllerRevision](indexer, v1beta2.Resource("controllerrevision"))} } // ControllerRevisions returns an object that can list and get ControllerRevisions. func (s *controllerRevisionLister) ControllerRevisions(namespace string) ControllerRevisionNamespaceLister { return controllerRevisionNamespaceLister{listers.NewNamespaced[*v1beta2.ControllerRevision](s.ResourceIndexer, namespace)} } // ControllerRevisionNamespaceLister helps list and get ControllerRevisions. // All objects returned here must be treated as read-only. type ControllerRevisionNamespaceLister interface { // List lists all ControllerRevisions in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.ControllerRevision, err error) // Get retrieves the ControllerRevision from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta2.ControllerRevision, error) ControllerRevisionNamespaceListerExpansion } // controllerRevisionNamespaceLister implements the ControllerRevisionNamespaceLister // interface. type controllerRevisionNamespaceLister struct { listers.ResourceIndexer[*v1beta2.ControllerRevision] } kubernetes-client-go-a2dfcab/listers/apps/v1beta2/daemonset.go000066400000000000000000000050321472614177300246020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // DaemonSetLister helps list DaemonSets. // All objects returned here must be treated as read-only. type DaemonSetLister interface { // List lists all DaemonSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.DaemonSet, err error) // DaemonSets returns an object that can list and get DaemonSets. DaemonSets(namespace string) DaemonSetNamespaceLister DaemonSetListerExpansion } // daemonSetLister implements the DaemonSetLister interface. type daemonSetLister struct { listers.ResourceIndexer[*v1beta2.DaemonSet] } // NewDaemonSetLister returns a new DaemonSetLister. func NewDaemonSetLister(indexer cache.Indexer) DaemonSetLister { return &daemonSetLister{listers.New[*v1beta2.DaemonSet](indexer, v1beta2.Resource("daemonset"))} } // DaemonSets returns an object that can list and get DaemonSets. func (s *daemonSetLister) DaemonSets(namespace string) DaemonSetNamespaceLister { return daemonSetNamespaceLister{listers.NewNamespaced[*v1beta2.DaemonSet](s.ResourceIndexer, namespace)} } // DaemonSetNamespaceLister helps list and get DaemonSets. // All objects returned here must be treated as read-only. type DaemonSetNamespaceLister interface { // List lists all DaemonSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.DaemonSet, err error) // Get retrieves the DaemonSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta2.DaemonSet, error) DaemonSetNamespaceListerExpansion } // daemonSetNamespaceLister implements the DaemonSetNamespaceLister // interface. type daemonSetNamespaceLister struct { listers.ResourceIndexer[*v1beta2.DaemonSet] } kubernetes-client-go-a2dfcab/listers/apps/v1beta2/daemonset_expansion.go000066400000000000000000000073651472614177300267010ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta2 import ( "fmt" apps "k8s.io/api/apps/v1beta2" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // DaemonSetListerExpansion allows custom methods to be added to // DaemonSetLister. type DaemonSetListerExpansion interface { GetPodDaemonSets(pod *v1.Pod) ([]*apps.DaemonSet, error) GetHistoryDaemonSets(history *apps.ControllerRevision) ([]*apps.DaemonSet, error) } // DaemonSetNamespaceListerExpansion allows custom methods to be added to // DaemonSetNamespaceLister. type DaemonSetNamespaceListerExpansion interface{} // GetPodDaemonSets returns a list of DaemonSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching DaemonSets are found. func (s *daemonSetLister) GetPodDaemonSets(pod *v1.Pod) ([]*apps.DaemonSet, error) { var selector labels.Selector var daemonSet *apps.DaemonSet if len(pod.Labels) == 0 { return nil, fmt.Errorf("no daemon sets found for pod %v because it has no labels", pod.Name) } list, err := s.DaemonSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var daemonSets []*apps.DaemonSet for i := range list { daemonSet = list[i] if daemonSet.Namespace != pod.Namespace { continue } selector, err = metav1.LabelSelectorAsSelector(daemonSet.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a daemonSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } daemonSets = append(daemonSets, daemonSet) } if len(daemonSets) == 0 { return nil, fmt.Errorf("could not find daemon set for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return daemonSets, nil } // GetHistoryDaemonSets returns a list of DaemonSets that potentially // match a ControllerRevision. Only the one specified in the ControllerRevision's ControllerRef // will actually manage it. // Returns an error only if no matching DaemonSets are found. func (s *daemonSetLister) GetHistoryDaemonSets(history *apps.ControllerRevision) ([]*apps.DaemonSet, error) { if len(history.Labels) == 0 { return nil, fmt.Errorf("no DaemonSet found for ControllerRevision %s because it has no labels", history.Name) } list, err := s.DaemonSets(history.Namespace).List(labels.Everything()) if err != nil { return nil, err } var daemonSets []*apps.DaemonSet for _, ds := range list { selector, err := metav1.LabelSelectorAsSelector(ds.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the history object continue } // If a DaemonSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(history.Labels)) { continue } daemonSets = append(daemonSets, ds) } if len(daemonSets) == 0 { return nil, fmt.Errorf("could not find DaemonSets for ControllerRevision %s in namespace %s with labels: %v", history.Name, history.Namespace, history.Labels) } return daemonSets, nil } kubernetes-client-go-a2dfcab/listers/apps/v1beta2/deployment.go000066400000000000000000000051021472614177300250010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // DeploymentLister helps list Deployments. // All objects returned here must be treated as read-only. type DeploymentLister interface { // List lists all Deployments in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.Deployment, err error) // Deployments returns an object that can list and get Deployments. Deployments(namespace string) DeploymentNamespaceLister DeploymentListerExpansion } // deploymentLister implements the DeploymentLister interface. type deploymentLister struct { listers.ResourceIndexer[*v1beta2.Deployment] } // NewDeploymentLister returns a new DeploymentLister. func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { return &deploymentLister{listers.New[*v1beta2.Deployment](indexer, v1beta2.Resource("deployment"))} } // Deployments returns an object that can list and get Deployments. func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceLister { return deploymentNamespaceLister{listers.NewNamespaced[*v1beta2.Deployment](s.ResourceIndexer, namespace)} } // DeploymentNamespaceLister helps list and get Deployments. // All objects returned here must be treated as read-only. type DeploymentNamespaceLister interface { // List lists all Deployments in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.Deployment, err error) // Get retrieves the Deployment from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta2.Deployment, error) DeploymentNamespaceListerExpansion } // deploymentNamespaceLister implements the DeploymentNamespaceLister // interface. type deploymentNamespaceLister struct { listers.ResourceIndexer[*v1beta2.Deployment] } kubernetes-client-go-a2dfcab/listers/apps/v1beta2/expansion_generated.go000066400000000000000000000023471472614177300266530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 // ControllerRevisionListerExpansion allows custom methods to be added to // ControllerRevisionLister. type ControllerRevisionListerExpansion interface{} // ControllerRevisionNamespaceListerExpansion allows custom methods to be added to // ControllerRevisionNamespaceLister. type ControllerRevisionNamespaceListerExpansion interface{} // DeploymentListerExpansion allows custom methods to be added to // DeploymentLister. type DeploymentListerExpansion interface{} // DeploymentNamespaceListerExpansion allows custom methods to be added to // DeploymentNamespaceLister. type DeploymentNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/apps/v1beta2/replicaset.go000066400000000000000000000051021472614177300247540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ReplicaSetLister helps list ReplicaSets. // All objects returned here must be treated as read-only. type ReplicaSetLister interface { // List lists all ReplicaSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.ReplicaSet, err error) // ReplicaSets returns an object that can list and get ReplicaSets. ReplicaSets(namespace string) ReplicaSetNamespaceLister ReplicaSetListerExpansion } // replicaSetLister implements the ReplicaSetLister interface. type replicaSetLister struct { listers.ResourceIndexer[*v1beta2.ReplicaSet] } // NewReplicaSetLister returns a new ReplicaSetLister. func NewReplicaSetLister(indexer cache.Indexer) ReplicaSetLister { return &replicaSetLister{listers.New[*v1beta2.ReplicaSet](indexer, v1beta2.Resource("replicaset"))} } // ReplicaSets returns an object that can list and get ReplicaSets. func (s *replicaSetLister) ReplicaSets(namespace string) ReplicaSetNamespaceLister { return replicaSetNamespaceLister{listers.NewNamespaced[*v1beta2.ReplicaSet](s.ResourceIndexer, namespace)} } // ReplicaSetNamespaceLister helps list and get ReplicaSets. // All objects returned here must be treated as read-only. type ReplicaSetNamespaceLister interface { // List lists all ReplicaSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.ReplicaSet, err error) // Get retrieves the ReplicaSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta2.ReplicaSet, error) ReplicaSetNamespaceListerExpansion } // replicaSetNamespaceLister implements the ReplicaSetNamespaceLister // interface. type replicaSetNamespaceLister struct { listers.ResourceIndexer[*v1beta2.ReplicaSet] } kubernetes-client-go-a2dfcab/listers/apps/v1beta2/replicaset_expansion.go000066400000000000000000000044061472614177300270460ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta2 import ( "fmt" apps "k8s.io/api/apps/v1beta2" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // ReplicaSetListerExpansion allows custom methods to be added to // ReplicaSetLister. type ReplicaSetListerExpansion interface { GetPodReplicaSets(pod *v1.Pod) ([]*apps.ReplicaSet, error) } // ReplicaSetNamespaceListerExpansion allows custom methods to be added to // ReplicaSetNamespaceLister. type ReplicaSetNamespaceListerExpansion interface{} // GetPodReplicaSets returns a list of ReplicaSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching ReplicaSets are found. func (s *replicaSetLister) GetPodReplicaSets(pod *v1.Pod) ([]*apps.ReplicaSet, error) { if len(pod.Labels) == 0 { return nil, fmt.Errorf("no ReplicaSets found for pod %v because it has no labels", pod.Name) } list, err := s.ReplicaSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var rss []*apps.ReplicaSet for _, rs := range list { if rs.Namespace != pod.Namespace { continue } selector, err := metav1.LabelSelectorAsSelector(rs.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a ReplicaSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } rss = append(rss, rs) } if len(rss) == 0 { return nil, fmt.Errorf("could not find ReplicaSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return rss, nil } kubernetes-client-go-a2dfcab/listers/apps/v1beta2/statefulset.go000066400000000000000000000051521472614177300251710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // StatefulSetLister helps list StatefulSets. // All objects returned here must be treated as read-only. type StatefulSetLister interface { // List lists all StatefulSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.StatefulSet, err error) // StatefulSets returns an object that can list and get StatefulSets. StatefulSets(namespace string) StatefulSetNamespaceLister StatefulSetListerExpansion } // statefulSetLister implements the StatefulSetLister interface. type statefulSetLister struct { listers.ResourceIndexer[*v1beta2.StatefulSet] } // NewStatefulSetLister returns a new StatefulSetLister. func NewStatefulSetLister(indexer cache.Indexer) StatefulSetLister { return &statefulSetLister{listers.New[*v1beta2.StatefulSet](indexer, v1beta2.Resource("statefulset"))} } // StatefulSets returns an object that can list and get StatefulSets. func (s *statefulSetLister) StatefulSets(namespace string) StatefulSetNamespaceLister { return statefulSetNamespaceLister{listers.NewNamespaced[*v1beta2.StatefulSet](s.ResourceIndexer, namespace)} } // StatefulSetNamespaceLister helps list and get StatefulSets. // All objects returned here must be treated as read-only. type StatefulSetNamespaceLister interface { // List lists all StatefulSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.StatefulSet, err error) // Get retrieves the StatefulSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta2.StatefulSet, error) StatefulSetNamespaceListerExpansion } // statefulSetNamespaceLister implements the StatefulSetNamespaceLister // interface. type statefulSetNamespaceLister struct { listers.ResourceIndexer[*v1beta2.StatefulSet] } kubernetes-client-go-a2dfcab/listers/apps/v1beta2/statefulset_expansion.go000066400000000000000000000045531472614177300272610ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta2 import ( "fmt" apps "k8s.io/api/apps/v1beta2" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // StatefulSetListerExpansion allows custom methods to be added to // StatefulSetLister. type StatefulSetListerExpansion interface { GetPodStatefulSets(pod *v1.Pod) ([]*apps.StatefulSet, error) } // StatefulSetNamespaceListerExpansion allows custom methods to be added to // StatefulSetNamespaceLister. type StatefulSetNamespaceListerExpansion interface{} // GetPodStatefulSets returns a list of StatefulSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching StatefulSets are found. func (s *statefulSetLister) GetPodStatefulSets(pod *v1.Pod) ([]*apps.StatefulSet, error) { var selector labels.Selector var ps *apps.StatefulSet if len(pod.Labels) == 0 { return nil, fmt.Errorf("no StatefulSets found for pod %v because it has no labels", pod.Name) } list, err := s.StatefulSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var psList []*apps.StatefulSet for i := range list { ps = list[i] if ps.Namespace != pod.Namespace { continue } selector, err = metav1.LabelSelectorAsSelector(ps.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a StatefulSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } psList = append(psList, ps) } if len(psList) == 0 { return nil, fmt.Errorf("could not find StatefulSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return psList, nil } kubernetes-client-go-a2dfcab/listers/autoscaling/000077500000000000000000000000001472614177300223765ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/autoscaling/v1/000077500000000000000000000000001472614177300227245ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/autoscaling/v1/expansion_generated.go000066400000000000000000000017371472614177300273050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // HorizontalPodAutoscalerListerExpansion allows custom methods to be added to // HorizontalPodAutoscalerLister. type HorizontalPodAutoscalerListerExpansion interface{} // HorizontalPodAutoscalerNamespaceListerExpansion allows custom methods to be added to // HorizontalPodAutoscalerNamespaceLister. type HorizontalPodAutoscalerNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/autoscaling/v1/horizontalpodautoscaler.go000066400000000000000000000060321472614177300302330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/autoscaling/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // HorizontalPodAutoscalerLister helps list HorizontalPodAutoscalers. // All objects returned here must be treated as read-only. type HorizontalPodAutoscalerLister interface { // List lists all HorizontalPodAutoscalers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.HorizontalPodAutoscaler, err error) // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister HorizontalPodAutoscalerListerExpansion } // horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { listers.ResourceIndexer[*v1.HorizontalPodAutoscaler] } // NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister. func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister { return &horizontalPodAutoscalerLister{listers.New[*v1.HorizontalPodAutoscaler](indexer, v1.Resource("horizontalpodautoscaler"))} } // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister { return horizontalPodAutoscalerNamespaceLister{listers.NewNamespaced[*v1.HorizontalPodAutoscaler](s.ResourceIndexer, namespace)} } // HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers. // All objects returned here must be treated as read-only. type HorizontalPodAutoscalerNamespaceLister interface { // List lists all HorizontalPodAutoscalers in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.HorizontalPodAutoscaler, err error) // Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.HorizontalPodAutoscaler, error) HorizontalPodAutoscalerNamespaceListerExpansion } // horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister // interface. type horizontalPodAutoscalerNamespaceLister struct { listers.ResourceIndexer[*v1.HorizontalPodAutoscaler] } kubernetes-client-go-a2dfcab/listers/autoscaling/v2/000077500000000000000000000000001472614177300227255ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/autoscaling/v2/expansion_generated.go000066400000000000000000000017371472614177300273060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v2 // HorizontalPodAutoscalerListerExpansion allows custom methods to be added to // HorizontalPodAutoscalerLister. type HorizontalPodAutoscalerListerExpansion interface{} // HorizontalPodAutoscalerNamespaceListerExpansion allows custom methods to be added to // HorizontalPodAutoscalerNamespaceLister. type HorizontalPodAutoscalerNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/autoscaling/v2/horizontalpodautoscaler.go000066400000000000000000000060321472614177300302340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v2 import ( v2 "k8s.io/api/autoscaling/v2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // HorizontalPodAutoscalerLister helps list HorizontalPodAutoscalers. // All objects returned here must be treated as read-only. type HorizontalPodAutoscalerLister interface { // List lists all HorizontalPodAutoscalers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2.HorizontalPodAutoscaler, err error) // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister HorizontalPodAutoscalerListerExpansion } // horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { listers.ResourceIndexer[*v2.HorizontalPodAutoscaler] } // NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister. func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister { return &horizontalPodAutoscalerLister{listers.New[*v2.HorizontalPodAutoscaler](indexer, v2.Resource("horizontalpodautoscaler"))} } // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister { return horizontalPodAutoscalerNamespaceLister{listers.NewNamespaced[*v2.HorizontalPodAutoscaler](s.ResourceIndexer, namespace)} } // HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers. // All objects returned here must be treated as read-only. type HorizontalPodAutoscalerNamespaceLister interface { // List lists all HorizontalPodAutoscalers in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2.HorizontalPodAutoscaler, err error) // Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v2.HorizontalPodAutoscaler, error) HorizontalPodAutoscalerNamespaceListerExpansion } // horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister // interface. type horizontalPodAutoscalerNamespaceLister struct { listers.ResourceIndexer[*v2.HorizontalPodAutoscaler] } kubernetes-client-go-a2dfcab/listers/autoscaling/v2beta1/000077500000000000000000000000001472614177300236425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/autoscaling/v2beta1/expansion_generated.go000066400000000000000000000017441472614177300302210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v2beta1 // HorizontalPodAutoscalerListerExpansion allows custom methods to be added to // HorizontalPodAutoscalerLister. type HorizontalPodAutoscalerListerExpansion interface{} // HorizontalPodAutoscalerNamespaceListerExpansion allows custom methods to be added to // HorizontalPodAutoscalerNamespaceLister. type HorizontalPodAutoscalerNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/autoscaling/v2beta1/horizontalpodautoscaler.go000066400000000000000000000061211472614177300311500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v2beta1 import ( v2beta1 "k8s.io/api/autoscaling/v2beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // HorizontalPodAutoscalerLister helps list HorizontalPodAutoscalers. // All objects returned here must be treated as read-only. type HorizontalPodAutoscalerLister interface { // List lists all HorizontalPodAutoscalers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2beta1.HorizontalPodAutoscaler, err error) // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister HorizontalPodAutoscalerListerExpansion } // horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { listers.ResourceIndexer[*v2beta1.HorizontalPodAutoscaler] } // NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister. func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister { return &horizontalPodAutoscalerLister{listers.New[*v2beta1.HorizontalPodAutoscaler](indexer, v2beta1.Resource("horizontalpodautoscaler"))} } // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister { return horizontalPodAutoscalerNamespaceLister{listers.NewNamespaced[*v2beta1.HorizontalPodAutoscaler](s.ResourceIndexer, namespace)} } // HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers. // All objects returned here must be treated as read-only. type HorizontalPodAutoscalerNamespaceLister interface { // List lists all HorizontalPodAutoscalers in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2beta1.HorizontalPodAutoscaler, err error) // Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v2beta1.HorizontalPodAutoscaler, error) HorizontalPodAutoscalerNamespaceListerExpansion } // horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister // interface. type horizontalPodAutoscalerNamespaceLister struct { listers.ResourceIndexer[*v2beta1.HorizontalPodAutoscaler] } kubernetes-client-go-a2dfcab/listers/autoscaling/v2beta2/000077500000000000000000000000001472614177300236435ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/autoscaling/v2beta2/expansion_generated.go000066400000000000000000000017441472614177300302220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v2beta2 // HorizontalPodAutoscalerListerExpansion allows custom methods to be added to // HorizontalPodAutoscalerLister. type HorizontalPodAutoscalerListerExpansion interface{} // HorizontalPodAutoscalerNamespaceListerExpansion allows custom methods to be added to // HorizontalPodAutoscalerNamespaceLister. type HorizontalPodAutoscalerNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/autoscaling/v2beta2/horizontalpodautoscaler.go000066400000000000000000000061211472614177300311510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v2beta2 import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // HorizontalPodAutoscalerLister helps list HorizontalPodAutoscalers. // All objects returned here must be treated as read-only. type HorizontalPodAutoscalerLister interface { // List lists all HorizontalPodAutoscalers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister HorizontalPodAutoscalerListerExpansion } // horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { listers.ResourceIndexer[*v2beta2.HorizontalPodAutoscaler] } // NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister. func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister { return &horizontalPodAutoscalerLister{listers.New[*v2beta2.HorizontalPodAutoscaler](indexer, v2beta2.Resource("horizontalpodautoscaler"))} } // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister { return horizontalPodAutoscalerNamespaceLister{listers.NewNamespaced[*v2beta2.HorizontalPodAutoscaler](s.ResourceIndexer, namespace)} } // HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers. // All objects returned here must be treated as read-only. type HorizontalPodAutoscalerNamespaceLister interface { // List lists all HorizontalPodAutoscalers in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) // Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v2beta2.HorizontalPodAutoscaler, error) HorizontalPodAutoscalerNamespaceListerExpansion } // horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister // interface. type horizontalPodAutoscalerNamespaceLister struct { listers.ResourceIndexer[*v2beta2.HorizontalPodAutoscaler] } kubernetes-client-go-a2dfcab/listers/batch/000077500000000000000000000000001472614177300211465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/batch/v1/000077500000000000000000000000001472614177300214745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/batch/v1/cronjob.go000066400000000000000000000046241472614177300234650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/batch/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CronJobLister helps list CronJobs. // All objects returned here must be treated as read-only. type CronJobLister interface { // List lists all CronJobs in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CronJob, err error) // CronJobs returns an object that can list and get CronJobs. CronJobs(namespace string) CronJobNamespaceLister CronJobListerExpansion } // cronJobLister implements the CronJobLister interface. type cronJobLister struct { listers.ResourceIndexer[*v1.CronJob] } // NewCronJobLister returns a new CronJobLister. func NewCronJobLister(indexer cache.Indexer) CronJobLister { return &cronJobLister{listers.New[*v1.CronJob](indexer, v1.Resource("cronjob"))} } // CronJobs returns an object that can list and get CronJobs. func (s *cronJobLister) CronJobs(namespace string) CronJobNamespaceLister { return cronJobNamespaceLister{listers.NewNamespaced[*v1.CronJob](s.ResourceIndexer, namespace)} } // CronJobNamespaceLister helps list and get CronJobs. // All objects returned here must be treated as read-only. type CronJobNamespaceLister interface { // List lists all CronJobs in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CronJob, err error) // Get retrieves the CronJob from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.CronJob, error) CronJobNamespaceListerExpansion } // cronJobNamespaceLister implements the CronJobNamespaceLister // interface. type cronJobNamespaceLister struct { listers.ResourceIndexer[*v1.CronJob] } kubernetes-client-go-a2dfcab/listers/batch/v1/expansion_generated.go000066400000000000000000000015771472614177300260570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // CronJobListerExpansion allows custom methods to be added to // CronJobLister. type CronJobListerExpansion interface{} // CronJobNamespaceListerExpansion allows custom methods to be added to // CronJobNamespaceLister. type CronJobNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/batch/v1/job.go000066400000000000000000000043641472614177300226040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/batch/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // JobLister helps list Jobs. // All objects returned here must be treated as read-only. type JobLister interface { // List lists all Jobs in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Job, err error) // Jobs returns an object that can list and get Jobs. Jobs(namespace string) JobNamespaceLister JobListerExpansion } // jobLister implements the JobLister interface. type jobLister struct { listers.ResourceIndexer[*v1.Job] } // NewJobLister returns a new JobLister. func NewJobLister(indexer cache.Indexer) JobLister { return &jobLister{listers.New[*v1.Job](indexer, v1.Resource("job"))} } // Jobs returns an object that can list and get Jobs. func (s *jobLister) Jobs(namespace string) JobNamespaceLister { return jobNamespaceLister{listers.NewNamespaced[*v1.Job](s.ResourceIndexer, namespace)} } // JobNamespaceLister helps list and get Jobs. // All objects returned here must be treated as read-only. type JobNamespaceLister interface { // List lists all Jobs in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Job, err error) // Get retrieves the Job from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Job, error) JobNamespaceListerExpansion } // jobNamespaceLister implements the JobNamespaceLister // interface. type jobNamespaceLister struct { listers.ResourceIndexer[*v1.Job] } kubernetes-client-go-a2dfcab/listers/batch/v1/job_expansion.go000066400000000000000000000042461472614177300246670ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "fmt" batch "k8s.io/api/batch/v1" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // JobListerExpansion allows custom methods to be added to // JobLister. type JobListerExpansion interface { // GetPodJobs returns a list of Jobs that potentially // match a Pod. Only the one specified in the Pod's ControllerRef // will actually manage it. // Returns an error only if no matching Jobs are found. GetPodJobs(pod *v1.Pod) (jobs []batch.Job, err error) } // GetPodJobs returns a list of Jobs that potentially // match a Pod. Only the one specified in the Pod's ControllerRef // will actually manage it. // Returns an error only if no matching Jobs are found. func (l *jobLister) GetPodJobs(pod *v1.Pod) (jobs []batch.Job, err error) { if len(pod.Labels) == 0 { err = fmt.Errorf("no jobs found for pod %v because it has no labels", pod.Name) return } var list []*batch.Job list, err = l.Jobs(pod.Namespace).List(labels.Everything()) if err != nil { return } for _, job := range list { selector, err := metav1.LabelSelectorAsSelector(job.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } if !selector.Matches(labels.Set(pod.Labels)) { continue } jobs = append(jobs, *job) } if len(jobs) == 0 { err = fmt.Errorf("could not find jobs for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return } // JobNamespaceListerExpansion allows custom methods to be added to // JobNamespaceLister. type JobNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/batch/v1beta1/000077500000000000000000000000001472614177300224115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/batch/v1beta1/cronjob.go000066400000000000000000000047131472614177300244010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/batch/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CronJobLister helps list CronJobs. // All objects returned here must be treated as read-only. type CronJobLister interface { // List lists all CronJobs in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.CronJob, err error) // CronJobs returns an object that can list and get CronJobs. CronJobs(namespace string) CronJobNamespaceLister CronJobListerExpansion } // cronJobLister implements the CronJobLister interface. type cronJobLister struct { listers.ResourceIndexer[*v1beta1.CronJob] } // NewCronJobLister returns a new CronJobLister. func NewCronJobLister(indexer cache.Indexer) CronJobLister { return &cronJobLister{listers.New[*v1beta1.CronJob](indexer, v1beta1.Resource("cronjob"))} } // CronJobs returns an object that can list and get CronJobs. func (s *cronJobLister) CronJobs(namespace string) CronJobNamespaceLister { return cronJobNamespaceLister{listers.NewNamespaced[*v1beta1.CronJob](s.ResourceIndexer, namespace)} } // CronJobNamespaceLister helps list and get CronJobs. // All objects returned here must be treated as read-only. type CronJobNamespaceLister interface { // List lists all CronJobs in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.CronJob, err error) // Get retrieves the CronJob from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.CronJob, error) CronJobNamespaceListerExpansion } // cronJobNamespaceLister implements the CronJobNamespaceLister // interface. type cronJobNamespaceLister struct { listers.ResourceIndexer[*v1beta1.CronJob] } kubernetes-client-go-a2dfcab/listers/batch/v1beta1/expansion_generated.go000066400000000000000000000016041472614177300267630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // CronJobListerExpansion allows custom methods to be added to // CronJobLister. type CronJobListerExpansion interface{} // CronJobNamespaceListerExpansion allows custom methods to be added to // CronJobNamespaceLister. type CronJobNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/certificates/000077500000000000000000000000001472614177300225325ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/certificates/v1/000077500000000000000000000000001472614177300230605ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/certificates/v1/certificatesigningrequest.go000066400000000000000000000035561472614177300306720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/certificates/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CertificateSigningRequestLister helps list CertificateSigningRequests. // All objects returned here must be treated as read-only. type CertificateSigningRequestLister interface { // List lists all CertificateSigningRequests in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CertificateSigningRequest, err error) // Get retrieves the CertificateSigningRequest from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.CertificateSigningRequest, error) CertificateSigningRequestListerExpansion } // certificateSigningRequestLister implements the CertificateSigningRequestLister interface. type certificateSigningRequestLister struct { listers.ResourceIndexer[*v1.CertificateSigningRequest] } // NewCertificateSigningRequestLister returns a new CertificateSigningRequestLister. func NewCertificateSigningRequestLister(indexer cache.Indexer) CertificateSigningRequestLister { return &certificateSigningRequestLister{listers.New[*v1.CertificateSigningRequest](indexer, v1.Resource("certificatesigningrequest"))} } kubernetes-client-go-a2dfcab/listers/certificates/v1/expansion_generated.go000066400000000000000000000014401472614177300274300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // CertificateSigningRequestListerExpansion allows custom methods to be added to // CertificateSigningRequestLister. type CertificateSigningRequestListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/certificates/v1alpha1/000077500000000000000000000000001472614177300241475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/certificates/v1alpha1/clustertrustbundle.go000066400000000000000000000034311472614177300304540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/certificates/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ClusterTrustBundleLister helps list ClusterTrustBundles. // All objects returned here must be treated as read-only. type ClusterTrustBundleLister interface { // List lists all ClusterTrustBundles in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ClusterTrustBundle, err error) // Get retrieves the ClusterTrustBundle from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.ClusterTrustBundle, error) ClusterTrustBundleListerExpansion } // clusterTrustBundleLister implements the ClusterTrustBundleLister interface. type clusterTrustBundleLister struct { listers.ResourceIndexer[*v1alpha1.ClusterTrustBundle] } // NewClusterTrustBundleLister returns a new ClusterTrustBundleLister. func NewClusterTrustBundleLister(indexer cache.Indexer) ClusterTrustBundleLister { return &clusterTrustBundleLister{listers.New[*v1alpha1.ClusterTrustBundle](indexer, v1alpha1.Resource("clustertrustbundle"))} } kubernetes-client-go-a2dfcab/listers/certificates/v1alpha1/expansion_generated.go000066400000000000000000000014211472614177300305160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // ClusterTrustBundleListerExpansion allows custom methods to be added to // ClusterTrustBundleLister. type ClusterTrustBundleListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/certificates/v1beta1/000077500000000000000000000000001472614177300237755ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/certificates/v1beta1/certificatesigningrequest.go000066400000000000000000000036261472614177300316050ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/certificates/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CertificateSigningRequestLister helps list CertificateSigningRequests. // All objects returned here must be treated as read-only. type CertificateSigningRequestLister interface { // List lists all CertificateSigningRequests in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequest, err error) // Get retrieves the CertificateSigningRequest from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.CertificateSigningRequest, error) CertificateSigningRequestListerExpansion } // certificateSigningRequestLister implements the CertificateSigningRequestLister interface. type certificateSigningRequestLister struct { listers.ResourceIndexer[*v1beta1.CertificateSigningRequest] } // NewCertificateSigningRequestLister returns a new CertificateSigningRequestLister. func NewCertificateSigningRequestLister(indexer cache.Indexer) CertificateSigningRequestLister { return &certificateSigningRequestLister{listers.New[*v1beta1.CertificateSigningRequest](indexer, v1beta1.Resource("certificatesigningrequest"))} } kubernetes-client-go-a2dfcab/listers/certificates/v1beta1/expansion_generated.go000066400000000000000000000014451472614177300303520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // CertificateSigningRequestListerExpansion allows custom methods to be added to // CertificateSigningRequestLister. type CertificateSigningRequestListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/coordination/000077500000000000000000000000001472614177300225555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/coordination/v1/000077500000000000000000000000001472614177300231035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/coordination/v1/expansion_generated.go000066400000000000000000000015631472614177300274610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // LeaseListerExpansion allows custom methods to be added to // LeaseLister. type LeaseListerExpansion interface{} // LeaseNamespaceListerExpansion allows custom methods to be added to // LeaseNamespaceLister. type LeaseNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/coordination/v1/lease.go000066400000000000000000000045131472614177300245260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/coordination/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // LeaseLister helps list Leases. // All objects returned here must be treated as read-only. type LeaseLister interface { // List lists all Leases in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Lease, err error) // Leases returns an object that can list and get Leases. Leases(namespace string) LeaseNamespaceLister LeaseListerExpansion } // leaseLister implements the LeaseLister interface. type leaseLister struct { listers.ResourceIndexer[*v1.Lease] } // NewLeaseLister returns a new LeaseLister. func NewLeaseLister(indexer cache.Indexer) LeaseLister { return &leaseLister{listers.New[*v1.Lease](indexer, v1.Resource("lease"))} } // Leases returns an object that can list and get Leases. func (s *leaseLister) Leases(namespace string) LeaseNamespaceLister { return leaseNamespaceLister{listers.NewNamespaced[*v1.Lease](s.ResourceIndexer, namespace)} } // LeaseNamespaceLister helps list and get Leases. // All objects returned here must be treated as read-only. type LeaseNamespaceLister interface { // List lists all Leases in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Lease, err error) // Get retrieves the Lease from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Lease, error) LeaseNamespaceListerExpansion } // leaseNamespaceLister implements the LeaseNamespaceLister // interface. type leaseNamespaceLister struct { listers.ResourceIndexer[*v1.Lease] } kubernetes-client-go-a2dfcab/listers/coordination/v1alpha1/000077500000000000000000000000001472614177300241725ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/coordination/v1alpha1/expansion_generated.go000066400000000000000000000016571472614177300305540ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // LeaseCandidateListerExpansion allows custom methods to be added to // LeaseCandidateLister. type LeaseCandidateListerExpansion interface{} // LeaseCandidateNamespaceListerExpansion allows custom methods to be added to // LeaseCandidateNamespaceLister. type LeaseCandidateNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/coordination/v1alpha1/leasecandidate.go000066400000000000000000000053651472614177300274600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/coordination/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // LeaseCandidateLister helps list LeaseCandidates. // All objects returned here must be treated as read-only. type LeaseCandidateLister interface { // List lists all LeaseCandidates in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.LeaseCandidate, err error) // LeaseCandidates returns an object that can list and get LeaseCandidates. LeaseCandidates(namespace string) LeaseCandidateNamespaceLister LeaseCandidateListerExpansion } // leaseCandidateLister implements the LeaseCandidateLister interface. type leaseCandidateLister struct { listers.ResourceIndexer[*v1alpha1.LeaseCandidate] } // NewLeaseCandidateLister returns a new LeaseCandidateLister. func NewLeaseCandidateLister(indexer cache.Indexer) LeaseCandidateLister { return &leaseCandidateLister{listers.New[*v1alpha1.LeaseCandidate](indexer, v1alpha1.Resource("leasecandidate"))} } // LeaseCandidates returns an object that can list and get LeaseCandidates. func (s *leaseCandidateLister) LeaseCandidates(namespace string) LeaseCandidateNamespaceLister { return leaseCandidateNamespaceLister{listers.NewNamespaced[*v1alpha1.LeaseCandidate](s.ResourceIndexer, namespace)} } // LeaseCandidateNamespaceLister helps list and get LeaseCandidates. // All objects returned here must be treated as read-only. type LeaseCandidateNamespaceLister interface { // List lists all LeaseCandidates in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.LeaseCandidate, err error) // Get retrieves the LeaseCandidate from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.LeaseCandidate, error) LeaseCandidateNamespaceListerExpansion } // leaseCandidateNamespaceLister implements the LeaseCandidateNamespaceLister // interface. type leaseCandidateNamespaceLister struct { listers.ResourceIndexer[*v1alpha1.LeaseCandidate] } kubernetes-client-go-a2dfcab/listers/coordination/v1beta1/000077500000000000000000000000001472614177300240205ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/coordination/v1beta1/expansion_generated.go000066400000000000000000000015701472614177300303740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // LeaseListerExpansion allows custom methods to be added to // LeaseLister. type LeaseListerExpansion interface{} // LeaseNamespaceListerExpansion allows custom methods to be added to // LeaseNamespaceLister. type LeaseNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/coordination/v1beta1/lease.go000066400000000000000000000046021472614177300254420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/coordination/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // LeaseLister helps list Leases. // All objects returned here must be treated as read-only. type LeaseLister interface { // List lists all Leases in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Lease, err error) // Leases returns an object that can list and get Leases. Leases(namespace string) LeaseNamespaceLister LeaseListerExpansion } // leaseLister implements the LeaseLister interface. type leaseLister struct { listers.ResourceIndexer[*v1beta1.Lease] } // NewLeaseLister returns a new LeaseLister. func NewLeaseLister(indexer cache.Indexer) LeaseLister { return &leaseLister{listers.New[*v1beta1.Lease](indexer, v1beta1.Resource("lease"))} } // Leases returns an object that can list and get Leases. func (s *leaseLister) Leases(namespace string) LeaseNamespaceLister { return leaseNamespaceLister{listers.NewNamespaced[*v1beta1.Lease](s.ResourceIndexer, namespace)} } // LeaseNamespaceLister helps list and get Leases. // All objects returned here must be treated as read-only. type LeaseNamespaceLister interface { // List lists all Leases in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Lease, err error) // Get retrieves the Lease from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.Lease, error) LeaseNamespaceListerExpansion } // leaseNamespaceLister implements the LeaseNamespaceLister // interface. type leaseNamespaceLister struct { listers.ResourceIndexer[*v1beta1.Lease] } kubernetes-client-go-a2dfcab/listers/core/000077500000000000000000000000001472614177300210155ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/core/v1/000077500000000000000000000000001472614177300213435ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/core/v1/componentstatus.go000066400000000000000000000032521472614177300251420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ComponentStatusLister helps list ComponentStatuses. // All objects returned here must be treated as read-only. type ComponentStatusLister interface { // List lists all ComponentStatuses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ComponentStatus, err error) // Get retrieves the ComponentStatus from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ComponentStatus, error) ComponentStatusListerExpansion } // componentStatusLister implements the ComponentStatusLister interface. type componentStatusLister struct { listers.ResourceIndexer[*v1.ComponentStatus] } // NewComponentStatusLister returns a new ComponentStatusLister. func NewComponentStatusLister(indexer cache.Indexer) ComponentStatusLister { return &componentStatusLister{listers.New[*v1.ComponentStatus](indexer, v1.Resource("componentstatus"))} } kubernetes-client-go-a2dfcab/listers/core/v1/configmap.go000066400000000000000000000047431472614177300236450ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ConfigMapLister helps list ConfigMaps. // All objects returned here must be treated as read-only. type ConfigMapLister interface { // List lists all ConfigMaps in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ConfigMap, err error) // ConfigMaps returns an object that can list and get ConfigMaps. ConfigMaps(namespace string) ConfigMapNamespaceLister ConfigMapListerExpansion } // configMapLister implements the ConfigMapLister interface. type configMapLister struct { listers.ResourceIndexer[*v1.ConfigMap] } // NewConfigMapLister returns a new ConfigMapLister. func NewConfigMapLister(indexer cache.Indexer) ConfigMapLister { return &configMapLister{listers.New[*v1.ConfigMap](indexer, v1.Resource("configmap"))} } // ConfigMaps returns an object that can list and get ConfigMaps. func (s *configMapLister) ConfigMaps(namespace string) ConfigMapNamespaceLister { return configMapNamespaceLister{listers.NewNamespaced[*v1.ConfigMap](s.ResourceIndexer, namespace)} } // ConfigMapNamespaceLister helps list and get ConfigMaps. // All objects returned here must be treated as read-only. type ConfigMapNamespaceLister interface { // List lists all ConfigMaps in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ConfigMap, err error) // Get retrieves the ConfigMap from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ConfigMap, error) ConfigMapNamespaceListerExpansion } // configMapNamespaceLister implements the ConfigMapNamespaceLister // interface. type configMapNamespaceLister struct { listers.ResourceIndexer[*v1.ConfigMap] } kubernetes-client-go-a2dfcab/listers/core/v1/endpoints.go000066400000000000000000000047311472614177300237020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // EndpointsLister helps list Endpoints. // All objects returned here must be treated as read-only. type EndpointsLister interface { // List lists all Endpoints in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Endpoints, err error) // Endpoints returns an object that can list and get Endpoints. Endpoints(namespace string) EndpointsNamespaceLister EndpointsListerExpansion } // endpointsLister implements the EndpointsLister interface. type endpointsLister struct { listers.ResourceIndexer[*v1.Endpoints] } // NewEndpointsLister returns a new EndpointsLister. func NewEndpointsLister(indexer cache.Indexer) EndpointsLister { return &endpointsLister{listers.New[*v1.Endpoints](indexer, v1.Resource("endpoints"))} } // Endpoints returns an object that can list and get Endpoints. func (s *endpointsLister) Endpoints(namespace string) EndpointsNamespaceLister { return endpointsNamespaceLister{listers.NewNamespaced[*v1.Endpoints](s.ResourceIndexer, namespace)} } // EndpointsNamespaceLister helps list and get Endpoints. // All objects returned here must be treated as read-only. type EndpointsNamespaceLister interface { // List lists all Endpoints in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Endpoints, err error) // Get retrieves the Endpoints from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Endpoints, error) EndpointsNamespaceListerExpansion } // endpointsNamespaceLister implements the EndpointsNamespaceLister // interface. type endpointsNamespaceLister struct { listers.ResourceIndexer[*v1.Endpoints] } kubernetes-client-go-a2dfcab/listers/core/v1/event.go000066400000000000000000000045031472614177300230150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // EventLister helps list Events. // All objects returned here must be treated as read-only. type EventLister interface { // List lists all Events in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Event, err error) // Events returns an object that can list and get Events. Events(namespace string) EventNamespaceLister EventListerExpansion } // eventLister implements the EventLister interface. type eventLister struct { listers.ResourceIndexer[*v1.Event] } // NewEventLister returns a new EventLister. func NewEventLister(indexer cache.Indexer) EventLister { return &eventLister{listers.New[*v1.Event](indexer, v1.Resource("event"))} } // Events returns an object that can list and get Events. func (s *eventLister) Events(namespace string) EventNamespaceLister { return eventNamespaceLister{listers.NewNamespaced[*v1.Event](s.ResourceIndexer, namespace)} } // EventNamespaceLister helps list and get Events. // All objects returned here must be treated as read-only. type EventNamespaceLister interface { // List lists all Events in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Event, err error) // Get retrieves the Event from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Event, error) EventNamespaceListerExpansion } // eventNamespaceLister implements the EventNamespaceLister // interface. type eventNamespaceLister struct { listers.ResourceIndexer[*v1.Event] } kubernetes-client-go-a2dfcab/listers/core/v1/expansion_generated.go000066400000000000000000000103471472614177300257210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // ComponentStatusListerExpansion allows custom methods to be added to // ComponentStatusLister. type ComponentStatusListerExpansion interface{} // ConfigMapListerExpansion allows custom methods to be added to // ConfigMapLister. type ConfigMapListerExpansion interface{} // ConfigMapNamespaceListerExpansion allows custom methods to be added to // ConfigMapNamespaceLister. type ConfigMapNamespaceListerExpansion interface{} // EndpointsListerExpansion allows custom methods to be added to // EndpointsLister. type EndpointsListerExpansion interface{} // EndpointsNamespaceListerExpansion allows custom methods to be added to // EndpointsNamespaceLister. type EndpointsNamespaceListerExpansion interface{} // EventListerExpansion allows custom methods to be added to // EventLister. type EventListerExpansion interface{} // EventNamespaceListerExpansion allows custom methods to be added to // EventNamespaceLister. type EventNamespaceListerExpansion interface{} // LimitRangeListerExpansion allows custom methods to be added to // LimitRangeLister. type LimitRangeListerExpansion interface{} // LimitRangeNamespaceListerExpansion allows custom methods to be added to // LimitRangeNamespaceLister. type LimitRangeNamespaceListerExpansion interface{} // NamespaceListerExpansion allows custom methods to be added to // NamespaceLister. type NamespaceListerExpansion interface{} // NodeListerExpansion allows custom methods to be added to // NodeLister. type NodeListerExpansion interface{} // PersistentVolumeListerExpansion allows custom methods to be added to // PersistentVolumeLister. type PersistentVolumeListerExpansion interface{} // PersistentVolumeClaimListerExpansion allows custom methods to be added to // PersistentVolumeClaimLister. type PersistentVolumeClaimListerExpansion interface{} // PersistentVolumeClaimNamespaceListerExpansion allows custom methods to be added to // PersistentVolumeClaimNamespaceLister. type PersistentVolumeClaimNamespaceListerExpansion interface{} // PodListerExpansion allows custom methods to be added to // PodLister. type PodListerExpansion interface{} // PodNamespaceListerExpansion allows custom methods to be added to // PodNamespaceLister. type PodNamespaceListerExpansion interface{} // PodTemplateListerExpansion allows custom methods to be added to // PodTemplateLister. type PodTemplateListerExpansion interface{} // PodTemplateNamespaceListerExpansion allows custom methods to be added to // PodTemplateNamespaceLister. type PodTemplateNamespaceListerExpansion interface{} // ResourceQuotaListerExpansion allows custom methods to be added to // ResourceQuotaLister. type ResourceQuotaListerExpansion interface{} // ResourceQuotaNamespaceListerExpansion allows custom methods to be added to // ResourceQuotaNamespaceLister. type ResourceQuotaNamespaceListerExpansion interface{} // SecretListerExpansion allows custom methods to be added to // SecretLister. type SecretListerExpansion interface{} // SecretNamespaceListerExpansion allows custom methods to be added to // SecretNamespaceLister. type SecretNamespaceListerExpansion interface{} // ServiceListerExpansion allows custom methods to be added to // ServiceLister. type ServiceListerExpansion interface{} // ServiceNamespaceListerExpansion allows custom methods to be added to // ServiceNamespaceLister. type ServiceNamespaceListerExpansion interface{} // ServiceAccountListerExpansion allows custom methods to be added to // ServiceAccountLister. type ServiceAccountListerExpansion interface{} // ServiceAccountNamespaceListerExpansion allows custom methods to be added to // ServiceAccountNamespaceLister. type ServiceAccountNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/core/v1/limitrange.go000066400000000000000000000050131472614177300240240ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // LimitRangeLister helps list LimitRanges. // All objects returned here must be treated as read-only. type LimitRangeLister interface { // List lists all LimitRanges in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.LimitRange, err error) // LimitRanges returns an object that can list and get LimitRanges. LimitRanges(namespace string) LimitRangeNamespaceLister LimitRangeListerExpansion } // limitRangeLister implements the LimitRangeLister interface. type limitRangeLister struct { listers.ResourceIndexer[*v1.LimitRange] } // NewLimitRangeLister returns a new LimitRangeLister. func NewLimitRangeLister(indexer cache.Indexer) LimitRangeLister { return &limitRangeLister{listers.New[*v1.LimitRange](indexer, v1.Resource("limitrange"))} } // LimitRanges returns an object that can list and get LimitRanges. func (s *limitRangeLister) LimitRanges(namespace string) LimitRangeNamespaceLister { return limitRangeNamespaceLister{listers.NewNamespaced[*v1.LimitRange](s.ResourceIndexer, namespace)} } // LimitRangeNamespaceLister helps list and get LimitRanges. // All objects returned here must be treated as read-only. type LimitRangeNamespaceLister interface { // List lists all LimitRanges in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.LimitRange, err error) // Get retrieves the LimitRange from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.LimitRange, error) LimitRangeNamespaceListerExpansion } // limitRangeNamespaceLister implements the LimitRangeNamespaceLister // interface. type limitRangeNamespaceLister struct { listers.ResourceIndexer[*v1.LimitRange] } kubernetes-client-go-a2dfcab/listers/core/v1/namespace.go000066400000000000000000000030661472614177300236330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // NamespaceLister helps list Namespaces. // All objects returned here must be treated as read-only. type NamespaceLister interface { // List lists all Namespaces in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Namespace, err error) // Get retrieves the Namespace from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Namespace, error) NamespaceListerExpansion } // namespaceLister implements the NamespaceLister interface. type namespaceLister struct { listers.ResourceIndexer[*v1.Namespace] } // NewNamespaceLister returns a new NamespaceLister. func NewNamespaceLister(indexer cache.Indexer) NamespaceLister { return &namespaceLister{listers.New[*v1.Namespace](indexer, v1.Resource("namespace"))} } kubernetes-client-go-a2dfcab/listers/core/v1/node.go000066400000000000000000000027271472614177300226270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // NodeLister helps list Nodes. // All objects returned here must be treated as read-only. type NodeLister interface { // List lists all Nodes in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Node, err error) // Get retrieves the Node from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Node, error) NodeListerExpansion } // nodeLister implements the NodeLister interface. type nodeLister struct { listers.ResourceIndexer[*v1.Node] } // NewNodeLister returns a new NodeLister. func NewNodeLister(indexer cache.Indexer) NodeLister { return &nodeLister{listers.New[*v1.Node](indexer, v1.Resource("node"))} } kubernetes-client-go-a2dfcab/listers/core/v1/persistentvolume.go000066400000000000000000000032731472614177300253270ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PersistentVolumeLister helps list PersistentVolumes. // All objects returned here must be treated as read-only. type PersistentVolumeLister interface { // List lists all PersistentVolumes in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PersistentVolume, err error) // Get retrieves the PersistentVolume from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.PersistentVolume, error) PersistentVolumeListerExpansion } // persistentVolumeLister implements the PersistentVolumeLister interface. type persistentVolumeLister struct { listers.ResourceIndexer[*v1.PersistentVolume] } // NewPersistentVolumeLister returns a new PersistentVolumeLister. func NewPersistentVolumeLister(indexer cache.Indexer) PersistentVolumeLister { return &persistentVolumeLister{listers.New[*v1.PersistentVolume](indexer, v1.Resource("persistentvolume"))} } kubernetes-client-go-a2dfcab/listers/core/v1/persistentvolumeclaim.go000066400000000000000000000057031472614177300263350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PersistentVolumeClaimLister helps list PersistentVolumeClaims. // All objects returned here must be treated as read-only. type PersistentVolumeClaimLister interface { // List lists all PersistentVolumeClaims in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PersistentVolumeClaim, err error) // PersistentVolumeClaims returns an object that can list and get PersistentVolumeClaims. PersistentVolumeClaims(namespace string) PersistentVolumeClaimNamespaceLister PersistentVolumeClaimListerExpansion } // persistentVolumeClaimLister implements the PersistentVolumeClaimLister interface. type persistentVolumeClaimLister struct { listers.ResourceIndexer[*v1.PersistentVolumeClaim] } // NewPersistentVolumeClaimLister returns a new PersistentVolumeClaimLister. func NewPersistentVolumeClaimLister(indexer cache.Indexer) PersistentVolumeClaimLister { return &persistentVolumeClaimLister{listers.New[*v1.PersistentVolumeClaim](indexer, v1.Resource("persistentvolumeclaim"))} } // PersistentVolumeClaims returns an object that can list and get PersistentVolumeClaims. func (s *persistentVolumeClaimLister) PersistentVolumeClaims(namespace string) PersistentVolumeClaimNamespaceLister { return persistentVolumeClaimNamespaceLister{listers.NewNamespaced[*v1.PersistentVolumeClaim](s.ResourceIndexer, namespace)} } // PersistentVolumeClaimNamespaceLister helps list and get PersistentVolumeClaims. // All objects returned here must be treated as read-only. type PersistentVolumeClaimNamespaceLister interface { // List lists all PersistentVolumeClaims in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PersistentVolumeClaim, err error) // Get retrieves the PersistentVolumeClaim from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.PersistentVolumeClaim, error) PersistentVolumeClaimNamespaceListerExpansion } // persistentVolumeClaimNamespaceLister implements the PersistentVolumeClaimNamespaceLister // interface. type persistentVolumeClaimNamespaceLister struct { listers.ResourceIndexer[*v1.PersistentVolumeClaim] } kubernetes-client-go-a2dfcab/listers/core/v1/pod.go000066400000000000000000000043631472614177300224620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PodLister helps list Pods. // All objects returned here must be treated as read-only. type PodLister interface { // List lists all Pods in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Pod, err error) // Pods returns an object that can list and get Pods. Pods(namespace string) PodNamespaceLister PodListerExpansion } // podLister implements the PodLister interface. type podLister struct { listers.ResourceIndexer[*v1.Pod] } // NewPodLister returns a new PodLister. func NewPodLister(indexer cache.Indexer) PodLister { return &podLister{listers.New[*v1.Pod](indexer, v1.Resource("pod"))} } // Pods returns an object that can list and get Pods. func (s *podLister) Pods(namespace string) PodNamespaceLister { return podNamespaceLister{listers.NewNamespaced[*v1.Pod](s.ResourceIndexer, namespace)} } // PodNamespaceLister helps list and get Pods. // All objects returned here must be treated as read-only. type PodNamespaceLister interface { // List lists all Pods in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Pod, err error) // Get retrieves the Pod from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Pod, error) PodNamespaceListerExpansion } // podNamespaceLister implements the PodNamespaceLister // interface. type podNamespaceLister struct { listers.ResourceIndexer[*v1.Pod] } kubernetes-client-go-a2dfcab/listers/core/v1/podtemplate.go000066400000000000000000000050631472614177300242140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PodTemplateLister helps list PodTemplates. // All objects returned here must be treated as read-only. type PodTemplateLister interface { // List lists all PodTemplates in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PodTemplate, err error) // PodTemplates returns an object that can list and get PodTemplates. PodTemplates(namespace string) PodTemplateNamespaceLister PodTemplateListerExpansion } // podTemplateLister implements the PodTemplateLister interface. type podTemplateLister struct { listers.ResourceIndexer[*v1.PodTemplate] } // NewPodTemplateLister returns a new PodTemplateLister. func NewPodTemplateLister(indexer cache.Indexer) PodTemplateLister { return &podTemplateLister{listers.New[*v1.PodTemplate](indexer, v1.Resource("podtemplate"))} } // PodTemplates returns an object that can list and get PodTemplates. func (s *podTemplateLister) PodTemplates(namespace string) PodTemplateNamespaceLister { return podTemplateNamespaceLister{listers.NewNamespaced[*v1.PodTemplate](s.ResourceIndexer, namespace)} } // PodTemplateNamespaceLister helps list and get PodTemplates. // All objects returned here must be treated as read-only. type PodTemplateNamespaceLister interface { // List lists all PodTemplates in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PodTemplate, err error) // Get retrieves the PodTemplate from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.PodTemplate, error) PodTemplateNamespaceListerExpansion } // podTemplateNamespaceLister implements the PodTemplateNamespaceLister // interface. type podTemplateNamespaceLister struct { listers.ResourceIndexer[*v1.PodTemplate] } kubernetes-client-go-a2dfcab/listers/core/v1/replicationcontroller.go000066400000000000000000000057031472614177300263140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ReplicationControllerLister helps list ReplicationControllers. // All objects returned here must be treated as read-only. type ReplicationControllerLister interface { // List lists all ReplicationControllers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ReplicationController, err error) // ReplicationControllers returns an object that can list and get ReplicationControllers. ReplicationControllers(namespace string) ReplicationControllerNamespaceLister ReplicationControllerListerExpansion } // replicationControllerLister implements the ReplicationControllerLister interface. type replicationControllerLister struct { listers.ResourceIndexer[*v1.ReplicationController] } // NewReplicationControllerLister returns a new ReplicationControllerLister. func NewReplicationControllerLister(indexer cache.Indexer) ReplicationControllerLister { return &replicationControllerLister{listers.New[*v1.ReplicationController](indexer, v1.Resource("replicationcontroller"))} } // ReplicationControllers returns an object that can list and get ReplicationControllers. func (s *replicationControllerLister) ReplicationControllers(namespace string) ReplicationControllerNamespaceLister { return replicationControllerNamespaceLister{listers.NewNamespaced[*v1.ReplicationController](s.ResourceIndexer, namespace)} } // ReplicationControllerNamespaceLister helps list and get ReplicationControllers. // All objects returned here must be treated as read-only. type ReplicationControllerNamespaceLister interface { // List lists all ReplicationControllers in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ReplicationController, err error) // Get retrieves the ReplicationController from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ReplicationController, error) ReplicationControllerNamespaceListerExpansion } // replicationControllerNamespaceLister implements the ReplicationControllerNamespaceLister // interface. type replicationControllerNamespaceLister struct { listers.ResourceIndexer[*v1.ReplicationController] } kubernetes-client-go-a2dfcab/listers/core/v1/replicationcontroller_expansion.go000066400000000000000000000043171472614177300304000ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "fmt" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" ) // ReplicationControllerListerExpansion allows custom methods to be added to // ReplicationControllerLister. type ReplicationControllerListerExpansion interface { GetPodControllers(pod *v1.Pod) ([]*v1.ReplicationController, error) } // ReplicationControllerNamespaceListerExpansion allows custom methods to be added to // ReplicationControllerNamespaceLister. type ReplicationControllerNamespaceListerExpansion interface{} // GetPodControllers returns a list of ReplicationControllers that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching ReplicationControllers are found. func (s *replicationControllerLister) GetPodControllers(pod *v1.Pod) ([]*v1.ReplicationController, error) { if len(pod.Labels) == 0 { return nil, fmt.Errorf("no controllers found for pod %v because it has no labels", pod.Name) } items, err := s.ReplicationControllers(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var controllers []*v1.ReplicationController for i := range items { rc := items[i] selector := labels.Set(rc.Spec.Selector).AsSelectorPreValidated() // If an rc with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } controllers = append(controllers, rc) } if len(controllers) == 0 { return nil, fmt.Errorf("could not find controller for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return controllers, nil } kubernetes-client-go-a2dfcab/listers/core/v1/resourcequota.go000066400000000000000000000052031472614177300245730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ResourceQuotaLister helps list ResourceQuotas. // All objects returned here must be treated as read-only. type ResourceQuotaLister interface { // List lists all ResourceQuotas in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ResourceQuota, err error) // ResourceQuotas returns an object that can list and get ResourceQuotas. ResourceQuotas(namespace string) ResourceQuotaNamespaceLister ResourceQuotaListerExpansion } // resourceQuotaLister implements the ResourceQuotaLister interface. type resourceQuotaLister struct { listers.ResourceIndexer[*v1.ResourceQuota] } // NewResourceQuotaLister returns a new ResourceQuotaLister. func NewResourceQuotaLister(indexer cache.Indexer) ResourceQuotaLister { return &resourceQuotaLister{listers.New[*v1.ResourceQuota](indexer, v1.Resource("resourcequota"))} } // ResourceQuotas returns an object that can list and get ResourceQuotas. func (s *resourceQuotaLister) ResourceQuotas(namespace string) ResourceQuotaNamespaceLister { return resourceQuotaNamespaceLister{listers.NewNamespaced[*v1.ResourceQuota](s.ResourceIndexer, namespace)} } // ResourceQuotaNamespaceLister helps list and get ResourceQuotas. // All objects returned here must be treated as read-only. type ResourceQuotaNamespaceLister interface { // List lists all ResourceQuotas in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ResourceQuota, err error) // Get retrieves the ResourceQuota from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ResourceQuota, error) ResourceQuotaNamespaceListerExpansion } // resourceQuotaNamespaceLister implements the ResourceQuotaNamespaceLister // interface. type resourceQuotaNamespaceLister struct { listers.ResourceIndexer[*v1.ResourceQuota] } kubernetes-client-go-a2dfcab/listers/core/v1/secret.go000066400000000000000000000045531472614177300231660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // SecretLister helps list Secrets. // All objects returned here must be treated as read-only. type SecretLister interface { // List lists all Secrets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Secret, err error) // Secrets returns an object that can list and get Secrets. Secrets(namespace string) SecretNamespaceLister SecretListerExpansion } // secretLister implements the SecretLister interface. type secretLister struct { listers.ResourceIndexer[*v1.Secret] } // NewSecretLister returns a new SecretLister. func NewSecretLister(indexer cache.Indexer) SecretLister { return &secretLister{listers.New[*v1.Secret](indexer, v1.Resource("secret"))} } // Secrets returns an object that can list and get Secrets. func (s *secretLister) Secrets(namespace string) SecretNamespaceLister { return secretNamespaceLister{listers.NewNamespaced[*v1.Secret](s.ResourceIndexer, namespace)} } // SecretNamespaceLister helps list and get Secrets. // All objects returned here must be treated as read-only. type SecretNamespaceLister interface { // List lists all Secrets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Secret, err error) // Get retrieves the Secret from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Secret, error) SecretNamespaceListerExpansion } // secretNamespaceLister implements the SecretNamespaceLister // interface. type secretNamespaceLister struct { listers.ResourceIndexer[*v1.Secret] } kubernetes-client-go-a2dfcab/listers/core/v1/service.go000066400000000000000000000046231472614177300233370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ServiceLister helps list Services. // All objects returned here must be treated as read-only. type ServiceLister interface { // List lists all Services in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Service, err error) // Services returns an object that can list and get Services. Services(namespace string) ServiceNamespaceLister ServiceListerExpansion } // serviceLister implements the ServiceLister interface. type serviceLister struct { listers.ResourceIndexer[*v1.Service] } // NewServiceLister returns a new ServiceLister. func NewServiceLister(indexer cache.Indexer) ServiceLister { return &serviceLister{listers.New[*v1.Service](indexer, v1.Resource("service"))} } // Services returns an object that can list and get Services. func (s *serviceLister) Services(namespace string) ServiceNamespaceLister { return serviceNamespaceLister{listers.NewNamespaced[*v1.Service](s.ResourceIndexer, namespace)} } // ServiceNamespaceLister helps list and get Services. // All objects returned here must be treated as read-only. type ServiceNamespaceLister interface { // List lists all Services in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Service, err error) // Get retrieves the Service from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Service, error) ServiceNamespaceListerExpansion } // serviceNamespaceLister implements the ServiceNamespaceLister // interface. type serviceNamespaceLister struct { listers.ResourceIndexer[*v1.Service] } kubernetes-client-go-a2dfcab/listers/core/v1/serviceaccount.go000066400000000000000000000052531472614177300247140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ServiceAccountLister helps list ServiceAccounts. // All objects returned here must be treated as read-only. type ServiceAccountLister interface { // List lists all ServiceAccounts in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ServiceAccount, err error) // ServiceAccounts returns an object that can list and get ServiceAccounts. ServiceAccounts(namespace string) ServiceAccountNamespaceLister ServiceAccountListerExpansion } // serviceAccountLister implements the ServiceAccountLister interface. type serviceAccountLister struct { listers.ResourceIndexer[*v1.ServiceAccount] } // NewServiceAccountLister returns a new ServiceAccountLister. func NewServiceAccountLister(indexer cache.Indexer) ServiceAccountLister { return &serviceAccountLister{listers.New[*v1.ServiceAccount](indexer, v1.Resource("serviceaccount"))} } // ServiceAccounts returns an object that can list and get ServiceAccounts. func (s *serviceAccountLister) ServiceAccounts(namespace string) ServiceAccountNamespaceLister { return serviceAccountNamespaceLister{listers.NewNamespaced[*v1.ServiceAccount](s.ResourceIndexer, namespace)} } // ServiceAccountNamespaceLister helps list and get ServiceAccounts. // All objects returned here must be treated as read-only. type ServiceAccountNamespaceLister interface { // List lists all ServiceAccounts in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ServiceAccount, err error) // Get retrieves the ServiceAccount from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ServiceAccount, error) ServiceAccountNamespaceListerExpansion } // serviceAccountNamespaceLister implements the ServiceAccountNamespaceLister // interface. type serviceAccountNamespaceLister struct { listers.ResourceIndexer[*v1.ServiceAccount] } kubernetes-client-go-a2dfcab/listers/discovery/000077500000000000000000000000001472614177300220745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/discovery/v1/000077500000000000000000000000001472614177300224225ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/discovery/v1/endpointslice.go000066400000000000000000000052101472614177300256070ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/discovery/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // EndpointSliceLister helps list EndpointSlices. // All objects returned here must be treated as read-only. type EndpointSliceLister interface { // List lists all EndpointSlices in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.EndpointSlice, err error) // EndpointSlices returns an object that can list and get EndpointSlices. EndpointSlices(namespace string) EndpointSliceNamespaceLister EndpointSliceListerExpansion } // endpointSliceLister implements the EndpointSliceLister interface. type endpointSliceLister struct { listers.ResourceIndexer[*v1.EndpointSlice] } // NewEndpointSliceLister returns a new EndpointSliceLister. func NewEndpointSliceLister(indexer cache.Indexer) EndpointSliceLister { return &endpointSliceLister{listers.New[*v1.EndpointSlice](indexer, v1.Resource("endpointslice"))} } // EndpointSlices returns an object that can list and get EndpointSlices. func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceNamespaceLister { return endpointSliceNamespaceLister{listers.NewNamespaced[*v1.EndpointSlice](s.ResourceIndexer, namespace)} } // EndpointSliceNamespaceLister helps list and get EndpointSlices. // All objects returned here must be treated as read-only. type EndpointSliceNamespaceLister interface { // List lists all EndpointSlices in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.EndpointSlice, err error) // Get retrieves the EndpointSlice from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.EndpointSlice, error) EndpointSliceNamespaceListerExpansion } // endpointSliceNamespaceLister implements the EndpointSliceNamespaceLister // interface. type endpointSliceNamespaceLister struct { listers.ResourceIndexer[*v1.EndpointSlice] } kubernetes-client-go-a2dfcab/listers/discovery/v1/expansion_generated.go000066400000000000000000000016431472614177300267770ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // EndpointSliceListerExpansion allows custom methods to be added to // EndpointSliceLister. type EndpointSliceListerExpansion interface{} // EndpointSliceNamespaceListerExpansion allows custom methods to be added to // EndpointSliceNamespaceLister. type EndpointSliceNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/discovery/v1beta1/000077500000000000000000000000001472614177300233375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/discovery/v1beta1/endpointslice.go000066400000000000000000000052771472614177300265410ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/discovery/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // EndpointSliceLister helps list EndpointSlices. // All objects returned here must be treated as read-only. type EndpointSliceLister interface { // List lists all EndpointSlices in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.EndpointSlice, err error) // EndpointSlices returns an object that can list and get EndpointSlices. EndpointSlices(namespace string) EndpointSliceNamespaceLister EndpointSliceListerExpansion } // endpointSliceLister implements the EndpointSliceLister interface. type endpointSliceLister struct { listers.ResourceIndexer[*v1beta1.EndpointSlice] } // NewEndpointSliceLister returns a new EndpointSliceLister. func NewEndpointSliceLister(indexer cache.Indexer) EndpointSliceLister { return &endpointSliceLister{listers.New[*v1beta1.EndpointSlice](indexer, v1beta1.Resource("endpointslice"))} } // EndpointSlices returns an object that can list and get EndpointSlices. func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceNamespaceLister { return endpointSliceNamespaceLister{listers.NewNamespaced[*v1beta1.EndpointSlice](s.ResourceIndexer, namespace)} } // EndpointSliceNamespaceLister helps list and get EndpointSlices. // All objects returned here must be treated as read-only. type EndpointSliceNamespaceLister interface { // List lists all EndpointSlices in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.EndpointSlice, err error) // Get retrieves the EndpointSlice from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.EndpointSlice, error) EndpointSliceNamespaceListerExpansion } // endpointSliceNamespaceLister implements the EndpointSliceNamespaceLister // interface. type endpointSliceNamespaceLister struct { listers.ResourceIndexer[*v1beta1.EndpointSlice] } kubernetes-client-go-a2dfcab/listers/discovery/v1beta1/expansion_generated.go000066400000000000000000000016501472614177300277120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // EndpointSliceListerExpansion allows custom methods to be added to // EndpointSliceLister. type EndpointSliceListerExpansion interface{} // EndpointSliceNamespaceListerExpansion allows custom methods to be added to // EndpointSliceNamespaceLister. type EndpointSliceNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/doc.go000066400000000000000000000012631472614177300211630ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package listers provides generated listers for Kubernetes APIs. package listers // import "k8s.io/client-go/listers" kubernetes-client-go-a2dfcab/listers/events/000077500000000000000000000000001472614177300213715ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/events/v1/000077500000000000000000000000001472614177300217175ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/events/v1/event.go000066400000000000000000000045051472614177300233730ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/events/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // EventLister helps list Events. // All objects returned here must be treated as read-only. type EventLister interface { // List lists all Events in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Event, err error) // Events returns an object that can list and get Events. Events(namespace string) EventNamespaceLister EventListerExpansion } // eventLister implements the EventLister interface. type eventLister struct { listers.ResourceIndexer[*v1.Event] } // NewEventLister returns a new EventLister. func NewEventLister(indexer cache.Indexer) EventLister { return &eventLister{listers.New[*v1.Event](indexer, v1.Resource("event"))} } // Events returns an object that can list and get Events. func (s *eventLister) Events(namespace string) EventNamespaceLister { return eventNamespaceLister{listers.NewNamespaced[*v1.Event](s.ResourceIndexer, namespace)} } // EventNamespaceLister helps list and get Events. // All objects returned here must be treated as read-only. type EventNamespaceLister interface { // List lists all Events in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Event, err error) // Get retrieves the Event from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Event, error) EventNamespaceListerExpansion } // eventNamespaceLister implements the EventNamespaceLister // interface. type eventNamespaceLister struct { listers.ResourceIndexer[*v1.Event] } kubernetes-client-go-a2dfcab/listers/events/v1/expansion_generated.go000066400000000000000000000015631472614177300262750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // EventListerExpansion allows custom methods to be added to // EventLister. type EventListerExpansion interface{} // EventNamespaceListerExpansion allows custom methods to be added to // EventNamespaceLister. type EventNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/events/v1beta1/000077500000000000000000000000001472614177300226345ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/events/v1beta1/event.go000066400000000000000000000045741472614177300243160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/events/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // EventLister helps list Events. // All objects returned here must be treated as read-only. type EventLister interface { // List lists all Events in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Event, err error) // Events returns an object that can list and get Events. Events(namespace string) EventNamespaceLister EventListerExpansion } // eventLister implements the EventLister interface. type eventLister struct { listers.ResourceIndexer[*v1beta1.Event] } // NewEventLister returns a new EventLister. func NewEventLister(indexer cache.Indexer) EventLister { return &eventLister{listers.New[*v1beta1.Event](indexer, v1beta1.Resource("event"))} } // Events returns an object that can list and get Events. func (s *eventLister) Events(namespace string) EventNamespaceLister { return eventNamespaceLister{listers.NewNamespaced[*v1beta1.Event](s.ResourceIndexer, namespace)} } // EventNamespaceLister helps list and get Events. // All objects returned here must be treated as read-only. type EventNamespaceLister interface { // List lists all Events in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Event, err error) // Get retrieves the Event from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.Event, error) EventNamespaceListerExpansion } // eventNamespaceLister implements the EventNamespaceLister // interface. type eventNamespaceLister struct { listers.ResourceIndexer[*v1beta1.Event] } kubernetes-client-go-a2dfcab/listers/events/v1beta1/expansion_generated.go000066400000000000000000000015701472614177300272100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // EventListerExpansion allows custom methods to be added to // EventLister. type EventListerExpansion interface{} // EventNamespaceListerExpansion allows custom methods to be added to // EventNamespaceLister. type EventNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/extensions/000077500000000000000000000000001472614177300222645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/000077500000000000000000000000001472614177300235275ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/daemonset.go000066400000000000000000000050401472614177300260340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // DaemonSetLister helps list DaemonSets. // All objects returned here must be treated as read-only. type DaemonSetLister interface { // List lists all DaemonSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.DaemonSet, err error) // DaemonSets returns an object that can list and get DaemonSets. DaemonSets(namespace string) DaemonSetNamespaceLister DaemonSetListerExpansion } // daemonSetLister implements the DaemonSetLister interface. type daemonSetLister struct { listers.ResourceIndexer[*v1beta1.DaemonSet] } // NewDaemonSetLister returns a new DaemonSetLister. func NewDaemonSetLister(indexer cache.Indexer) DaemonSetLister { return &daemonSetLister{listers.New[*v1beta1.DaemonSet](indexer, v1beta1.Resource("daemonset"))} } // DaemonSets returns an object that can list and get DaemonSets. func (s *daemonSetLister) DaemonSets(namespace string) DaemonSetNamespaceLister { return daemonSetNamespaceLister{listers.NewNamespaced[*v1beta1.DaemonSet](s.ResourceIndexer, namespace)} } // DaemonSetNamespaceLister helps list and get DaemonSets. // All objects returned here must be treated as read-only. type DaemonSetNamespaceLister interface { // List lists all DaemonSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.DaemonSet, err error) // Get retrieves the DaemonSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.DaemonSet, error) DaemonSetNamespaceListerExpansion } // daemonSetNamespaceLister implements the DaemonSetNamespaceLister // interface. type daemonSetNamespaceLister struct { listers.ResourceIndexer[*v1beta1.DaemonSet] } kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/daemonset_expansion.go000066400000000000000000000074531472614177300301320ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "fmt" apps "k8s.io/api/apps/v1beta1" "k8s.io/api/core/v1" "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // DaemonSetListerExpansion allows custom methods to be added to // DaemonSetLister. type DaemonSetListerExpansion interface { GetPodDaemonSets(pod *v1.Pod) ([]*v1beta1.DaemonSet, error) GetHistoryDaemonSets(history *apps.ControllerRevision) ([]*v1beta1.DaemonSet, error) } // DaemonSetNamespaceListerExpansion allows custom methods to be added to // DaemonSetNamespaceLister. type DaemonSetNamespaceListerExpansion interface{} // GetPodDaemonSets returns a list of DaemonSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching DaemonSets are found. func (s *daemonSetLister) GetPodDaemonSets(pod *v1.Pod) ([]*v1beta1.DaemonSet, error) { var selector labels.Selector var daemonSet *v1beta1.DaemonSet if len(pod.Labels) == 0 { return nil, fmt.Errorf("no daemon sets found for pod %v because it has no labels", pod.Name) } list, err := s.DaemonSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var daemonSets []*v1beta1.DaemonSet for i := range list { daemonSet = list[i] if daemonSet.Namespace != pod.Namespace { continue } selector, err = metav1.LabelSelectorAsSelector(daemonSet.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a daemonSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } daemonSets = append(daemonSets, daemonSet) } if len(daemonSets) == 0 { return nil, fmt.Errorf("could not find daemon set for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return daemonSets, nil } // GetHistoryDaemonSets returns a list of DaemonSets that potentially // match a ControllerRevision. Only the one specified in the ControllerRevision's ControllerRef // will actually manage it. // Returns an error only if no matching DaemonSets are found. func (s *daemonSetLister) GetHistoryDaemonSets(history *apps.ControllerRevision) ([]*v1beta1.DaemonSet, error) { if len(history.Labels) == 0 { return nil, fmt.Errorf("no DaemonSet found for ControllerRevision %s because it has no labels", history.Name) } list, err := s.DaemonSets(history.Namespace).List(labels.Everything()) if err != nil { return nil, err } var daemonSets []*v1beta1.DaemonSet for _, ds := range list { selector, err := metav1.LabelSelectorAsSelector(ds.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the history object continue } // If a DaemonSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(history.Labels)) { continue } daemonSets = append(daemonSets, ds) } if len(daemonSets) == 0 { return nil, fmt.Errorf("could not find DaemonSets for ControllerRevision %s in namespace %s with labels: %v", history.Name, history.Namespace, history.Labels) } return daemonSets, nil } kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/daemonset_expansion_test.go000066400000000000000000000104431472614177300311620ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "testing" "k8s.io/api/core/v1" extensions "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/tools/cache" ) func TestDaemonSetLister(t *testing.T) { store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{"namespace": cache.MetaNamespaceIndexFunc}) lister := NewDaemonSetLister(store) testCases := []struct { inDSs []*extensions.DaemonSet list func() ([]*extensions.DaemonSet, error) outDaemonSetNames sets.String expectErr bool }{ // Basic listing { inDSs: []*extensions.DaemonSet{ {ObjectMeta: metav1.ObjectMeta{Name: "basic"}}, }, list: func() ([]*extensions.DaemonSet, error) { return lister.List(labels.Everything()) }, outDaemonSetNames: sets.NewString("basic"), }, // Listing multiple daemon sets { inDSs: []*extensions.DaemonSet{ {ObjectMeta: metav1.ObjectMeta{Name: "basic"}}, {ObjectMeta: metav1.ObjectMeta{Name: "complex"}}, {ObjectMeta: metav1.ObjectMeta{Name: "complex2"}}, }, list: func() ([]*extensions.DaemonSet, error) { return lister.List(labels.Everything()) }, outDaemonSetNames: sets.NewString("basic", "complex", "complex2"), }, // No pod labels { inDSs: []*extensions.DaemonSet{ { ObjectMeta: metav1.ObjectMeta{Name: "basic", Namespace: "ns"}, Spec: extensions.DaemonSetSpec{ Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "baz"}}, }, }, }, list: func() ([]*extensions.DaemonSet, error) { pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{Name: "pod1", Namespace: "ns"}, } return lister.GetPodDaemonSets(pod) }, outDaemonSetNames: sets.NewString(), expectErr: true, }, // No DS selectors { inDSs: []*extensions.DaemonSet{ { ObjectMeta: metav1.ObjectMeta{Name: "basic", Namespace: "ns"}, }, }, list: func() ([]*extensions.DaemonSet, error) { pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "pod1", Namespace: "ns", Labels: map[string]string{"foo": "bar"}, }, } return lister.GetPodDaemonSets(pod) }, outDaemonSetNames: sets.NewString(), expectErr: true, }, // Matching labels to selectors and namespace { inDSs: []*extensions.DaemonSet{ { ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Spec: extensions.DaemonSetSpec{ Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, { ObjectMeta: metav1.ObjectMeta{Name: "bar", Namespace: "ns"}, Spec: extensions.DaemonSetSpec{ Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, }, list: func() ([]*extensions.DaemonSet, error) { pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "pod1", Labels: map[string]string{"foo": "bar"}, Namespace: "ns", }, } return lister.GetPodDaemonSets(pod) }, outDaemonSetNames: sets.NewString("bar"), }, } for _, c := range testCases { for _, r := range c.inDSs { store.Add(r) } daemonSets, err := c.list() if err != nil && c.expectErr { continue } else if c.expectErr { t.Error("Expected error, got none") continue } else if err != nil { t.Errorf("Unexpected error %#v", err) continue } daemonSetNames := make([]string, len(daemonSets)) for ix := range daemonSets { daemonSetNames[ix] = daemonSets[ix].Name } if !c.outDaemonSetNames.HasAll(daemonSetNames...) || len(daemonSetNames) != len(c.outDaemonSetNames) { t.Errorf("Unexpected got controllers %+v expected %+v", daemonSetNames, c.outDaemonSetNames) } } } kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/deployment.go000066400000000000000000000051101472614177300262330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // DeploymentLister helps list Deployments. // All objects returned here must be treated as read-only. type DeploymentLister interface { // List lists all Deployments in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Deployment, err error) // Deployments returns an object that can list and get Deployments. Deployments(namespace string) DeploymentNamespaceLister DeploymentListerExpansion } // deploymentLister implements the DeploymentLister interface. type deploymentLister struct { listers.ResourceIndexer[*v1beta1.Deployment] } // NewDeploymentLister returns a new DeploymentLister. func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { return &deploymentLister{listers.New[*v1beta1.Deployment](indexer, v1beta1.Resource("deployment"))} } // Deployments returns an object that can list and get Deployments. func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceLister { return deploymentNamespaceLister{listers.NewNamespaced[*v1beta1.Deployment](s.ResourceIndexer, namespace)} } // DeploymentNamespaceLister helps list and get Deployments. // All objects returned here must be treated as read-only. type DeploymentNamespaceLister interface { // List lists all Deployments in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Deployment, err error) // Get retrieves the Deployment from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.Deployment, error) DeploymentNamespaceListerExpansion } // deploymentNamespaceLister implements the DeploymentNamespaceLister // interface. type deploymentNamespaceLister struct { listers.ResourceIndexer[*v1beta1.Deployment] } kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/expansion_generated.go000066400000000000000000000027301472614177300301020ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // DeploymentListerExpansion allows custom methods to be added to // DeploymentLister. type DeploymentListerExpansion interface{} // DeploymentNamespaceListerExpansion allows custom methods to be added to // DeploymentNamespaceLister. type DeploymentNamespaceListerExpansion interface{} // IngressListerExpansion allows custom methods to be added to // IngressLister. type IngressListerExpansion interface{} // IngressNamespaceListerExpansion allows custom methods to be added to // IngressNamespaceLister. type IngressNamespaceListerExpansion interface{} // NetworkPolicyListerExpansion allows custom methods to be added to // NetworkPolicyLister. type NetworkPolicyListerExpansion interface{} // NetworkPolicyNamespaceListerExpansion allows custom methods to be added to // NetworkPolicyNamespaceLister. type NetworkPolicyNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/ingress.go000066400000000000000000000047321472614177300255360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // IngressLister helps list Ingresses. // All objects returned here must be treated as read-only. type IngressLister interface { // List lists all Ingresses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Ingress, err error) // Ingresses returns an object that can list and get Ingresses. Ingresses(namespace string) IngressNamespaceLister IngressListerExpansion } // ingressLister implements the IngressLister interface. type ingressLister struct { listers.ResourceIndexer[*v1beta1.Ingress] } // NewIngressLister returns a new IngressLister. func NewIngressLister(indexer cache.Indexer) IngressLister { return &ingressLister{listers.New[*v1beta1.Ingress](indexer, v1beta1.Resource("ingress"))} } // Ingresses returns an object that can list and get Ingresses. func (s *ingressLister) Ingresses(namespace string) IngressNamespaceLister { return ingressNamespaceLister{listers.NewNamespaced[*v1beta1.Ingress](s.ResourceIndexer, namespace)} } // IngressNamespaceLister helps list and get Ingresses. // All objects returned here must be treated as read-only. type IngressNamespaceLister interface { // List lists all Ingresses in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Ingress, err error) // Get retrieves the Ingress from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.Ingress, error) IngressNamespaceListerExpansion } // ingressNamespaceLister implements the IngressNamespaceLister // interface. type ingressNamespaceLister struct { listers.ResourceIndexer[*v1beta1.Ingress] } kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/networkpolicy.go000066400000000000000000000053121472614177300267700ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // NetworkPolicyLister helps list NetworkPolicies. // All objects returned here must be treated as read-only. type NetworkPolicyLister interface { // List lists all NetworkPolicies in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.NetworkPolicy, err error) // NetworkPolicies returns an object that can list and get NetworkPolicies. NetworkPolicies(namespace string) NetworkPolicyNamespaceLister NetworkPolicyListerExpansion } // networkPolicyLister implements the NetworkPolicyLister interface. type networkPolicyLister struct { listers.ResourceIndexer[*v1beta1.NetworkPolicy] } // NewNetworkPolicyLister returns a new NetworkPolicyLister. func NewNetworkPolicyLister(indexer cache.Indexer) NetworkPolicyLister { return &networkPolicyLister{listers.New[*v1beta1.NetworkPolicy](indexer, v1beta1.Resource("networkpolicy"))} } // NetworkPolicies returns an object that can list and get NetworkPolicies. func (s *networkPolicyLister) NetworkPolicies(namespace string) NetworkPolicyNamespaceLister { return networkPolicyNamespaceLister{listers.NewNamespaced[*v1beta1.NetworkPolicy](s.ResourceIndexer, namespace)} } // NetworkPolicyNamespaceLister helps list and get NetworkPolicies. // All objects returned here must be treated as read-only. type NetworkPolicyNamespaceLister interface { // List lists all NetworkPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.NetworkPolicy, err error) // Get retrieves the NetworkPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.NetworkPolicy, error) NetworkPolicyNamespaceListerExpansion } // networkPolicyNamespaceLister implements the NetworkPolicyNamespaceLister // interface. type networkPolicyNamespaceLister struct { listers.ResourceIndexer[*v1beta1.NetworkPolicy] } kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/replicaset.go000066400000000000000000000051101472614177300262060ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ReplicaSetLister helps list ReplicaSets. // All objects returned here must be treated as read-only. type ReplicaSetLister interface { // List lists all ReplicaSets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ReplicaSet, err error) // ReplicaSets returns an object that can list and get ReplicaSets. ReplicaSets(namespace string) ReplicaSetNamespaceLister ReplicaSetListerExpansion } // replicaSetLister implements the ReplicaSetLister interface. type replicaSetLister struct { listers.ResourceIndexer[*v1beta1.ReplicaSet] } // NewReplicaSetLister returns a new ReplicaSetLister. func NewReplicaSetLister(indexer cache.Indexer) ReplicaSetLister { return &replicaSetLister{listers.New[*v1beta1.ReplicaSet](indexer, v1beta1.Resource("replicaset"))} } // ReplicaSets returns an object that can list and get ReplicaSets. func (s *replicaSetLister) ReplicaSets(namespace string) ReplicaSetNamespaceLister { return replicaSetNamespaceLister{listers.NewNamespaced[*v1beta1.ReplicaSet](s.ResourceIndexer, namespace)} } // ReplicaSetNamespaceLister helps list and get ReplicaSets. // All objects returned here must be treated as read-only. type ReplicaSetNamespaceLister interface { // List lists all ReplicaSets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ReplicaSet, err error) // Get retrieves the ReplicaSet from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.ReplicaSet, error) ReplicaSetNamespaceListerExpansion } // replicaSetNamespaceLister implements the ReplicaSetNamespaceLister // interface. type replicaSetNamespaceLister struct { listers.ResourceIndexer[*v1beta1.ReplicaSet] } kubernetes-client-go-a2dfcab/listers/extensions/v1beta1/replicaset_expansion.go000066400000000000000000000044441472614177300303030ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "fmt" "k8s.io/api/core/v1" extensions "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // ReplicaSetListerExpansion allows custom methods to be added to // ReplicaSetLister. type ReplicaSetListerExpansion interface { GetPodReplicaSets(pod *v1.Pod) ([]*extensions.ReplicaSet, error) } // ReplicaSetNamespaceListerExpansion allows custom methods to be added to // ReplicaSetNamespaceLister. type ReplicaSetNamespaceListerExpansion interface{} // GetPodReplicaSets returns a list of ReplicaSets that potentially match a pod. // Only the one specified in the Pod's ControllerRef will actually manage it. // Returns an error only if no matching ReplicaSets are found. func (s *replicaSetLister) GetPodReplicaSets(pod *v1.Pod) ([]*extensions.ReplicaSet, error) { if len(pod.Labels) == 0 { return nil, fmt.Errorf("no ReplicaSets found for pod %v because it has no labels", pod.Name) } list, err := s.ReplicaSets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var rss []*extensions.ReplicaSet for _, rs := range list { if rs.Namespace != pod.Namespace { continue } selector, err := metav1.LabelSelectorAsSelector(rs.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a ReplicaSet with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } rss = append(rss, rs) } if len(rss) == 0 { return nil, fmt.Errorf("could not find ReplicaSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return rss, nil } kubernetes-client-go-a2dfcab/listers/flowcontrol/000077500000000000000000000000001472614177300224355ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/flowcontrol/v1/000077500000000000000000000000001472614177300227635ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/flowcontrol/v1/expansion_generated.go000066400000000000000000000016461472614177300273430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // FlowSchemaListerExpansion allows custom methods to be added to // FlowSchemaLister. type FlowSchemaListerExpansion interface{} // PriorityLevelConfigurationListerExpansion allows custom methods to be added to // PriorityLevelConfigurationLister. type PriorityLevelConfigurationListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/flowcontrol/v1/flowschema.go000066400000000000000000000031201472614177300254360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/flowcontrol/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // FlowSchemaLister helps list FlowSchemas. // All objects returned here must be treated as read-only. type FlowSchemaLister interface { // List lists all FlowSchemas in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.FlowSchema, err error) // Get retrieves the FlowSchema from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.FlowSchema, error) FlowSchemaListerExpansion } // flowSchemaLister implements the FlowSchemaLister interface. type flowSchemaLister struct { listers.ResourceIndexer[*v1.FlowSchema] } // NewFlowSchemaLister returns a new FlowSchemaLister. func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { return &flowSchemaLister{listers.New[*v1.FlowSchema](indexer, v1.Resource("flowschema"))} } kubernetes-client-go-a2dfcab/listers/flowcontrol/v1/prioritylevelconfiguration.go000066400000000000000000000036001472614177300310120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/flowcontrol/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PriorityLevelConfigurationLister helps list PriorityLevelConfigurations. // All objects returned here must be treated as read-only. type PriorityLevelConfigurationLister interface { // List lists all PriorityLevelConfigurations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PriorityLevelConfiguration, err error) // Get retrieves the PriorityLevelConfiguration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.PriorityLevelConfiguration, error) PriorityLevelConfigurationListerExpansion } // priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { listers.ResourceIndexer[*v1.PriorityLevelConfiguration] } // NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { return &priorityLevelConfigurationLister{listers.New[*v1.PriorityLevelConfiguration](indexer, v1.Resource("prioritylevelconfiguration"))} } kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta1/000077500000000000000000000000001472614177300237005ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta1/expansion_generated.go000066400000000000000000000016531472614177300302560ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // FlowSchemaListerExpansion allows custom methods to be added to // FlowSchemaLister. type FlowSchemaListerExpansion interface{} // PriorityLevelConfigurationListerExpansion allows custom methods to be added to // PriorityLevelConfigurationLister. type PriorityLevelConfigurationListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta1/flowschema.go000066400000000000000000000031701472614177300263600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // FlowSchemaLister helps list FlowSchemas. // All objects returned here must be treated as read-only. type FlowSchemaLister interface { // List lists all FlowSchemas in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.FlowSchema, err error) // Get retrieves the FlowSchema from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.FlowSchema, error) FlowSchemaListerExpansion } // flowSchemaLister implements the FlowSchemaLister interface. type flowSchemaLister struct { listers.ResourceIndexer[*v1beta1.FlowSchema] } // NewFlowSchemaLister returns a new FlowSchemaLister. func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { return &flowSchemaLister{listers.New[*v1beta1.FlowSchema](indexer, v1beta1.Resource("flowschema"))} } kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go000066400000000000000000000036501472614177300317340ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PriorityLevelConfigurationLister helps list PriorityLevelConfigurations. // All objects returned here must be treated as read-only. type PriorityLevelConfigurationLister interface { // List lists all PriorityLevelConfigurations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.PriorityLevelConfiguration, err error) // Get retrieves the PriorityLevelConfiguration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.PriorityLevelConfiguration, error) PriorityLevelConfigurationListerExpansion } // priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { listers.ResourceIndexer[*v1beta1.PriorityLevelConfiguration] } // NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { return &priorityLevelConfigurationLister{listers.New[*v1beta1.PriorityLevelConfiguration](indexer, v1beta1.Resource("prioritylevelconfiguration"))} } kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta2/000077500000000000000000000000001472614177300237015ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta2/expansion_generated.go000066400000000000000000000016531472614177300302570ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 // FlowSchemaListerExpansion allows custom methods to be added to // FlowSchemaLister. type FlowSchemaListerExpansion interface{} // PriorityLevelConfigurationListerExpansion allows custom methods to be added to // PriorityLevelConfigurationLister. type PriorityLevelConfigurationListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta2/flowschema.go000066400000000000000000000031701472614177300263610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // FlowSchemaLister helps list FlowSchemas. // All objects returned here must be treated as read-only. type FlowSchemaLister interface { // List lists all FlowSchemas in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.FlowSchema, err error) // Get retrieves the FlowSchema from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta2.FlowSchema, error) FlowSchemaListerExpansion } // flowSchemaLister implements the FlowSchemaLister interface. type flowSchemaLister struct { listers.ResourceIndexer[*v1beta2.FlowSchema] } // NewFlowSchemaLister returns a new FlowSchemaLister. func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { return &flowSchemaLister{listers.New[*v1beta2.FlowSchema](indexer, v1beta2.Resource("flowschema"))} } kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go000066400000000000000000000036501472614177300317350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PriorityLevelConfigurationLister helps list PriorityLevelConfigurations. // All objects returned here must be treated as read-only. type PriorityLevelConfigurationLister interface { // List lists all PriorityLevelConfigurations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta2.PriorityLevelConfiguration, err error) // Get retrieves the PriorityLevelConfiguration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta2.PriorityLevelConfiguration, error) PriorityLevelConfigurationListerExpansion } // priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { listers.ResourceIndexer[*v1beta2.PriorityLevelConfiguration] } // NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { return &priorityLevelConfigurationLister{listers.New[*v1beta2.PriorityLevelConfiguration](indexer, v1beta2.Resource("prioritylevelconfiguration"))} } kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta3/000077500000000000000000000000001472614177300237025ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta3/expansion_generated.go000066400000000000000000000016531472614177300302600ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta3 // FlowSchemaListerExpansion allows custom methods to be added to // FlowSchemaLister. type FlowSchemaListerExpansion interface{} // PriorityLevelConfigurationListerExpansion allows custom methods to be added to // PriorityLevelConfigurationLister. type PriorityLevelConfigurationListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta3/flowschema.go000066400000000000000000000031701472614177300263620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // FlowSchemaLister helps list FlowSchemas. // All objects returned here must be treated as read-only. type FlowSchemaLister interface { // List lists all FlowSchemas in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta3.FlowSchema, err error) // Get retrieves the FlowSchema from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta3.FlowSchema, error) FlowSchemaListerExpansion } // flowSchemaLister implements the FlowSchemaLister interface. type flowSchemaLister struct { listers.ResourceIndexer[*v1beta3.FlowSchema] } // NewFlowSchemaLister returns a new FlowSchemaLister. func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { return &flowSchemaLister{listers.New[*v1beta3.FlowSchema](indexer, v1beta3.Resource("flowschema"))} } kubernetes-client-go-a2dfcab/listers/flowcontrol/v1beta3/prioritylevelconfiguration.go000066400000000000000000000036501472614177300317360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PriorityLevelConfigurationLister helps list PriorityLevelConfigurations. // All objects returned here must be treated as read-only. type PriorityLevelConfigurationLister interface { // List lists all PriorityLevelConfigurations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta3.PriorityLevelConfiguration, err error) // Get retrieves the PriorityLevelConfiguration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta3.PriorityLevelConfiguration, error) PriorityLevelConfigurationListerExpansion } // priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { listers.ResourceIndexer[*v1beta3.PriorityLevelConfiguration] } // NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { return &priorityLevelConfigurationLister{listers.New[*v1beta3.PriorityLevelConfiguration](indexer, v1beta3.Resource("prioritylevelconfiguration"))} } kubernetes-client-go-a2dfcab/listers/generic_helpers.go000066400000000000000000000051271472614177300235570ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package listers import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" ) // ResourceIndexer wraps an indexer, resource, and optional namespace for a given type. // This is intended for use by listers (generated by lister-gen) only. type ResourceIndexer[T runtime.Object] struct { indexer cache.Indexer resource schema.GroupResource namespace string // empty for non-namespaced types } // New returns a new instance of a lister (resource indexer) wrapping the given indexer and resource for the specified type. // This is intended for use by listers (generated by lister-gen) only. func New[T runtime.Object](indexer cache.Indexer, resource schema.GroupResource) ResourceIndexer[T] { return ResourceIndexer[T]{indexer: indexer, resource: resource} } // NewNamespaced returns a new instance of a namespaced lister (resource indexer) wrapping the given parent and namespace for the specified type. // This is intended for use by listers (generated by lister-gen) only. func NewNamespaced[T runtime.Object](parent ResourceIndexer[T], namespace string) ResourceIndexer[T] { return ResourceIndexer[T]{indexer: parent.indexer, resource: parent.resource, namespace: namespace} } // List lists all resources in the indexer matching the given selector. func (l ResourceIndexer[T]) List(selector labels.Selector) (ret []T, err error) { // ListAllByNamespace reverts to ListAll on empty namespaces err = cache.ListAllByNamespace(l.indexer, l.namespace, selector, func(m interface{}) { ret = append(ret, m.(T)) }) return ret, err } // Get retrieves the resource from the index for a given name. func (l ResourceIndexer[T]) Get(name string) (T, error) { var key string if l.namespace == "" { key = name } else { key = l.namespace + "/" + name } obj, exists, err := l.indexer.GetByKey(key) if err != nil { return *new(T), err } if !exists { return *new(T), errors.NewNotFound(l.resource, name) } return obj.(T), nil } kubernetes-client-go-a2dfcab/listers/imagepolicy/000077500000000000000000000000001472614177300223675ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/imagepolicy/v1alpha1/000077500000000000000000000000001472614177300240045ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/imagepolicy/v1alpha1/expansion_generated.go000066400000000000000000000013741472614177300303620ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // ImageReviewListerExpansion allows custom methods to be added to // ImageReviewLister. type ImageReviewListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/imagepolicy/v1alpha1/imagereview.go000066400000000000000000000032231472614177300266370ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/imagepolicy/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ImageReviewLister helps list ImageReviews. // All objects returned here must be treated as read-only. type ImageReviewLister interface { // List lists all ImageReviews in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ImageReview, err error) // Get retrieves the ImageReview from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.ImageReview, error) ImageReviewListerExpansion } // imageReviewLister implements the ImageReviewLister interface. type imageReviewLister struct { listers.ResourceIndexer[*v1alpha1.ImageReview] } // NewImageReviewLister returns a new ImageReviewLister. func NewImageReviewLister(indexer cache.Indexer) ImageReviewLister { return &imageReviewLister{listers.New[*v1alpha1.ImageReview](indexer, v1alpha1.Resource("imagereview"))} } kubernetes-client-go-a2dfcab/listers/networking/000077500000000000000000000000001472614177300222545ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/networking/v1/000077500000000000000000000000001472614177300226025ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/networking/v1/expansion_generated.go000066400000000000000000000024731472614177300271610ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // IngressListerExpansion allows custom methods to be added to // IngressLister. type IngressListerExpansion interface{} // IngressNamespaceListerExpansion allows custom methods to be added to // IngressNamespaceLister. type IngressNamespaceListerExpansion interface{} // IngressClassListerExpansion allows custom methods to be added to // IngressClassLister. type IngressClassListerExpansion interface{} // NetworkPolicyListerExpansion allows custom methods to be added to // NetworkPolicyLister. type NetworkPolicyListerExpansion interface{} // NetworkPolicyNamespaceListerExpansion allows custom methods to be added to // NetworkPolicyNamespaceLister. type NetworkPolicyNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/networking/v1/ingress.go000066400000000000000000000046431472614177300246120ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // IngressLister helps list Ingresses. // All objects returned here must be treated as read-only. type IngressLister interface { // List lists all Ingresses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Ingress, err error) // Ingresses returns an object that can list and get Ingresses. Ingresses(namespace string) IngressNamespaceLister IngressListerExpansion } // ingressLister implements the IngressLister interface. type ingressLister struct { listers.ResourceIndexer[*v1.Ingress] } // NewIngressLister returns a new IngressLister. func NewIngressLister(indexer cache.Indexer) IngressLister { return &ingressLister{listers.New[*v1.Ingress](indexer, v1.Resource("ingress"))} } // Ingresses returns an object that can list and get Ingresses. func (s *ingressLister) Ingresses(namespace string) IngressNamespaceLister { return ingressNamespaceLister{listers.NewNamespaced[*v1.Ingress](s.ResourceIndexer, namespace)} } // IngressNamespaceLister helps list and get Ingresses. // All objects returned here must be treated as read-only. type IngressNamespaceLister interface { // List lists all Ingresses in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Ingress, err error) // Get retrieves the Ingress from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Ingress, error) IngressNamespaceListerExpansion } // ingressNamespaceLister implements the IngressNamespaceLister // interface. type ingressNamespaceLister struct { listers.ResourceIndexer[*v1.Ingress] } kubernetes-client-go-a2dfcab/listers/networking/v1/ingressclass.go000066400000000000000000000031671472614177300256400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // IngressClassLister helps list IngressClasses. // All objects returned here must be treated as read-only. type IngressClassLister interface { // List lists all IngressClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.IngressClass, err error) // Get retrieves the IngressClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.IngressClass, error) IngressClassListerExpansion } // ingressClassLister implements the IngressClassLister interface. type ingressClassLister struct { listers.ResourceIndexer[*v1.IngressClass] } // NewIngressClassLister returns a new IngressClassLister. func NewIngressClassLister(indexer cache.Indexer) IngressClassLister { return &ingressClassLister{listers.New[*v1.IngressClass](indexer, v1.Resource("ingressclass"))} } kubernetes-client-go-a2dfcab/listers/networking/v1/networkpolicy.go000066400000000000000000000052231472614177300260440ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // NetworkPolicyLister helps list NetworkPolicies. // All objects returned here must be treated as read-only. type NetworkPolicyLister interface { // List lists all NetworkPolicies in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.NetworkPolicy, err error) // NetworkPolicies returns an object that can list and get NetworkPolicies. NetworkPolicies(namespace string) NetworkPolicyNamespaceLister NetworkPolicyListerExpansion } // networkPolicyLister implements the NetworkPolicyLister interface. type networkPolicyLister struct { listers.ResourceIndexer[*v1.NetworkPolicy] } // NewNetworkPolicyLister returns a new NetworkPolicyLister. func NewNetworkPolicyLister(indexer cache.Indexer) NetworkPolicyLister { return &networkPolicyLister{listers.New[*v1.NetworkPolicy](indexer, v1.Resource("networkpolicy"))} } // NetworkPolicies returns an object that can list and get NetworkPolicies. func (s *networkPolicyLister) NetworkPolicies(namespace string) NetworkPolicyNamespaceLister { return networkPolicyNamespaceLister{listers.NewNamespaced[*v1.NetworkPolicy](s.ResourceIndexer, namespace)} } // NetworkPolicyNamespaceLister helps list and get NetworkPolicies. // All objects returned here must be treated as read-only. type NetworkPolicyNamespaceLister interface { // List lists all NetworkPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.NetworkPolicy, err error) // Get retrieves the NetworkPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.NetworkPolicy, error) NetworkPolicyNamespaceListerExpansion } // networkPolicyNamespaceLister implements the NetworkPolicyNamespaceLister // interface. type networkPolicyNamespaceLister struct { listers.ResourceIndexer[*v1.NetworkPolicy] } kubernetes-client-go-a2dfcab/listers/networking/v1alpha1/000077500000000000000000000000001472614177300236715ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/networking/v1alpha1/expansion_generated.go000066400000000000000000000015741472614177300302510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // IPAddressListerExpansion allows custom methods to be added to // IPAddressLister. type IPAddressListerExpansion interface{} // ServiceCIDRListerExpansion allows custom methods to be added to // ServiceCIDRLister. type ServiceCIDRListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/networking/v1alpha1/ipaddress.go000066400000000000000000000031561472614177300262030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/networking/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // IPAddressLister helps list IPAddresses. // All objects returned here must be treated as read-only. type IPAddressLister interface { // List lists all IPAddresses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.IPAddress, err error) // Get retrieves the IPAddress from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.IPAddress, error) IPAddressListerExpansion } // iPAddressLister implements the IPAddressLister interface. type iPAddressLister struct { listers.ResourceIndexer[*v1alpha1.IPAddress] } // NewIPAddressLister returns a new IPAddressLister. func NewIPAddressLister(indexer cache.Indexer) IPAddressLister { return &iPAddressLister{listers.New[*v1alpha1.IPAddress](indexer, v1alpha1.Resource("ipaddress"))} } kubernetes-client-go-a2dfcab/listers/networking/v1alpha1/servicecidr.go000066400000000000000000000032221472614177300265210ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/networking/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ServiceCIDRLister helps list ServiceCIDRs. // All objects returned here must be treated as read-only. type ServiceCIDRLister interface { // List lists all ServiceCIDRs in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ServiceCIDR, err error) // Get retrieves the ServiceCIDR from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.ServiceCIDR, error) ServiceCIDRListerExpansion } // serviceCIDRLister implements the ServiceCIDRLister interface. type serviceCIDRLister struct { listers.ResourceIndexer[*v1alpha1.ServiceCIDR] } // NewServiceCIDRLister returns a new ServiceCIDRLister. func NewServiceCIDRLister(indexer cache.Indexer) ServiceCIDRLister { return &serviceCIDRLister{listers.New[*v1alpha1.ServiceCIDR](indexer, v1alpha1.Resource("servicecidr"))} } kubernetes-client-go-a2dfcab/listers/networking/v1beta1/000077500000000000000000000000001472614177300235175ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/networking/v1beta1/expansion_generated.go000066400000000000000000000024231472614177300300710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // IPAddressListerExpansion allows custom methods to be added to // IPAddressLister. type IPAddressListerExpansion interface{} // IngressListerExpansion allows custom methods to be added to // IngressLister. type IngressListerExpansion interface{} // IngressNamespaceListerExpansion allows custom methods to be added to // IngressNamespaceLister. type IngressNamespaceListerExpansion interface{} // IngressClassListerExpansion allows custom methods to be added to // IngressClassLister. type IngressClassListerExpansion interface{} // ServiceCIDRListerExpansion allows custom methods to be added to // ServiceCIDRLister. type ServiceCIDRListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/networking/v1beta1/ingress.go000066400000000000000000000047321472614177300255260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/networking/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // IngressLister helps list Ingresses. // All objects returned here must be treated as read-only. type IngressLister interface { // List lists all Ingresses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Ingress, err error) // Ingresses returns an object that can list and get Ingresses. Ingresses(namespace string) IngressNamespaceLister IngressListerExpansion } // ingressLister implements the IngressLister interface. type ingressLister struct { listers.ResourceIndexer[*v1beta1.Ingress] } // NewIngressLister returns a new IngressLister. func NewIngressLister(indexer cache.Indexer) IngressLister { return &ingressLister{listers.New[*v1beta1.Ingress](indexer, v1beta1.Resource("ingress"))} } // Ingresses returns an object that can list and get Ingresses. func (s *ingressLister) Ingresses(namespace string) IngressNamespaceLister { return ingressNamespaceLister{listers.NewNamespaced[*v1beta1.Ingress](s.ResourceIndexer, namespace)} } // IngressNamespaceLister helps list and get Ingresses. // All objects returned here must be treated as read-only. type IngressNamespaceLister interface { // List lists all Ingresses in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Ingress, err error) // Get retrieves the Ingress from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.Ingress, error) IngressNamespaceListerExpansion } // ingressNamespaceLister implements the IngressNamespaceLister // interface. type ingressNamespaceLister struct { listers.ResourceIndexer[*v1beta1.Ingress] } kubernetes-client-go-a2dfcab/listers/networking/v1beta1/ingressclass.go000066400000000000000000000032371472614177300265530ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/networking/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // IngressClassLister helps list IngressClasses. // All objects returned here must be treated as read-only. type IngressClassLister interface { // List lists all IngressClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.IngressClass, err error) // Get retrieves the IngressClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.IngressClass, error) IngressClassListerExpansion } // ingressClassLister implements the IngressClassLister interface. type ingressClassLister struct { listers.ResourceIndexer[*v1beta1.IngressClass] } // NewIngressClassLister returns a new IngressClassLister. func NewIngressClassLister(indexer cache.Indexer) IngressClassLister { return &ingressClassLister{listers.New[*v1beta1.IngressClass](indexer, v1beta1.Resource("ingressclass"))} } kubernetes-client-go-a2dfcab/listers/networking/v1beta1/ipaddress.go000066400000000000000000000031461472614177300260300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/networking/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // IPAddressLister helps list IPAddresses. // All objects returned here must be treated as read-only. type IPAddressLister interface { // List lists all IPAddresses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.IPAddress, err error) // Get retrieves the IPAddress from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.IPAddress, error) IPAddressListerExpansion } // iPAddressLister implements the IPAddressLister interface. type iPAddressLister struct { listers.ResourceIndexer[*v1beta1.IPAddress] } // NewIPAddressLister returns a new IPAddressLister. func NewIPAddressLister(indexer cache.Indexer) IPAddressLister { return &iPAddressLister{listers.New[*v1beta1.IPAddress](indexer, v1beta1.Resource("ipaddress"))} } kubernetes-client-go-a2dfcab/listers/networking/v1beta1/servicecidr.go000066400000000000000000000032121472614177300263460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/networking/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ServiceCIDRLister helps list ServiceCIDRs. // All objects returned here must be treated as read-only. type ServiceCIDRLister interface { // List lists all ServiceCIDRs in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ServiceCIDR, err error) // Get retrieves the ServiceCIDR from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.ServiceCIDR, error) ServiceCIDRListerExpansion } // serviceCIDRLister implements the ServiceCIDRLister interface. type serviceCIDRLister struct { listers.ResourceIndexer[*v1beta1.ServiceCIDR] } // NewServiceCIDRLister returns a new ServiceCIDRLister. func NewServiceCIDRLister(indexer cache.Indexer) ServiceCIDRLister { return &serviceCIDRLister{listers.New[*v1beta1.ServiceCIDR](indexer, v1beta1.Resource("servicecidr"))} } kubernetes-client-go-a2dfcab/listers/node/000077500000000000000000000000001472614177300210125ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/node/v1/000077500000000000000000000000001472614177300213405ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/node/v1/expansion_generated.go000066400000000000000000000013711472614177300257130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // RuntimeClassListerExpansion allows custom methods to be added to // RuntimeClassLister. type RuntimeClassListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/node/v1/runtimeclass.go000066400000000000000000000031611472614177300244010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/node/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RuntimeClassLister helps list RuntimeClasses. // All objects returned here must be treated as read-only. type RuntimeClassLister interface { // List lists all RuntimeClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.RuntimeClass, err error) // Get retrieves the RuntimeClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.RuntimeClass, error) RuntimeClassListerExpansion } // runtimeClassLister implements the RuntimeClassLister interface. type runtimeClassLister struct { listers.ResourceIndexer[*v1.RuntimeClass] } // NewRuntimeClassLister returns a new RuntimeClassLister. func NewRuntimeClassLister(indexer cache.Indexer) RuntimeClassLister { return &runtimeClassLister{listers.New[*v1.RuntimeClass](indexer, v1.Resource("runtimeclass"))} } kubernetes-client-go-a2dfcab/listers/node/v1alpha1/000077500000000000000000000000001472614177300224275ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/node/v1alpha1/expansion_generated.go000066400000000000000000000013771472614177300270100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // RuntimeClassListerExpansion allows custom methods to be added to // RuntimeClassLister. type RuntimeClassListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/node/v1alpha1/runtimeclass.go000066400000000000000000000032411472614177300254670ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/node/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RuntimeClassLister helps list RuntimeClasses. // All objects returned here must be treated as read-only. type RuntimeClassLister interface { // List lists all RuntimeClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.RuntimeClass, err error) // Get retrieves the RuntimeClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.RuntimeClass, error) RuntimeClassListerExpansion } // runtimeClassLister implements the RuntimeClassLister interface. type runtimeClassLister struct { listers.ResourceIndexer[*v1alpha1.RuntimeClass] } // NewRuntimeClassLister returns a new RuntimeClassLister. func NewRuntimeClassLister(indexer cache.Indexer) RuntimeClassLister { return &runtimeClassLister{listers.New[*v1alpha1.RuntimeClass](indexer, v1alpha1.Resource("runtimeclass"))} } kubernetes-client-go-a2dfcab/listers/node/v1beta1/000077500000000000000000000000001472614177300222555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/node/v1beta1/expansion_generated.go000066400000000000000000000013761472614177300266350ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // RuntimeClassListerExpansion allows custom methods to be added to // RuntimeClassLister. type RuntimeClassListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/node/v1beta1/runtimeclass.go000066400000000000000000000032311472614177300253140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/node/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RuntimeClassLister helps list RuntimeClasses. // All objects returned here must be treated as read-only. type RuntimeClassLister interface { // List lists all RuntimeClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.RuntimeClass, err error) // Get retrieves the RuntimeClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.RuntimeClass, error) RuntimeClassListerExpansion } // runtimeClassLister implements the RuntimeClassLister interface. type runtimeClassLister struct { listers.ResourceIndexer[*v1beta1.RuntimeClass] } // NewRuntimeClassLister returns a new RuntimeClassLister. func NewRuntimeClassLister(indexer cache.Indexer) RuntimeClassLister { return &runtimeClassLister{listers.New[*v1beta1.RuntimeClass](indexer, v1beta1.Resource("runtimeclass"))} } kubernetes-client-go-a2dfcab/listers/policy/000077500000000000000000000000001472614177300213645ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/policy/v1/000077500000000000000000000000001472614177300217125ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/policy/v1/eviction.go000066400000000000000000000046751472614177300240750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/policy/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // EvictionLister helps list Evictions. // All objects returned here must be treated as read-only. type EvictionLister interface { // List lists all Evictions in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Eviction, err error) // Evictions returns an object that can list and get Evictions. Evictions(namespace string) EvictionNamespaceLister EvictionListerExpansion } // evictionLister implements the EvictionLister interface. type evictionLister struct { listers.ResourceIndexer[*v1.Eviction] } // NewEvictionLister returns a new EvictionLister. func NewEvictionLister(indexer cache.Indexer) EvictionLister { return &evictionLister{listers.New[*v1.Eviction](indexer, v1.Resource("eviction"))} } // Evictions returns an object that can list and get Evictions. func (s *evictionLister) Evictions(namespace string) EvictionNamespaceLister { return evictionNamespaceLister{listers.NewNamespaced[*v1.Eviction](s.ResourceIndexer, namespace)} } // EvictionNamespaceLister helps list and get Evictions. // All objects returned here must be treated as read-only. type EvictionNamespaceLister interface { // List lists all Evictions in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Eviction, err error) // Get retrieves the Eviction from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Eviction, error) EvictionNamespaceListerExpansion } // evictionNamespaceLister implements the EvictionNamespaceLister // interface. type evictionNamespaceLister struct { listers.ResourceIndexer[*v1.Eviction] } kubernetes-client-go-a2dfcab/listers/policy/v1/expansion_generated.go000066400000000000000000000016051472614177300262650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // EvictionListerExpansion allows custom methods to be added to // EvictionLister. type EvictionListerExpansion interface{} // EvictionNamespaceListerExpansion allows custom methods to be added to // EvictionNamespaceLister. type EvictionNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/policy/v1/poddisruptionbudget.go000066400000000000000000000055651472614177300263520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/policy/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PodDisruptionBudgetLister helps list PodDisruptionBudgets. // All objects returned here must be treated as read-only. type PodDisruptionBudgetLister interface { // List lists all PodDisruptionBudgets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PodDisruptionBudget, err error) // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets. PodDisruptionBudgets(namespace string) PodDisruptionBudgetNamespaceLister PodDisruptionBudgetListerExpansion } // podDisruptionBudgetLister implements the PodDisruptionBudgetLister interface. type podDisruptionBudgetLister struct { listers.ResourceIndexer[*v1.PodDisruptionBudget] } // NewPodDisruptionBudgetLister returns a new PodDisruptionBudgetLister. func NewPodDisruptionBudgetLister(indexer cache.Indexer) PodDisruptionBudgetLister { return &podDisruptionBudgetLister{listers.New[*v1.PodDisruptionBudget](indexer, v1.Resource("poddisruptionbudget"))} } // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets. func (s *podDisruptionBudgetLister) PodDisruptionBudgets(namespace string) PodDisruptionBudgetNamespaceLister { return podDisruptionBudgetNamespaceLister{listers.NewNamespaced[*v1.PodDisruptionBudget](s.ResourceIndexer, namespace)} } // PodDisruptionBudgetNamespaceLister helps list and get PodDisruptionBudgets. // All objects returned here must be treated as read-only. type PodDisruptionBudgetNamespaceLister interface { // List lists all PodDisruptionBudgets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PodDisruptionBudget, err error) // Get retrieves the PodDisruptionBudget from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.PodDisruptionBudget, error) PodDisruptionBudgetNamespaceListerExpansion } // podDisruptionBudgetNamespaceLister implements the PodDisruptionBudgetNamespaceLister // interface. type podDisruptionBudgetNamespaceLister struct { listers.ResourceIndexer[*v1.PodDisruptionBudget] } kubernetes-client-go-a2dfcab/listers/policy/v1/poddisruptionbudget_expansion.go000066400000000000000000000041371472614177300304300ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "fmt" "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // PodDisruptionBudgetListerExpansion allows custom methods to be added to // PodDisruptionBudgetLister. type PodDisruptionBudgetListerExpansion interface { GetPodPodDisruptionBudgets(pod *v1.Pod) ([]*policy.PodDisruptionBudget, error) } // PodDisruptionBudgetNamespaceListerExpansion allows custom methods to be added to // PodDisruptionBudgetNamespaceLister. type PodDisruptionBudgetNamespaceListerExpansion interface{} // GetPodPodDisruptionBudgets returns a list of PodDisruptionBudgets matching a pod. func (s *podDisruptionBudgetLister) GetPodPodDisruptionBudgets(pod *v1.Pod) ([]*policy.PodDisruptionBudget, error) { var selector labels.Selector list, err := s.PodDisruptionBudgets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var pdbList []*policy.PodDisruptionBudget for i := range list { pdb := list[i] selector, err = metav1.LabelSelectorAsSelector(pdb.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // Unlike the v1beta version, here we let an empty selector match everything. if !selector.Matches(labels.Set(pod.Labels)) { continue } pdbList = append(pdbList, pdb) } if len(pdbList) == 0 { return nil, fmt.Errorf("could not find PodDisruptionBudget for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return pdbList, nil } kubernetes-client-go-a2dfcab/listers/policy/v1beta1/000077500000000000000000000000001472614177300226275ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/policy/v1beta1/eviction.go000066400000000000000000000047641472614177300250110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/policy/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // EvictionLister helps list Evictions. // All objects returned here must be treated as read-only. type EvictionLister interface { // List lists all Evictions in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Eviction, err error) // Evictions returns an object that can list and get Evictions. Evictions(namespace string) EvictionNamespaceLister EvictionListerExpansion } // evictionLister implements the EvictionLister interface. type evictionLister struct { listers.ResourceIndexer[*v1beta1.Eviction] } // NewEvictionLister returns a new EvictionLister. func NewEvictionLister(indexer cache.Indexer) EvictionLister { return &evictionLister{listers.New[*v1beta1.Eviction](indexer, v1beta1.Resource("eviction"))} } // Evictions returns an object that can list and get Evictions. func (s *evictionLister) Evictions(namespace string) EvictionNamespaceLister { return evictionNamespaceLister{listers.NewNamespaced[*v1beta1.Eviction](s.ResourceIndexer, namespace)} } // EvictionNamespaceLister helps list and get Evictions. // All objects returned here must be treated as read-only. type EvictionNamespaceLister interface { // List lists all Evictions in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Eviction, err error) // Get retrieves the Eviction from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.Eviction, error) EvictionNamespaceListerExpansion } // evictionNamespaceLister implements the EvictionNamespaceLister // interface. type evictionNamespaceLister struct { listers.ResourceIndexer[*v1beta1.Eviction] } kubernetes-client-go-a2dfcab/listers/policy/v1beta1/expansion_generated.go000066400000000000000000000016121472614177300272000ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // EvictionListerExpansion allows custom methods to be added to // EvictionLister. type EvictionListerExpansion interface{} // EvictionNamespaceListerExpansion allows custom methods to be added to // EvictionNamespaceLister. type EvictionNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/policy/v1beta1/poddisruptionbudget.go000066400000000000000000000056541472614177300272660ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/policy/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PodDisruptionBudgetLister helps list PodDisruptionBudgets. // All objects returned here must be treated as read-only. type PodDisruptionBudgetLister interface { // List lists all PodDisruptionBudgets in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.PodDisruptionBudget, err error) // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets. PodDisruptionBudgets(namespace string) PodDisruptionBudgetNamespaceLister PodDisruptionBudgetListerExpansion } // podDisruptionBudgetLister implements the PodDisruptionBudgetLister interface. type podDisruptionBudgetLister struct { listers.ResourceIndexer[*v1beta1.PodDisruptionBudget] } // NewPodDisruptionBudgetLister returns a new PodDisruptionBudgetLister. func NewPodDisruptionBudgetLister(indexer cache.Indexer) PodDisruptionBudgetLister { return &podDisruptionBudgetLister{listers.New[*v1beta1.PodDisruptionBudget](indexer, v1beta1.Resource("poddisruptionbudget"))} } // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets. func (s *podDisruptionBudgetLister) PodDisruptionBudgets(namespace string) PodDisruptionBudgetNamespaceLister { return podDisruptionBudgetNamespaceLister{listers.NewNamespaced[*v1beta1.PodDisruptionBudget](s.ResourceIndexer, namespace)} } // PodDisruptionBudgetNamespaceLister helps list and get PodDisruptionBudgets. // All objects returned here must be treated as read-only. type PodDisruptionBudgetNamespaceLister interface { // List lists all PodDisruptionBudgets in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.PodDisruptionBudget, err error) // Get retrieves the PodDisruptionBudget from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.PodDisruptionBudget, error) PodDisruptionBudgetNamespaceListerExpansion } // podDisruptionBudgetNamespaceLister implements the PodDisruptionBudgetNamespaceLister // interface. type podDisruptionBudgetNamespaceLister struct { listers.ResourceIndexer[*v1beta1.PodDisruptionBudget] } kubernetes-client-go-a2dfcab/listers/policy/v1beta1/poddisruptionbudget_expansion.go000066400000000000000000000043221472614177300313410ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "fmt" "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // PodDisruptionBudgetListerExpansion allows custom methods to be added to // PodDisruptionBudgetLister. type PodDisruptionBudgetListerExpansion interface { GetPodPodDisruptionBudgets(pod *v1.Pod) ([]*policy.PodDisruptionBudget, error) } // PodDisruptionBudgetNamespaceListerExpansion allows custom methods to be added to // PodDisruptionBudgetNamespaceLister. type PodDisruptionBudgetNamespaceListerExpansion interface{} // GetPodPodDisruptionBudgets returns a list of PodDisruptionBudgets matching a pod. Returns an error only if no matching PodDisruptionBudgets are found. func (s *podDisruptionBudgetLister) GetPodPodDisruptionBudgets(pod *v1.Pod) ([]*policy.PodDisruptionBudget, error) { var selector labels.Selector list, err := s.PodDisruptionBudgets(pod.Namespace).List(labels.Everything()) if err != nil { return nil, err } var pdbList []*policy.PodDisruptionBudget for i := range list { pdb := list[i] selector, err = metav1.LabelSelectorAsSelector(pdb.Spec.Selector) if err != nil { // This object has an invalid selector, it does not match the pod continue } // If a PDB with a nil or empty selector creeps in, it should match nothing, not everything. if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) { continue } pdbList = append(pdbList, pdb) } if len(pdbList) == 0 { return nil, fmt.Errorf("could not find PodDisruptionBudget for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) } return pdbList, nil } kubernetes-client-go-a2dfcab/listers/rbac/000077500000000000000000000000001472614177300207745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/rbac/OWNERS000066400000000000000000000002441472614177300217340ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-auth-authorizers-approvers reviewers: - sig-auth-authorizers-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/listers/rbac/v1/000077500000000000000000000000001472614177300213225ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/rbac/v1/clusterrole.go000066400000000000000000000031341472614177300242150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ClusterRoleLister helps list ClusterRoles. // All objects returned here must be treated as read-only. type ClusterRoleLister interface { // List lists all ClusterRoles in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ClusterRole, err error) // Get retrieves the ClusterRole from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ClusterRole, error) ClusterRoleListerExpansion } // clusterRoleLister implements the ClusterRoleLister interface. type clusterRoleLister struct { listers.ResourceIndexer[*v1.ClusterRole] } // NewClusterRoleLister returns a new ClusterRoleLister. func NewClusterRoleLister(indexer cache.Indexer) ClusterRoleLister { return &clusterRoleLister{listers.New[*v1.ClusterRole](indexer, v1.Resource("clusterrole"))} } kubernetes-client-go-a2dfcab/listers/rbac/v1/clusterrolebinding.go000066400000000000000000000033411472614177300255500ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ClusterRoleBindingLister helps list ClusterRoleBindings. // All objects returned here must be treated as read-only. type ClusterRoleBindingLister interface { // List lists all ClusterRoleBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ClusterRoleBinding, err error) // Get retrieves the ClusterRoleBinding from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.ClusterRoleBinding, error) ClusterRoleBindingListerExpansion } // clusterRoleBindingLister implements the ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { listers.ResourceIndexer[*v1.ClusterRoleBinding] } // NewClusterRoleBindingLister returns a new ClusterRoleBindingLister. func NewClusterRoleBindingLister(indexer cache.Indexer) ClusterRoleBindingLister { return &clusterRoleBindingLister{listers.New[*v1.ClusterRoleBinding](indexer, v1.Resource("clusterrolebinding"))} } kubernetes-client-go-a2dfcab/listers/rbac/v1/expansion_generated.go000066400000000000000000000026651472614177300257040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // ClusterRoleListerExpansion allows custom methods to be added to // ClusterRoleLister. type ClusterRoleListerExpansion interface{} // ClusterRoleBindingListerExpansion allows custom methods to be added to // ClusterRoleBindingLister. type ClusterRoleBindingListerExpansion interface{} // RoleListerExpansion allows custom methods to be added to // RoleLister. type RoleListerExpansion interface{} // RoleNamespaceListerExpansion allows custom methods to be added to // RoleNamespaceLister. type RoleNamespaceListerExpansion interface{} // RoleBindingListerExpansion allows custom methods to be added to // RoleBindingLister. type RoleBindingListerExpansion interface{} // RoleBindingNamespaceListerExpansion allows custom methods to be added to // RoleBindingNamespaceLister. type RoleBindingNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/rbac/v1/role.go000066400000000000000000000044331472614177300226160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RoleLister helps list Roles. // All objects returned here must be treated as read-only. type RoleLister interface { // List lists all Roles in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Role, err error) // Roles returns an object that can list and get Roles. Roles(namespace string) RoleNamespaceLister RoleListerExpansion } // roleLister implements the RoleLister interface. type roleLister struct { listers.ResourceIndexer[*v1.Role] } // NewRoleLister returns a new RoleLister. func NewRoleLister(indexer cache.Indexer) RoleLister { return &roleLister{listers.New[*v1.Role](indexer, v1.Resource("role"))} } // Roles returns an object that can list and get Roles. func (s *roleLister) Roles(namespace string) RoleNamespaceLister { return roleNamespaceLister{listers.NewNamespaced[*v1.Role](s.ResourceIndexer, namespace)} } // RoleNamespaceLister helps list and get Roles. // All objects returned here must be treated as read-only. type RoleNamespaceLister interface { // List lists all Roles in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Role, err error) // Get retrieves the Role from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.Role, error) RoleNamespaceListerExpansion } // roleNamespaceLister implements the RoleNamespaceLister // interface. type roleNamespaceLister struct { listers.ResourceIndexer[*v1.Role] } kubernetes-client-go-a2dfcab/listers/rbac/v1/rolebinding.go000066400000000000000000000050631472614177300241510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RoleBindingLister helps list RoleBindings. // All objects returned here must be treated as read-only. type RoleBindingLister interface { // List lists all RoleBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.RoleBinding, err error) // RoleBindings returns an object that can list and get RoleBindings. RoleBindings(namespace string) RoleBindingNamespaceLister RoleBindingListerExpansion } // roleBindingLister implements the RoleBindingLister interface. type roleBindingLister struct { listers.ResourceIndexer[*v1.RoleBinding] } // NewRoleBindingLister returns a new RoleBindingLister. func NewRoleBindingLister(indexer cache.Indexer) RoleBindingLister { return &roleBindingLister{listers.New[*v1.RoleBinding](indexer, v1.Resource("rolebinding"))} } // RoleBindings returns an object that can list and get RoleBindings. func (s *roleBindingLister) RoleBindings(namespace string) RoleBindingNamespaceLister { return roleBindingNamespaceLister{listers.NewNamespaced[*v1.RoleBinding](s.ResourceIndexer, namespace)} } // RoleBindingNamespaceLister helps list and get RoleBindings. // All objects returned here must be treated as read-only. type RoleBindingNamespaceLister interface { // List lists all RoleBindings in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.RoleBinding, err error) // Get retrieves the RoleBinding from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.RoleBinding, error) RoleBindingNamespaceListerExpansion } // roleBindingNamespaceLister implements the RoleBindingNamespaceLister // interface. type roleBindingNamespaceLister struct { listers.ResourceIndexer[*v1.RoleBinding] } kubernetes-client-go-a2dfcab/listers/rbac/v1alpha1/000077500000000000000000000000001472614177300224115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/rbac/v1alpha1/clusterrole.go000066400000000000000000000032141472614177300253030ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ClusterRoleLister helps list ClusterRoles. // All objects returned here must be treated as read-only. type ClusterRoleLister interface { // List lists all ClusterRoles in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ClusterRole, err error) // Get retrieves the ClusterRole from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.ClusterRole, error) ClusterRoleListerExpansion } // clusterRoleLister implements the ClusterRoleLister interface. type clusterRoleLister struct { listers.ResourceIndexer[*v1alpha1.ClusterRole] } // NewClusterRoleLister returns a new ClusterRoleLister. func NewClusterRoleLister(indexer cache.Indexer) ClusterRoleLister { return &clusterRoleLister{listers.New[*v1alpha1.ClusterRole](indexer, v1alpha1.Resource("clusterrole"))} } kubernetes-client-go-a2dfcab/listers/rbac/v1alpha1/clusterrolebinding.go000066400000000000000000000034211472614177300266360ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ClusterRoleBindingLister helps list ClusterRoleBindings. // All objects returned here must be treated as read-only. type ClusterRoleBindingLister interface { // List lists all ClusterRoleBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ClusterRoleBinding, err error) // Get retrieves the ClusterRoleBinding from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.ClusterRoleBinding, error) ClusterRoleBindingListerExpansion } // clusterRoleBindingLister implements the ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { listers.ResourceIndexer[*v1alpha1.ClusterRoleBinding] } // NewClusterRoleBindingLister returns a new ClusterRoleBindingLister. func NewClusterRoleBindingLister(indexer cache.Indexer) ClusterRoleBindingLister { return &clusterRoleBindingLister{listers.New[*v1alpha1.ClusterRoleBinding](indexer, v1alpha1.Resource("clusterrolebinding"))} } kubernetes-client-go-a2dfcab/listers/rbac/v1alpha1/expansion_generated.go000066400000000000000000000026731472614177300267720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // ClusterRoleListerExpansion allows custom methods to be added to // ClusterRoleLister. type ClusterRoleListerExpansion interface{} // ClusterRoleBindingListerExpansion allows custom methods to be added to // ClusterRoleBindingLister. type ClusterRoleBindingListerExpansion interface{} // RoleListerExpansion allows custom methods to be added to // RoleLister. type RoleListerExpansion interface{} // RoleNamespaceListerExpansion allows custom methods to be added to // RoleNamespaceLister. type RoleNamespaceListerExpansion interface{} // RoleBindingListerExpansion allows custom methods to be added to // RoleBindingLister. type RoleBindingListerExpansion interface{} // RoleBindingNamespaceListerExpansion allows custom methods to be added to // RoleBindingNamespaceLister. type RoleBindingNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/rbac/v1alpha1/role.go000066400000000000000000000045351472614177300237100ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RoleLister helps list Roles. // All objects returned here must be treated as read-only. type RoleLister interface { // List lists all Roles in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.Role, err error) // Roles returns an object that can list and get Roles. Roles(namespace string) RoleNamespaceLister RoleListerExpansion } // roleLister implements the RoleLister interface. type roleLister struct { listers.ResourceIndexer[*v1alpha1.Role] } // NewRoleLister returns a new RoleLister. func NewRoleLister(indexer cache.Indexer) RoleLister { return &roleLister{listers.New[*v1alpha1.Role](indexer, v1alpha1.Resource("role"))} } // Roles returns an object that can list and get Roles. func (s *roleLister) Roles(namespace string) RoleNamespaceLister { return roleNamespaceLister{listers.NewNamespaced[*v1alpha1.Role](s.ResourceIndexer, namespace)} } // RoleNamespaceLister helps list and get Roles. // All objects returned here must be treated as read-only. type RoleNamespaceLister interface { // List lists all Roles in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.Role, err error) // Get retrieves the Role from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.Role, error) RoleNamespaceListerExpansion } // roleNamespaceLister implements the RoleNamespaceLister // interface. type roleNamespaceLister struct { listers.ResourceIndexer[*v1alpha1.Role] } kubernetes-client-go-a2dfcab/listers/rbac/v1alpha1/rolebinding.go000066400000000000000000000051651472614177300252430ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RoleBindingLister helps list RoleBindings. // All objects returned here must be treated as read-only. type RoleBindingLister interface { // List lists all RoleBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.RoleBinding, err error) // RoleBindings returns an object that can list and get RoleBindings. RoleBindings(namespace string) RoleBindingNamespaceLister RoleBindingListerExpansion } // roleBindingLister implements the RoleBindingLister interface. type roleBindingLister struct { listers.ResourceIndexer[*v1alpha1.RoleBinding] } // NewRoleBindingLister returns a new RoleBindingLister. func NewRoleBindingLister(indexer cache.Indexer) RoleBindingLister { return &roleBindingLister{listers.New[*v1alpha1.RoleBinding](indexer, v1alpha1.Resource("rolebinding"))} } // RoleBindings returns an object that can list and get RoleBindings. func (s *roleBindingLister) RoleBindings(namespace string) RoleBindingNamespaceLister { return roleBindingNamespaceLister{listers.NewNamespaced[*v1alpha1.RoleBinding](s.ResourceIndexer, namespace)} } // RoleBindingNamespaceLister helps list and get RoleBindings. // All objects returned here must be treated as read-only. type RoleBindingNamespaceLister interface { // List lists all RoleBindings in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.RoleBinding, err error) // Get retrieves the RoleBinding from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.RoleBinding, error) RoleBindingNamespaceListerExpansion } // roleBindingNamespaceLister implements the RoleBindingNamespaceLister // interface. type roleBindingNamespaceLister struct { listers.ResourceIndexer[*v1alpha1.RoleBinding] } kubernetes-client-go-a2dfcab/listers/rbac/v1beta1/000077500000000000000000000000001472614177300222375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/rbac/v1beta1/clusterrole.go000066400000000000000000000032041472614177300251300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ClusterRoleLister helps list ClusterRoles. // All objects returned here must be treated as read-only. type ClusterRoleLister interface { // List lists all ClusterRoles in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ClusterRole, err error) // Get retrieves the ClusterRole from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.ClusterRole, error) ClusterRoleListerExpansion } // clusterRoleLister implements the ClusterRoleLister interface. type clusterRoleLister struct { listers.ResourceIndexer[*v1beta1.ClusterRole] } // NewClusterRoleLister returns a new ClusterRoleLister. func NewClusterRoleLister(indexer cache.Indexer) ClusterRoleLister { return &clusterRoleLister{listers.New[*v1beta1.ClusterRole](indexer, v1beta1.Resource("clusterrole"))} } kubernetes-client-go-a2dfcab/listers/rbac/v1beta1/clusterrolebinding.go000066400000000000000000000034111472614177300264630ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ClusterRoleBindingLister helps list ClusterRoleBindings. // All objects returned here must be treated as read-only. type ClusterRoleBindingLister interface { // List lists all ClusterRoleBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.ClusterRoleBinding, err error) // Get retrieves the ClusterRoleBinding from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.ClusterRoleBinding, error) ClusterRoleBindingListerExpansion } // clusterRoleBindingLister implements the ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { listers.ResourceIndexer[*v1beta1.ClusterRoleBinding] } // NewClusterRoleBindingLister returns a new ClusterRoleBindingLister. func NewClusterRoleBindingLister(indexer cache.Indexer) ClusterRoleBindingLister { return &clusterRoleBindingLister{listers.New[*v1beta1.ClusterRoleBinding](indexer, v1beta1.Resource("clusterrolebinding"))} } kubernetes-client-go-a2dfcab/listers/rbac/v1beta1/expansion_generated.go000066400000000000000000000026721472614177300266170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // ClusterRoleListerExpansion allows custom methods to be added to // ClusterRoleLister. type ClusterRoleListerExpansion interface{} // ClusterRoleBindingListerExpansion allows custom methods to be added to // ClusterRoleBindingLister. type ClusterRoleBindingListerExpansion interface{} // RoleListerExpansion allows custom methods to be added to // RoleLister. type RoleListerExpansion interface{} // RoleNamespaceListerExpansion allows custom methods to be added to // RoleNamespaceLister. type RoleNamespaceListerExpansion interface{} // RoleBindingListerExpansion allows custom methods to be added to // RoleBindingLister. type RoleBindingListerExpansion interface{} // RoleBindingNamespaceListerExpansion allows custom methods to be added to // RoleBindingNamespaceLister. type RoleBindingNamespaceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/rbac/v1beta1/role.go000066400000000000000000000045221472614177300235320ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RoleLister helps list Roles. // All objects returned here must be treated as read-only. type RoleLister interface { // List lists all Roles in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Role, err error) // Roles returns an object that can list and get Roles. Roles(namespace string) RoleNamespaceLister RoleListerExpansion } // roleLister implements the RoleLister interface. type roleLister struct { listers.ResourceIndexer[*v1beta1.Role] } // NewRoleLister returns a new RoleLister. func NewRoleLister(indexer cache.Indexer) RoleLister { return &roleLister{listers.New[*v1beta1.Role](indexer, v1beta1.Resource("role"))} } // Roles returns an object that can list and get Roles. func (s *roleLister) Roles(namespace string) RoleNamespaceLister { return roleNamespaceLister{listers.NewNamespaced[*v1beta1.Role](s.ResourceIndexer, namespace)} } // RoleNamespaceLister helps list and get Roles. // All objects returned here must be treated as read-only. type RoleNamespaceLister interface { // List lists all Roles in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.Role, err error) // Get retrieves the Role from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.Role, error) RoleNamespaceListerExpansion } // roleNamespaceLister implements the RoleNamespaceLister // interface. type roleNamespaceLister struct { listers.ResourceIndexer[*v1beta1.Role] } kubernetes-client-go-a2dfcab/listers/rbac/v1beta1/rolebinding.go000066400000000000000000000051521472614177300250650ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // RoleBindingLister helps list RoleBindings. // All objects returned here must be treated as read-only. type RoleBindingLister interface { // List lists all RoleBindings in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.RoleBinding, err error) // RoleBindings returns an object that can list and get RoleBindings. RoleBindings(namespace string) RoleBindingNamespaceLister RoleBindingListerExpansion } // roleBindingLister implements the RoleBindingLister interface. type roleBindingLister struct { listers.ResourceIndexer[*v1beta1.RoleBinding] } // NewRoleBindingLister returns a new RoleBindingLister. func NewRoleBindingLister(indexer cache.Indexer) RoleBindingLister { return &roleBindingLister{listers.New[*v1beta1.RoleBinding](indexer, v1beta1.Resource("rolebinding"))} } // RoleBindings returns an object that can list and get RoleBindings. func (s *roleBindingLister) RoleBindings(namespace string) RoleBindingNamespaceLister { return roleBindingNamespaceLister{listers.NewNamespaced[*v1beta1.RoleBinding](s.ResourceIndexer, namespace)} } // RoleBindingNamespaceLister helps list and get RoleBindings. // All objects returned here must be treated as read-only. type RoleBindingNamespaceLister interface { // List lists all RoleBindings in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.RoleBinding, err error) // Get retrieves the RoleBinding from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.RoleBinding, error) RoleBindingNamespaceListerExpansion } // roleBindingNamespaceLister implements the RoleBindingNamespaceLister // interface. type roleBindingNamespaceLister struct { listers.ResourceIndexer[*v1beta1.RoleBinding] } kubernetes-client-go-a2dfcab/listers/resource/000077500000000000000000000000001472614177300217145ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/resource/v1alpha3/000077500000000000000000000000001472614177300233335ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/resource/v1alpha3/deviceclass.go000066400000000000000000000032221472614177300261460ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha3 import ( v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // DeviceClassLister helps list DeviceClasses. // All objects returned here must be treated as read-only. type DeviceClassLister interface { // List lists all DeviceClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha3.DeviceClass, err error) // Get retrieves the DeviceClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha3.DeviceClass, error) DeviceClassListerExpansion } // deviceClassLister implements the DeviceClassLister interface. type deviceClassLister struct { listers.ResourceIndexer[*v1alpha3.DeviceClass] } // NewDeviceClassLister returns a new DeviceClassLister. func NewDeviceClassLister(indexer cache.Indexer) DeviceClassLister { return &deviceClassLister{listers.New[*v1alpha3.DeviceClass](indexer, v1alpha3.Resource("deviceclass"))} } kubernetes-client-go-a2dfcab/listers/resource/v1alpha3/expansion_generated.go000066400000000000000000000035731472614177300277140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha3 // DeviceClassListerExpansion allows custom methods to be added to // DeviceClassLister. type DeviceClassListerExpansion interface{} // PodSchedulingContextListerExpansion allows custom methods to be added to // PodSchedulingContextLister. type PodSchedulingContextListerExpansion interface{} // PodSchedulingContextNamespaceListerExpansion allows custom methods to be added to // PodSchedulingContextNamespaceLister. type PodSchedulingContextNamespaceListerExpansion interface{} // ResourceClaimListerExpansion allows custom methods to be added to // ResourceClaimLister. type ResourceClaimListerExpansion interface{} // ResourceClaimNamespaceListerExpansion allows custom methods to be added to // ResourceClaimNamespaceLister. type ResourceClaimNamespaceListerExpansion interface{} // ResourceClaimTemplateListerExpansion allows custom methods to be added to // ResourceClaimTemplateLister. type ResourceClaimTemplateListerExpansion interface{} // ResourceClaimTemplateNamespaceListerExpansion allows custom methods to be added to // ResourceClaimTemplateNamespaceLister. type ResourceClaimTemplateNamespaceListerExpansion interface{} // ResourceSliceListerExpansion allows custom methods to be added to // ResourceSliceLister. type ResourceSliceListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/resource/v1alpha3/podschedulingcontext.go000066400000000000000000000057411472614177300301260ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha3 import ( v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PodSchedulingContextLister helps list PodSchedulingContexts. // All objects returned here must be treated as read-only. type PodSchedulingContextLister interface { // List lists all PodSchedulingContexts in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha3.PodSchedulingContext, err error) // PodSchedulingContexts returns an object that can list and get PodSchedulingContexts. PodSchedulingContexts(namespace string) PodSchedulingContextNamespaceLister PodSchedulingContextListerExpansion } // podSchedulingContextLister implements the PodSchedulingContextLister interface. type podSchedulingContextLister struct { listers.ResourceIndexer[*v1alpha3.PodSchedulingContext] } // NewPodSchedulingContextLister returns a new PodSchedulingContextLister. func NewPodSchedulingContextLister(indexer cache.Indexer) PodSchedulingContextLister { return &podSchedulingContextLister{listers.New[*v1alpha3.PodSchedulingContext](indexer, v1alpha3.Resource("podschedulingcontext"))} } // PodSchedulingContexts returns an object that can list and get PodSchedulingContexts. func (s *podSchedulingContextLister) PodSchedulingContexts(namespace string) PodSchedulingContextNamespaceLister { return podSchedulingContextNamespaceLister{listers.NewNamespaced[*v1alpha3.PodSchedulingContext](s.ResourceIndexer, namespace)} } // PodSchedulingContextNamespaceLister helps list and get PodSchedulingContexts. // All objects returned here must be treated as read-only. type PodSchedulingContextNamespaceLister interface { // List lists all PodSchedulingContexts in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha3.PodSchedulingContext, err error) // Get retrieves the PodSchedulingContext from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha3.PodSchedulingContext, error) PodSchedulingContextNamespaceListerExpansion } // podSchedulingContextNamespaceLister implements the PodSchedulingContextNamespaceLister // interface. type podSchedulingContextNamespaceLister struct { listers.ResourceIndexer[*v1alpha3.PodSchedulingContext] } kubernetes-client-go-a2dfcab/listers/resource/v1alpha3/resourceclaim.go000066400000000000000000000053111472614177300265170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha3 import ( v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ResourceClaimLister helps list ResourceClaims. // All objects returned here must be treated as read-only. type ResourceClaimLister interface { // List lists all ResourceClaims in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha3.ResourceClaim, err error) // ResourceClaims returns an object that can list and get ResourceClaims. ResourceClaims(namespace string) ResourceClaimNamespaceLister ResourceClaimListerExpansion } // resourceClaimLister implements the ResourceClaimLister interface. type resourceClaimLister struct { listers.ResourceIndexer[*v1alpha3.ResourceClaim] } // NewResourceClaimLister returns a new ResourceClaimLister. func NewResourceClaimLister(indexer cache.Indexer) ResourceClaimLister { return &resourceClaimLister{listers.New[*v1alpha3.ResourceClaim](indexer, v1alpha3.Resource("resourceclaim"))} } // ResourceClaims returns an object that can list and get ResourceClaims. func (s *resourceClaimLister) ResourceClaims(namespace string) ResourceClaimNamespaceLister { return resourceClaimNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClaim](s.ResourceIndexer, namespace)} } // ResourceClaimNamespaceLister helps list and get ResourceClaims. // All objects returned here must be treated as read-only. type ResourceClaimNamespaceLister interface { // List lists all ResourceClaims in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha3.ResourceClaim, err error) // Get retrieves the ResourceClaim from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha3.ResourceClaim, error) ResourceClaimNamespaceListerExpansion } // resourceClaimNamespaceLister implements the ResourceClaimNamespaceLister // interface. type resourceClaimNamespaceLister struct { listers.ResourceIndexer[*v1alpha3.ResourceClaim] } kubernetes-client-go-a2dfcab/listers/resource/v1alpha3/resourceclaimtemplate.go000066400000000000000000000060111472614177300302510ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha3 import ( v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ResourceClaimTemplateLister helps list ResourceClaimTemplates. // All objects returned here must be treated as read-only. type ResourceClaimTemplateLister interface { // List lists all ResourceClaimTemplates in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimTemplate, err error) // ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister ResourceClaimTemplateListerExpansion } // resourceClaimTemplateLister implements the ResourceClaimTemplateLister interface. type resourceClaimTemplateLister struct { listers.ResourceIndexer[*v1alpha3.ResourceClaimTemplate] } // NewResourceClaimTemplateLister returns a new ResourceClaimTemplateLister. func NewResourceClaimTemplateLister(indexer cache.Indexer) ResourceClaimTemplateLister { return &resourceClaimTemplateLister{listers.New[*v1alpha3.ResourceClaimTemplate](indexer, v1alpha3.Resource("resourceclaimtemplate"))} } // ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. func (s *resourceClaimTemplateLister) ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister { return resourceClaimTemplateNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClaimTemplate](s.ResourceIndexer, namespace)} } // ResourceClaimTemplateNamespaceLister helps list and get ResourceClaimTemplates. // All objects returned here must be treated as read-only. type ResourceClaimTemplateNamespaceLister interface { // List lists all ResourceClaimTemplates in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimTemplate, err error) // Get retrieves the ResourceClaimTemplate from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha3.ResourceClaimTemplate, error) ResourceClaimTemplateNamespaceListerExpansion } // resourceClaimTemplateNamespaceLister implements the ResourceClaimTemplateNamespaceLister // interface. type resourceClaimTemplateNamespaceLister struct { listers.ResourceIndexer[*v1alpha3.ResourceClaimTemplate] } kubernetes-client-go-a2dfcab/listers/resource/v1alpha3/resourceslice.go000066400000000000000000000032661472614177300265400ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha3 import ( v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // ResourceSliceLister helps list ResourceSlices. // All objects returned here must be treated as read-only. type ResourceSliceLister interface { // List lists all ResourceSlices in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha3.ResourceSlice, err error) // Get retrieves the ResourceSlice from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha3.ResourceSlice, error) ResourceSliceListerExpansion } // resourceSliceLister implements the ResourceSliceLister interface. type resourceSliceLister struct { listers.ResourceIndexer[*v1alpha3.ResourceSlice] } // NewResourceSliceLister returns a new ResourceSliceLister. func NewResourceSliceLister(indexer cache.Indexer) ResourceSliceLister { return &resourceSliceLister{listers.New[*v1alpha3.ResourceSlice](indexer, v1alpha3.Resource("resourceslice"))} } kubernetes-client-go-a2dfcab/listers/scheduling/000077500000000000000000000000001472614177300222125ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/scheduling/v1/000077500000000000000000000000001472614177300225405ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/scheduling/v1/expansion_generated.go000066400000000000000000000013741472614177300271160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // PriorityClassListerExpansion allows custom methods to be added to // PriorityClassLister. type PriorityClassListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/scheduling/v1/priorityclass.go000066400000000000000000000032121472614177300257740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/scheduling/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PriorityClassLister helps list PriorityClasses. // All objects returned here must be treated as read-only. type PriorityClassLister interface { // List lists all PriorityClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PriorityClass, err error) // Get retrieves the PriorityClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.PriorityClass, error) PriorityClassListerExpansion } // priorityClassLister implements the PriorityClassLister interface. type priorityClassLister struct { listers.ResourceIndexer[*v1.PriorityClass] } // NewPriorityClassLister returns a new PriorityClassLister. func NewPriorityClassLister(indexer cache.Indexer) PriorityClassLister { return &priorityClassLister{listers.New[*v1.PriorityClass](indexer, v1.Resource("priorityclass"))} } kubernetes-client-go-a2dfcab/listers/scheduling/v1alpha1/000077500000000000000000000000001472614177300236275ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/scheduling/v1alpha1/expansion_generated.go000066400000000000000000000014021472614177300301750ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // PriorityClassListerExpansion allows custom methods to be added to // PriorityClassLister. type PriorityClassListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/scheduling/v1alpha1/priorityclass.go000066400000000000000000000032721472614177300270710ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/scheduling/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PriorityClassLister helps list PriorityClasses. // All objects returned here must be treated as read-only. type PriorityClassLister interface { // List lists all PriorityClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.PriorityClass, err error) // Get retrieves the PriorityClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.PriorityClass, error) PriorityClassListerExpansion } // priorityClassLister implements the PriorityClassLister interface. type priorityClassLister struct { listers.ResourceIndexer[*v1alpha1.PriorityClass] } // NewPriorityClassLister returns a new PriorityClassLister. func NewPriorityClassLister(indexer cache.Indexer) PriorityClassLister { return &priorityClassLister{listers.New[*v1alpha1.PriorityClass](indexer, v1alpha1.Resource("priorityclass"))} } kubernetes-client-go-a2dfcab/listers/scheduling/v1beta1/000077500000000000000000000000001472614177300234555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/scheduling/v1beta1/expansion_generated.go000066400000000000000000000014011472614177300300220ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // PriorityClassListerExpansion allows custom methods to be added to // PriorityClassLister. type PriorityClassListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/scheduling/v1beta1/priorityclass.go000066400000000000000000000032621472614177300267160ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/scheduling/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // PriorityClassLister helps list PriorityClasses. // All objects returned here must be treated as read-only. type PriorityClassLister interface { // List lists all PriorityClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.PriorityClass, err error) // Get retrieves the PriorityClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.PriorityClass, error) PriorityClassListerExpansion } // priorityClassLister implements the PriorityClassLister interface. type priorityClassLister struct { listers.ResourceIndexer[*v1beta1.PriorityClass] } // NewPriorityClassLister returns a new PriorityClassLister. func NewPriorityClassLister(indexer cache.Indexer) PriorityClassLister { return &priorityClassLister{listers.New[*v1beta1.PriorityClass](indexer, v1beta1.Resource("priorityclass"))} } kubernetes-client-go-a2dfcab/listers/storage/000077500000000000000000000000001472614177300215315ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/storage/v1/000077500000000000000000000000001472614177300220575ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/storage/v1/csidriver.go000066400000000000000000000030711472614177300244010ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CSIDriverLister helps list CSIDrivers. // All objects returned here must be treated as read-only. type CSIDriverLister interface { // List lists all CSIDrivers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CSIDriver, err error) // Get retrieves the CSIDriver from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.CSIDriver, error) CSIDriverListerExpansion } // cSIDriverLister implements the CSIDriverLister interface. type cSIDriverLister struct { listers.ResourceIndexer[*v1.CSIDriver] } // NewCSIDriverLister returns a new CSIDriverLister. func NewCSIDriverLister(indexer cache.Indexer) CSIDriverLister { return &cSIDriverLister{listers.New[*v1.CSIDriver](indexer, v1.Resource("csidriver"))} } kubernetes-client-go-a2dfcab/listers/storage/v1/csinode.go000066400000000000000000000030231472614177300240300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CSINodeLister helps list CSINodes. // All objects returned here must be treated as read-only. type CSINodeLister interface { // List lists all CSINodes in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CSINode, err error) // Get retrieves the CSINode from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.CSINode, error) CSINodeListerExpansion } // cSINodeLister implements the CSINodeLister interface. type cSINodeLister struct { listers.ResourceIndexer[*v1.CSINode] } // NewCSINodeLister returns a new CSINodeLister. func NewCSINodeLister(indexer cache.Indexer) CSINodeLister { return &cSINodeLister{listers.New[*v1.CSINode](indexer, v1.Resource("csinode"))} } kubernetes-client-go-a2dfcab/listers/storage/v1/csistoragecapacity.go000066400000000000000000000055301472614177300262720ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CSIStorageCapacityLister helps list CSIStorageCapacities. // All objects returned here must be treated as read-only. type CSIStorageCapacityLister interface { // List lists all CSIStorageCapacities in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CSIStorageCapacity, err error) // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister CSIStorageCapacityListerExpansion } // cSIStorageCapacityLister implements the CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { listers.ResourceIndexer[*v1.CSIStorageCapacity] } // NewCSIStorageCapacityLister returns a new CSIStorageCapacityLister. func NewCSIStorageCapacityLister(indexer cache.Indexer) CSIStorageCapacityLister { return &cSIStorageCapacityLister{listers.New[*v1.CSIStorageCapacity](indexer, v1.Resource("csistoragecapacity"))} } // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister { return cSIStorageCapacityNamespaceLister{listers.NewNamespaced[*v1.CSIStorageCapacity](s.ResourceIndexer, namespace)} } // CSIStorageCapacityNamespaceLister helps list and get CSIStorageCapacities. // All objects returned here must be treated as read-only. type CSIStorageCapacityNamespaceLister interface { // List lists all CSIStorageCapacities in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CSIStorageCapacity, err error) // Get retrieves the CSIStorageCapacity from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1.CSIStorageCapacity, error) CSIStorageCapacityNamespaceListerExpansion } // cSIStorageCapacityNamespaceLister implements the CSIStorageCapacityNamespaceLister // interface. type cSIStorageCapacityNamespaceLister struct { listers.ResourceIndexer[*v1.CSIStorageCapacity] } kubernetes-client-go-a2dfcab/listers/storage/v1/expansion_generated.go000066400000000000000000000027311472614177300264330ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 // CSIDriverListerExpansion allows custom methods to be added to // CSIDriverLister. type CSIDriverListerExpansion interface{} // CSINodeListerExpansion allows custom methods to be added to // CSINodeLister. type CSINodeListerExpansion interface{} // CSIStorageCapacityListerExpansion allows custom methods to be added to // CSIStorageCapacityLister. type CSIStorageCapacityListerExpansion interface{} // CSIStorageCapacityNamespaceListerExpansion allows custom methods to be added to // CSIStorageCapacityNamespaceLister. type CSIStorageCapacityNamespaceListerExpansion interface{} // StorageClassListerExpansion allows custom methods to be added to // StorageClassLister. type StorageClassListerExpansion interface{} // VolumeAttachmentListerExpansion allows custom methods to be added to // VolumeAttachmentLister. type VolumeAttachmentListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/storage/v1/storageclass.go000066400000000000000000000031641472614177300251040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // StorageClassLister helps list StorageClasses. // All objects returned here must be treated as read-only. type StorageClassLister interface { // List lists all StorageClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.StorageClass, err error) // Get retrieves the StorageClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.StorageClass, error) StorageClassListerExpansion } // storageClassLister implements the StorageClassLister interface. type storageClassLister struct { listers.ResourceIndexer[*v1.StorageClass] } // NewStorageClassLister returns a new StorageClassLister. func NewStorageClassLister(indexer cache.Indexer) StorageClassLister { return &storageClassLister{listers.New[*v1.StorageClass](indexer, v1.Resource("storageclass"))} } kubernetes-client-go-a2dfcab/listers/storage/v1/volumeattachment.go000066400000000000000000000032761472614177300257760ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // VolumeAttachmentLister helps list VolumeAttachments. // All objects returned here must be treated as read-only. type VolumeAttachmentLister interface { // List lists all VolumeAttachments in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.VolumeAttachment, err error) // Get retrieves the VolumeAttachment from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1.VolumeAttachment, error) VolumeAttachmentListerExpansion } // volumeAttachmentLister implements the VolumeAttachmentLister interface. type volumeAttachmentLister struct { listers.ResourceIndexer[*v1.VolumeAttachment] } // NewVolumeAttachmentLister returns a new VolumeAttachmentLister. func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister { return &volumeAttachmentLister{listers.New[*v1.VolumeAttachment](indexer, v1.Resource("volumeattachment"))} } kubernetes-client-go-a2dfcab/listers/storage/v1alpha1/000077500000000000000000000000001472614177300231465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/storage/v1alpha1/csistoragecapacity.go000066400000000000000000000056321472614177300273640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/storage/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CSIStorageCapacityLister helps list CSIStorageCapacities. // All objects returned here must be treated as read-only. type CSIStorageCapacityLister interface { // List lists all CSIStorageCapacities in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.CSIStorageCapacity, err error) // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister CSIStorageCapacityListerExpansion } // cSIStorageCapacityLister implements the CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { listers.ResourceIndexer[*v1alpha1.CSIStorageCapacity] } // NewCSIStorageCapacityLister returns a new CSIStorageCapacityLister. func NewCSIStorageCapacityLister(indexer cache.Indexer) CSIStorageCapacityLister { return &cSIStorageCapacityLister{listers.New[*v1alpha1.CSIStorageCapacity](indexer, v1alpha1.Resource("csistoragecapacity"))} } // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister { return cSIStorageCapacityNamespaceLister{listers.NewNamespaced[*v1alpha1.CSIStorageCapacity](s.ResourceIndexer, namespace)} } // CSIStorageCapacityNamespaceLister helps list and get CSIStorageCapacities. // All objects returned here must be treated as read-only. type CSIStorageCapacityNamespaceLister interface { // List lists all CSIStorageCapacities in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.CSIStorageCapacity, err error) // Get retrieves the CSIStorageCapacity from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.CSIStorageCapacity, error) CSIStorageCapacityNamespaceListerExpansion } // cSIStorageCapacityNamespaceLister implements the CSIStorageCapacityNamespaceLister // interface. type cSIStorageCapacityNamespaceLister struct { listers.ResourceIndexer[*v1alpha1.CSIStorageCapacity] } kubernetes-client-go-a2dfcab/listers/storage/v1alpha1/expansion_generated.go000066400000000000000000000024001472614177300275130ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // CSIStorageCapacityListerExpansion allows custom methods to be added to // CSIStorageCapacityLister. type CSIStorageCapacityListerExpansion interface{} // CSIStorageCapacityNamespaceListerExpansion allows custom methods to be added to // CSIStorageCapacityNamespaceLister. type CSIStorageCapacityNamespaceListerExpansion interface{} // VolumeAttachmentListerExpansion allows custom methods to be added to // VolumeAttachmentLister. type VolumeAttachmentListerExpansion interface{} // VolumeAttributesClassListerExpansion allows custom methods to be added to // VolumeAttributesClassLister. type VolumeAttributesClassListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/storage/v1alpha1/volumeattachment.go000066400000000000000000000033561472614177300270640ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/storage/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // VolumeAttachmentLister helps list VolumeAttachments. // All objects returned here must be treated as read-only. type VolumeAttachmentLister interface { // List lists all VolumeAttachments in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.VolumeAttachment, err error) // Get retrieves the VolumeAttachment from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.VolumeAttachment, error) VolumeAttachmentListerExpansion } // volumeAttachmentLister implements the VolumeAttachmentLister interface. type volumeAttachmentLister struct { listers.ResourceIndexer[*v1alpha1.VolumeAttachment] } // NewVolumeAttachmentLister returns a new VolumeAttachmentLister. func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister { return &volumeAttachmentLister{listers.New[*v1alpha1.VolumeAttachment](indexer, v1alpha1.Resource("volumeattachment"))} } kubernetes-client-go-a2dfcab/listers/storage/v1alpha1/volumeattributesclass.go000066400000000000000000000035171472614177300301470ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/storage/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // VolumeAttributesClassLister helps list VolumeAttributesClasses. // All objects returned here must be treated as read-only. type VolumeAttributesClassLister interface { // List lists all VolumeAttributesClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.VolumeAttributesClass, err error) // Get retrieves the VolumeAttributesClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.VolumeAttributesClass, error) VolumeAttributesClassListerExpansion } // volumeAttributesClassLister implements the VolumeAttributesClassLister interface. type volumeAttributesClassLister struct { listers.ResourceIndexer[*v1alpha1.VolumeAttributesClass] } // NewVolumeAttributesClassLister returns a new VolumeAttributesClassLister. func NewVolumeAttributesClassLister(indexer cache.Indexer) VolumeAttributesClassLister { return &volumeAttributesClassLister{listers.New[*v1alpha1.VolumeAttributesClass](indexer, v1alpha1.Resource("volumeattributesclass"))} } kubernetes-client-go-a2dfcab/listers/storage/v1beta1/000077500000000000000000000000001472614177300227745ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/storage/v1beta1/csidriver.go000066400000000000000000000031411472614177300253140ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CSIDriverLister helps list CSIDrivers. // All objects returned here must be treated as read-only. type CSIDriverLister interface { // List lists all CSIDrivers in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.CSIDriver, err error) // Get retrieves the CSIDriver from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.CSIDriver, error) CSIDriverListerExpansion } // cSIDriverLister implements the CSIDriverLister interface. type cSIDriverLister struct { listers.ResourceIndexer[*v1beta1.CSIDriver] } // NewCSIDriverLister returns a new CSIDriverLister. func NewCSIDriverLister(indexer cache.Indexer) CSIDriverLister { return &cSIDriverLister{listers.New[*v1beta1.CSIDriver](indexer, v1beta1.Resource("csidriver"))} } kubernetes-client-go-a2dfcab/listers/storage/v1beta1/csinode.go000066400000000000000000000030731472614177300247520ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CSINodeLister helps list CSINodes. // All objects returned here must be treated as read-only. type CSINodeLister interface { // List lists all CSINodes in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.CSINode, err error) // Get retrieves the CSINode from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.CSINode, error) CSINodeListerExpansion } // cSINodeLister implements the CSINodeLister interface. type cSINodeLister struct { listers.ResourceIndexer[*v1beta1.CSINode] } // NewCSINodeLister returns a new CSINodeLister. func NewCSINodeLister(indexer cache.Indexer) CSINodeLister { return &cSINodeLister{listers.New[*v1beta1.CSINode](indexer, v1beta1.Resource("csinode"))} } kubernetes-client-go-a2dfcab/listers/storage/v1beta1/csistoragecapacity.go000066400000000000000000000056171472614177300272150ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // CSIStorageCapacityLister helps list CSIStorageCapacities. // All objects returned here must be treated as read-only. type CSIStorageCapacityLister interface { // List lists all CSIStorageCapacities in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.CSIStorageCapacity, err error) // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister CSIStorageCapacityListerExpansion } // cSIStorageCapacityLister implements the CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { listers.ResourceIndexer[*v1beta1.CSIStorageCapacity] } // NewCSIStorageCapacityLister returns a new CSIStorageCapacityLister. func NewCSIStorageCapacityLister(indexer cache.Indexer) CSIStorageCapacityLister { return &cSIStorageCapacityLister{listers.New[*v1beta1.CSIStorageCapacity](indexer, v1beta1.Resource("csistoragecapacity"))} } // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister { return cSIStorageCapacityNamespaceLister{listers.NewNamespaced[*v1beta1.CSIStorageCapacity](s.ResourceIndexer, namespace)} } // CSIStorageCapacityNamespaceLister helps list and get CSIStorageCapacities. // All objects returned here must be treated as read-only. type CSIStorageCapacityNamespaceLister interface { // List lists all CSIStorageCapacities in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.CSIStorageCapacity, err error) // Get retrieves the CSIStorageCapacity from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.CSIStorageCapacity, error) CSIStorageCapacityNamespaceListerExpansion } // cSIStorageCapacityNamespaceLister implements the CSIStorageCapacityNamespaceLister // interface. type cSIStorageCapacityNamespaceLister struct { listers.ResourceIndexer[*v1beta1.CSIStorageCapacity] } kubernetes-client-go-a2dfcab/listers/storage/v1beta1/expansion_generated.go000066400000000000000000000032021472614177300273420ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 // CSIDriverListerExpansion allows custom methods to be added to // CSIDriverLister. type CSIDriverListerExpansion interface{} // CSINodeListerExpansion allows custom methods to be added to // CSINodeLister. type CSINodeListerExpansion interface{} // CSIStorageCapacityListerExpansion allows custom methods to be added to // CSIStorageCapacityLister. type CSIStorageCapacityListerExpansion interface{} // CSIStorageCapacityNamespaceListerExpansion allows custom methods to be added to // CSIStorageCapacityNamespaceLister. type CSIStorageCapacityNamespaceListerExpansion interface{} // StorageClassListerExpansion allows custom methods to be added to // StorageClassLister. type StorageClassListerExpansion interface{} // VolumeAttachmentListerExpansion allows custom methods to be added to // VolumeAttachmentLister. type VolumeAttachmentListerExpansion interface{} // VolumeAttributesClassListerExpansion allows custom methods to be added to // VolumeAttributesClassLister. type VolumeAttributesClassListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/storage/v1beta1/storageclass.go000066400000000000000000000032341472614177300260170ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // StorageClassLister helps list StorageClasses. // All objects returned here must be treated as read-only. type StorageClassLister interface { // List lists all StorageClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.StorageClass, err error) // Get retrieves the StorageClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.StorageClass, error) StorageClassListerExpansion } // storageClassLister implements the StorageClassLister interface. type storageClassLister struct { listers.ResourceIndexer[*v1beta1.StorageClass] } // NewStorageClassLister returns a new StorageClassLister. func NewStorageClassLister(indexer cache.Indexer) StorageClassLister { return &storageClassLister{listers.New[*v1beta1.StorageClass](indexer, v1beta1.Resource("storageclass"))} } kubernetes-client-go-a2dfcab/listers/storage/v1beta1/volumeattachment.go000066400000000000000000000033461472614177300267110ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // VolumeAttachmentLister helps list VolumeAttachments. // All objects returned here must be treated as read-only. type VolumeAttachmentLister interface { // List lists all VolumeAttachments in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.VolumeAttachment, err error) // Get retrieves the VolumeAttachment from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.VolumeAttachment, error) VolumeAttachmentListerExpansion } // volumeAttachmentLister implements the VolumeAttachmentLister interface. type volumeAttachmentLister struct { listers.ResourceIndexer[*v1beta1.VolumeAttachment] } // NewVolumeAttachmentLister returns a new VolumeAttachmentLister. func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister { return &volumeAttachmentLister{listers.New[*v1beta1.VolumeAttachment](indexer, v1beta1.Resource("volumeattachment"))} } kubernetes-client-go-a2dfcab/listers/storage/v1beta1/volumeattributesclass.go000066400000000000000000000035071472614177300277740ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // VolumeAttributesClassLister helps list VolumeAttributesClasses. // All objects returned here must be treated as read-only. type VolumeAttributesClassLister interface { // List lists all VolumeAttributesClasses in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1beta1.VolumeAttributesClass, err error) // Get retrieves the VolumeAttributesClass from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1beta1.VolumeAttributesClass, error) VolumeAttributesClassListerExpansion } // volumeAttributesClassLister implements the VolumeAttributesClassLister interface. type volumeAttributesClassLister struct { listers.ResourceIndexer[*v1beta1.VolumeAttributesClass] } // NewVolumeAttributesClassLister returns a new VolumeAttributesClassLister. func NewVolumeAttributesClassLister(indexer cache.Indexer) VolumeAttributesClassLister { return &volumeAttributesClassLister{listers.New[*v1beta1.VolumeAttributesClass](indexer, v1beta1.Resource("volumeattributesclass"))} } kubernetes-client-go-a2dfcab/listers/storagemigration/000077500000000000000000000000001472614177300234435ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/storagemigration/v1alpha1/000077500000000000000000000000001472614177300250605ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/listers/storagemigration/v1alpha1/expansion_generated.go000066400000000000000000000014401472614177300314300ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 // StorageVersionMigrationListerExpansion allows custom methods to be added to // StorageVersionMigrationLister. type StorageVersionMigrationListerExpansion interface{} kubernetes-client-go-a2dfcab/listers/storagemigration/v1alpha1/storageversionmigration.go000066400000000000000000000035741472614177300324040ustar00rootroot00000000000000/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "k8s.io/api/storagemigration/v1alpha1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) // StorageVersionMigrationLister helps list StorageVersionMigrations. // All objects returned here must be treated as read-only. type StorageVersionMigrationLister interface { // List lists all StorageVersionMigrations in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.StorageVersionMigration, err error) // Get retrieves the StorageVersionMigration from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.StorageVersionMigration, error) StorageVersionMigrationListerExpansion } // storageVersionMigrationLister implements the StorageVersionMigrationLister interface. type storageVersionMigrationLister struct { listers.ResourceIndexer[*v1alpha1.StorageVersionMigration] } // NewStorageVersionMigrationLister returns a new StorageVersionMigrationLister. func NewStorageVersionMigrationLister(indexer cache.Indexer) StorageVersionMigrationLister { return &storageVersionMigrationLister{listers.New[*v1alpha1.StorageVersionMigration](indexer, v1alpha1.Resource("storageversionmigration"))} } kubernetes-client-go-a2dfcab/metadata/000077500000000000000000000000001472614177300201605ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/metadata/fake/000077500000000000000000000000001472614177300210665ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/metadata/fake/simple.go000066400000000000000000000336501472614177300227150ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" "fmt" "strings" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/metadata" "k8s.io/client-go/testing" ) // MetadataClient assists in creating fake objects for use when testing, since metadata.Getter // does not expose create type MetadataClient interface { metadata.Getter CreateFake(obj *metav1.PartialObjectMetadata, opts metav1.CreateOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) UpdateFake(obj *metav1.PartialObjectMetadata, opts metav1.UpdateOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) } // NewTestScheme creates a unique Scheme for each test. func NewTestScheme() *runtime.Scheme { return runtime.NewScheme() } // NewSimpleMetadataClient creates a new client that will use the provided scheme and respond with the // provided objects when requests are made. It will track actions made to the client which can be checked // with GetActions(). func NewSimpleMetadataClient(scheme *runtime.Scheme, objects ...runtime.Object) *FakeMetadataClient { gvkFakeList := schema.GroupVersionKind{Group: "fake-metadata-client-group", Version: "v1", Kind: "List"} if !scheme.Recognizes(gvkFakeList) { // In order to use List with this client, you have to have the v1.List registered in your scheme, since this is a test // type we modify the input scheme scheme.AddKnownTypeWithName(gvkFakeList, &metav1.List{}) } codecs := serializer.NewCodecFactory(scheme) o := testing.NewObjectTracker(scheme, codecs.UniversalDeserializer()) for _, obj := range objects { if err := o.Add(obj); err != nil { panic(err) } } cs := &FakeMetadataClient{scheme: scheme, tracker: o} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { gvr := action.GetResource() ns := action.GetNamespace() watch, err := o.Watch(gvr, ns) if err != nil { return false, nil, err } return true, watch, nil }) return cs } // FakeMetadataClient implements clientset.Interface. Meant to be embedded into a // struct to get a default implementation. This makes faking out just the method // you want to test easier. type FakeMetadataClient struct { testing.Fake scheme *runtime.Scheme tracker testing.ObjectTracker } type metadataResourceClient struct { client *FakeMetadataClient namespace string resource schema.GroupVersionResource } var ( _ metadata.Interface = &FakeMetadataClient{} _ testing.FakeClient = &FakeMetadataClient{} ) func (c *FakeMetadataClient) Tracker() testing.ObjectTracker { return c.tracker } // Resource returns an interface for accessing the provided resource. func (c *FakeMetadataClient) Resource(resource schema.GroupVersionResource) metadata.Getter { return &metadataResourceClient{client: c, resource: resource} } // Namespace returns an interface for accessing the current resource in the specified // namespace. func (c *metadataResourceClient) Namespace(ns string) metadata.ResourceInterface { ret := *c ret.namespace = ns return &ret } // CreateFake records the object creation and processes it via the reactor. func (c *metadataResourceClient) CreateFake(obj *metav1.PartialObjectMetadata, opts metav1.CreateOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootCreateAction(c.resource, obj), obj) case len(c.namespace) == 0 && len(subresources) > 0: var accessor metav1.Object // avoid shadowing err accessor, err = meta.Accessor(obj) if err != nil { return nil, err } name := accessor.GetName() uncastRet, err = c.client.Fake. Invokes(testing.NewRootCreateSubresourceAction(c.resource, name, strings.Join(subresources, "/"), obj), obj) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewCreateAction(c.resource, c.namespace, obj), obj) case len(c.namespace) > 0 && len(subresources) > 0: var accessor metav1.Object // avoid shadowing err accessor, err = meta.Accessor(obj) if err != nil { return nil, err } name := accessor.GetName() uncastRet, err = c.client.Fake. Invokes(testing.NewCreateSubresourceAction(c.resource, name, strings.Join(subresources, "/"), c.namespace, obj), obj) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret, ok := uncastRet.(*metav1.PartialObjectMetadata) if !ok { return nil, fmt.Errorf("unexpected return value type %T", uncastRet) } return ret, err } // UpdateFake records the object update and processes it via the reactor. func (c *metadataResourceClient) UpdateFake(obj *metav1.PartialObjectMetadata, opts metav1.UpdateOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootUpdateAction(c.resource, obj), obj) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootUpdateSubresourceAction(c.resource, strings.Join(subresources, "/"), obj), obj) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewUpdateAction(c.resource, c.namespace, obj), obj) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewUpdateSubresourceAction(c.resource, strings.Join(subresources, "/"), c.namespace, obj), obj) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret, ok := uncastRet.(*metav1.PartialObjectMetadata) if !ok { return nil, fmt.Errorf("unexpected return value type %T", uncastRet) } return ret, err } // UpdateStatus records the object status update and processes it via the reactor. func (c *metadataResourceClient) UpdateStatus(obj *metav1.PartialObjectMetadata, opts metav1.UpdateOptions) (*metav1.PartialObjectMetadata, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootUpdateSubresourceAction(c.resource, "status", obj), obj) case len(c.namespace) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewUpdateSubresourceAction(c.resource, "status", c.namespace, obj), obj) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret, ok := uncastRet.(*metav1.PartialObjectMetadata) if !ok { return nil, fmt.Errorf("unexpected return value type %T", uncastRet) } return ret, err } // Delete records the object deletion and processes it via the reactor. func (c *metadataResourceClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error { var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: _, err = c.client.Fake. Invokes(testing.NewRootDeleteAction(c.resource, name), &metav1.Status{Status: "metadata delete fail"}) case len(c.namespace) == 0 && len(subresources) > 0: _, err = c.client.Fake. Invokes(testing.NewRootDeleteSubresourceAction(c.resource, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata delete fail"}) case len(c.namespace) > 0 && len(subresources) == 0: _, err = c.client.Fake. Invokes(testing.NewDeleteAction(c.resource, c.namespace, name), &metav1.Status{Status: "metadata delete fail"}) case len(c.namespace) > 0 && len(subresources) > 0: _, err = c.client.Fake. Invokes(testing.NewDeleteSubresourceAction(c.resource, strings.Join(subresources, "/"), c.namespace, name), &metav1.Status{Status: "metadata delete fail"}) } return err } // DeleteCollection records the object collection deletion and processes it via the reactor. func (c *metadataResourceClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOptions metav1.ListOptions) error { var err error switch { case len(c.namespace) == 0: action := testing.NewRootDeleteCollectionAction(c.resource, listOptions) _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "metadata deletecollection fail"}) case len(c.namespace) > 0: action := testing.NewDeleteCollectionAction(c.resource, c.namespace, listOptions) _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "metadata deletecollection fail"}) } return err } // Get records the object retrieval and processes it via the reactor. func (c *metadataResourceClient) Get(ctx context.Context, name string, opts metav1.GetOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootGetAction(c.resource, name), &metav1.Status{Status: "metadata get fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootGetSubresourceAction(c.resource, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata get fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewGetAction(c.resource, c.namespace, name), &metav1.Status{Status: "metadata get fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewGetSubresourceAction(c.resource, c.namespace, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata get fail"}) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret, ok := uncastRet.(*metav1.PartialObjectMetadata) if !ok { return nil, fmt.Errorf("unexpected return value type %T", uncastRet) } return ret, err } // List records the object deletion and processes it via the reactor. func (c *metadataResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*metav1.PartialObjectMetadataList, error) { var obj runtime.Object var err error switch { case len(c.namespace) == 0: obj, err = c.client.Fake. Invokes(testing.NewRootListAction(c.resource, schema.GroupVersionKind{Group: "fake-metadata-client-group", Version: "v1", Kind: "" /*List is appended by the tracker automatically*/}, opts), &metav1.Status{Status: "metadata list fail"}) case len(c.namespace) > 0: obj, err = c.client.Fake. Invokes(testing.NewListAction(c.resource, schema.GroupVersionKind{Group: "fake-metadata-client-group", Version: "v1", Kind: "" /*List is appended by the tracker automatically*/}, c.namespace, opts), &metav1.Status{Status: "metadata list fail"}) } if obj == nil { return nil, err } label, _, _ := testing.ExtractFromListOptions(opts) if label == nil { label = labels.Everything() } inputList, ok := obj.(*metav1.List) if !ok { return nil, fmt.Errorf("incoming object is incorrect type %T", obj) } list := &metav1.PartialObjectMetadataList{ ListMeta: inputList.ListMeta, } for i := range inputList.Items { item, ok := inputList.Items[i].Object.(*metav1.PartialObjectMetadata) if !ok { return nil, fmt.Errorf("item %d in list %T is %T", i, inputList, inputList.Items[i].Object) } metadata, err := meta.Accessor(item) if err != nil { return nil, err } if label.Matches(labels.Set(metadata.GetLabels())) { list.Items = append(list.Items, *item) } } return list, nil } func (c *metadataResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { switch { case len(c.namespace) == 0: return c.client.Fake. InvokesWatch(testing.NewRootWatchAction(c.resource, opts)) case len(c.namespace) > 0: return c.client.Fake. InvokesWatch(testing.NewWatchAction(c.resource, c.namespace, opts)) } panic("math broke") } // Patch records the object patch and processes it via the reactor. func (c *metadataResourceClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) { var uncastRet runtime.Object var err error switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootPatchAction(c.resource, name, pt, data), &metav1.Status{Status: "metadata patch fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewRootPatchSubresourceAction(c.resource, name, pt, data, subresources...), &metav1.Status{Status: "metadata patch fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. Invokes(testing.NewPatchAction(c.resource, c.namespace, name, pt, data), &metav1.Status{Status: "metadata patch fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. Invokes(testing.NewPatchSubresourceAction(c.resource, c.namespace, name, pt, data, subresources...), &metav1.Status{Status: "metadata patch fail"}) } if err != nil { return nil, err } if uncastRet == nil { return nil, err } ret, ok := uncastRet.(*metav1.PartialObjectMetadata) if !ok { return nil, fmt.Errorf("unexpected return value type %T", uncastRet) } return ret, err } kubernetes-client-go-a2dfcab/metadata/fake/simple_test.go000066400000000000000000000163621472614177300237550ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "context" "fmt" "testing" "github.com/google/go-cmp/cmp" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" ) const ( testGroup = "testgroup" testVersion = "testversion" testResource = "testkinds" testNamespace = "testns" testName = "testname" testKind = "TestKind" testAPIVersion = "testgroup/testversion" ) func newPartialObjectMetadata(apiVersion, kind, namespace, name string) *metav1.PartialObjectMetadata { return &metav1.PartialObjectMetadata{ TypeMeta: metav1.TypeMeta{ APIVersion: apiVersion, Kind: kind, }, ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, Name: name, }, } } func newPartialObjectMetadataWithAnnotations(annotations map[string]string) *metav1.PartialObjectMetadata { u := newPartialObjectMetadata(testAPIVersion, testKind, testNamespace, testName) u.Annotations = annotations return u } func TestList(t *testing.T) { scheme := NewTestScheme() metav1.AddMetaToScheme(scheme) client := NewSimpleMetadataClient(scheme, newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group2/version", "TheKind", "ns-foo", "name2-foo"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-bar"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-baz"), newPartialObjectMetadata("group2/version", "TheKind", "ns-foo", "name2-baz"), ) listFirst, err := client.Resource(schema.GroupVersionResource{Group: "group", Version: "version", Resource: "thekinds"}).List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Fatal(err) } expected := []metav1.PartialObjectMetadata{ *newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-bar"), *newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-baz"), *newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), } if !equality.Semantic.DeepEqual(listFirst.Items, expected) { t.Fatal(cmp.Diff(expected, listFirst.Items)) } } type patchTestCase struct { name string object runtime.Object patchType types.PatchType patchBytes []byte wantErrMsg string expectedPatchedObject runtime.Object } func (tc *patchTestCase) runner(t *testing.T) { scheme := NewTestScheme() metav1.AddMetaToScheme(scheme) client := NewSimpleMetadataClient(scheme, tc.object) resourceInterface := client.Resource(schema.GroupVersionResource{Group: testGroup, Version: testVersion, Resource: testResource}).Namespace(testNamespace) got, recErr := resourceInterface.Patch(context.TODO(), testName, tc.patchType, tc.patchBytes, metav1.PatchOptions{}) if err := tc.verifyErr(recErr); err != nil { t.Error(err) } if err := tc.verifyResult(got); err != nil { t.Error(err) } } // verifyErr verifies that the given error returned from Patch is the error // expected by the test case. func (tc *patchTestCase) verifyErr(err error) error { if tc.wantErrMsg != "" && err == nil { return fmt.Errorf("want error, got nil") } if tc.wantErrMsg == "" && err != nil { return fmt.Errorf("want no error, got %v", err) } if err != nil { if want, got := tc.wantErrMsg, err.Error(); want != got { return fmt.Errorf("incorrect error: want: %q got: %q", want, got) } } return nil } func (tc *patchTestCase) verifyResult(result *metav1.PartialObjectMetadata) error { if tc.expectedPatchedObject == nil && result == nil { return nil } if !equality.Semantic.DeepEqual(result, tc.expectedPatchedObject) { return fmt.Errorf("unexpected diff in received object: %s", cmp.Diff(tc.expectedPatchedObject, result)) } return nil } func TestPatch(t *testing.T) { testCases := []patchTestCase{ { name: "jsonpatch fails with merge type", object: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar"}), patchType: types.StrategicMergePatchType, patchBytes: []byte(`[]`), wantErrMsg: "invalid JSON document", }, { name: "jsonpatch works with empty patch", object: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar"}), patchType: types.JSONPatchType, // No-op patchBytes: []byte(`[]`), expectedPatchedObject: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar"}), }, { name: "jsonpatch works with simple change patch", object: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar"}), patchType: types.JSONPatchType, // change spec.foo from bar to foobar patchBytes: []byte(`[{"op": "replace", "path": "/metadata/annotations/foo", "value": "foobar"}]`), expectedPatchedObject: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "foobar"}), }, { name: "jsonpatch works with simple addition", object: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar"}), patchType: types.JSONPatchType, // add spec.newvalue = dummy patchBytes: []byte(`[{"op": "add", "path": "/metadata/annotations/newvalue", "value": "dummy"}]`), expectedPatchedObject: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar", "newvalue": "dummy"}), }, { name: "jsonpatch works with simple deletion", object: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar", "toremove": "shouldnotbehere"}), patchType: types.JSONPatchType, // remove spec.newvalue = dummy patchBytes: []byte(`[{"op": "remove", "path": "/metadata/annotations/toremove"}]`), expectedPatchedObject: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar"}), }, { name: "strategic merge patch fails with JSONPatch", object: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar"}), patchType: types.StrategicMergePatchType, // add spec.newvalue = dummy patchBytes: []byte(`[{"op": "add", "path": "/metadata/annotations/newvalue", "value": "dummy"}]`), wantErrMsg: "invalid JSON document", }, { name: "merge patch works with simple replacement", object: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "bar"}), patchType: types.MergePatchType, patchBytes: []byte(`{ "metadata": {"annotations": { "foo": "baz" } } }`), expectedPatchedObject: newPartialObjectMetadataWithAnnotations(map[string]string{"foo": "baz"}), }, // TODO: Add tests for strategic merge using v1.Pod for example to ensure the test cases // demonstrate expected use cases. } for _, tc := range testCases { t.Run(tc.name, tc.runner) } } kubernetes-client-go-a2dfcab/metadata/interface.go000066400000000000000000000040341472614177300224500ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadata import ( "context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" ) // Interface allows a caller to get the metadata (in the form of PartialObjectMetadata objects) // from any Kubernetes compatible resource API. type Interface interface { Resource(resource schema.GroupVersionResource) Getter } // ResourceInterface contains the set of methods that may be invoked on objects by their metadata. // Update is not supported by the server, but Patch can be used for the actions Update would handle. type ResourceInterface interface { Delete(ctx context.Context, name string, options metav1.DeleteOptions, subresources ...string) error DeleteCollection(ctx context.Context, options metav1.DeleteOptions, listOptions metav1.ListOptions) error Get(ctx context.Context, name string, options metav1.GetOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) List(ctx context.Context, opts metav1.ListOptions) (*metav1.PartialObjectMetadataList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) } // Getter handles both namespaced and non-namespaced resource types consistently. type Getter interface { Namespace(string) ResourceInterface ResourceInterface } kubernetes-client-go-a2dfcab/metadata/metadata.go000066400000000000000000000272021472614177300222720ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadata import ( "context" "encoding/json" "fmt" "net/http" "time" "k8s.io/klog/v2" metainternalversionscheme "k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/rest" ) var deleteScheme = runtime.NewScheme() var parameterScheme = runtime.NewScheme() var deleteOptionsCodec = serializer.NewCodecFactory(deleteScheme) var dynamicParameterCodec = runtime.NewParameterCodec(parameterScheme) var versionV1 = schema.GroupVersion{Version: "v1"} func init() { metav1.AddToGroupVersion(parameterScheme, versionV1) metav1.AddToGroupVersion(deleteScheme, versionV1) } // Client allows callers to retrieve the object metadata for any // Kubernetes-compatible API endpoint. The client uses the // meta.k8s.io/v1 PartialObjectMetadata resource to more efficiently // retrieve just the necessary metadata, but on older servers // (Kubernetes 1.14 and before) will retrieve the object and then // convert the metadata. type Client struct { client *rest.RESTClient } var _ Interface = &Client{} // ConfigFor returns a copy of the provided config with the // appropriate metadata client defaults set. func ConfigFor(inConfig *rest.Config) *rest.Config { config := rest.CopyConfig(inConfig) config.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json" config.ContentType = "application/vnd.kubernetes.protobuf" config.NegotiatedSerializer = metainternalversionscheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return config } // NewForConfigOrDie creates a new metadata client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) Interface { ret, err := NewForConfig(c) if err != nil { panic(err) } return ret } // NewForConfig creates a new metadata client that can retrieve object // metadata details about any Kubernetes object (core, aggregated, or custom // resource based) in the form of PartialObjectMetadata objects, or returns // an error. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(inConfig *rest.Config) (Interface, error) { config := ConfigFor(inConfig) httpClient, err := rest.HTTPClientFor(config) if err != nil { return nil, err } return NewForConfigAndClient(config, httpClient) } // NewForConfigAndClient creates a new metadata client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(inConfig *rest.Config, h *http.Client) (Interface, error) { config := ConfigFor(inConfig) // for serializing the options config.GroupVersion = &schema.GroupVersion{} config.APIPath = "/this-value-should-never-be-sent" restClient, err := rest.RESTClientForConfigAndClient(config, h) if err != nil { return nil, err } return &Client{client: restClient}, nil } type client struct { client *Client namespace string resource schema.GroupVersionResource } // Resource returns an interface that can access cluster or namespace // scoped instances of resource. func (c *Client) Resource(resource schema.GroupVersionResource) Getter { return &client{client: c, resource: resource} } // Namespace returns an interface that can access namespace-scoped instances of the // provided resource. func (c *client) Namespace(ns string) ResourceInterface { ret := *c ret.namespace = ns return &ret } // Delete removes the provided resource from the server. func (c *client) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error { if len(name) == 0 { return fmt.Errorf("name is required") } // if DeleteOptions are delivered to Negotiator for serialization, // HTTP-Request header will bring "Content-Type: application/vnd.kubernetes.protobuf" // apiextensions-apiserver uses unstructuredNegotiatedSerializer to decode the input, // server-side will reply with 406 errors. // The special treatment here is to be compatible with CRD Handler // see: https://github.com/kubernetes/kubernetes/blob/1a845ccd076bbf1b03420fe694c85a5cd3bd6bed/staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go#L843 deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts) if err != nil { return err } result := c.client.client. Delete(). AbsPath(append(c.makeURLSegments(name), subresources...)...). SetHeader("Content-Type", runtime.ContentTypeJSON). Body(deleteOptionsByte). Do(ctx) return result.Error() } // DeleteCollection triggers deletion of all resources in the specified scope (namespace or cluster). func (c *client) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOptions metav1.ListOptions) error { // See comment on Delete deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts) if err != nil { return err } result := c.client.client. Delete(). AbsPath(c.makeURLSegments("")...). SetHeader("Content-Type", runtime.ContentTypeJSON). Body(deleteOptionsByte). SpecificallyVersionedParams(&listOptions, dynamicParameterCodec, versionV1). Do(ctx) return result.Error() } // Get returns the resource with name from the specified scope (namespace or cluster). func (c *client) Get(ctx context.Context, name string, opts metav1.GetOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) { if len(name) == 0 { return nil, fmt.Errorf("name is required") } result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...). SetHeader("Accept", "application/vnd.kubernetes.protobuf;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json"). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } obj, err := result.Get() if runtime.IsNotRegisteredError(err) { klog.FromContext(ctx).V(5).Info("Could not retrieve PartialObjectMetadata", "err", err) rawBytes, err := result.Raw() if err != nil { return nil, err } var partial metav1.PartialObjectMetadata if err := json.Unmarshal(rawBytes, &partial); err != nil { return nil, fmt.Errorf("unable to decode returned object as PartialObjectMetadata: %v", err) } if !isLikelyObjectMetadata(&partial) { return nil, fmt.Errorf("object does not appear to match the ObjectMeta schema: %#v", partial) } partial.TypeMeta = metav1.TypeMeta{} return &partial, nil } if err != nil { return nil, err } partial, ok := obj.(*metav1.PartialObjectMetadata) if !ok { return nil, fmt.Errorf("unexpected object, expected PartialObjectMetadata but got %T", obj) } return partial, nil } // List returns all resources within the specified scope (namespace or cluster). func (c *client) List(ctx context.Context, opts metav1.ListOptions) (*metav1.PartialObjectMetadataList, error) { result := c.client.client.Get().AbsPath(c.makeURLSegments("")...). SetHeader("Accept", "application/vnd.kubernetes.protobuf;as=PartialObjectMetadataList;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadataList;g=meta.k8s.io;v=v1,application/json"). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } obj, err := result.Get() if runtime.IsNotRegisteredError(err) { klog.FromContext(ctx).V(5).Info("Could not retrieve PartialObjectMetadataList", "err", err) rawBytes, err := result.Raw() if err != nil { return nil, err } var partial metav1.PartialObjectMetadataList if err := json.Unmarshal(rawBytes, &partial); err != nil { return nil, fmt.Errorf("unable to decode returned object as PartialObjectMetadataList: %v", err) } partial.TypeMeta = metav1.TypeMeta{} return &partial, nil } if err != nil { return nil, err } partial, ok := obj.(*metav1.PartialObjectMetadataList) if !ok { return nil, fmt.Errorf("unexpected object, expected PartialObjectMetadata but got %T", obj) } return partial, nil } // Watch finds all changes to the resources in the specified scope (namespace or cluster). func (c *client) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } opts.Watch = true return c.client.client.Get(). AbsPath(c.makeURLSegments("")...). SetHeader("Accept", "application/vnd.kubernetes.protobuf;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json"). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Timeout(timeout). Watch(ctx) } // Patch modifies the named resource in the specified scope (namespace or cluster). func (c *client) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*metav1.PartialObjectMetadata, error) { if len(name) == 0 { return nil, fmt.Errorf("name is required") } result := c.client.client. Patch(pt). AbsPath(append(c.makeURLSegments(name), subresources...)...). Body(data). SetHeader("Accept", "application/vnd.kubernetes.protobuf;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json"). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } obj, err := result.Get() if runtime.IsNotRegisteredError(err) { rawBytes, err := result.Raw() if err != nil { return nil, err } var partial metav1.PartialObjectMetadata if err := json.Unmarshal(rawBytes, &partial); err != nil { return nil, fmt.Errorf("unable to decode returned object as PartialObjectMetadata: %v", err) } if !isLikelyObjectMetadata(&partial) { return nil, fmt.Errorf("object does not appear to match the ObjectMeta schema") } partial.TypeMeta = metav1.TypeMeta{} return &partial, nil } if err != nil { return nil, err } partial, ok := obj.(*metav1.PartialObjectMetadata) if !ok { return nil, fmt.Errorf("unexpected object, expected PartialObjectMetadata but got %T", obj) } return partial, nil } func (c *client) makeURLSegments(name string) []string { url := []string{} if len(c.resource.Group) == 0 { url = append(url, "api") } else { url = append(url, "apis", c.resource.Group) } url = append(url, c.resource.Version) if len(c.namespace) > 0 { url = append(url, "namespaces", c.namespace) } url = append(url, c.resource.Resource) if len(name) > 0 { url = append(url, name) } return url } func isLikelyObjectMetadata(meta *metav1.PartialObjectMetadata) bool { return len(meta.UID) > 0 || !meta.CreationTimestamp.IsZero() || len(meta.Name) > 0 || len(meta.GenerateName) > 0 } kubernetes-client-go-a2dfcab/metadata/metadata_test.go000066400000000000000000000224621472614177300233340ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadata import ( "context" "encoding/json" "io" "net/http" "net/http/httptest" "reflect" "strings" "testing" "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/rest" "k8s.io/klog/v2/ktesting" ) func TestClient(t *testing.T) { gvr := schema.GroupVersionResource{Group: "group", Version: "v1", Resource: "resource"} statusOK := &metav1.Status{ Status: metav1.StatusSuccess, Code: http.StatusOK, } writeJSON := func(t *testing.T, w http.ResponseWriter, obj runtime.Object) { data, err := json.Marshal(obj) if err != nil { t.Fatal(err) } w.Header().Set("Content-Type", "application/json") if _, err := w.Write(data); err != nil { t.Fatal(err) } } testCases := []struct { name string handler func(t *testing.T, w http.ResponseWriter, req *http.Request) want func(ctx context.Context, t *testing.T, client *Client) }{ { name: "GET is able to convert a JSON object to PartialObjectMetadata", handler: func(t *testing.T, w http.ResponseWriter, req *http.Request) { if req.Header.Get("Accept") != "application/vnd.kubernetes.protobuf;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json" { t.Fatal(req.Header.Get("Accept")) } if req.Method != "GET" && req.URL.String() != "/apis/group/v1/namespaces/ns/resource/name" { t.Fatal(req.URL.String()) } writeJSON(t, w, &corev1.Pod{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "name", Namespace: "ns", }, }) }, want: func(ctx context.Context, t *testing.T, client *Client) { obj, err := client.Resource(gvr).Namespace("ns").Get(ctx, "name", metav1.GetOptions{}) if err != nil { t.Fatal(err) } expect := &metav1.PartialObjectMetadata{ ObjectMeta: metav1.ObjectMeta{ Name: "name", Namespace: "ns", }, } if !reflect.DeepEqual(expect, obj) { t.Fatal(cmp.Diff(expect, obj)) } }, }, { name: "LIST is able to convert a JSON object to PartialObjectMetadata", handler: func(t *testing.T, w http.ResponseWriter, req *http.Request) { if req.Header.Get("Accept") != "application/vnd.kubernetes.protobuf;as=PartialObjectMetadataList;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadataList;g=meta.k8s.io;v=v1,application/json" { t.Fatal(req.Header.Get("Accept")) } if req.Method != "GET" && req.URL.String() != "/apis/group/v1/namespaces/ns/resource" { t.Fatal(req.URL.String()) } writeJSON(t, w, &corev1.PodList{ TypeMeta: metav1.TypeMeta{ Kind: "PodList", APIVersion: "v1", }, ListMeta: metav1.ListMeta{ ResourceVersion: "253", }, Items: []corev1.Pod{ { TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "name", Namespace: "ns", }, }, }, }) }, want: func(ctx context.Context, t *testing.T, client *Client) { objs, err := client.Resource(gvr).Namespace("ns").List(ctx, metav1.ListOptions{}) if err != nil { t.Fatal(err) } if objs.GetResourceVersion() != "253" { t.Fatal(objs) } expect := []metav1.PartialObjectMetadata{ { TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "name", Namespace: "ns", }, }, } if !reflect.DeepEqual(expect, objs.Items) { t.Fatal(cmp.Diff(expect, objs.Items)) } }, }, { name: "GET fails if the object is JSON and has no kind", handler: func(t *testing.T, w http.ResponseWriter, req *http.Request) { if req.Header.Get("Accept") != "application/vnd.kubernetes.protobuf;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json" { t.Fatal(req.Header.Get("Accept")) } if req.Method != "GET" && req.URL.String() != "/apis/group/v1/namespaces/ns/resource/name" { t.Fatal(req.URL.String()) } writeJSON(t, w, &corev1.Pod{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ UID: "123", }, }) }, want: func(ctx context.Context, t *testing.T, client *Client) { obj, err := client.Resource(gvr).Namespace("ns").Get(ctx, "name", metav1.GetOptions{}) if err == nil || !runtime.IsMissingKind(err) { t.Fatal(err) } if obj != nil { t.Fatal(obj) } }, }, { name: "GET fails if the object is JSON and has no apiVersion", handler: func(t *testing.T, w http.ResponseWriter, req *http.Request) { if req.Header.Get("Accept") != "application/vnd.kubernetes.protobuf;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json" { t.Fatal(req.Header.Get("Accept")) } if req.Method != "GET" && req.URL.String() != "/apis/group/v1/namespaces/ns/resource/name" { t.Fatal(req.URL.String()) } writeJSON(t, w, &corev1.Pod{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", }, ObjectMeta: metav1.ObjectMeta{ UID: "123", }, }) }, want: func(ctx context.Context, t *testing.T, client *Client) { obj, err := client.Resource(gvr).Namespace("ns").Get(ctx, "name", metav1.GetOptions{}) if err == nil || !runtime.IsMissingVersion(err) { t.Fatal(err) } if obj != nil { t.Fatal(obj) } }, }, { name: "GET fails if the object is JSON and not clearly metadata", handler: func(t *testing.T, w http.ResponseWriter, req *http.Request) { if req.Header.Get("Accept") != "application/vnd.kubernetes.protobuf;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json" { t.Fatal(req.Header.Get("Accept")) } if req.Method != "GET" && req.URL.String() != "/apis/group/v1/namespaces/ns/resource/name" { t.Fatal(req.URL.String()) } writeJSON(t, w, &corev1.Pod{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{}, }) }, want: func(ctx context.Context, t *testing.T, client *Client) { obj, err := client.Resource(gvr).Namespace("ns").Get(ctx, "name", metav1.GetOptions{}) if err == nil || !strings.Contains(err.Error(), "object does not appear to match the ObjectMeta schema") { t.Fatal(err) } if obj != nil { t.Fatal(obj) } }, }, { name: "Delete fails if DeleteOptions cannot be serialized to JSON", handler: func(t *testing.T, w http.ResponseWriter, req *http.Request) { if req.Header.Get("Content-Type") != runtime.ContentTypeJSON { t.Fatal(req.Header.Get("Content-Type")) } if req.Method != "DELETE" && req.URL.String() != "/apis/group/v1/namespaces/ns/resource/name" { t.Fatal(req.URL.String()) } defer req.Body.Close() buf, err := io.ReadAll(req.Body) if err != nil { t.Fatal(err) } if !json.Valid(buf) { t.Fatalf("request body is not a valid JSON: %s", buf) } writeJSON(t, w, statusOK) }, want: func(ctx context.Context, t *testing.T, client *Client) { err := client.Resource(gvr).Namespace("ns").Delete(ctx, "name", metav1.DeleteOptions{}) if err != nil { t.Fatal(err) } }, }, { name: "DeleteCollection fails if DeleteOptions cannot be serialized to JSON", handler: func(t *testing.T, w http.ResponseWriter, req *http.Request) { if req.Header.Get("Content-Type") != runtime.ContentTypeJSON { t.Fatal(req.Header.Get("Content-Type")) } if req.Method != "DELETE" && req.URL.String() != "/apis/group/v1/namespaces/ns/resource/name" { t.Fatal(req.URL.String()) } defer req.Body.Close() buf, err := io.ReadAll(req.Body) if err != nil { t.Fatal(err) } if !json.Valid(buf) { t.Fatalf("request body is not a valid JSON: %s", buf) } writeJSON(t, w, statusOK) }, want: func(ctx context.Context, t *testing.T, client *Client) { err := client.Resource(gvr).Namespace("ns").DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{}) if err != nil { t.Fatal(err) } }, }, } for _, tt := range testCases { t.Run(tt.name, func(t *testing.T) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { tt.handler(t, w, req) })) defer s.Close() _, ctx := ktesting.NewTestContext(t) cfg := ConfigFor(&rest.Config{Host: s.URL}) client := NewForConfigOrDie(cfg).(*Client) tt.want(ctx, t, client) }) } } kubernetes-client-go-a2dfcab/metadata/metadatainformer/000077500000000000000000000000001472614177300235025ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/metadata/metadatainformer/informer.go000066400000000000000000000161501472614177300256550ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadatainformer import ( "context" "sync" "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/informers" "k8s.io/client-go/metadata" "k8s.io/client-go/metadata/metadatalister" "k8s.io/client-go/tools/cache" ) // SharedInformerOption defines the functional option type for metadataSharedInformerFactory. type SharedInformerOption func(*metadataSharedInformerFactory) *metadataSharedInformerFactory // WithTransform sets a transform on all informers. func WithTransform(transform cache.TransformFunc) SharedInformerOption { return func(factory *metadataSharedInformerFactory) *metadataSharedInformerFactory { factory.transform = transform return factory } } // NewSharedInformerFactory constructs a new instance of metadataSharedInformerFactory for all namespaces. func NewSharedInformerFactory(client metadata.Interface, defaultResync time.Duration) SharedInformerFactory { return NewFilteredSharedInformerFactory(client, defaultResync, metav1.NamespaceAll, nil) } // NewFilteredSharedInformerFactory constructs a new instance of metadataSharedInformerFactory. // Listers obtained via this factory will be subject to the same filters as specified here. func NewFilteredSharedInformerFactory(client metadata.Interface, defaultResync time.Duration, namespace string, tweakListOptions TweakListOptionsFunc) SharedInformerFactory { return &metadataSharedInformerFactory{ client: client, defaultResync: defaultResync, namespace: namespace, informers: map[schema.GroupVersionResource]informers.GenericInformer{}, startedInformers: make(map[schema.GroupVersionResource]bool), tweakListOptions: tweakListOptions, } } // NewSharedInformerFactoryWithOptions constructs a new instance of metadataSharedInformerFactory with additional options. func NewSharedInformerFactoryWithOptions(client metadata.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { factory := &metadataSharedInformerFactory{ client: client, namespace: v1.NamespaceAll, defaultResync: defaultResync, informers: map[schema.GroupVersionResource]informers.GenericInformer{}, startedInformers: make(map[schema.GroupVersionResource]bool), } // Apply all options for _, opt := range options { factory = opt(factory) } return factory } type metadataSharedInformerFactory struct { client metadata.Interface defaultResync time.Duration namespace string transform cache.TransformFunc lock sync.Mutex informers map[schema.GroupVersionResource]informers.GenericInformer // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[schema.GroupVersionResource]bool tweakListOptions TweakListOptionsFunc // wg tracks how many goroutines were started. wg sync.WaitGroup // shuttingDown is true when Shutdown has been called. It may still be running // because it needs to wait for goroutines. shuttingDown bool } var _ SharedInformerFactory = &metadataSharedInformerFactory{} func (f *metadataSharedInformerFactory) ForResource(gvr schema.GroupVersionResource) informers.GenericInformer { f.lock.Lock() defer f.lock.Unlock() key := gvr informer, exists := f.informers[key] if exists { return informer } informer = NewFilteredMetadataInformer(f.client, gvr, f.namespace, f.defaultResync, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) informer.Informer().SetTransform(f.transform) f.informers[key] = informer return informer } // Start initializes all requested informers. func (f *metadataSharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() if f.shuttingDown { return } for informerType, informer := range f.informers { if !f.startedInformers[informerType] { f.wg.Add(1) // We need a new variable in each loop iteration, // otherwise the goroutine would use the loop variable // and that keeps changing. informer := informer.Informer() go func() { defer f.wg.Done() informer.Run(stopCh) }() f.startedInformers[informerType] = true } } } // WaitForCacheSync waits for all started informers' cache were synced. func (f *metadataSharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool { informers := func() map[schema.GroupVersionResource]cache.SharedIndexInformer { f.lock.Lock() defer f.lock.Unlock() informers := map[schema.GroupVersionResource]cache.SharedIndexInformer{} for informerType, informer := range f.informers { if f.startedInformers[informerType] { informers[informerType] = informer.Informer() } } return informers }() res := map[schema.GroupVersionResource]bool{} for informType, informer := range informers { res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) } return res } func (f *metadataSharedInformerFactory) Shutdown() { // Will return immediately if there is nothing to wait for. defer f.wg.Wait() f.lock.Lock() defer f.lock.Unlock() f.shuttingDown = true } // NewFilteredMetadataInformer constructs a new informer for a metadata type. func NewFilteredMetadataInformer(client metadata.Interface, gvr schema.GroupVersionResource, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions TweakListOptionsFunc) informers.GenericInformer { return &metadataInformer{ gvr: gvr, informer: cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.Resource(gvr).Namespace(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.Resource(gvr).Namespace(namespace).Watch(context.TODO(), options) }, }, &metav1.PartialObjectMetadata{}, resyncPeriod, indexers, ), } } type metadataInformer struct { informer cache.SharedIndexInformer gvr schema.GroupVersionResource } var _ informers.GenericInformer = &metadataInformer{} func (d *metadataInformer) Informer() cache.SharedIndexInformer { return d.informer } func (d *metadataInformer) Lister() cache.GenericLister { return metadatalister.NewRuntimeObjectShim(metadatalister.New(d.informer.GetIndexer(), d.gvr)) } kubernetes-client-go-a2dfcab/metadata/metadatainformer/informer_test.go000066400000000000000000000140451472614177300267150ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadatainformer import ( "context" "flag" "testing" "time" "github.com/google/go-cmp/cmp" "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/metadata/fake" "k8s.io/client-go/tools/cache" ) func init() { klog.InitFlags(flag.CommandLine) flag.CommandLine.Lookup("v").Value.Set("5") flag.CommandLine.Lookup("alsologtostderr").Value.Set("true") } func TestMetadataSharedInformerFactory(t *testing.T) { scenarios := []struct { name string existingObj *metav1.PartialObjectMetadata gvr schema.GroupVersionResource ns string trigger func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeMetadataClient, testObject *metav1.PartialObjectMetadata) *metav1.PartialObjectMetadata handler func(rcvCh chan<- *metav1.PartialObjectMetadata) *cache.ResourceEventHandlerFuncs }{ // scenario 1 { name: "scenario 1: test if adding an object triggers AddFunc", ns: "ns-foo", gvr: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"}, trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeMetadataClient, _ *metav1.PartialObjectMetadata) *metav1.PartialObjectMetadata { testObject := newPartialObjectMetadata("extensions/v1beta1", "Deployment", "ns-foo", "name-foo") createdObj, err := fakeClient.Resource(gvr).Namespace(ns).(fake.MetadataClient).CreateFake(testObject, metav1.CreateOptions{}) if err != nil { t.Error(err) } return createdObj }, handler: func(rcvCh chan<- *metav1.PartialObjectMetadata) *cache.ResourceEventHandlerFuncs { return &cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { rcvCh <- obj.(*metav1.PartialObjectMetadata) }, } }, }, // scenario 2 { name: "scenario 2: tests if updating an object triggers UpdateFunc", ns: "ns-foo", gvr: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"}, existingObj: newPartialObjectMetadata("extensions/v1beta1", "Deployment", "ns-foo", "name-foo"), trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeMetadataClient, testObject *metav1.PartialObjectMetadata) *metav1.PartialObjectMetadata { if testObject.Annotations == nil { testObject.Annotations = make(map[string]string) } testObject.Annotations["test"] = "updatedName" updatedObj, err := fakeClient.Resource(gvr).Namespace(ns).(fake.MetadataClient).UpdateFake(testObject, metav1.UpdateOptions{}) if err != nil { t.Error(err) } return updatedObj }, handler: func(rcvCh chan<- *metav1.PartialObjectMetadata) *cache.ResourceEventHandlerFuncs { return &cache.ResourceEventHandlerFuncs{ UpdateFunc: func(old, updated interface{}) { rcvCh <- updated.(*metav1.PartialObjectMetadata) }, } }, }, // scenario 3 { name: "scenario 3: test if deleting an object triggers DeleteFunc", ns: "ns-foo", gvr: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"}, existingObj: newPartialObjectMetadata("extensions/v1beta1", "Deployment", "ns-foo", "name-foo"), trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeMetadataClient, testObject *metav1.PartialObjectMetadata) *metav1.PartialObjectMetadata { err := fakeClient.Resource(gvr).Namespace(ns).Delete(context.TODO(), testObject.GetName(), metav1.DeleteOptions{}) if err != nil { t.Error(err) } return testObject }, handler: func(rcvCh chan<- *metav1.PartialObjectMetadata) *cache.ResourceEventHandlerFuncs { return &cache.ResourceEventHandlerFuncs{ DeleteFunc: func(obj interface{}) { rcvCh <- obj.(*metav1.PartialObjectMetadata) }, } }, }, } for _, ts := range scenarios { t.Run(ts.name, func(t *testing.T) { // test data timeout := time.Duration(3 * time.Second) ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() scheme := fake.NewTestScheme() metav1.AddMetaToScheme(scheme) informerReciveObjectCh := make(chan *metav1.PartialObjectMetadata, 1) objs := []runtime.Object{} if ts.existingObj != nil { objs = append(objs, ts.existingObj) } fakeClient := fake.NewSimpleMetadataClient(scheme, objs...) target := NewSharedInformerFactory(fakeClient, 0) // act informerListerForGvr := target.ForResource(ts.gvr) informerListerForGvr.Informer().AddEventHandler(ts.handler(informerReciveObjectCh)) target.Start(ctx.Done()) if synced := target.WaitForCacheSync(ctx.Done()); !synced[ts.gvr] { t.Fatalf("informer for %s hasn't synced", ts.gvr) } testObject := ts.trigger(ts.gvr, ts.ns, fakeClient, ts.existingObj) select { case objFromInformer := <-informerReciveObjectCh: if !equality.Semantic.DeepEqual(testObject, objFromInformer) { t.Fatalf("%v", cmp.Diff(testObject, objFromInformer)) } case <-ctx.Done(): t.Errorf("tested informer haven't received an object, waited %v", timeout) } }) } } func newPartialObjectMetadata(apiVersion, kind, namespace, name string) *metav1.PartialObjectMetadata { return &metav1.PartialObjectMetadata{ TypeMeta: metav1.TypeMeta{ APIVersion: apiVersion, Kind: kind, }, ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, Name: name, }, } } kubernetes-client-go-a2dfcab/metadata/metadatainformer/interface.go000066400000000000000000000040241472614177300257710ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadatainformer import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/informers" ) // SharedInformerFactory provides access to a shared informer and lister for dynamic client type SharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. Start(stopCh <-chan struct{}) // ForResource gives generic access to a shared informer of the matching type. ForResource(gvr schema.GroupVersionResource) informers.GenericInformer // WaitForCacheSync blocks until all started informers' caches were synced // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool // Shutdown marks a factory as shutting down. At that point no new // informers can be started anymore and Start will return without // doing anything. // // In addition, Shutdown blocks until all goroutines have terminated. For that // to happen, the close channel(s) that they were started with must be closed, // either before Shutdown gets called or while it is waiting. // // Shutdown may be called multiple times, even concurrently. All such calls will // block until all goroutines have terminated. Shutdown() } // TweakListOptionsFunc defines the signature of a helper function // that wants to provide more listing options to API type TweakListOptionsFunc func(*metav1.ListOptions) kubernetes-client-go-a2dfcab/metadata/metadatalister/000077500000000000000000000000001472614177300231635ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/metadata/metadatalister/interface.go000066400000000000000000000027261472614177300254610ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadatalister import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) // Lister helps list resources. type Lister interface { // List lists all resources in the indexer. List(selector labels.Selector) (ret []*metav1.PartialObjectMetadata, err error) // Get retrieves a resource from the indexer with the given name Get(name string) (*metav1.PartialObjectMetadata, error) // Namespace returns an object that can list and get resources in a given namespace. Namespace(namespace string) NamespaceLister } // NamespaceLister helps list and get resources. type NamespaceLister interface { // List lists all resources in the indexer for a given namespace. List(selector labels.Selector) (ret []*metav1.PartialObjectMetadata, err error) // Get retrieves a resource from the indexer for a given namespace and name. Get(name string) (*metav1.PartialObjectMetadata, error) } kubernetes-client-go-a2dfcab/metadata/metadatalister/lister.go000066400000000000000000000057331472614177300250240ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadatalister import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" ) var _ Lister = &metadataLister{} var _ NamespaceLister = &metadataNamespaceLister{} // metadataLister implements the Lister interface. type metadataLister struct { indexer cache.Indexer gvr schema.GroupVersionResource } // New returns a new Lister. func New(indexer cache.Indexer, gvr schema.GroupVersionResource) Lister { return &metadataLister{indexer: indexer, gvr: gvr} } // List lists all resources in the indexer. func (l *metadataLister) List(selector labels.Selector) (ret []*metav1.PartialObjectMetadata, err error) { err = cache.ListAll(l.indexer, selector, func(m interface{}) { ret = append(ret, m.(*metav1.PartialObjectMetadata)) }) return ret, err } // Get retrieves a resource from the indexer with the given name func (l *metadataLister) Get(name string) (*metav1.PartialObjectMetadata, error) { obj, exists, err := l.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(l.gvr.GroupResource(), name) } return obj.(*metav1.PartialObjectMetadata), nil } // Namespace returns an object that can list and get resources from a given namespace. func (l *metadataLister) Namespace(namespace string) NamespaceLister { return &metadataNamespaceLister{indexer: l.indexer, namespace: namespace, gvr: l.gvr} } // metadataNamespaceLister implements the NamespaceLister interface. type metadataNamespaceLister struct { indexer cache.Indexer namespace string gvr schema.GroupVersionResource } // List lists all resources in the indexer for a given namespace. func (l *metadataNamespaceLister) List(selector labels.Selector) (ret []*metav1.PartialObjectMetadata, err error) { err = cache.ListAllByNamespace(l.indexer, l.namespace, selector, func(m interface{}) { ret = append(ret, m.(*metav1.PartialObjectMetadata)) }) return ret, err } // Get retrieves a resource from the indexer for a given namespace and name. func (l *metadataNamespaceLister) Get(name string) (*metav1.PartialObjectMetadata, error) { obj, exists, err := l.indexer.GetByKey(l.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(l.gvr.GroupResource(), name) } return obj.(*metav1.PartialObjectMetadata), nil } kubernetes-client-go-a2dfcab/metadata/metadatalister/lister_test.go000066400000000000000000000206221472614177300260550ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadatalister import ( "reflect" "testing" "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" ) func TestNamespaceGetMethod(t *testing.T) { tests := []struct { name string existingObjects []runtime.Object namespaceToSync string gvrToSync schema.GroupVersionResource objectToGet string expectedObject *metav1.PartialObjectMetadata expectError bool }{ { name: "scenario 1: gets name-foo1 resource from the indexer from ns-foo namespace", existingObjects: []runtime.Object{ newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo1"), newPartialObjectMetadata("group/version", "TheKind", "ns-bar", "name-bar"), }, namespaceToSync: "ns-foo", gvrToSync: schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}, objectToGet: "name-foo1", expectedObject: newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo1"), }, { name: "scenario 2: gets name-foo-non-existing resource from the indexer from ns-foo namespace", existingObjects: []runtime.Object{ newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo1"), newPartialObjectMetadata("group/version", "TheKind", "ns-bar", "name-bar"), }, namespaceToSync: "ns-foo", gvrToSync: schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}, objectToGet: "name-foo-non-existing", expectError: true, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { // test data indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, obj := range test.existingObjects { err := indexer.Add(obj) if err != nil { t.Fatal(err) } } // act target := New(indexer, test.gvrToSync).Namespace(test.namespaceToSync) actualObject, err := target.Get(test.objectToGet) // validate if test.expectError { if err == nil { t.Fatal("expected to get an error but non was returned") } return } if err != nil { t.Fatal(err) } if !reflect.DeepEqual(test.expectedObject, actualObject) { t.Fatalf("unexpected object has been returned expected = %v actual = %v, diff = %v", test.expectedObject, actualObject, cmp.Diff(test.expectedObject, actualObject)) } }) } } func TestNamespaceListMethod(t *testing.T) { // test data objs := []runtime.Object{ newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo1"), newPartialObjectMetadata("group/version", "TheKind", "ns-bar", "name-bar"), } indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, obj := range objs { err := indexer.Add(obj) if err != nil { t.Fatal(err) } } expectedOutput := []*metav1.PartialObjectMetadata{ newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo1"), } namespaceToList := "ns-foo" // act target := New(indexer, schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}).Namespace(namespaceToList) actualOutput, err := target.List(labels.Everything()) // validate if err != nil { t.Fatal(err) } assertListOrDie(expectedOutput, actualOutput, t) } func TestListerGetMethod(t *testing.T) { tests := []struct { name string existingObjects []runtime.Object namespaceToSync string gvrToSync schema.GroupVersionResource objectToGet string expectedObject *metav1.PartialObjectMetadata expectError bool }{ { name: "scenario 1: gets name-foo1 resource from the indexer", existingObjects: []runtime.Object{ newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group/version", "TheKind", "", "name-foo1"), newPartialObjectMetadata("group/version", "TheKind", "ns-bar", "name-bar"), }, namespaceToSync: "", gvrToSync: schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}, objectToGet: "name-foo1", expectedObject: newPartialObjectMetadata("group/version", "TheKind", "", "name-foo1"), }, { name: "scenario 2: doesn't get name-foo resource from the indexer from ns-foo namespace", existingObjects: []runtime.Object{ newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo1"), newPartialObjectMetadata("group/version", "TheKind", "ns-bar", "name-bar"), }, namespaceToSync: "ns-foo", gvrToSync: schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}, objectToGet: "name-foo", expectError: true, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { // test data indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, obj := range test.existingObjects { err := indexer.Add(obj) if err != nil { t.Fatal(err) } } // act target := New(indexer, test.gvrToSync) actualObject, err := target.Get(test.objectToGet) // validate if test.expectError { if err == nil { t.Fatal("expected to get an error but non was returned") } return } if err != nil { t.Fatal(err) } if !reflect.DeepEqual(test.expectedObject, actualObject) { t.Fatalf("unexpected object has been returned expected = %v actual = %v, diff = %v", test.expectedObject, actualObject, cmp.Diff(test.expectedObject, actualObject)) } }) } } func TestListerListMethod(t *testing.T) { // test data objs := []runtime.Object{ newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-bar"), } indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) for _, obj := range objs { err := indexer.Add(obj) if err != nil { t.Fatal(err) } } expectedOutput := []*metav1.PartialObjectMetadata{ newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-foo"), newPartialObjectMetadata("group/version", "TheKind", "ns-foo", "name-bar"), } // act target := New(indexer, schema.GroupVersionResource{Group: "group", Version: "version", Resource: "TheKinds"}) actualOutput, err := target.List(labels.Everything()) // validate if err != nil { t.Fatal(err) } assertListOrDie(expectedOutput, actualOutput, t) } func assertListOrDie(expected, actual []*metav1.PartialObjectMetadata, t *testing.T) { if len(actual) != len(expected) { t.Fatalf("unexpected number of items returned, expected = %d, actual = %d", len(expected), len(actual)) } for _, expectedObject := range expected { found := false for _, actualObject := range actual { if actualObject.GetName() == expectedObject.GetName() { if !reflect.DeepEqual(expectedObject, actualObject) { t.Fatalf("unexpected object has been returned expected = %v actual = %v, diff = %v", expectedObject, actualObject, cmp.Diff(expectedObject, actualObject)) } found = true } } if !found { t.Fatalf("the resource with the name = %s was not found in the returned output", expectedObject.GetName()) } } } func newPartialObjectMetadata(apiVersion, kind, namespace, name string) *metav1.PartialObjectMetadata { return &metav1.PartialObjectMetadata{ TypeMeta: metav1.TypeMeta{ APIVersion: apiVersion, Kind: kind, }, ObjectMeta: metav1.ObjectMeta{ Namespace: namespace, Name: name, }, } } kubernetes-client-go-a2dfcab/metadata/metadatalister/shim.go000066400000000000000000000051131472614177300244520ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadatalister import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/cache" ) var _ cache.GenericLister = &metadataListerShim{} var _ cache.GenericNamespaceLister = &metadataNamespaceListerShim{} // metadataListerShim implements the cache.GenericLister interface. type metadataListerShim struct { lister Lister } // NewRuntimeObjectShim returns a new shim for Lister. // It wraps Lister so that it implements cache.GenericLister interface func NewRuntimeObjectShim(lister Lister) cache.GenericLister { return &metadataListerShim{lister: lister} } // List will return all objects across namespaces func (s *metadataListerShim) List(selector labels.Selector) (ret []runtime.Object, err error) { objs, err := s.lister.List(selector) if err != nil { return nil, err } ret = make([]runtime.Object, len(objs)) for index, obj := range objs { ret[index] = obj } return ret, err } // Get will attempt to retrieve assuming that name==key func (s *metadataListerShim) Get(name string) (runtime.Object, error) { return s.lister.Get(name) } func (s *metadataListerShim) ByNamespace(namespace string) cache.GenericNamespaceLister { return &metadataNamespaceListerShim{ namespaceLister: s.lister.Namespace(namespace), } } // metadataNamespaceListerShim implements the NamespaceLister interface. // It wraps NamespaceLister so that it implements cache.GenericNamespaceLister interface type metadataNamespaceListerShim struct { namespaceLister NamespaceLister } // List will return all objects in this namespace func (ns *metadataNamespaceListerShim) List(selector labels.Selector) (ret []runtime.Object, err error) { objs, err := ns.namespaceLister.List(selector) if err != nil { return nil, err } ret = make([]runtime.Object, len(objs)) for index, obj := range objs { ret[index] = obj } return ret, err } // Get will attempt to retrieve by namespace and name func (ns *metadataNamespaceListerShim) Get(name string) (runtime.Object, error) { return ns.namespaceLister.Get(name) } kubernetes-client-go-a2dfcab/openapi/000077500000000000000000000000001472614177300200335ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/openapi/OWNERS000066400000000000000000000001131472614177300207660ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - apelisse kubernetes-client-go-a2dfcab/openapi/cached/000077500000000000000000000000001472614177300212425ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/openapi/cached/client.go000066400000000000000000000022741472614177300230540ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cached import ( "sync" "k8s.io/client-go/openapi" ) type client struct { delegate openapi.Client once sync.Once result map[string]openapi.GroupVersion err error } func NewClient(other openapi.Client) openapi.Client { return &client{ delegate: other, } } func (c *client) Paths() (map[string]openapi.GroupVersion, error) { c.once.Do(func() { uncached, err := c.delegate.Paths() if err != nil { c.err = err return } result := make(map[string]openapi.GroupVersion, len(uncached)) for k, v := range uncached { result[k] = newGroupVersion(v) } c.result = result }) return c.result, c.err } kubernetes-client-go-a2dfcab/openapi/cached/groupversion.go000066400000000000000000000023741472614177300243410ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cached import ( "sync" "k8s.io/client-go/openapi" ) type groupversion struct { delegate openapi.GroupVersion lock sync.Mutex docs map[string]docInfo } type docInfo struct { data []byte err error } func newGroupVersion(delegate openapi.GroupVersion) *groupversion { return &groupversion{ delegate: delegate, } } func (g *groupversion) Schema(contentType string) ([]byte, error) { g.lock.Lock() defer g.lock.Unlock() cachedInfo, ok := g.docs[contentType] if !ok { if g.docs == nil { g.docs = make(map[string]docInfo) } cachedInfo.data, cachedInfo.err = g.delegate.Schema(contentType) g.docs[contentType] = cachedInfo } return cachedInfo.data, cachedInfo.err } kubernetes-client-go-a2dfcab/openapi/client.go000066400000000000000000000035161472614177300216450ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapi import ( "context" "encoding/json" "strings" "k8s.io/client-go/rest" "k8s.io/kube-openapi/pkg/handler3" ) type Client interface { Paths() (map[string]GroupVersion, error) } type client struct { // URL includes the `hash` query param to take advantage of cache busting restClient rest.Interface } func NewClient(restClient rest.Interface) Client { return &client{ restClient: restClient, } } func (c *client) Paths() (map[string]GroupVersion, error) { data, err := c.restClient.Get(). AbsPath("/openapi/v3"). Do(context.TODO()). Raw() if err != nil { return nil, err } discoMap := &handler3.OpenAPIV3Discovery{} err = json.Unmarshal(data, discoMap) if err != nil { return nil, err } // Create GroupVersions for each element of the result result := map[string]GroupVersion{} for k, v := range discoMap.Paths { // If the server returned a URL rooted at /openapi/v3, preserve any additional client-side prefix. // If the server returned a URL not rooted at /openapi/v3, treat it as an actual server-relative URL. // See https://github.com/kubernetes/kubernetes/issues/117463 for details useClientPrefix := strings.HasPrefix(v.ServerRelativeURL, "/openapi/v3") result[k] = newGroupVersion(c, v, useClientPrefix) } return result, nil } kubernetes-client-go-a2dfcab/openapi/groupversion.go000066400000000000000000000036601472614177300231310ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapi import ( "context" "net/url" "k8s.io/kube-openapi/pkg/handler3" ) const ContentTypeOpenAPIV3PB = "application/com.github.proto-openapi.spec.v3@v1.0+protobuf" type GroupVersion interface { Schema(contentType string) ([]byte, error) } type groupversion struct { client *client item handler3.OpenAPIV3DiscoveryGroupVersion useClientPrefix bool } func newGroupVersion(client *client, item handler3.OpenAPIV3DiscoveryGroupVersion, useClientPrefix bool) *groupversion { return &groupversion{client: client, item: item, useClientPrefix: useClientPrefix} } func (g *groupversion) Schema(contentType string) ([]byte, error) { if !g.useClientPrefix { return g.client.restClient.Get(). RequestURI(g.item.ServerRelativeURL). SetHeader("Accept", contentType). Do(context.TODO()). Raw() } locator, err := url.Parse(g.item.ServerRelativeURL) if err != nil { return nil, err } path := g.client.restClient.Get(). AbsPath(locator.Path). SetHeader("Accept", contentType) // Other than root endpoints(openapiv3/apis), resources have hash query parameter to support etags. // However, absPath does not support handling query parameters internally, // so that hash query parameter is added manually for k, value := range locator.Query() { for _, v := range value { path.Param(k, v) } } return path.Do(context.TODO()).Raw() } kubernetes-client-go-a2dfcab/openapi/groupversion_test.go000066400000000000000000000062761472614177300241760ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapi import ( "fmt" "net/http" "net/http/httptest" "testing" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" ) func TestGroupVersion(t *testing.T) { tests := []struct { name string prefix string serverReturnsPrefix bool }{ { name: "no prefix", prefix: "", serverReturnsPrefix: false, }, { name: "prefix not in discovery", prefix: "/test-endpoint", serverReturnsPrefix: false, }, { name: "prefix in discovery", prefix: "/test-endpoint", serverReturnsPrefix: true, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch { case r.URL.Path == test.prefix+"/openapi/v3/apis/apps/v1" && r.URL.RawQuery == "hash=014fbff9a07c": w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write([]byte(`{"openapi":"3.0.0","info":{"title":"Kubernetes","version":"unversioned"}}`)) case r.URL.Path == test.prefix+"/openapi/v3": // return root content w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) if test.serverReturnsPrefix { w.Write([]byte(fmt.Sprintf(`{"paths":{"apis/apps/v1":{"serverRelativeURL":"%s/openapi/v3/apis/apps/v1?hash=014fbff9a07c"}}}`, test.prefix))) } else { w.Write([]byte(`{"paths":{"apis/apps/v1":{"serverRelativeURL":"/openapi/v3/apis/apps/v1?hash=014fbff9a07c"}}}`)) } default: t.Errorf("unexpected request: %s", r.URL.String()) w.WriteHeader(http.StatusNotFound) return } })) defer server.Close() c, err := rest.RESTClientFor(&rest.Config{ Host: server.URL + test.prefix, ContentConfig: rest.ContentConfig{ NegotiatedSerializer: scheme.Codecs, GroupVersion: &appsv1.SchemeGroupVersion, }, }) if err != nil { t.Fatalf("unexpected error occurred: %v", err) } openapiClient := NewClient(c) paths, err := openapiClient.Paths() if err != nil { t.Fatalf("unexpected error occurred: %v", err) } schema, err := paths["apis/apps/v1"].Schema(runtime.ContentTypeJSON) if err != nil { t.Fatalf("unexpected error occurred: %v", err) } expectedResult := `{"openapi":"3.0.0","info":{"title":"Kubernetes","version":"unversioned"}}` if string(schema) != expectedResult { t.Fatalf("unexpected result actual: %s expected: %s", string(schema), expectedResult) } }) } } kubernetes-client-go-a2dfcab/openapi/openapitest/000077500000000000000000000000001472614177300223665ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/openapi/openapitest/fakeclient.go000066400000000000000000000050511472614177300250230ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapitest import ( "fmt" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/openapi" ) // FakeClient implements openapi.Client interface, with hard-coded // return values, including the possibility to force errors. type FakeClient struct { // Hard-coded paths to return from Paths() function. PathsMap map[string]openapi.GroupVersion // Hard-coded returned error. ForcedErr error } // Validate FakeClient implements openapi.Client interface. var _ openapi.Client = &FakeClient{} // NewFakeClient returns a fake openapi client with an empty PathsMap. func NewFakeClient() *FakeClient { return &FakeClient{PathsMap: make(map[string]openapi.GroupVersion)} } // Paths returns stored PathsMap field, creating an empty one if // it does not already exist. If ForcedErr is set, this function // returns the error instead. func (f FakeClient) Paths() (map[string]openapi.GroupVersion, error) { if f.ForcedErr != nil { return nil, f.ForcedErr } return f.PathsMap, nil } // FakeGroupVersion implements openapi.GroupVersion with hard-coded // return GroupVersion specification bytes. If ForcedErr is set, then // "Schema()" function returns the error instead of the GVSpec. type FakeGroupVersion struct { // Hard-coded GroupVersion specification GVSpec []byte // Hard-coded returned error. ForcedErr error } // FileOpenAPIGroupVersion implements the openapi.GroupVersion interface. var _ openapi.GroupVersion = &FakeGroupVersion{} // Schema returns the hard-coded byte slice, including creating an // empty slice if it has not been set yet. If the ForcedErr is set, // this function returns the error instead of the GVSpec field. If // content type other than application/json is passed, and error is // returned. func (f FakeGroupVersion) Schema(contentType string) ([]byte, error) { if contentType != runtime.ContentTypeJSON { return nil, fmt.Errorf("application/json is only content type supported: %s", contentType) } if f.ForcedErr != nil { return nil, f.ForcedErr } return f.GVSpec, nil } kubernetes-client-go-a2dfcab/openapi/openapitest/fileclient.go000066400000000000000000000055541472614177300250440ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapitest import ( "embed" "errors" "io/fs" "os" "strings" "k8s.io/client-go/openapi" ) //go:embed testdata/*_openapi.json var embedded embed.FS // NewFileClient returns a test client implementing the openapi.Client // interface, which serves Open API V3 specifications files from the // given path, as prepared in `api/openapi-spec/v3`. func NewFileClient(path string) openapi.Client { return &fileClient{f: os.DirFS(path)} } // NewEmbeddedFileClient returns a test client that uses the embedded // `testdata` openapi files. func NewEmbeddedFileClient() openapi.Client { f, err := fs.Sub(embedded, "testdata") if err != nil { panic(err) } return &fileClient{f: f} } type fileClient struct { f fs.FS } // fileClient implements the openapi.Client interface. var _ openapi.Client = &fileClient{} // Paths returns a map of api path string to openapi.GroupVersion or // an error. The OpenAPI V3 GroupVersion specifications are hard-coded // in the "testdata" subdirectory. The api path is derived from the // spec filename. Example: // // apis__apps__v1_openapi.json -> apis/apps/v1 // // The file contents are read only once. All files must parse correctly // into an api path, or an error is returned. func (f *fileClient) Paths() (map[string]openapi.GroupVersion, error) { paths := map[string]openapi.GroupVersion{} entries, err := fs.ReadDir(f.f, ".") if err != nil { return nil, err } for _, e := range entries { // this reverses the transformation done in hack/update-openapi-spec.sh path := strings.ReplaceAll(strings.TrimSuffix(e.Name(), "_openapi.json"), "__", "/") paths[path] = &fileGroupVersion{f: f.f, filename: e.Name()} } return paths, nil } type fileGroupVersion struct { f fs.FS filename string } // fileGroupVersion implements the openapi.GroupVersion interface. var _ openapi.GroupVersion = &fileGroupVersion{} // Schema returns the OpenAPI V3 specification for the GroupVersion as // unstructured bytes, or an error if the contentType is not // "application/json" or there is an error reading the spec file. The // file is read only once. func (f *fileGroupVersion) Schema(contentType string) ([]byte, error) { if contentType != "application/json" { return nil, errors.New("openapitest only supports 'application/json' contentType") } return fs.ReadFile(f.f, f.filename) } kubernetes-client-go-a2dfcab/openapi/openapitest/fileclient_test.go000066400000000000000000000052551472614177300261010ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapitest_test import ( "testing" "k8s.io/client-go/openapi/openapitest" "k8s.io/kube-openapi/pkg/spec3" kjson "sigs.k8s.io/json" ) func TestOpenAPIEmbeddedTest(t *testing.T) { client := openapitest.NewEmbeddedFileClient() // make sure we get paths paths, err := client.Paths() if err != nil { t.Fatalf("error fetching paths: %v", err) } if len(paths) == 0 { t.Error("empty paths") } // spot check specific paths expectedPaths := []string{ "api/v1", "apis/apps/v1", "apis/batch/v1", "apis/networking.k8s.io/v1alpha1", "apis/discovery.k8s.io/v1", } for _, p := range expectedPaths { if _, ok := paths[p]; !ok { t.Fatalf("expected %s", p) } } // make sure all paths can load for path, gv := range paths { data, err := gv.Schema("application/json") if err != nil { t.Fatalf("error reading schema for %v: %v", path, err) } o := &spec3.OpenAPI{} stricterrs, err := kjson.UnmarshalStrict(data, o) if err != nil { t.Fatalf("error unmarshaling schema for %v: %v", path, err) } if len(stricterrs) > 0 { t.Fatalf("strict errors unmarshaling schema for %v: %v", path, stricterrs) } } } func TestOpenAPITest(t *testing.T) { client := openapitest.NewFileClient("testdata") // make sure we get paths paths, err := client.Paths() if err != nil { t.Fatalf("error fetching paths: %v", err) } if len(paths) == 0 { t.Error("empty paths") } // spot check specific paths expectedPaths := []string{ "api/v1", "apis/apps/v1", "apis/batch/v1", "apis/networking.k8s.io/v1alpha1", "apis/discovery.k8s.io/v1", } for _, p := range expectedPaths { if _, ok := paths[p]; !ok { t.Fatalf("expected %s", p) } } // make sure all paths can load for path, gv := range paths { data, err := gv.Schema("application/json") if err != nil { t.Fatalf("error reading schema for %v: %v", path, err) } o := &spec3.OpenAPI{} stricterrs, err := kjson.UnmarshalStrict(data, o) if err != nil { t.Fatalf("error unmarshaling schema for %v: %v", path, err) } if len(stricterrs) > 0 { t.Fatalf("strict errors unmarshaling schema for %v: %v", path, stricterrs) } } } kubernetes-client-go-a2dfcab/openapi/openapitest/testdata/000077500000000000000000000000001472614177300241775ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/openapi/openapitest/testdata/api__v1_openapi.json000066400000000000000000062230761472614177300301430ustar00rootroot00000000000000{ "components": { "schemas": { "io.k8s.api.authentication.v1.BoundObjectReference": { "description": "BoundObjectReference is a reference to an object that a token is bound to.", "properties": { "apiVersion": { "description": "API version of the referent.", "type": "string" }, "kind": { "description": "Kind of the referent. Valid kinds are 'Pod' and 'Secret'.", "type": "string" }, "name": { "description": "Name of the referent.", "type": "string" }, "uid": { "description": "UID of the referent.", "type": "string" } }, "type": "object" }, "io.k8s.api.authentication.v1.TokenRequest": { "description": "TokenRequest requests a token for a given service account.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequestSpec" } ], "default": {}, "description": "Spec holds information about the request being evaluated" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequestStatus" } ], "default": {}, "description": "Status is filled in by the server and indicates whether the token can be authenticated." } }, "required": [ "spec" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "authentication.k8s.io", "kind": "TokenRequest", "version": "v1" } ] }, "io.k8s.api.authentication.v1.TokenRequestSpec": { "description": "TokenRequestSpec contains client provided parameters of a token request.", "properties": { "audiences": { "description": "Audiences are the intendend audiences of the token. A recipient of a token must identify themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences.", "items": { "default": "", "type": "string" }, "type": "array" }, "boundObjectRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.BoundObjectReference" } ], "description": "BoundObjectRef is a reference to an object that the token will be bound to. The token will only be valid for as long as the bound object exists. NOTE: The API server's TokenReview endpoint will validate the BoundObjectRef, but other audiences may not. Keep ExpirationSeconds small if you want prompt revocation." }, "expirationSeconds": { "description": "ExpirationSeconds is the requested duration of validity of the request. The token issuer may return a token with a different validity duration so a client needs to check the 'expiration' field in a response.", "format": "int64", "type": "integer" } }, "required": [ "audiences" ], "type": "object" }, "io.k8s.api.authentication.v1.TokenRequestStatus": { "description": "TokenRequestStatus is the result of a token request.", "properties": { "expirationTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "ExpirationTimestamp is the time of expiration of the returned token." }, "token": { "default": "", "description": "Token is the opaque bearer token.", "type": "string" } }, "required": [ "token", "expirationTimestamp" ], "type": "object" }, "io.k8s.api.autoscaling.v1.Scale": { "description": "Scale represents a scaling request for a resource.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata." }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.ScaleSpec" } ], "default": {}, "description": "defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status." }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.ScaleStatus" } ], "default": {}, "description": "current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "autoscaling", "kind": "Scale", "version": "v1" } ] }, "io.k8s.api.autoscaling.v1.ScaleSpec": { "description": "ScaleSpec describes the attributes of a scale subresource.", "properties": { "replicas": { "description": "desired number of instances for the scaled object.", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.autoscaling.v1.ScaleStatus": { "description": "ScaleStatus represents the current status of a scale subresource.", "properties": { "replicas": { "default": 0, "description": "actual number of observed instances of the scaled object.", "format": "int32", "type": "integer" }, "selector": { "description": "label query over pods that should match the replicas count. This is same as the label selector but in the string format to avoid introspection by clients. The string will be in the same format as the query-param syntax. More info about label selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels#label-selectors", "type": "string" } }, "required": [ "replicas" ], "type": "object" }, "io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource": { "description": "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "string" }, "partition": { "description": "partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).", "format": "int32", "type": "integer" }, "readOnly": { "description": "readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "boolean" }, "volumeID": { "default": "", "description": "volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.Affinity": { "description": "Affinity is a group of affinity scheduling rules.", "properties": { "nodeAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeAffinity" } ], "description": "Describes node affinity scheduling rules for the pod." }, "podAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinity" } ], "description": "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s))." }, "podAntiAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity" } ], "description": "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s))." } }, "type": "object" }, "io.k8s.api.core.v1.AttachedVolume": { "description": "AttachedVolume describes a volume attached to a node", "properties": { "devicePath": { "default": "", "description": "DevicePath represents the device path where the volume should be available", "type": "string" }, "name": { "default": "", "description": "Name of the attached volume", "type": "string" } }, "required": [ "name", "devicePath" ], "type": "object" }, "io.k8s.api.core.v1.AzureDiskVolumeSource": { "description": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", "properties": { "cachingMode": { "description": "cachingMode is the Host Caching mode: None, Read Only, Read Write.", "type": "string" }, "diskName": { "default": "", "description": "diskName is the Name of the data disk in the blob storage", "type": "string" }, "diskURI": { "default": "", "description": "diskURI is the URI of data disk in the blob storage", "type": "string" }, "fsType": { "description": "fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "kind": { "description": "kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared", "type": "string" }, "readOnly": { "description": "readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" } }, "required": [ "diskName", "diskURI" ], "type": "object" }, "io.k8s.api.core.v1.AzureFilePersistentVolumeSource": { "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", "properties": { "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretName": { "default": "", "description": "secretName is the name of secret that contains Azure Storage Account Name and Key", "type": "string" }, "secretNamespace": { "description": "secretNamespace is the namespace of the secret that contains Azure Storage Account Name and Key default is the same as the Pod", "type": "string" }, "shareName": { "default": "", "description": "shareName is the azure Share Name", "type": "string" } }, "required": [ "secretName", "shareName" ], "type": "object" }, "io.k8s.api.core.v1.AzureFileVolumeSource": { "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", "properties": { "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretName": { "default": "", "description": "secretName is the name of secret that contains Azure Storage Account Name and Key", "type": "string" }, "shareName": { "default": "", "description": "shareName is the azure share Name", "type": "string" } }, "required": [ "secretName", "shareName" ], "type": "object" }, "io.k8s.api.core.v1.Binding": { "description": "Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "target": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "default": {}, "description": "The target object that you want to bind to the standard object." } }, "required": [ "target" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Binding", "version": "v1" } ] }, "io.k8s.api.core.v1.CSIPersistentVolumeSource": { "description": "Represents storage that is managed by an external CSI volume driver (Beta feature)", "properties": { "controllerExpandSecretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "controllerExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed." }, "controllerPublishSecretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "controllerPublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed." }, "driver": { "default": "", "description": "driver is the name of the driver to use for this volume. Required.", "type": "string" }, "fsType": { "description": "fsType to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\".", "type": "string" }, "nodeExpandSecretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "nodeExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeExpandVolume call. This is an alpha field and requires enabling CSINodeExpandSecret feature gate. This field is optional, may be omitted if no secret is required. If the secret object contains more than one secret, all secrets are passed." }, "nodePublishSecretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed." }, "nodeStageSecretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "nodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed." }, "readOnly": { "description": "readOnly value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).", "type": "boolean" }, "volumeAttributes": { "additionalProperties": { "default": "", "type": "string" }, "description": "volumeAttributes of the volume to publish.", "type": "object" }, "volumeHandle": { "default": "", "description": "volumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.", "type": "string" } }, "required": [ "driver", "volumeHandle" ], "type": "object" }, "io.k8s.api.core.v1.CSIVolumeSource": { "description": "Represents a source location of a volume to mount, managed by an external CSI driver", "properties": { "driver": { "default": "", "description": "driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.", "type": "string" }, "fsType": { "description": "fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.", "type": "string" }, "nodePublishSecretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed." }, "readOnly": { "description": "readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).", "type": "boolean" }, "volumeAttributes": { "additionalProperties": { "default": "", "type": "string" }, "description": "volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.", "type": "object" } }, "required": [ "driver" ], "type": "object" }, "io.k8s.api.core.v1.Capabilities": { "description": "Adds and removes POSIX capabilities from running containers.", "properties": { "add": { "description": "Added capabilities", "items": { "default": "", "type": "string" }, "type": "array" }, "drop": { "description": "Removed capabilities", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.CephFSPersistentVolumeSource": { "description": "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", "properties": { "monitors": { "description": "monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "items": { "default": "", "type": "string" }, "type": "array" }, "path": { "description": "path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /", "type": "string" }, "readOnly": { "description": "readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "boolean" }, "secretFile": { "description": "secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "string" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" }, "user": { "description": "user is Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "string" } }, "required": [ "monitors" ], "type": "object" }, "io.k8s.api.core.v1.CephFSVolumeSource": { "description": "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", "properties": { "monitors": { "description": "monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "items": { "default": "", "type": "string" }, "type": "array" }, "path": { "description": "path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /", "type": "string" }, "readOnly": { "description": "readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "boolean" }, "secretFile": { "description": "secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "string" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" }, "user": { "description": "user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "string" } }, "required": [ "monitors" ], "type": "object" }, "io.k8s.api.core.v1.CinderPersistentVolumeSource": { "description": "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "string" }, "readOnly": { "description": "readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "secretRef is Optional: points to a secret object containing parameters used to connect to OpenStack." }, "volumeID": { "default": "", "description": "volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.CinderVolumeSource": { "description": "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is optional: points to a secret object containing parameters used to connect to OpenStack." }, "volumeID": { "default": "", "description": "volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.ClaimSource": { "description": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.", "properties": { "resourceClaimName": { "description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.", "type": "string" }, "resourceClaimTemplateName": { "description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The name of the ResourceClaim will be -, where is the PodResourceClaim.Name. Pod validation will reject the pod if the concatenated name is not valid for a ResourceClaim (e.g. too long).\n\nAn existing ResourceClaim with that name that is not owned by the pod will not be used for the pod to avoid using an unrelated resource by mistake. Scheduling and pod startup are then blocked until the unrelated ResourceClaim is removed.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ClientIPConfig": { "description": "ClientIPConfig represents the configurations of Client IP based session affinity.", "properties": { "timeoutSeconds": { "description": "timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours).", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.core.v1.ComponentCondition": { "description": "Information about the condition of a component.", "properties": { "error": { "description": "Condition error code for a component. For example, a health check error code.", "type": "string" }, "message": { "description": "Message about the condition for a component. For example, information about a health check.", "type": "string" }, "status": { "default": "", "description": "Status of the condition for a component. Valid values for \"Healthy\": \"True\", \"False\", or \"Unknown\".", "type": "string" }, "type": { "default": "", "description": "Type of condition for a component. Valid value: \"Healthy\"", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.core.v1.ComponentStatus": { "description": "ComponentStatus (and ComponentStatusList) holds the cluster validation info. Deprecated: This API is deprecated in v1.19+", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "conditions": { "description": "List of component conditions observed", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ComponentStatus", "version": "v1" } ] }, "io.k8s.api.core.v1.ComponentStatusList": { "description": "Status of all the conditions for the component as a list of ComponentStatus objects. Deprecated: This API is deprecated in v1.19+", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of ComponentStatus objects.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatus" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ComponentStatusList", "version": "v1" } ] }, "io.k8s.api.core.v1.ConfigMap": { "description": "ConfigMap holds configuration data for pods to consume.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "binaryData": { "additionalProperties": { "format": "byte", "type": "string" }, "description": "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.", "type": "object" }, "data": { "additionalProperties": { "default": "", "type": "string" }, "description": "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.", "type": "object" }, "immutable": { "description": "Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.", "type": "boolean" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ConfigMap", "version": "v1" } ] }, "io.k8s.api.core.v1.ConfigMapEnvSource": { "description": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the ConfigMap must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.ConfigMapKeySelector": { "description": "Selects a key from a ConfigMap.", "properties": { "key": { "default": "", "description": "The key to select.", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the ConfigMap or its key must be defined", "type": "boolean" } }, "required": [ "key" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ConfigMapList": { "description": "ConfigMapList is a resource containing a list of ConfigMap objects.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "Items is the list of ConfigMaps.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ConfigMapList", "version": "v1" } ] }, "io.k8s.api.core.v1.ConfigMapNodeConfigSource": { "description": "ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. This API is deprecated since 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration", "properties": { "kubeletConfigKey": { "default": "", "description": "KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.", "type": "string" }, "name": { "default": "", "description": "Name is the metadata.name of the referenced ConfigMap. This field is required in all cases.", "type": "string" }, "namespace": { "default": "", "description": "Namespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.", "type": "string" }, "resourceVersion": { "description": "ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.", "type": "string" }, "uid": { "description": "UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.", "type": "string" } }, "required": [ "namespace", "name", "kubeletConfigKey" ], "type": "object" }, "io.k8s.api.core.v1.ConfigMapProjection": { "description": "Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.", "properties": { "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional specify whether the ConfigMap or its keys must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.ConfigMapVolumeSource": { "description": "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional specify whether the ConfigMap or its keys must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.Container": { "description": "A single application container that you want to run within a pod.", "properties": { "args": { "description": "Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "command": { "description": "Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "env": { "description": "List of environment variables to set in the container. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVar" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "envFrom": { "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvFromSource" } ], "default": {} }, "type": "array" }, "image": { "description": "Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", "type": "string" }, "imagePullPolicy": { "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", "type": "string" }, "lifecycle": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Lifecycle" } ], "description": "Actions that the management system should take in response to container lifecycle events. Cannot be updated." }, "livenessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "name": { "default": "", "description": "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", "type": "string" }, "ports": { "description": "List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerPort" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "containerPort", "protocol" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "containerPort", "x-kubernetes-patch-strategy": "merge" }, "readinessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecurityContext" } ], "description": "SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" }, "startupProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "stdin": { "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", "type": "boolean" }, "stdinOnce": { "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", "type": "boolean" }, "terminationMessagePath": { "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", "type": "string" }, "terminationMessagePolicy": { "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", "type": "string" }, "tty": { "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", "type": "boolean" }, "volumeDevices": { "description": "volumeDevices is the list of block devices to be used by the container.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeDevice" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge" }, "volumeMounts": { "description": "Pod volumes to mount into the container's filesystem. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeMount" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, "workingDir": { "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.ContainerImage": { "description": "Describe a container image", "properties": { "names": { "description": "Names by which this image is known. e.g. [\"kubernetes.example/hyperkube:v1.0.7\", \"cloud-vendor.registry.example/cloud-vendor/hyperkube:v1.0.7\"]", "items": { "default": "", "type": "string" }, "type": "array" }, "sizeBytes": { "description": "The size of the image in bytes.", "format": "int64", "type": "integer" } }, "type": "object" }, "io.k8s.api.core.v1.ContainerPort": { "description": "ContainerPort represents a network port in a single container.", "properties": { "containerPort": { "default": 0, "description": "Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.", "format": "int32", "type": "integer" }, "hostIP": { "description": "What host IP to bind the external port to.", "type": "string" }, "hostPort": { "description": "Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.", "format": "int32", "type": "integer" }, "name": { "description": "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.", "type": "string" }, "protocol": { "default": "TCP", "description": "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".", "type": "string" } }, "required": [ "containerPort" ], "type": "object" }, "io.k8s.api.core.v1.ContainerState": { "description": "ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.", "properties": { "running": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerStateRunning" } ], "description": "Details about a running container" }, "terminated": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerStateTerminated" } ], "description": "Details about a terminated container" }, "waiting": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerStateWaiting" } ], "description": "Details about a waiting container" } }, "type": "object" }, "io.k8s.api.core.v1.ContainerStateRunning": { "description": "ContainerStateRunning is a running state of a container.", "properties": { "startedAt": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Time at which the container was last (re-)started" } }, "type": "object" }, "io.k8s.api.core.v1.ContainerStateTerminated": { "description": "ContainerStateTerminated is a terminated state of a container.", "properties": { "containerID": { "description": "Container's ID in the format '://'", "type": "string" }, "exitCode": { "default": 0, "description": "Exit status from the last termination of the container", "format": "int32", "type": "integer" }, "finishedAt": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Time at which the container last terminated" }, "message": { "description": "Message regarding the last termination of the container", "type": "string" }, "reason": { "description": "(brief) reason from the last termination of the container", "type": "string" }, "signal": { "description": "Signal from the last termination of the container", "format": "int32", "type": "integer" }, "startedAt": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Time at which previous execution of the container started" } }, "required": [ "exitCode" ], "type": "object" }, "io.k8s.api.core.v1.ContainerStateWaiting": { "description": "ContainerStateWaiting is a waiting state of a container.", "properties": { "message": { "description": "Message regarding why the container is not yet running.", "type": "string" }, "reason": { "description": "(brief) reason the container is not yet running.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ContainerStatus": { "description": "ContainerStatus contains details for the current status of this container.", "properties": { "containerID": { "description": "Container's ID in the format '://'.", "type": "string" }, "image": { "default": "", "description": "The image the container is running. More info: https://kubernetes.io/docs/concepts/containers/images.", "type": "string" }, "imageID": { "default": "", "description": "ImageID of the container's image.", "type": "string" }, "lastState": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerState" } ], "default": {}, "description": "Details about the container's last termination condition." }, "name": { "default": "", "description": "This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.", "type": "string" }, "ready": { "default": false, "description": "Specifies whether the container has passed its readiness probe.", "type": "boolean" }, "restartCount": { "default": 0, "description": "The number of times the container has been restarted.", "format": "int32", "type": "integer" }, "started": { "description": "Specifies whether the container has passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. Is always true when no startupProbe is defined.", "type": "boolean" }, "state": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerState" } ], "default": {}, "description": "Details about the container's current condition." } }, "required": [ "name", "ready", "restartCount", "image", "imageID" ], "type": "object" }, "io.k8s.api.core.v1.DaemonEndpoint": { "description": "DaemonEndpoint contains information about a single Daemon endpoint.", "properties": { "Port": { "default": 0, "description": "Port number of the given endpoint.", "format": "int32", "type": "integer" } }, "required": [ "Port" ], "type": "object" }, "io.k8s.api.core.v1.DownwardAPIProjection": { "description": "Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.", "properties": { "items": { "description": "Items is a list of DownwardAPIVolume file", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.DownwardAPIVolumeFile": { "description": "DownwardAPIVolumeFile represents information to create the file containing the pod field", "properties": { "fieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector" } ], "description": "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported." }, "mode": { "description": "Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "path": { "default": "", "description": "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'", "type": "string" }, "resourceFieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector" } ], "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported." } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.DownwardAPIVolumeSource": { "description": "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "Items is a list of downward API volume file", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.EmptyDirVolumeSource": { "description": "Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.", "properties": { "medium": { "description": "medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", "type": "string" }, "sizeLimit": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "description": "sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" } }, "type": "object" }, "io.k8s.api.core.v1.EndpointAddress": { "description": "EndpointAddress is a tuple that describes single IP address.", "properties": { "hostname": { "description": "The Hostname of this endpoint", "type": "string" }, "ip": { "default": "", "description": "The IP of this endpoint. May not be loopback (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 or fe80::/10), or link-local multicast (224.0.0.0/24 or ff02::/16).", "type": "string" }, "nodeName": { "description": "Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.", "type": "string" }, "targetRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "description": "Reference to object providing the endpoint." } }, "required": [ "ip" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.EndpointPort": { "description": "EndpointPort is a tuple that describes a single port.", "properties": { "appProtocol": { "description": "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol.", "type": "string" }, "name": { "description": "The name of this port. This must match the 'name' field in the corresponding ServicePort. Must be a DNS_LABEL. Optional only if one port is defined.", "type": "string" }, "port": { "default": 0, "description": "The port number of the endpoint.", "format": "int32", "type": "integer" }, "protocol": { "description": "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", "type": "string" } }, "required": [ "port" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.EndpointSubset": { "description": "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n\n\t{\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t}\n\nThe resulting set of endpoints can be viewed as:\n\n\ta: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n\tb: [ 10.10.1.1:309, 10.10.2.2:309 ]", "properties": { "addresses": { "description": "IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointAddress" } ], "default": {} }, "type": "array" }, "notReadyAddresses": { "description": "IP addresses which offer the related ports but are not currently marked as ready because they have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointAddress" } ], "default": {} }, "type": "array" }, "ports": { "description": "Port numbers available on the related IP addresses.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointPort" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.Endpoints": { "description": "Endpoints is a collection of endpoints that implement the actual service. Example:\n\n\t Name: \"mysvc\",\n\t Subsets: [\n\t {\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t },\n\t {\n\t Addresses: [{\"ip\": \"10.10.3.3\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n\t },\n\t]", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "subsets": { "description": "The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointSubset" } ], "default": {} }, "type": "array" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Endpoints", "version": "v1" } ] }, "io.k8s.api.core.v1.EndpointsList": { "description": "EndpointsList is a list of endpoints.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of endpoints.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "EndpointsList", "version": "v1" } ] }, "io.k8s.api.core.v1.EnvFromSource": { "description": "EnvFromSource represents the source of a set of ConfigMaps", "properties": { "configMapRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource" } ], "description": "The ConfigMap to select from" }, "prefix": { "description": "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", "type": "string" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretEnvSource" } ], "description": "The Secret to select from" } }, "type": "object" }, "io.k8s.api.core.v1.EnvVar": { "description": "EnvVar represents an environment variable present in a Container.", "properties": { "name": { "default": "", "description": "Name of the environment variable. Must be a C_IDENTIFIER.", "type": "string" }, "value": { "description": "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", "type": "string" }, "valueFrom": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVarSource" } ], "description": "Source for the environment variable's value. Cannot be used if value is not empty." } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.EnvVarSource": { "description": "EnvVarSource represents a source for the value of an EnvVar.", "properties": { "configMapKeyRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector" } ], "description": "Selects a key of a ConfigMap." }, "fieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector" } ], "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs." }, "resourceFieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector" } ], "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported." }, "secretKeyRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretKeySelector" } ], "description": "Selects a key of a secret in the pod's namespace" } }, "type": "object" }, "io.k8s.api.core.v1.EphemeralContainer": { "description": "An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.", "properties": { "args": { "description": "Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "command": { "description": "Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "env": { "description": "List of environment variables to set in the container. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVar" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "envFrom": { "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvFromSource" } ], "default": {} }, "type": "array" }, "image": { "description": "Container image name. More info: https://kubernetes.io/docs/concepts/containers/images", "type": "string" }, "imagePullPolicy": { "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", "type": "string" }, "lifecycle": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Lifecycle" } ], "description": "Lifecycle is not allowed for ephemeral containers." }, "livenessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "name": { "default": "", "description": "Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.", "type": "string" }, "ports": { "description": "Ports are not allowed for ephemeral containers.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerPort" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "containerPort", "protocol" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "containerPort", "x-kubernetes-patch-strategy": "merge" }, "readinessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod." }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecurityContext" } ], "description": "Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext." }, "startupProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "stdin": { "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", "type": "boolean" }, "stdinOnce": { "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", "type": "boolean" }, "targetContainerName": { "description": "If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.", "type": "string" }, "terminationMessagePath": { "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", "type": "string" }, "terminationMessagePolicy": { "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", "type": "string" }, "tty": { "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", "type": "boolean" }, "volumeDevices": { "description": "volumeDevices is the list of block devices to be used by the container.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeDevice" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge" }, "volumeMounts": { "description": "Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeMount" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, "workingDir": { "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.EphemeralVolumeSource": { "description": "Represents an ephemeral volume that is handled by a normal storage driver.", "properties": { "volumeClaimTemplate": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate" } ], "description": "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil." } }, "type": "object" }, "io.k8s.api.core.v1.Event": { "description": "Event is a report of an event somewhere in the cluster. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data.", "properties": { "action": { "description": "What action was taken/failed regarding to the Regarding object.", "type": "string" }, "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "count": { "description": "The number of times this event has occurred.", "format": "int32", "type": "integer" }, "eventTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime" } ], "default": {}, "description": "Time when this Event was first observed." }, "firstTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)" }, "involvedObject": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "default": {}, "description": "The object that this event is about." }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "lastTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "The time at which the most recent occurrence of this event was recorded." }, "message": { "description": "A human-readable description of the status of this operation.", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "reason": { "description": "This should be a short, machine understandable string that gives the reason for the transition into the object's current status.", "type": "string" }, "related": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "description": "Optional secondary object for more complex actions." }, "reportingComponent": { "default": "", "description": "Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.", "type": "string" }, "reportingInstance": { "default": "", "description": "ID of the controller instance, e.g. `kubelet-xyzf`.", "type": "string" }, "series": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventSeries" } ], "description": "Data about the Event series this event represents or nil if it's a singleton Event." }, "source": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventSource" } ], "default": {}, "description": "The component reporting this event. Should be a short machine understandable string." }, "type": { "description": "Type of this event (Normal, Warning), new types could be added in the future", "type": "string" } }, "required": [ "metadata", "involvedObject" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Event", "version": "v1" } ] }, "io.k8s.api.core.v1.EventList": { "description": "EventList is a list of events.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of events", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "EventList", "version": "v1" } ] }, "io.k8s.api.core.v1.EventSeries": { "description": "EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.", "properties": { "count": { "description": "Number of occurrences in this series up to the last heartbeat time", "format": "int32", "type": "integer" }, "lastObservedTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime" } ], "default": {}, "description": "Time of the last occurrence observed" } }, "type": "object" }, "io.k8s.api.core.v1.EventSource": { "description": "EventSource contains information for an event.", "properties": { "component": { "description": "Component from which the event is generated.", "type": "string" }, "host": { "description": "Node name on which the event is generated.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ExecAction": { "description": "ExecAction describes a \"run in container\" action.", "properties": { "command": { "description": "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.FCVolumeSource": { "description": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "lun": { "description": "lun is Optional: FC target lun number", "format": "int32", "type": "integer" }, "readOnly": { "description": "readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "targetWWNs": { "description": "targetWWNs is Optional: FC target worldwide names (WWNs)", "items": { "default": "", "type": "string" }, "type": "array" }, "wwids": { "description": "wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.FlexPersistentVolumeSource": { "description": "FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin.", "properties": { "driver": { "default": "", "description": "driver is the name of the driver to use for this volume.", "type": "string" }, "fsType": { "description": "fsType is the Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", "type": "string" }, "options": { "additionalProperties": { "default": "", "type": "string" }, "description": "options is Optional: this field holds extra command options if any.", "type": "object" }, "readOnly": { "description": "readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "secretRef is Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts." } }, "required": [ "driver" ], "type": "object" }, "io.k8s.api.core.v1.FlexVolumeSource": { "description": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", "properties": { "driver": { "default": "", "description": "driver is the name of the driver to use for this volume.", "type": "string" }, "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", "type": "string" }, "options": { "additionalProperties": { "default": "", "type": "string" }, "description": "options is Optional: this field holds extra command options if any.", "type": "object" }, "readOnly": { "description": "readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts." } }, "required": [ "driver" ], "type": "object" }, "io.k8s.api.core.v1.FlockerVolumeSource": { "description": "Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.", "properties": { "datasetName": { "description": "datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated", "type": "string" }, "datasetUUID": { "description": "datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.GCEPersistentDiskVolumeSource": { "description": "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "string" }, "partition": { "description": "partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "format": "int32", "type": "integer" }, "pdName": { "default": "", "description": "pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "string" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "boolean" } }, "required": [ "pdName" ], "type": "object" }, "io.k8s.api.core.v1.GRPCAction": { "properties": { "port": { "default": 0, "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", "format": "int32", "type": "integer" }, "service": { "default": "", "description": "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.", "type": "string" } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.GitRepoVolumeSource": { "description": "Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", "properties": { "directory": { "description": "directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.", "type": "string" }, "repository": { "default": "", "description": "repository is the URL", "type": "string" }, "revision": { "description": "revision is the commit hash for the specified revision.", "type": "string" } }, "required": [ "repository" ], "type": "object" }, "io.k8s.api.core.v1.GlusterfsPersistentVolumeSource": { "description": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", "properties": { "endpoints": { "default": "", "description": "endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "endpointsNamespace": { "description": "endpointsNamespace is the namespace that contains Glusterfs endpoint. If this field is empty, the EndpointNamespace defaults to the same namespace as the bound PVC. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "path": { "default": "", "description": "path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "readOnly": { "description": "readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "boolean" } }, "required": [ "endpoints", "path" ], "type": "object" }, "io.k8s.api.core.v1.GlusterfsVolumeSource": { "description": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", "properties": { "endpoints": { "default": "", "description": "endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "path": { "default": "", "description": "path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "readOnly": { "description": "readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "boolean" } }, "required": [ "endpoints", "path" ], "type": "object" }, "io.k8s.api.core.v1.HTTPGetAction": { "description": "HTTPGetAction describes an action based on HTTP Get requests.", "properties": { "host": { "description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", "type": "string" }, "httpHeaders": { "description": "Custom headers to set in the request. HTTP allows repeated headers.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPHeader" } ], "default": {} }, "type": "array" }, "path": { "description": "Path to access on the HTTP server.", "type": "string" }, "port": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "default": {}, "description": "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME." }, "scheme": { "description": "Scheme to use for connecting to the host. Defaults to HTTP.", "type": "string" } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.HTTPHeader": { "description": "HTTPHeader describes a custom header to be used in HTTP probes", "properties": { "name": { "default": "", "description": "The header field name", "type": "string" }, "value": { "default": "", "description": "The header field value", "type": "string" } }, "required": [ "name", "value" ], "type": "object" }, "io.k8s.api.core.v1.HostAlias": { "description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.", "properties": { "hostnames": { "description": "Hostnames for the above IP address.", "items": { "default": "", "type": "string" }, "type": "array" }, "ip": { "description": "IP address of the host file entry.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.HostPathVolumeSource": { "description": "Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.", "properties": { "path": { "default": "", "description": "path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", "type": "string" }, "type": { "description": "type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", "type": "string" } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.ISCSIPersistentVolumeSource": { "description": "ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", "properties": { "chapAuthDiscovery": { "description": "chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication", "type": "boolean" }, "chapAuthSession": { "description": "chapAuthSession defines whether support iSCSI Session CHAP authentication", "type": "boolean" }, "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", "type": "string" }, "initiatorName": { "description": "initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.", "type": "string" }, "iqn": { "default": "", "description": "iqn is Target iSCSI Qualified Name.", "type": "string" }, "iscsiInterface": { "description": "iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", "type": "string" }, "lun": { "default": 0, "description": "lun is iSCSI Target Lun number.", "format": "int32", "type": "integer" }, "portals": { "description": "portals is the iSCSI Target Portal List. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", "items": { "default": "", "type": "string" }, "type": "array" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "secretRef is the CHAP Secret for iSCSI target and initiator authentication" }, "targetPortal": { "default": "", "description": "targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", "type": "string" } }, "required": [ "targetPortal", "iqn", "lun" ], "type": "object" }, "io.k8s.api.core.v1.ISCSIVolumeSource": { "description": "Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", "properties": { "chapAuthDiscovery": { "description": "chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication", "type": "boolean" }, "chapAuthSession": { "description": "chapAuthSession defines whether support iSCSI Session CHAP authentication", "type": "boolean" }, "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", "type": "string" }, "initiatorName": { "description": "initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.", "type": "string" }, "iqn": { "default": "", "description": "iqn is the target iSCSI Qualified Name.", "type": "string" }, "iscsiInterface": { "description": "iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", "type": "string" }, "lun": { "default": 0, "description": "lun represents iSCSI Target Lun number.", "format": "int32", "type": "integer" }, "portals": { "description": "portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", "items": { "default": "", "type": "string" }, "type": "array" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is the CHAP Secret for iSCSI target and initiator authentication" }, "targetPortal": { "default": "", "description": "targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", "type": "string" } }, "required": [ "targetPortal", "iqn", "lun" ], "type": "object" }, "io.k8s.api.core.v1.KeyToPath": { "description": "Maps a string key to a path within a volume.", "properties": { "key": { "default": "", "description": "key is the key to project.", "type": "string" }, "mode": { "description": "mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "path": { "default": "", "description": "path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.", "type": "string" } }, "required": [ "key", "path" ], "type": "object" }, "io.k8s.api.core.v1.Lifecycle": { "description": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", "properties": { "postStart": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LifecycleHandler" } ], "description": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" }, "preStop": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LifecycleHandler" } ], "description": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" } }, "type": "object" }, "io.k8s.api.core.v1.LifecycleHandler": { "description": "LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.", "properties": { "exec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ExecAction" } ], "description": "Exec specifies the action to take." }, "httpGet": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPGetAction" } ], "description": "HTTPGet specifies the http request to perform." }, "tcpSocket": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TCPSocketAction" } ], "description": "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified." } }, "type": "object" }, "io.k8s.api.core.v1.LimitRange": { "description": "LimitRange sets resource usage limits for each kind of resource in a Namespace.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeSpec" } ], "default": {}, "description": "Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "LimitRange", "version": "v1" } ] }, "io.k8s.api.core.v1.LimitRangeItem": { "description": "LimitRangeItem defines a min/max usage limit for any resource that matches on kind.", "properties": { "default": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Default resource requirement limit value by resource name if resource limit is omitted.", "type": "object" }, "defaultRequest": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "DefaultRequest is the default resource requirement request value by resource name if resource request is omitted.", "type": "object" }, "max": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Max usage constraints on this kind by resource name.", "type": "object" }, "maxLimitRequestRatio": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource.", "type": "object" }, "min": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Min usage constraints on this kind by resource name.", "type": "object" }, "type": { "default": "", "description": "Type of resource that this limit applies to.", "type": "string" } }, "required": [ "type" ], "type": "object" }, "io.k8s.api.core.v1.LimitRangeList": { "description": "LimitRangeList is a list of LimitRange items.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "Items is a list of LimitRange objects. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "LimitRangeList", "version": "v1" } ] }, "io.k8s.api.core.v1.LimitRangeSpec": { "description": "LimitRangeSpec defines a min/max usage limit for resources that match on kind.", "properties": { "limits": { "description": "Limits is the list of LimitRangeItem objects that are enforced.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeItem" } ], "default": {} }, "type": "array" } }, "required": [ "limits" ], "type": "object" }, "io.k8s.api.core.v1.LoadBalancerIngress": { "description": "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.", "properties": { "hostname": { "description": "Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)", "type": "string" }, "ip": { "description": "IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)", "type": "string" }, "ports": { "description": "Ports is a list of records of service ports If used, every port defined in the service should have an entry in it", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PortStatus" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" } }, "type": "object" }, "io.k8s.api.core.v1.LoadBalancerStatus": { "description": "LoadBalancerStatus represents the status of a load-balancer.", "properties": { "ingress": { "description": "Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LoadBalancerIngress" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.LocalObjectReference": { "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.LocalVolumeSource": { "description": "Local represents directly-attached storage with node affinity (Beta feature)", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. It applies only when the Path is a block device. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default value is to auto-select a filesystem if unspecified.", "type": "string" }, "path": { "default": "", "description": "path of the full path to the volume on the node. It can be either a directory or block device (disk, partition, ...).", "type": "string" } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.NFSVolumeSource": { "description": "Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.", "properties": { "path": { "default": "", "description": "path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "string" }, "readOnly": { "description": "readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "boolean" }, "server": { "default": "", "description": "server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "string" } }, "required": [ "server", "path" ], "type": "object" }, "io.k8s.api.core.v1.Namespace": { "description": "Namespace provides a scope for Names. Use of multiple namespaces is optional.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NamespaceSpec" } ], "default": {}, "description": "Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NamespaceStatus" } ], "default": {}, "description": "Status describes the current status of a Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Namespace", "version": "v1" } ] }, "io.k8s.api.core.v1.NamespaceCondition": { "description": "NamespaceCondition contains details about state of namespace.", "properties": { "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {} }, "message": { "type": "string" }, "reason": { "type": "string" }, "status": { "default": "", "description": "Status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "Type of namespace controller condition.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.core.v1.NamespaceList": { "description": "NamespaceList is a list of Namespaces.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "Items is the list of Namespace objects in the list. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "NamespaceList", "version": "v1" } ] }, "io.k8s.api.core.v1.NamespaceSpec": { "description": "NamespaceSpec describes the attributes on a Namespace.", "properties": { "finalizers": { "description": "Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.NamespaceStatus": { "description": "NamespaceStatus is information about the current status of a Namespace.", "properties": { "conditions": { "description": "Represents the latest available observations of a namespace's current state.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NamespaceCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "phase": { "description": "Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.Node": { "description": "Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSpec" } ], "default": {}, "description": "Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeStatus" } ], "default": {}, "description": "Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Node", "version": "v1" } ] }, "io.k8s.api.core.v1.NodeAddress": { "description": "NodeAddress contains information for the node's address.", "properties": { "address": { "default": "", "description": "The node address.", "type": "string" }, "type": { "default": "", "description": "Node address type, one of Hostname, ExternalIP or InternalIP.", "type": "string" } }, "required": [ "type", "address" ], "type": "object" }, "io.k8s.api.core.v1.NodeAffinity": { "description": "Node affinity is a group of node affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" } ], "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node." } }, "type": "object" }, "io.k8s.api.core.v1.NodeCondition": { "description": "NodeCondition contains condition information for a node.", "properties": { "lastHeartbeatTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time we got an update on a given condition." }, "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time the condition transit from one status to another." }, "message": { "description": "Human readable message indicating details about last transition.", "type": "string" }, "reason": { "description": "(brief) reason for the condition's last transition.", "type": "string" }, "status": { "default": "", "description": "Status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "Type of node condition.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.core.v1.NodeConfigSource": { "description": "NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. This API is deprecated since 1.22", "properties": { "configMap": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapNodeConfigSource" } ], "description": "ConfigMap is a reference to a Node's ConfigMap" } }, "type": "object" }, "io.k8s.api.core.v1.NodeConfigStatus": { "description": "NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource.", "properties": { "active": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeConfigSource" } ], "description": "Active reports the checkpointed config the node is actively using. Active will represent either the current version of the Assigned config, or the current LastKnownGood config, depending on whether attempting to use the Assigned config results in an error." }, "assigned": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeConfigSource" } ], "description": "Assigned reports the checkpointed config the node will try to use. When Node.Spec.ConfigSource is updated, the node checkpoints the associated config payload to local disk, along with a record indicating intended config. The node refers to this record to choose its config checkpoint, and reports this record in Assigned. Assigned only updates in the status after the record has been checkpointed to disk. When the Kubelet is restarted, it tries to make the Assigned config the Active config by loading and validating the checkpointed payload identified by Assigned." }, "error": { "description": "Error describes any problems reconciling the Spec.ConfigSource to the Active config. Errors may occur, for example, attempting to checkpoint Spec.ConfigSource to the local Assigned record, attempting to checkpoint the payload associated with Spec.ConfigSource, attempting to load or validate the Assigned config, etc. Errors may occur at different points while syncing config. Earlier errors (e.g. download or checkpointing errors) will not result in a rollback to LastKnownGood, and may resolve across Kubelet retries. Later errors (e.g. loading or validating a checkpointed config) will result in a rollback to LastKnownGood. In the latter case, it is usually possible to resolve the error by fixing the config assigned in Spec.ConfigSource. You can find additional information for debugging by searching the error message in the Kubelet log. Error is a human-readable description of the error state; machines can check whether or not Error is empty, but should not rely on the stability of the Error text across Kubelet versions.", "type": "string" }, "lastKnownGood": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeConfigSource" } ], "description": "LastKnownGood reports the checkpointed config the node will fall back to when it encounters an error attempting to use the Assigned config. The Assigned config becomes the LastKnownGood config when the node determines that the Assigned config is stable and correct. This is currently implemented as a 10-minute soak period starting when the local record of Assigned config is updated. If the Assigned config is Active at the end of this period, it becomes the LastKnownGood. Note that if Spec.ConfigSource is reset to nil (use local defaults), the LastKnownGood is also immediately reset to nil, because the local default config is always assumed good. You should not make assumptions about the node's method of determining config stability and correctness, as this may change or become configurable in the future." } }, "type": "object" }, "io.k8s.api.core.v1.NodeDaemonEndpoints": { "description": "NodeDaemonEndpoints lists ports opened by daemons running on the Node.", "properties": { "kubeletEndpoint": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DaemonEndpoint" } ], "default": {}, "description": "Endpoint on which Kubelet is listening." } }, "type": "object" }, "io.k8s.api.core.v1.NodeList": { "description": "NodeList is the whole list of all Nodes which have been registered with master.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of nodes", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "NodeList", "version": "v1" } ] }, "io.k8s.api.core.v1.NodeSelector": { "description": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", "properties": { "nodeSelectorTerms": { "description": "Required. A list of node selector terms. The terms are ORed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm" } ], "default": {} }, "type": "array" } }, "required": [ "nodeSelectorTerms" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.NodeSelectorRequirement": { "description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "properties": { "key": { "default": "", "description": "The label key that the selector applies to.", "type": "string" }, "operator": { "default": "", "description": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", "type": "string" }, "values": { "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", "items": { "default": "", "type": "string" }, "type": "array" } }, "required": [ "key", "operator" ], "type": "object" }, "io.k8s.api.core.v1.NodeSelectorTerm": { "description": "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.", "properties": { "matchExpressions": { "description": "A list of node selector requirements by node's labels.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement" } ], "default": {} }, "type": "array" }, "matchFields": { "description": "A list of node selector requirements by node's fields.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement" } ], "default": {} }, "type": "array" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.NodeSpec": { "description": "NodeSpec describes the attributes that a node is created with.", "properties": { "configSource": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeConfigSource" } ], "description": "Deprecated: Previously used to specify the source of the node's configuration for the DynamicKubeletConfig feature. This feature is removed." }, "externalID": { "description": "Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966", "type": "string" }, "podCIDR": { "description": "PodCIDR represents the pod IP range assigned to the node.", "type": "string" }, "podCIDRs": { "description": "podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-patch-strategy": "merge" }, "providerID": { "description": "ID of the node assigned by the cloud provider in the format: ://", "type": "string" }, "taints": { "description": "If specified, the node's taints.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Taint" } ], "default": {} }, "type": "array" }, "unschedulable": { "description": "Unschedulable controls node schedulability of new pods. By default, node is schedulable. More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.NodeStatus": { "description": "NodeStatus is information about the current status of a node.", "properties": { "addresses": { "description": "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example. Consumers should assume that addresses can change during the lifetime of a Node. However, there are some exceptions where this may not be possible, such as Pods that inherit a Node's address in its own status or consumers of the downward API (status.hostIP).", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeAddress" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "allocatable": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity.", "type": "object" }, "capacity": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", "type": "object" }, "conditions": { "description": "Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "config": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeConfigStatus" } ], "description": "Status of the config assigned to the node via the dynamic Kubelet config feature." }, "daemonEndpoints": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeDaemonEndpoints" } ], "default": {}, "description": "Endpoints of daemons running on the Node." }, "images": { "description": "List of container images on this node", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerImage" } ], "default": {} }, "type": "array" }, "nodeInfo": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSystemInfo" } ], "default": {}, "description": "Set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#info" }, "phase": { "description": "NodePhase is the recently observed lifecycle phase of the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#phase The field is never populated, and now is deprecated.", "type": "string" }, "volumesAttached": { "description": "List of volumes that are attached to the node.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AttachedVolume" } ], "default": {} }, "type": "array" }, "volumesInUse": { "description": "List of attachable volumes in use (mounted) by the node.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.NodeSystemInfo": { "description": "NodeSystemInfo is a set of ids/uuids to uniquely identify the node.", "properties": { "architecture": { "default": "", "description": "The Architecture reported by the node", "type": "string" }, "bootID": { "default": "", "description": "Boot ID reported by the node.", "type": "string" }, "containerRuntimeVersion": { "default": "", "description": "ContainerRuntime Version reported by the node through runtime remote API (e.g. containerd://1.4.2).", "type": "string" }, "kernelVersion": { "default": "", "description": "Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).", "type": "string" }, "kubeProxyVersion": { "default": "", "description": "KubeProxy Version reported by the node.", "type": "string" }, "kubeletVersion": { "default": "", "description": "Kubelet Version reported by the node.", "type": "string" }, "machineID": { "default": "", "description": "MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html", "type": "string" }, "operatingSystem": { "default": "", "description": "The Operating System reported by the node", "type": "string" }, "osImage": { "default": "", "description": "OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).", "type": "string" }, "systemUUID": { "default": "", "description": "SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid", "type": "string" } }, "required": [ "machineID", "systemUUID", "bootID", "kernelVersion", "osImage", "containerRuntimeVersion", "kubeletVersion", "kubeProxyVersion", "operatingSystem", "architecture" ], "type": "object" }, "io.k8s.api.core.v1.ObjectFieldSelector": { "description": "ObjectFieldSelector selects an APIVersioned field of an object.", "properties": { "apiVersion": { "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", "type": "string" }, "fieldPath": { "default": "", "description": "Path of the field to select in the specified API version.", "type": "string" } }, "required": [ "fieldPath" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ObjectReference": { "description": "ObjectReference contains enough information to let you inspect or modify the referred object.", "properties": { "apiVersion": { "description": "API version of the referent.", "type": "string" }, "fieldPath": { "description": "If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.", "type": "string" }, "kind": { "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "namespace": { "description": "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", "type": "string" }, "resourceVersion": { "description": "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "uid": { "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids", "type": "string" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.PersistentVolume": { "description": "PersistentVolume (PV) is a storage resource provisioned by an administrator. It is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeSpec" } ], "default": {}, "description": "spec defines a specification of a persistent volume owned by the cluster. Provisioned by an administrator. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeStatus" } ], "default": {}, "description": "status represents the current information/status for the persistent volume. Populated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "PersistentVolume", "version": "v1" } ] }, "io.k8s.api.core.v1.PersistentVolumeClaim": { "description": "PersistentVolumeClaim is a user's request for and claim to a persistent volume", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec" } ], "default": {}, "description": "spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimStatus" } ], "default": {}, "description": "status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } ] }, "io.k8s.api.core.v1.PersistentVolumeClaimCondition": { "description": "PersistentVolumeClaimCondition contails details about state of pvc", "properties": { "lastProbeTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "lastProbeTime is the time we probed the condition." }, "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "lastTransitionTime is the time the condition transitioned from one status to another." }, "message": { "description": "message is the human-readable message indicating details about last transition.", "type": "string" }, "reason": { "description": "reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports \"ResizeStarted\" that means the underlying persistent volume is being resized.", "type": "string" }, "status": { "default": "", "type": "string" }, "type": { "default": "", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimList": { "description": "PersistentVolumeClaimList is a list of PersistentVolumeClaim items.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "items is a list of persistent volume claims. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "PersistentVolumeClaimList", "version": "v1" } ] }, "io.k8s.api.core.v1.PersistentVolumeClaimSpec": { "description": "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes", "properties": { "accessModes": { "description": "accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", "items": { "default": "", "type": "string" }, "type": "array" }, "dataSource": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference" } ], "description": "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource." }, "dataSourceRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TypedObjectReference" } ], "description": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled." }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources" }, "selector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "selector is a label query over volumes to consider for binding." }, "storageClassName": { "description": "storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", "type": "string" }, "volumeMode": { "description": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", "type": "string" }, "volumeName": { "description": "volumeName is the binding reference to the PersistentVolume backing this claim.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimStatus": { "description": "PersistentVolumeClaimStatus is the current status of a persistent volume claim.", "properties": { "accessModes": { "description": "accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", "items": { "default": "", "type": "string" }, "type": "array" }, "allocatedResources": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", "type": "object" }, "capacity": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "capacity represents the actual resources of the underlying volume.", "type": "object" }, "conditions": { "description": "conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "phase": { "description": "phase represents the current phase of PersistentVolumeClaim.", "type": "string" }, "resizeStatus": { "description": "resizeStatus stores status of resize operation. ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty string by resize controller or kubelet. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimTemplate": { "description": "PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.", "properties": { "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation." }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec" } ], "default": {}, "description": "The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here." } }, "required": [ "spec" ], "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource": { "description": "PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).", "properties": { "claimName": { "default": "", "description": "claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", "type": "string" }, "readOnly": { "description": "readOnly Will force the ReadOnly setting in VolumeMounts. Default false.", "type": "boolean" } }, "required": [ "claimName" ], "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeList": { "description": "PersistentVolumeList is a list of PersistentVolume items.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "items is a list of persistent volumes. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "PersistentVolumeList", "version": "v1" } ] }, "io.k8s.api.core.v1.PersistentVolumeSpec": { "description": "PersistentVolumeSpec is the specification of a persistent volume.", "properties": { "accessModes": { "description": "accessModes contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes", "items": { "default": "", "type": "string" }, "type": "array" }, "awsElasticBlockStore": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource" } ], "description": "awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" }, "azureDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource" } ], "description": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod." }, "azureFile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AzureFilePersistentVolumeSource" } ], "description": "azureFile represents an Azure File Service mount on the host and bind mount to the pod." }, "capacity": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "capacity is the description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", "type": "object" }, "cephfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CephFSPersistentVolumeSource" } ], "description": "cephFS represents a Ceph FS mount on the host that shares a pod's lifetime" }, "cinder": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CinderPersistentVolumeSource" } ], "description": "cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" }, "claimRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "description": "claimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName is the authoritative bind between PV and PVC. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding", "x-kubernetes-map-type": "granular" }, "csi": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CSIPersistentVolumeSource" } ], "description": "csi represents storage that is handled by an external CSI driver (Beta feature)." }, "fc": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FCVolumeSource" } ], "description": "fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod." }, "flexVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FlexPersistentVolumeSource" } ], "description": "flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin." }, "flocker": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource" } ], "description": "flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running" }, "gcePersistentDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource" } ], "description": "gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" }, "glusterfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GlusterfsPersistentVolumeSource" } ], "description": "glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md" }, "hostPath": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource" } ], "description": "hostPath represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath" }, "iscsi": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ISCSIPersistentVolumeSource" } ], "description": "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin." }, "local": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalVolumeSource" } ], "description": "local represents directly-attached storage with node affinity" }, "mountOptions": { "description": "mountOptions is the list of mount options, e.g. [\"ro\", \"soft\"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options", "items": { "default": "", "type": "string" }, "type": "array" }, "nfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource" } ], "description": "nfs represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" }, "nodeAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeNodeAffinity" } ], "description": "nodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume." }, "persistentVolumeReclaimPolicy": { "description": "persistentVolumeReclaimPolicy defines what happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming", "type": "string" }, "photonPersistentDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource" } ], "description": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" }, "portworxVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource" } ], "description": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine" }, "quobyte": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource" } ], "description": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime" }, "rbd": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.RBDPersistentVolumeSource" } ], "description": "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md" }, "scaleIO": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ScaleIOPersistentVolumeSource" } ], "description": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes." }, "storageClassName": { "description": "storageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.", "type": "string" }, "storageos": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.StorageOSPersistentVolumeSource" } ], "description": "storageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod More info: https://examples.k8s.io/volumes/storageos/README.md" }, "volumeMode": { "description": "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.", "type": "string" }, "vsphereVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource" } ], "description": "vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine" } }, "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeStatus": { "description": "PersistentVolumeStatus is the current status of a persistent volume.", "properties": { "message": { "description": "message is a human-readable message indicating details about why the volume is in this state.", "type": "string" }, "phase": { "description": "phase indicates if a volume is available, bound to a claim, or released by a claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase", "type": "string" }, "reason": { "description": "reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource": { "description": "Represents a Photon Controller persistent disk resource.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "pdID": { "default": "", "description": "pdID is the ID that identifies Photon Controller persistent disk", "type": "string" } }, "required": [ "pdID" ], "type": "object" }, "io.k8s.api.core.v1.Pod": { "description": "Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSpec" } ], "default": {}, "description": "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodStatus" } ], "default": {}, "description": "Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Pod", "version": "v1" } ] }, "io.k8s.api.core.v1.PodAffinity": { "description": "Pod affinity is a group of inter pod affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodAffinityTerm": { "description": "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running", "properties": { "labelSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "A label query over a set of resources, in this case pods." }, "namespaceSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces." }, "namespaces": { "description": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".", "items": { "default": "", "type": "string" }, "type": "array" }, "topologyKey": { "default": "", "description": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", "type": "string" } }, "required": [ "topologyKey" ], "type": "object" }, "io.k8s.api.core.v1.PodAntiAffinity": { "description": "Pod anti affinity is a group of inter pod anti affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "description": "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodCondition": { "description": "PodCondition contains details for the current condition of this pod.", "properties": { "lastProbeTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time we probed the condition." }, "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time the condition transitioned from one status to another." }, "message": { "description": "Human-readable message indicating details about last transition.", "type": "string" }, "reason": { "description": "Unique, one-word, CamelCase reason for the condition's last transition.", "type": "string" }, "status": { "default": "", "description": "Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", "type": "string" }, "type": { "default": "", "description": "Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.core.v1.PodDNSConfig": { "description": "PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.", "properties": { "nameservers": { "description": "A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.", "items": { "default": "", "type": "string" }, "type": "array" }, "options": { "description": "A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption" } ], "default": {} }, "type": "array" }, "searches": { "description": "A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodDNSConfigOption": { "description": "PodDNSConfigOption defines DNS resolver options of a pod.", "properties": { "name": { "description": "Required.", "type": "string" }, "value": { "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PodIP": { "description": "IP address information for entries in the (plural) PodIPs field. Each entry includes:\n\n\tIP: An IP address allocated to the pod. Routable at least within the cluster.", "properties": { "ip": { "description": "ip is an IP address (IPv4 or IPv6) assigned to the pod", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PodList": { "description": "PodList is a list of Pods.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of pods. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "PodList", "version": "v1" } ] }, "io.k8s.api.core.v1.PodOS": { "description": "PodOS defines the OS parameters of a pod.", "properties": { "name": { "default": "", "description": "Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodReadinessGate": { "description": "PodReadinessGate contains the reference to a pod condition", "properties": { "conditionType": { "default": "", "description": "ConditionType refers to a condition in the pod's condition list with matching type.", "type": "string" } }, "required": [ "conditionType" ], "type": "object" }, "io.k8s.api.core.v1.PodResourceClaim": { "description": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", "properties": { "name": { "default": "", "description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.", "type": "string" }, "source": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource" } ], "default": {}, "description": "Source describes where to find the ResourceClaim." } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodSchedulingGate": { "description": "PodSchedulingGate is associated to a Pod to guard its scheduling.", "properties": { "name": { "default": "", "description": "Name of the scheduling gate. Each scheduling gate must have a unique name field.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodSecurityContext": { "description": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", "properties": { "fsGroup": { "description": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "fsGroupChangePolicy": { "description": "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.", "type": "string" }, "runAsGroup": { "description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "runAsNonRoot": { "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "boolean" }, "runAsUser": { "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "seLinuxOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SELinuxOptions" } ], "description": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows." }, "seccompProfile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SeccompProfile" } ], "description": "The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows." }, "supplementalGroups": { "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.", "items": { "default": 0, "format": "int64", "type": "integer" }, "type": "array" }, "sysctls": { "description": "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Sysctl" } ], "default": {} }, "type": "array" }, "windowsOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions" } ], "description": "The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux." } }, "type": "object" }, "io.k8s.api.core.v1.PodSpec": { "description": "PodSpec is a description of a pod.", "properties": { "activeDeadlineSeconds": { "description": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", "format": "int64", "type": "integer" }, "affinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Affinity" } ], "description": "If specified, the pod's scheduling constraints" }, "automountServiceAccountToken": { "description": "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.", "type": "boolean" }, "containers": { "description": "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Container" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "dnsConfig": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodDNSConfig" } ], "description": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy." }, "dnsPolicy": { "description": "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", "type": "string" }, "enableServiceLinks": { "description": "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.", "type": "boolean" }, "ephemeralContainers": { "description": "List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EphemeralContainer" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "hostAliases": { "description": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HostAlias" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "ip", "x-kubernetes-patch-strategy": "merge" }, "hostIPC": { "description": "Use the host's ipc namespace. Optional: Default to false.", "type": "boolean" }, "hostNetwork": { "description": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", "type": "boolean" }, "hostPID": { "description": "Use the host's pid namespace. Optional: Default to false.", "type": "boolean" }, "hostUsers": { "description": "Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.", "type": "boolean" }, "hostname": { "description": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", "type": "string" }, "imagePullSecrets": { "description": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "initContainers": { "description": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Container" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "nodeName": { "description": "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", "type": "string" }, "nodeSelector": { "additionalProperties": { "default": "", "type": "string" }, "description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", "type": "object", "x-kubernetes-map-type": "atomic" }, "os": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodOS" } ], "description": "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup" }, "overhead": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md", "type": "object" }, "preemptionPolicy": { "description": "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.", "type": "string" }, "priority": { "description": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.", "format": "int32", "type": "integer" }, "priorityClassName": { "description": "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", "type": "string" }, "readinessGates": { "description": "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodReadinessGate" } ], "default": {} }, "type": "array" }, "resourceClaims": { "description": "ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodResourceClaim" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge,retainKeys" }, "restartPolicy": { "description": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", "type": "string" }, "runtimeClassName": { "description": "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", "type": "string" }, "schedulerName": { "description": "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", "type": "string" }, "schedulingGates": { "description": "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. More info: https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness.\n\nThis is an alpha-level feature enabled by PodSchedulingReadiness feature gate.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSchedulingGate" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSecurityContext" } ], "description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field." }, "serviceAccount": { "description": "DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", "type": "string" }, "serviceAccountName": { "description": "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", "type": "string" }, "setHostnameAsFQDN": { "description": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", "type": "boolean" }, "shareProcessNamespace": { "description": "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.", "type": "boolean" }, "subdomain": { "description": "If specified, the fully qualified Pod hostname will be \"...svc.\". If not specified, the pod will not have a domainname at all.", "type": "string" }, "terminationGracePeriodSeconds": { "description": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", "format": "int64", "type": "integer" }, "tolerations": { "description": "If specified, the pod's tolerations.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Toleration" } ], "default": {} }, "type": "array" }, "topologySpreadConstraints": { "description": "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "topologyKey", "whenUnsatisfiable" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "topologyKey", "x-kubernetes-patch-strategy": "merge" }, "volumes": { "description": "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Volume" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge,retainKeys" } }, "required": [ "containers" ], "type": "object" }, "io.k8s.api.core.v1.PodStatus": { "description": "PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.", "properties": { "conditions": { "description": "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "containerStatuses": { "description": "The list has one entry per container in the manifest. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerStatus" } ], "default": {} }, "type": "array" }, "ephemeralContainerStatuses": { "description": "Status for any ephemeral containers that have run in this pod.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerStatus" } ], "default": {} }, "type": "array" }, "hostIP": { "description": "IP address of the host to which the pod is assigned. Empty if not yet scheduled.", "type": "string" }, "initContainerStatuses": { "description": "The list has one entry per init container in the manifest. The most recent successful init container will have ready = true, the most recently started container will have startTime set. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerStatus" } ], "default": {} }, "type": "array" }, "message": { "description": "A human readable message indicating details about why the pod is in this condition.", "type": "string" }, "nominatedNodeName": { "description": "nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.", "type": "string" }, "phase": { "description": "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase", "type": "string" }, "podIP": { "description": "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", "type": "string" }, "podIPs": { "description": "podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list is empty if no IPs have been allocated yet.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodIP" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "ip", "x-kubernetes-patch-strategy": "merge" }, "qosClass": { "description": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md", "type": "string" }, "reason": { "description": "A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted'", "type": "string" }, "startTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod." } }, "type": "object" }, "io.k8s.api.core.v1.PodTemplate": { "description": "PodTemplate describes a template for creating copies of a predefined pod.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "template": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec" } ], "default": {}, "description": "Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "PodTemplate", "version": "v1" } ] }, "io.k8s.api.core.v1.PodTemplateList": { "description": "PodTemplateList is a list of PodTemplates.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of pod templates", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "PodTemplateList", "version": "v1" } ] }, "io.k8s.api.core.v1.PodTemplateSpec": { "description": "PodTemplateSpec describes the data a pod should have when created from a template", "properties": { "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSpec" } ], "default": {}, "description": "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object" }, "io.k8s.api.core.v1.PortStatus": { "properties": { "error": { "description": "Error is to record the problem with the service port The format of the error shall comply with the following rules: - built-in error values shall be specified in this file and those shall use\n CamelCase names\n- cloud provider specific error values must have names that comply with the\n format foo.example.com/CamelCase.", "type": "string" }, "port": { "default": 0, "description": "Port is the port number of the service port of which status is recorded here", "format": "int32", "type": "integer" }, "protocol": { "default": "", "description": "Protocol is the protocol of the service port of which status is recorded here The supported values are: \"TCP\", \"UDP\", \"SCTP\"", "type": "string" } }, "required": [ "port", "protocol" ], "type": "object" }, "io.k8s.api.core.v1.PortworxVolumeSource": { "description": "PortworxVolumeSource represents a Portworx volume resource.", "properties": { "fsType": { "description": "fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "volumeID": { "default": "", "description": "volumeID uniquely identifies a Portworx volume", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.PreferredSchedulingTerm": { "description": "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).", "properties": { "preference": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm" } ], "default": {}, "description": "A node selector term, associated with the corresponding weight." }, "weight": { "default": 0, "description": "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.", "format": "int32", "type": "integer" } }, "required": [ "weight", "preference" ], "type": "object" }, "io.k8s.api.core.v1.Probe": { "description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", "properties": { "exec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ExecAction" } ], "description": "Exec specifies the action to take." }, "failureThreshold": { "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", "format": "int32", "type": "integer" }, "grpc": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GRPCAction" } ], "description": "GRPC specifies an action involving a GRPC port." }, "httpGet": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPGetAction" } ], "description": "HTTPGet specifies the http request to perform." }, "initialDelaySeconds": { "description": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", "type": "integer" }, "periodSeconds": { "description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", "format": "int32", "type": "integer" }, "successThreshold": { "description": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", "format": "int32", "type": "integer" }, "tcpSocket": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TCPSocketAction" } ], "description": "TCPSocket specifies an action involving a TCP port." }, "terminationGracePeriodSeconds": { "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", "format": "int64", "type": "integer" }, "timeoutSeconds": { "description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.core.v1.ProjectedVolumeSource": { "description": "Represents a projected volume source", "properties": { "defaultMode": { "description": "defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "sources": { "description": "sources is the list of volume projections", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeProjection" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.QuobyteVolumeSource": { "description": "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.", "properties": { "group": { "description": "group to map volume access to Default is no group", "type": "string" }, "readOnly": { "description": "readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.", "type": "boolean" }, "registry": { "default": "", "description": "registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes", "type": "string" }, "tenant": { "description": "tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin", "type": "string" }, "user": { "description": "user to map volume access to Defaults to serivceaccount user", "type": "string" }, "volume": { "default": "", "description": "volume is a string that references an already created Quobyte volume by name.", "type": "string" } }, "required": [ "registry", "volume" ], "type": "object" }, "io.k8s.api.core.v1.RBDPersistentVolumeSource": { "description": "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", "type": "string" }, "image": { "default": "", "description": "image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "keyring": { "description": "keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "monitors": { "description": "monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "items": { "default": "", "type": "string" }, "type": "array" }, "pool": { "description": "pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" }, "user": { "description": "user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" } }, "required": [ "monitors", "image" ], "type": "object" }, "io.k8s.api.core.v1.RBDVolumeSource": { "description": "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", "type": "string" }, "image": { "default": "", "description": "image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "keyring": { "description": "keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "monitors": { "description": "monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "items": { "default": "", "type": "string" }, "type": "array" }, "pool": { "description": "pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" }, "user": { "description": "user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" } }, "required": [ "monitors", "image" ], "type": "object" }, "io.k8s.api.core.v1.ReplicationController": { "description": "ReplicationController represents the configuration of a replication controller.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "If the Labels of a ReplicationController are empty, they are defaulted to be the same as the Pod(s) that the replication controller manages. Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerSpec" } ], "default": {}, "description": "Spec defines the specification of the desired behavior of the replication controller. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerStatus" } ], "default": {}, "description": "Status is the most recently observed status of the replication controller. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ReplicationController", "version": "v1" } ] }, "io.k8s.api.core.v1.ReplicationControllerCondition": { "description": "ReplicationControllerCondition describes the state of a replication controller at a certain point.", "properties": { "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "The last time the condition transitioned from one status to another." }, "message": { "description": "A human readable message indicating details about the transition.", "type": "string" }, "reason": { "description": "The reason for the condition's last transition.", "type": "string" }, "status": { "default": "", "description": "Status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "Type of replication controller condition.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.core.v1.ReplicationControllerList": { "description": "ReplicationControllerList is a collection of replication controllers.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of replication controllers. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ReplicationControllerList", "version": "v1" } ] }, "io.k8s.api.core.v1.ReplicationControllerSpec": { "description": "ReplicationControllerSpec is the specification of a replication controller.", "properties": { "minReadySeconds": { "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", "format": "int32", "type": "integer" }, "replicas": { "description": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller", "format": "int32", "type": "integer" }, "selector": { "additionalProperties": { "default": "", "type": "string" }, "description": "Selector is a label query over pods that should match the Replicas count. If Selector is empty, it is defaulted to the labels present on the Pod template. Label keys and values that must match in order to be controlled by this replication controller, if empty defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", "type": "object", "x-kubernetes-map-type": "atomic" }, "template": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec" } ], "description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template" } }, "type": "object" }, "io.k8s.api.core.v1.ReplicationControllerStatus": { "description": "ReplicationControllerStatus represents the current status of a replication controller.", "properties": { "availableReplicas": { "description": "The number of available replicas (ready for at least minReadySeconds) for this replication controller.", "format": "int32", "type": "integer" }, "conditions": { "description": "Represents the latest available observations of a replication controller's current state.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "fullyLabeledReplicas": { "description": "The number of pods that have labels matching the labels of the pod template of the replication controller.", "format": "int32", "type": "integer" }, "observedGeneration": { "description": "ObservedGeneration reflects the generation of the most recently observed replication controller.", "format": "int64", "type": "integer" }, "readyReplicas": { "description": "The number of ready replicas for this replication controller.", "format": "int32", "type": "integer" }, "replicas": { "default": 0, "description": "Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller", "format": "int32", "type": "integer" } }, "required": [ "replicas" ], "type": "object" }, "io.k8s.api.core.v1.ResourceClaim": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "default": "", "description": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.ResourceFieldSelector": { "description": "ResourceFieldSelector represents container resources (cpu, memory) and their output format", "properties": { "containerName": { "description": "Container name: required for volumes, optional for env vars", "type": "string" }, "divisor": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {}, "description": "Specifies the output format of the exposed resources, defaults to \"1\"" }, "resource": { "default": "", "description": "Required: resource to select", "type": "string" } }, "required": [ "resource" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ResourceQuota": { "description": "ResourceQuota sets aggregate quota restrictions enforced per namespace", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaSpec" } ], "default": {}, "description": "Spec defines the desired quota. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaStatus" } ], "default": {}, "description": "Status defines the actual enforced quota and its current usage. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ResourceQuota", "version": "v1" } ] }, "io.k8s.api.core.v1.ResourceQuotaList": { "description": "ResourceQuotaList is a list of ResourceQuota items.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "Items is a list of ResourceQuota objects. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ResourceQuotaList", "version": "v1" } ] }, "io.k8s.api.core.v1.ResourceQuotaSpec": { "description": "ResourceQuotaSpec defines the desired hard limits to enforce for Quota.", "properties": { "hard": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "hard is the set of desired hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", "type": "object" }, "scopeSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ScopeSelector" } ], "description": "scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched." }, "scopes": { "description": "A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.ResourceQuotaStatus": { "description": "ResourceQuotaStatus defines the enforced hard limits and observed use.", "properties": { "hard": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Hard is the set of enforced hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", "type": "object" }, "used": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Used is the current observed total usage of the resource in the namespace.", "type": "object" } }, "type": "object" }, "io.k8s.api.core.v1.ResourceRequirements": { "description": "ResourceRequirements describes the compute resource requirements.", "properties": { "claims": { "description": "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceClaim" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map" }, "limits": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "type": "object" }, "requests": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "type": "object" } }, "type": "object" }, "io.k8s.api.core.v1.SELinuxOptions": { "description": "SELinuxOptions are the labels to be applied to the container", "properties": { "level": { "description": "Level is SELinux level label that applies to the container.", "type": "string" }, "role": { "description": "Role is a SELinux role label that applies to the container.", "type": "string" }, "type": { "description": "Type is a SELinux type label that applies to the container.", "type": "string" }, "user": { "description": "User is a SELinux user label that applies to the container.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ScaleIOPersistentVolumeSource": { "description": "ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\"", "type": "string" }, "gateway": { "default": "", "description": "gateway is the host address of the ScaleIO API Gateway.", "type": "string" }, "protectionDomain": { "description": "protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretReference" } ], "description": "secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail." }, "sslEnabled": { "description": "sslEnabled is the flag to enable/disable SSL communication with Gateway, default false", "type": "boolean" }, "storageMode": { "description": "storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", "type": "string" }, "storagePool": { "description": "storagePool is the ScaleIO Storage Pool associated with the protection domain.", "type": "string" }, "system": { "default": "", "description": "system is the name of the storage system as configured in ScaleIO.", "type": "string" }, "volumeName": { "description": "volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.", "type": "string" } }, "required": [ "gateway", "system", "secretRef" ], "type": "object" }, "io.k8s.api.core.v1.ScaleIOVolumeSource": { "description": "ScaleIOVolumeSource represents a persistent ScaleIO volume", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".", "type": "string" }, "gateway": { "default": "", "description": "gateway is the host address of the ScaleIO API Gateway.", "type": "string" }, "protectionDomain": { "description": "protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.", "type": "string" }, "readOnly": { "description": "readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail." }, "sslEnabled": { "description": "sslEnabled Flag enable/disable SSL communication with Gateway, default false", "type": "boolean" }, "storageMode": { "description": "storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", "type": "string" }, "storagePool": { "description": "storagePool is the ScaleIO Storage Pool associated with the protection domain.", "type": "string" }, "system": { "default": "", "description": "system is the name of the storage system as configured in ScaleIO.", "type": "string" }, "volumeName": { "description": "volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.", "type": "string" } }, "required": [ "gateway", "system", "secretRef" ], "type": "object" }, "io.k8s.api.core.v1.ScopeSelector": { "description": "A scope selector represents the AND of the selectors represented by the scoped-resource selector requirements.", "properties": { "matchExpressions": { "description": "A list of scope selector requirements by scope of the resources.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ScopedResourceSelectorRequirement" } ], "default": {} }, "type": "array" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ScopedResourceSelectorRequirement": { "description": "A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator that relates the scope name and values.", "properties": { "operator": { "default": "", "description": "Represents a scope's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist.", "type": "string" }, "scopeName": { "default": "", "description": "The name of the scope that the selector applies to.", "type": "string" }, "values": { "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", "items": { "default": "", "type": "string" }, "type": "array" } }, "required": [ "scopeName", "operator" ], "type": "object" }, "io.k8s.api.core.v1.SeccompProfile": { "description": "SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.", "properties": { "localhostProfile": { "description": "localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".", "type": "string" }, "type": { "default": "", "description": "type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.", "type": "string" } }, "required": [ "type" ], "type": "object", "x-kubernetes-unions": [ { "discriminator": "type", "fields-to-discriminateBy": { "localhostProfile": "LocalhostProfile" } } ] }, "io.k8s.api.core.v1.Secret": { "description": "Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "data": { "additionalProperties": { "format": "byte", "type": "string" }, "description": "Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4", "type": "object" }, "immutable": { "description": "Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.", "type": "boolean" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "stringData": { "additionalProperties": { "default": "", "type": "string" }, "description": "stringData allows specifying non-binary secret data in string form. It is provided as a write-only input field for convenience. All keys and values are merged into the data field on write, overwriting any existing values. The stringData field is never output when reading from the API.", "type": "object" }, "type": { "description": "Used to facilitate programmatic handling of secret data. More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Secret", "version": "v1" } ] }, "io.k8s.api.core.v1.SecretEnvSource": { "description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the Secret must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.SecretKeySelector": { "description": "SecretKeySelector selects a key of a Secret.", "properties": { "key": { "default": "", "description": "The key of the secret to select from. Must be a valid secret key.", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the Secret or its key must be defined", "type": "boolean" } }, "required": [ "key" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.SecretList": { "description": "SecretList is a list of Secret.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "Items is a list of secret objects. More info: https://kubernetes.io/docs/concepts/configuration/secret", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "SecretList", "version": "v1" } ] }, "io.k8s.api.core.v1.SecretProjection": { "description": "Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.", "properties": { "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional field specify whether the Secret or its key must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.SecretReference": { "description": "SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace", "properties": { "name": { "description": "name is unique within a namespace to reference a secret resource.", "type": "string" }, "namespace": { "description": "namespace defines the space within which the secret name must be unique.", "type": "string" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.SecretVolumeSource": { "description": "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "optional": { "description": "optional field specify whether the Secret or its keys must be defined", "type": "boolean" }, "secretName": { "description": "secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.SecurityContext": { "description": "SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.", "properties": { "allowPrivilegeEscalation": { "description": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "capabilities": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Capabilities" } ], "description": "The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows." }, "privileged": { "description": "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "procMount": { "description": "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.", "type": "string" }, "readOnlyRootFilesystem": { "description": "Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "runAsGroup": { "description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "runAsNonRoot": { "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "boolean" }, "runAsUser": { "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "seLinuxOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SELinuxOptions" } ], "description": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows." }, "seccompProfile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SeccompProfile" } ], "description": "The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows." }, "windowsOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions" } ], "description": "The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux." } }, "type": "object" }, "io.k8s.api.core.v1.Service": { "description": "Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceSpec" } ], "default": {}, "description": "Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceStatus" } ], "default": {}, "description": "Most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Service", "version": "v1" } ] }, "io.k8s.api.core.v1.ServiceAccount": { "description": "ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "automountServiceAccountToken": { "description": "AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level.", "type": "boolean" }, "imagePullSecrets": { "description": "ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "secrets": { "description": "Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a \"kubernetes.io/enforce-mountable-secrets\" annotation set to \"true\". This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ServiceAccount", "version": "v1" } ] }, "io.k8s.api.core.v1.ServiceAccountList": { "description": "ServiceAccountList is a list of ServiceAccount objects", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of ServiceAccounts. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ServiceAccountList", "version": "v1" } ] }, "io.k8s.api.core.v1.ServiceAccountTokenProjection": { "description": "ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).", "properties": { "audience": { "description": "audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.", "type": "string" }, "expirationSeconds": { "description": "expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.", "format": "int64", "type": "integer" }, "path": { "default": "", "description": "path is the path relative to the mount point of the file to project the token into.", "type": "string" } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.ServiceList": { "description": "ServiceList holds a list of services.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of services", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "ServiceList", "version": "v1" } ] }, "io.k8s.api.core.v1.ServicePort": { "description": "ServicePort contains information on service's port.", "properties": { "appProtocol": { "description": "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol.", "type": "string" }, "name": { "description": "The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the 'name' field in the EndpointPort. Optional if only one ServicePort is defined on this service.", "type": "string" }, "nodePort": { "description": "The port on each node on which this service is exposed when type is NodePort or LoadBalancer. Usually assigned by the system. If a value is specified, in-range, and not in use it will be used, otherwise the operation will fail. If not specified, a port will be allocated if this Service requires one. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type from NodePort to ClusterIP). More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport", "format": "int32", "type": "integer" }, "port": { "default": 0, "description": "The port that will be exposed by this service.", "format": "int32", "type": "integer" }, "protocol": { "default": "TCP", "description": "The IP protocol for this port. Supports \"TCP\", \"UDP\", and \"SCTP\". Default is TCP.", "type": "string" }, "targetPort": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "default": {}, "description": "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.ServiceSpec": { "description": "ServiceSpec describes the attributes that a user creates on a service.", "properties": { "allocateLoadBalancerNodePorts": { "description": "allocateLoadBalancerNodePorts defines if NodePorts will be automatically allocated for services with type LoadBalancer. Default is \"true\". It may be set to \"false\" if the cluster load-balancer does not rely on NodePorts. If the caller requests specific NodePorts (by specifying a value), those requests will be respected, regardless of this field. This field may only be set for services with type LoadBalancer and will be cleared if the type is changed to any other type.", "type": "boolean" }, "clusterIP": { "description": "clusterIP is the IP address of the service and is usually assigned randomly. If an address is specified manually, is in-range (as per system configuration), and is not in use, it will be allocated to the service; otherwise creation of the service will fail. This field may not be changed through updates unless the type field is also being changed to ExternalName (which requires this field to be blank) or the type field is being changed from ExternalName (in which case this field may optionally be specified, as describe above). Valid values are \"None\", empty string (\"\"), or a valid IP address. Setting this to \"None\" makes a \"headless service\" (no virtual IP), which is useful when direct endpoint connections are preferred and proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. If this field is specified when creating a Service of type ExternalName, creation will fail. This field will be wiped when updating a Service to type ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", "type": "string" }, "clusterIPs": { "description": "ClusterIPs is a list of IP addresses assigned to this service, and are usually assigned randomly. If an address is specified manually, is in-range (as per system configuration), and is not in use, it will be allocated to the service; otherwise creation of the service will fail. This field may not be changed through updates unless the type field is also being changed to ExternalName (which requires this field to be empty) or the type field is being changed from ExternalName (in which case this field may optionally be specified, as describe above). Valid values are \"None\", empty string (\"\"), or a valid IP address. Setting this to \"None\" makes a \"headless service\" (no virtual IP), which is useful when direct endpoint connections are preferred and proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. If this field is specified when creating a Service of type ExternalName, creation will fail. This field will be wiped when updating a Service to type ExternalName. If this field is not specified, it will be initialized from the clusterIP field. If this field is specified, clients must ensure that clusterIPs[0] and clusterIP have the same value.\n\nThis field may hold a maximum of two entries (dual-stack IPs, in either order). These IPs must correspond to the values of the ipFamilies field. Both clusterIPs and ipFamilies are governed by the ipFamilyPolicy field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "externalIPs": { "description": "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.", "items": { "default": "", "type": "string" }, "type": "array" }, "externalName": { "description": "externalName is the external reference that discovery mechanisms will return as an alias for this service (e.g. a DNS CNAME record). No proxying will be involved. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires `type` to be \"ExternalName\".", "type": "string" }, "externalTrafficPolicy": { "description": "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.", "type": "string" }, "healthCheckNodePort": { "description": "healthCheckNodePort specifies the healthcheck nodePort for the service. This only applies when type is set to LoadBalancer and externalTrafficPolicy is set to Local. If a value is specified, is in-range, and is not in use, it will be used. If not specified, a value will be automatically allocated. External systems (e.g. load-balancers) can use this port to determine if a given node holds endpoints for this service or not. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type). This field cannot be updated once set.", "format": "int32", "type": "integer" }, "internalTrafficPolicy": { "description": "InternalTrafficPolicy describes how nodes distribute service traffic they receive on the ClusterIP. If set to \"Local\", the proxy will assume that pods only want to talk to endpoints of the service on the same node as the pod, dropping the traffic if there are no local endpoints. The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features).", "type": "string" }, "ipFamilies": { "description": "IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this service. This field is usually assigned automatically based on cluster configuration and the ipFamilyPolicy field. If this field is specified manually, the requested family is available in the cluster, and ipFamilyPolicy allows it, it will be used; otherwise creation of the service will fail. This field is conditionally mutable: it allows for adding or removing a secondary IP family, but it does not allow changing the primary IP family of the Service. Valid values are \"IPv4\" and \"IPv6\". This field only applies to Services of types ClusterIP, NodePort, and LoadBalancer, and does apply to \"headless\" services. This field will be wiped when updating a Service to type ExternalName.\n\nThis field may hold a maximum of two entries (dual-stack families, in either order). These families must correspond to the values of the clusterIPs field, if specified. Both clusterIPs and ipFamilies are governed by the ipFamilyPolicy field.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "ipFamilyPolicy": { "description": "IPFamilyPolicy represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to SingleStack. Services can be \"SingleStack\" (a single IP family), \"PreferDualStack\" (two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or \"RequireDualStack\" (two IP families on dual-stack configured clusters, otherwise fail). The ipFamilies and clusterIPs fields depend on the value of this field. This field will be wiped when updating a service to type ExternalName.", "type": "string" }, "loadBalancerClass": { "description": "loadBalancerClass is the class of the load balancer implementation this Service belongs to. If specified, the value of this field must be a label-style identifier, with an optional prefix, e.g. \"internal-vip\" or \"example.com/internal-vip\". Unprefixed names are reserved for end-users. This field can only be set when the Service type is 'LoadBalancer'. If not set, the default load balancer implementation is used, today this is typically done through the cloud provider integration, but should apply for any default implementation. If set, it is assumed that a load balancer implementation is watching for Services with a matching class. Any default load balancer implementation (e.g. cloud providers) should ignore Services that set this field. This field can only be set when creating or updating a Service to type 'LoadBalancer'. Once set, it can not be changed. This field will be wiped when a service is updated to a non 'LoadBalancer' type.", "type": "string" }, "loadBalancerIP": { "description": "Only applies to Service Type: LoadBalancer. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. Deprecated: This field was under-specified and its meaning varies across implementations, and it cannot support dual-stack. As of Kubernetes v1.24, users are encouraged to use implementation-specific annotations when available. This field may be removed in a future API version.", "type": "string" }, "loadBalancerSourceRanges": { "description": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/", "items": { "default": "", "type": "string" }, "type": "array" }, "ports": { "description": "The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServicePort" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "port", "protocol" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "port", "x-kubernetes-patch-strategy": "merge" }, "publishNotReadyAddresses": { "description": "publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. The primary use case for setting this field is for a StatefulSet's Headless Service to propagate SRV DNS records for its Pods for the purpose of peer discovery. The Kubernetes controllers that generate Endpoints and EndpointSlice resources for Services interpret this to mean that all endpoints are considered \"ready\" even if the Pods themselves are not. Agents which consume only Kubernetes generated endpoints through the Endpoints or EndpointSlice resources can safely assume this behavior.", "type": "boolean" }, "selector": { "additionalProperties": { "default": "", "type": "string" }, "description": "Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/", "type": "object", "x-kubernetes-map-type": "atomic" }, "sessionAffinity": { "description": "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", "type": "string" }, "sessionAffinityConfig": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SessionAffinityConfig" } ], "description": "sessionAffinityConfig contains the configurations of session affinity." }, "type": { "description": "type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"ClusterIP\" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object or EndpointSlice objects. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a virtual IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the same endpoints as the clusterIP. \"ExternalName\" aliases this service to the specified externalName. Several other fields do not apply to ExternalName services. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ServiceStatus": { "description": "ServiceStatus represents the current status of a service.", "properties": { "conditions": { "description": "Current service state", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Condition" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "type" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "loadBalancer": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LoadBalancerStatus" } ], "default": {}, "description": "LoadBalancer contains the current status of the load-balancer, if one is present." } }, "type": "object" }, "io.k8s.api.core.v1.SessionAffinityConfig": { "description": "SessionAffinityConfig represents the configurations of session affinity.", "properties": { "clientIP": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ClientIPConfig" } ], "description": "clientIP contains the configurations of Client IP based session affinity." } }, "type": "object" }, "io.k8s.api.core.v1.StorageOSPersistentVolumeSource": { "description": "Represents a StorageOS persistent volume resource.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "description": "secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted." }, "volumeName": { "description": "volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", "type": "string" }, "volumeNamespace": { "description": "volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.StorageOSVolumeSource": { "description": "Represents a StorageOS persistent volume resource.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted." }, "volumeName": { "description": "volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", "type": "string" }, "volumeNamespace": { "description": "volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.Sysctl": { "description": "Sysctl defines a kernel parameter to be set", "properties": { "name": { "default": "", "description": "Name of a property to set", "type": "string" }, "value": { "default": "", "description": "Value of a property to set", "type": "string" } }, "required": [ "name", "value" ], "type": "object" }, "io.k8s.api.core.v1.TCPSocketAction": { "description": "TCPSocketAction describes an action based on opening a socket", "properties": { "host": { "description": "Optional: Host name to connect to, defaults to the pod IP.", "type": "string" }, "port": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "default": {}, "description": "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME." } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.Taint": { "description": "The node this Taint is attached to has the \"effect\" on any pod that does not tolerate the Taint.", "properties": { "effect": { "default": "", "description": "Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute.", "type": "string" }, "key": { "default": "", "description": "Required. The taint key to be applied to a node.", "type": "string" }, "timeAdded": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints." }, "value": { "description": "The taint value corresponding to the taint key.", "type": "string" } }, "required": [ "key", "effect" ], "type": "object" }, "io.k8s.api.core.v1.Toleration": { "description": "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .", "properties": { "effect": { "description": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.", "type": "string" }, "key": { "description": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", "type": "string" }, "operator": { "description": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.", "type": "string" }, "tolerationSeconds": { "description": "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.", "format": "int64", "type": "integer" }, "value": { "description": "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.TopologySpreadConstraint": { "description": "TopologySpreadConstraint specifies how to spread matching pods among the given topology.", "properties": { "labelSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain." }, "matchLabelKeys": { "description": "MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "maxSkew": { "default": 0, "description": "MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. The global minimum is the minimum number of matching pods in an eligible domain or zero if the number of eligible domains is less than MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 2/2/1: In this case, the global minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.", "format": "int32", "type": "integer" }, "minDomains": { "description": "MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule.\n\nFor example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew.\n\nThis is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).", "format": "int32", "type": "integer" }, "nodeAffinityPolicy": { "description": "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", "type": "string" }, "nodeTaintsPolicy": { "description": "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", "type": "string" }, "topologyKey": { "default": "", "description": "TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a \"bucket\", and try to put balanced number of pods into each bucket. We define a domain as a particular instance of a topology. Also, we define an eligible domain as a domain whose nodes meet the requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey is \"kubernetes.io/hostname\", each Node is a domain of that topology. And, if TopologyKey is \"topology.kubernetes.io/zone\", each zone is a domain of that topology. It's a required field.", "type": "string" }, "whenUnsatisfiable": { "default": "", "description": "WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.", "type": "string" } }, "required": [ "maxSkew", "topologyKey", "whenUnsatisfiable" ], "type": "object" }, "io.k8s.api.core.v1.TypedLocalObjectReference": { "description": "TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.", "properties": { "apiGroup": { "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", "type": "string" }, "kind": { "default": "", "description": "Kind is the type of resource being referenced", "type": "string" }, "name": { "default": "", "description": "Name is the name of resource being referenced", "type": "string" } }, "required": [ "kind", "name" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.TypedObjectReference": { "properties": { "apiGroup": { "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", "type": "string" }, "kind": { "default": "", "description": "Kind is the type of resource being referenced", "type": "string" }, "name": { "default": "", "description": "Name is the name of resource being referenced", "type": "string" }, "namespace": { "description": "Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", "type": "string" } }, "required": [ "kind", "name" ], "type": "object" }, "io.k8s.api.core.v1.Volume": { "description": "Volume represents a named volume in a pod that may be accessed by any container in the pod.", "properties": { "awsElasticBlockStore": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource" } ], "description": "awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" }, "azureDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource" } ], "description": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod." }, "azureFile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource" } ], "description": "azureFile represents an Azure File Service mount on the host and bind mount to the pod." }, "cephfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource" } ], "description": "cephFS represents a Ceph FS mount on the host that shares a pod's lifetime" }, "cinder": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource" } ], "description": "cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" }, "configMap": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource" } ], "description": "configMap represents a configMap that should populate this volume" }, "csi": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource" } ], "description": "csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature)." }, "downwardAPI": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource" } ], "description": "downwardAPI represents downward API about the pod that should populate this volume" }, "emptyDir": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource" } ], "description": "emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" }, "ephemeral": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource" } ], "description": "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time." }, "fc": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FCVolumeSource" } ], "description": "fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod." }, "flexVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource" } ], "description": "flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin." }, "flocker": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource" } ], "description": "flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running" }, "gcePersistentDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource" } ], "description": "gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" }, "gitRepo": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource" } ], "description": "gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container." }, "glusterfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource" } ], "description": "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md" }, "hostPath": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource" } ], "description": "hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath" }, "iscsi": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource" } ], "description": "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md" }, "name": { "default": "", "description": "name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "nfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource" } ], "description": "nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" }, "persistentVolumeClaim": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource" } ], "description": "persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" }, "photonPersistentDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource" } ], "description": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" }, "portworxVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource" } ], "description": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine" }, "projected": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource" } ], "description": "projected items for all in one resources secrets, configmaps, and downward API" }, "quobyte": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource" } ], "description": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime" }, "rbd": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource" } ], "description": "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md" }, "scaleIO": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource" } ], "description": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes." }, "secret": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource" } ], "description": "secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret" }, "storageos": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource" } ], "description": "storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." }, "vsphereVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource" } ], "description": "vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.VolumeDevice": { "description": "volumeDevice describes a mapping of a raw block device within a container.", "properties": { "devicePath": { "default": "", "description": "devicePath is the path inside of the container that the device will be mapped to.", "type": "string" }, "name": { "default": "", "description": "name must match the name of a persistentVolumeClaim in the pod", "type": "string" } }, "required": [ "name", "devicePath" ], "type": "object" }, "io.k8s.api.core.v1.VolumeMount": { "description": "VolumeMount describes a mounting of a Volume within a container.", "properties": { "mountPath": { "default": "", "description": "Path within the container at which the volume should be mounted. Must not contain ':'.", "type": "string" }, "mountPropagation": { "description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.", "type": "string" }, "name": { "default": "", "description": "This must match the Name of a Volume.", "type": "string" }, "readOnly": { "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.", "type": "boolean" }, "subPath": { "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", "type": "string" }, "subPathExpr": { "description": "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.", "type": "string" } }, "required": [ "name", "mountPath" ], "type": "object" }, "io.k8s.api.core.v1.VolumeNodeAffinity": { "description": "VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from.", "properties": { "required": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" } ], "description": "required specifies hard node constraints that must be met." } }, "type": "object" }, "io.k8s.api.core.v1.VolumeProjection": { "description": "Projection that may be projected along with other supported volume types", "properties": { "configMap": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection" } ], "description": "configMap information about the configMap data to project" }, "downwardAPI": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection" } ], "description": "downwardAPI information about the downwardAPI data to project" }, "secret": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretProjection" } ], "description": "secret information about the secret data to project" }, "serviceAccountToken": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection" } ], "description": "serviceAccountToken is information about the serviceAccountToken data to project" } }, "type": "object" }, "io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource": { "description": "Represents a vSphere volume resource.", "properties": { "fsType": { "description": "fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "storagePolicyID": { "description": "storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.", "type": "string" }, "storagePolicyName": { "description": "storagePolicyName is the storage Policy Based Management (SPBM) profile name.", "type": "string" }, "volumePath": { "default": "", "description": "volumePath is the path that identifies vSphere volume vmdk", "type": "string" } }, "required": [ "volumePath" ], "type": "object" }, "io.k8s.api.core.v1.WeightedPodAffinityTerm": { "description": "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)", "properties": { "podAffinityTerm": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {}, "description": "Required. A pod affinity term, associated with the corresponding weight." }, "weight": { "default": 0, "description": "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.", "format": "int32", "type": "integer" } }, "required": [ "weight", "podAffinityTerm" ], "type": "object" }, "io.k8s.api.core.v1.WindowsSecurityContextOptions": { "description": "WindowsSecurityContextOptions contain Windows-specific options and credentials.", "properties": { "gmsaCredentialSpec": { "description": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.", "type": "string" }, "gmsaCredentialSpecName": { "description": "GMSACredentialSpecName is the name of the GMSA credential spec to use.", "type": "string" }, "hostProcess": { "description": "HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.", "type": "boolean" }, "runAsUserName": { "description": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "string" } }, "type": "object" }, "io.k8s.api.policy.v1.Eviction": { "description": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "deleteOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } ], "description": "DeleteOptions may be provided" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "ObjectMeta describes the pod that is being evicted." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "policy", "kind": "Eviction", "version": "v1" } ] }, "io.k8s.apimachinery.pkg.api.resource.Quantity": { "description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource": { "description": "APIResource specifies the name of a resource and whether it is namespaced.", "properties": { "categories": { "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", "items": { "default": "", "type": "string" }, "type": "array" }, "group": { "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", "type": "string" }, "kind": { "default": "", "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", "type": "string" }, "name": { "default": "", "description": "name is the plural name of the resource.", "type": "string" }, "namespaced": { "default": false, "description": "namespaced indicates if a resource is namespaced or not.", "type": "boolean" }, "shortNames": { "description": "shortNames is a list of suggested short names of the resource.", "items": { "default": "", "type": "string" }, "type": "array" }, "singularName": { "default": "", "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", "type": "string" }, "storageVersionHash": { "description": "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", "type": "string" }, "verbs": { "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", "items": { "default": "", "type": "string" }, "type": "array" }, "version": { "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", "type": "string" } }, "required": [ "name", "singularName", "namespaced", "kind", "verbs" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList": { "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "groupVersion": { "default": "", "description": "groupVersion is the group and version this APIResourceList is for.", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "resources": { "description": "resources contains the name of the resources and if they are namespaced.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource" } ], "default": {} }, "type": "array" } }, "required": [ "groupVersion", "resources" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "APIResourceList", "version": "v1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.Condition": { "description": "Condition contains details for one aspect of the current state of this API Resource.", "properties": { "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable." }, "message": { "default": "", "description": "message is a human readable message indicating details about the transition. This may be an empty string.", "type": "string" }, "observedGeneration": { "description": "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.", "format": "int64", "type": "integer" }, "reason": { "default": "", "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.", "type": "string" }, "status": { "default": "", "description": "status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "type of condition in CamelCase or in foo.example.com/CamelCase.", "type": "string" } }, "required": [ "type", "status", "lastTransitionTime", "reason", "message" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions": { "description": "DeleteOptions may be provided when deleting an API object.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "dryRun": { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "items": { "default": "", "type": "string" }, "type": "array" }, "gracePeriodSeconds": { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "format": "int64", "type": "integer" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "orphanDependents": { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "type": "boolean" }, "preconditions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" } ], "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." }, "propagationPolicy": { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta2" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "extensions", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1": { "description": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector": { "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", "properties": { "matchExpressions": { "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement" } ], "default": {} }, "type": "array" }, "matchLabels": { "additionalProperties": { "default": "", "type": "string" }, "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", "type": "object" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement": { "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "properties": { "key": { "default": "", "description": "key is the label key that the selector applies to.", "type": "string", "x-kubernetes-patch-merge-key": "key", "x-kubernetes-patch-strategy": "merge" }, "operator": { "default": "", "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", "type": "string" }, "values": { "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", "items": { "default": "", "type": "string" }, "type": "array" } }, "required": [ "key", "operator" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta": { "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", "properties": { "continue": { "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", "type": "string" }, "remainingItemCount": { "description": "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", "format": "int64", "type": "integer" }, "resourceVersion": { "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry": { "description": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", "properties": { "apiVersion": { "description": "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", "type": "string" }, "fieldsType": { "description": "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", "type": "string" }, "fieldsV1": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1" } ], "description": "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type." }, "manager": { "description": "Manager is an identifier of the workflow managing these fields.", "type": "string" }, "operation": { "description": "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", "type": "string" }, "subresource": { "description": "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", "type": "string" }, "time": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over." } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime": { "description": "MicroTime is version of Time with microsecond level precision.", "format": "date-time", "type": "string" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta": { "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", "properties": { "annotations": { "additionalProperties": { "default": "", "type": "string" }, "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", "type": "object" }, "creationTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "deletionGracePeriodSeconds": { "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", "format": "int64", "type": "integer" }, "deletionTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "finalizers": { "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-patch-strategy": "merge" }, "generateName": { "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", "type": "string" }, "generation": { "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", "format": "int64", "type": "integer" }, "labels": { "additionalProperties": { "default": "", "type": "string" }, "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", "type": "object" }, "managedFields": { "description": "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry" } ], "default": {} }, "type": "array" }, "name": { "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "namespace": { "description": "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", "type": "string" }, "ownerReferences": { "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "uid", "x-kubernetes-patch-strategy": "merge" }, "resourceVersion": { "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" }, "uid": { "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference": { "description": "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", "properties": { "apiVersion": { "default": "", "description": "API version of the referent.", "type": "string" }, "blockOwnerDeletion": { "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", "type": "boolean" }, "controller": { "description": "If true, this reference points to the managing controller.", "type": "boolean" }, "kind": { "default": "", "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "default": "", "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "uid": { "default": "", "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "required": [ "apiVersion", "kind", "name", "uid" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Patch": { "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions": { "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", "properties": { "resourceVersion": { "description": "Specifies the target ResourceVersion", "type": "string" }, "uid": { "description": "Specifies the target UID.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Status": { "description": "Status is a return value for calls that don't return other objects.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "code": { "description": "Suggested HTTP return code for this status, 0 if not set.", "format": "int32", "type": "integer" }, "details": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails" } ], "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type." }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "message": { "description": "A human-readable description of the status of this operation.", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" }, "reason": { "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", "type": "string" }, "status": { "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Status", "version": "v1" }, { "group": "resource.k8s.io", "kind": "Status", "version": "v1alpha1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause": { "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", "properties": { "field": { "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", "type": "string" }, "message": { "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", "type": "string" }, "reason": { "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": { "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", "properties": { "causes": { "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause" } ], "default": {} }, "type": "array" }, "group": { "description": "The group attribute of the resource associated with the status StatusReason.", "type": "string" }, "kind": { "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", "type": "string" }, "retryAfterSeconds": { "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", "format": "int32", "type": "integer" }, "uid": { "description": "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Time": { "description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", "format": "date-time", "type": "string" }, "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent": { "description": "Event represents a single event to a watched resource.", "properties": { "object": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" } ], "default": {}, "description": "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context." }, "type": { "default": "", "type": "string" } }, "required": [ "type", "object" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta2" }, { "group": "batch", "kind": "WatchEvent", "version": "v1" }, { "group": "batch", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "extensions", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.runtime.RawExtension": { "description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", "type": "object" }, "io.k8s.apimachinery.pkg.util.intstr.IntOrString": { "description": "IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.", "format": "int-or-string", "oneOf": [ { "type": "integer" }, { "type": "string" } ] } }, "securitySchemes": { "BearerToken": { "description": "Bearer Token authentication", "in": "header", "name": "authorization", "type": "apiKey" } } }, "info": { "title": "Kubernetes", "version": "unversioned" }, "openapi": "3.0.0", "paths": { "/api/v1/": { "get": { "description": "get available resources", "operationId": "getCoreV1APIResources", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ] } }, "/api/v1/componentstatuses": { "get": { "description": "list objects of kind ComponentStatus", "operationId": "listCoreV1ComponentStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatusList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatusList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatusList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatusList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatusList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ComponentStatus", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/componentstatuses/{name}": { "get": { "description": "read the specified ComponentStatus", "operationId": "readCoreV1ComponentStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatus" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatus" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ComponentStatus" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "ComponentStatus", "version": "v1" } }, "parameters": [ { "description": "name of the ComponentStatus", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ] }, "/api/v1/configmaps": { "get": { "description": "list or watch objects of kind ConfigMap", "operationId": "listCoreV1ConfigMapForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/endpoints": { "get": { "description": "list or watch objects of kind Endpoints", "operationId": "listCoreV1EndpointsForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/events": { "get": { "description": "list or watch objects of kind Event", "operationId": "listCoreV1EventForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/limitranges": { "get": { "description": "list or watch objects of kind LimitRange", "operationId": "listCoreV1LimitRangeForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/namespaces": { "get": { "description": "list or watch objects of kind Namespace", "operationId": "listCoreV1Namespace", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NamespaceList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NamespaceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NamespaceList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NamespaceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NamespaceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } }, "parameters": [ { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a Namespace", "operationId": "createCoreV1Namespace", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/bindings": { "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a Binding", "operationId": "createCoreV1NamespacedBinding", "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Binding", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/configmaps": { "delete": { "description": "delete collection of ConfigMap", "operationId": "deleteCoreV1CollectionNamespacedConfigMap", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "get": { "description": "list or watch objects of kind ConfigMap", "operationId": "listCoreV1NamespacedConfigMap", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a ConfigMap", "operationId": "createCoreV1NamespacedConfigMap", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/configmaps/{name}": { "delete": { "description": "delete a ConfigMap", "operationId": "deleteCoreV1NamespacedConfigMap", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "get": { "description": "read the specified ConfigMap", "operationId": "readCoreV1NamespacedConfigMap", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "parameters": [ { "description": "name of the ConfigMap", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified ConfigMap", "operationId": "patchCoreV1NamespacedConfigMap", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "put": { "description": "replace the specified ConfigMap", "operationId": "replaceCoreV1NamespacedConfigMap", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMap" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/endpoints": { "delete": { "description": "delete collection of Endpoints", "operationId": "deleteCoreV1CollectionNamespacedEndpoints", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "get": { "description": "list or watch objects of kind Endpoints", "operationId": "listCoreV1NamespacedEndpoints", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EndpointsList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create Endpoints", "operationId": "createCoreV1NamespacedEndpoints", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/endpoints/{name}": { "delete": { "description": "delete Endpoints", "operationId": "deleteCoreV1NamespacedEndpoints", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "get": { "description": "read the specified Endpoints", "operationId": "readCoreV1NamespacedEndpoints", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "parameters": [ { "description": "name of the Endpoints", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Endpoints", "operationId": "patchCoreV1NamespacedEndpoints", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "put": { "description": "replace the specified Endpoints", "operationId": "replaceCoreV1NamespacedEndpoints", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Endpoints" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/events": { "delete": { "description": "delete collection of Event", "operationId": "deleteCoreV1CollectionNamespacedEvent", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "get": { "description": "list or watch objects of kind Event", "operationId": "listCoreV1NamespacedEvent", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.EventList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create an Event", "operationId": "createCoreV1NamespacedEvent", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/events/{name}": { "delete": { "description": "delete an Event", "operationId": "deleteCoreV1NamespacedEvent", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "get": { "description": "read the specified Event", "operationId": "readCoreV1NamespacedEvent", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "parameters": [ { "description": "name of the Event", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Event", "operationId": "patchCoreV1NamespacedEvent", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "put": { "description": "replace the specified Event", "operationId": "replaceCoreV1NamespacedEvent", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Event" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/limitranges": { "delete": { "description": "delete collection of LimitRange", "operationId": "deleteCoreV1CollectionNamespacedLimitRange", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "get": { "description": "list or watch objects of kind LimitRange", "operationId": "listCoreV1NamespacedLimitRange", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRangeList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a LimitRange", "operationId": "createCoreV1NamespacedLimitRange", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/limitranges/{name}": { "delete": { "description": "delete a LimitRange", "operationId": "deleteCoreV1NamespacedLimitRange", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "get": { "description": "read the specified LimitRange", "operationId": "readCoreV1NamespacedLimitRange", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "parameters": [ { "description": "name of the LimitRange", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified LimitRange", "operationId": "patchCoreV1NamespacedLimitRange", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "put": { "description": "replace the specified LimitRange", "operationId": "replaceCoreV1NamespacedLimitRange", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.LimitRange" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/persistentvolumeclaims": { "delete": { "description": "delete collection of PersistentVolumeClaim", "operationId": "deleteCoreV1CollectionNamespacedPersistentVolumeClaim", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "get": { "description": "list or watch objects of kind PersistentVolumeClaim", "operationId": "listCoreV1NamespacedPersistentVolumeClaim", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a PersistentVolumeClaim", "operationId": "createCoreV1NamespacedPersistentVolumeClaim", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}": { "delete": { "description": "delete a PersistentVolumeClaim", "operationId": "deleteCoreV1NamespacedPersistentVolumeClaim", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "get": { "description": "read the specified PersistentVolumeClaim", "operationId": "readCoreV1NamespacedPersistentVolumeClaim", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "parameters": [ { "description": "name of the PersistentVolumeClaim", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified PersistentVolumeClaim", "operationId": "patchCoreV1NamespacedPersistentVolumeClaim", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "put": { "description": "replace the specified PersistentVolumeClaim", "operationId": "replaceCoreV1NamespacedPersistentVolumeClaim", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status": { "get": { "description": "read status of the specified PersistentVolumeClaim", "operationId": "readCoreV1NamespacedPersistentVolumeClaimStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "parameters": [ { "description": "name of the PersistentVolumeClaim", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified PersistentVolumeClaim", "operationId": "patchCoreV1NamespacedPersistentVolumeClaimStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "put": { "description": "replace status of the specified PersistentVolumeClaim", "operationId": "replaceCoreV1NamespacedPersistentVolumeClaimStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods": { "delete": { "description": "delete collection of Pod", "operationId": "deleteCoreV1CollectionNamespacedPod", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "get": { "description": "list or watch objects of kind Pod", "operationId": "listCoreV1NamespacedPod", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a Pod", "operationId": "createCoreV1NamespacedPod", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}": { "delete": { "description": "delete a Pod", "operationId": "deleteCoreV1NamespacedPod", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "get": { "description": "read the specified Pod", "operationId": "readCoreV1NamespacedPod", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "name of the Pod", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Pod", "operationId": "patchCoreV1NamespacedPod", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "put": { "description": "replace the specified Pod", "operationId": "replaceCoreV1NamespacedPod", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/attach": { "get": { "description": "connect GET requests to attach of Pod", "operationId": "connectCoreV1GetNamespacedPodAttach", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodAttachOptions", "version": "v1" } }, "parameters": [ { "description": "The container in which to execute the command. Defaults to only container if there is only one container in the pod.", "in": "query", "name": "container", "schema": { "type": "string", "uniqueItems": true } }, { "description": "name of the PodAttachOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true.", "in": "query", "name": "stderr", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false.", "in": "query", "name": "stdin", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true.", "in": "query", "name": "stdout", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false.", "in": "query", "name": "tty", "schema": { "type": "boolean", "uniqueItems": true } } ], "post": { "description": "connect POST requests to attach of Pod", "operationId": "connectCoreV1PostNamespacedPodAttach", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodAttachOptions", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/binding": { "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "name of the Binding", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create binding of a Pod", "operationId": "createCoreV1NamespacedPodBinding", "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Binding" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Binding", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers": { "get": { "description": "read ephemeralcontainers of the specified Pod", "operationId": "readCoreV1NamespacedPodEphemeralcontainers", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "name of the Pod", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update ephemeralcontainers of the specified Pod", "operationId": "patchCoreV1NamespacedPodEphemeralcontainers", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "put": { "description": "replace ephemeralcontainers of the specified Pod", "operationId": "replaceCoreV1NamespacedPodEphemeralcontainers", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/eviction": { "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "name of the Eviction", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create eviction of a Pod", "operationId": "createCoreV1NamespacedPodEviction", "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.policy.v1.Eviction" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "policy", "kind": "Eviction", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/exec": { "get": { "description": "connect GET requests to exec of Pod", "operationId": "connectCoreV1GetNamespacedPodExec", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodExecOptions", "version": "v1" } }, "parameters": [ { "description": "Command is the remote command to execute. argv array. Not executed within a shell.", "in": "query", "name": "command", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Container in which to execute the command. Defaults to only container if there is only one container in the pod.", "in": "query", "name": "container", "schema": { "type": "string", "uniqueItems": true } }, { "description": "name of the PodExecOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "Redirect the standard error stream of the pod for this call.", "in": "query", "name": "stderr", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Redirect the standard input stream of the pod for this call. Defaults to false.", "in": "query", "name": "stdin", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Redirect the standard output stream of the pod for this call.", "in": "query", "name": "stdout", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "TTY if true indicates that a tty will be allocated for the exec call. Defaults to false.", "in": "query", "name": "tty", "schema": { "type": "boolean", "uniqueItems": true } } ], "post": { "description": "connect POST requests to exec of Pod", "operationId": "connectCoreV1PostNamespacedPodExec", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodExecOptions", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/log": { "get": { "description": "read log of the specified Pod", "operationId": "readCoreV1NamespacedPodLog", "responses": { "200": { "content": { "application/json": { "schema": { "type": "string" } }, "application/vnd.kubernetes.protobuf": { "schema": { "type": "string" } }, "application/yaml": { "schema": { "type": "string" } }, "text/plain": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "The container for which to stream logs. Defaults to only container if there is one container in the pod.", "in": "query", "name": "container", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Follow the log stream of the pod. Defaults to false.", "in": "query", "name": "follow", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet).", "in": "query", "name": "insecureSkipTLSVerifyBackend", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.", "in": "query", "name": "limitBytes", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Pod", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Return previous terminated container logs. Defaults to false.", "in": "query", "name": "previous", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", "in": "query", "name": "sinceSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime", "in": "query", "name": "tailLines", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.", "in": "query", "name": "timestamps", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/namespaces/{namespace}/pods/{name}/portforward": { "get": { "description": "connect GET requests to portforward of Pod", "operationId": "connectCoreV1GetNamespacedPodPortforward", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodPortForwardOptions", "version": "v1" } }, "parameters": [ { "description": "name of the PodPortForwardOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "List of ports to forward Required when using WebSockets", "in": "query", "name": "ports", "schema": { "type": "integer", "uniqueItems": true } } ], "post": { "description": "connect POST requests to portforward of Pod", "operationId": "connectCoreV1PostNamespacedPodPortforward", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodPortForwardOptions", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/proxy": { "delete": { "description": "connect DELETE requests to proxy of Pod", "operationId": "connectCoreV1DeleteNamespacedPodProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "get": { "description": "connect GET requests to proxy of Pod", "operationId": "connectCoreV1GetNamespacedPodProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "head": { "description": "connect HEAD requests to proxy of Pod", "operationId": "connectCoreV1HeadNamespacedPodProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "options": { "description": "connect OPTIONS requests to proxy of Pod", "operationId": "connectCoreV1OptionsNamespacedPodProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "parameters": [ { "description": "name of the PodProxyOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "Path is the URL path to use for the current proxy request to pod.", "in": "query", "name": "path", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "connect PATCH requests to proxy of Pod", "operationId": "connectCoreV1PatchNamespacedPodProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "post": { "description": "connect POST requests to proxy of Pod", "operationId": "connectCoreV1PostNamespacedPodProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "put": { "description": "connect PUT requests to proxy of Pod", "operationId": "connectCoreV1PutNamespacedPodProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}": { "delete": { "description": "connect DELETE requests to proxy of Pod", "operationId": "connectCoreV1DeleteNamespacedPodProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "get": { "description": "connect GET requests to proxy of Pod", "operationId": "connectCoreV1GetNamespacedPodProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "head": { "description": "connect HEAD requests to proxy of Pod", "operationId": "connectCoreV1HeadNamespacedPodProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "options": { "description": "connect OPTIONS requests to proxy of Pod", "operationId": "connectCoreV1OptionsNamespacedPodProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "parameters": [ { "description": "name of the PodProxyOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "path to the resource", "in": "path", "name": "path", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "Path is the URL path to use for the current proxy request to pod.", "in": "query", "name": "path", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "connect PATCH requests to proxy of Pod", "operationId": "connectCoreV1PatchNamespacedPodProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "post": { "description": "connect POST requests to proxy of Pod", "operationId": "connectCoreV1PostNamespacedPodProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } }, "put": { "description": "connect PUT requests to proxy of Pod", "operationId": "connectCoreV1PutNamespacedPodProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodProxyOptions", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/pods/{name}/status": { "get": { "description": "read status of the specified Pod", "operationId": "readCoreV1NamespacedPodStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "name of the Pod", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified Pod", "operationId": "patchCoreV1NamespacedPodStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "put": { "description": "replace status of the specified Pod", "operationId": "replaceCoreV1NamespacedPodStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Pod" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/podtemplates": { "delete": { "description": "delete collection of PodTemplate", "operationId": "deleteCoreV1CollectionNamespacedPodTemplate", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "get": { "description": "list or watch objects of kind PodTemplate", "operationId": "listCoreV1NamespacedPodTemplate", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a PodTemplate", "operationId": "createCoreV1NamespacedPodTemplate", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/podtemplates/{name}": { "delete": { "description": "delete a PodTemplate", "operationId": "deleteCoreV1NamespacedPodTemplate", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "get": { "description": "read the specified PodTemplate", "operationId": "readCoreV1NamespacedPodTemplate", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "parameters": [ { "description": "name of the PodTemplate", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified PodTemplate", "operationId": "patchCoreV1NamespacedPodTemplate", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "put": { "description": "replace the specified PodTemplate", "operationId": "replaceCoreV1NamespacedPodTemplate", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplate" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/replicationcontrollers": { "delete": { "description": "delete collection of ReplicationController", "operationId": "deleteCoreV1CollectionNamespacedReplicationController", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "get": { "description": "list or watch objects of kind ReplicationController", "operationId": "listCoreV1NamespacedReplicationController", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a ReplicationController", "operationId": "createCoreV1NamespacedReplicationController", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}": { "delete": { "description": "delete a ReplicationController", "operationId": "deleteCoreV1NamespacedReplicationController", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "get": { "description": "read the specified ReplicationController", "operationId": "readCoreV1NamespacedReplicationController", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "parameters": [ { "description": "name of the ReplicationController", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified ReplicationController", "operationId": "patchCoreV1NamespacedReplicationController", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "put": { "description": "replace the specified ReplicationController", "operationId": "replaceCoreV1NamespacedReplicationController", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale": { "get": { "description": "read scale of the specified ReplicationController", "operationId": "readCoreV1NamespacedReplicationControllerScale", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } }, "parameters": [ { "description": "name of the Scale", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update scale of the specified ReplicationController", "operationId": "patchCoreV1NamespacedReplicationControllerScale", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } }, "put": { "description": "replace scale of the specified ReplicationController", "operationId": "replaceCoreV1NamespacedReplicationControllerScale", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status": { "get": { "description": "read status of the specified ReplicationController", "operationId": "readCoreV1NamespacedReplicationControllerStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "parameters": [ { "description": "name of the ReplicationController", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified ReplicationController", "operationId": "patchCoreV1NamespacedReplicationControllerStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "put": { "description": "replace status of the specified ReplicationController", "operationId": "replaceCoreV1NamespacedReplicationControllerStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationController" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/resourcequotas": { "delete": { "description": "delete collection of ResourceQuota", "operationId": "deleteCoreV1CollectionNamespacedResourceQuota", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "get": { "description": "list or watch objects of kind ResourceQuota", "operationId": "listCoreV1NamespacedResourceQuota", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a ResourceQuota", "operationId": "createCoreV1NamespacedResourceQuota", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/resourcequotas/{name}": { "delete": { "description": "delete a ResourceQuota", "operationId": "deleteCoreV1NamespacedResourceQuota", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "get": { "description": "read the specified ResourceQuota", "operationId": "readCoreV1NamespacedResourceQuota", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "parameters": [ { "description": "name of the ResourceQuota", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified ResourceQuota", "operationId": "patchCoreV1NamespacedResourceQuota", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "put": { "description": "replace the specified ResourceQuota", "operationId": "replaceCoreV1NamespacedResourceQuota", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status": { "get": { "description": "read status of the specified ResourceQuota", "operationId": "readCoreV1NamespacedResourceQuotaStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "parameters": [ { "description": "name of the ResourceQuota", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified ResourceQuota", "operationId": "patchCoreV1NamespacedResourceQuotaStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "put": { "description": "replace status of the specified ResourceQuota", "operationId": "replaceCoreV1NamespacedResourceQuotaStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuota" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/secrets": { "delete": { "description": "delete collection of Secret", "operationId": "deleteCoreV1CollectionNamespacedSecret", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "get": { "description": "list or watch objects of kind Secret", "operationId": "listCoreV1NamespacedSecret", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a Secret", "operationId": "createCoreV1NamespacedSecret", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/secrets/{name}": { "delete": { "description": "delete a Secret", "operationId": "deleteCoreV1NamespacedSecret", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "get": { "description": "read the specified Secret", "operationId": "readCoreV1NamespacedSecret", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "parameters": [ { "description": "name of the Secret", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Secret", "operationId": "patchCoreV1NamespacedSecret", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "put": { "description": "replace the specified Secret", "operationId": "replaceCoreV1NamespacedSecret", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Secret" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/serviceaccounts": { "delete": { "description": "delete collection of ServiceAccount", "operationId": "deleteCoreV1CollectionNamespacedServiceAccount", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "get": { "description": "list or watch objects of kind ServiceAccount", "operationId": "listCoreV1NamespacedServiceAccount", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a ServiceAccount", "operationId": "createCoreV1NamespacedServiceAccount", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/serviceaccounts/{name}": { "delete": { "description": "delete a ServiceAccount", "operationId": "deleteCoreV1NamespacedServiceAccount", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "get": { "description": "read the specified ServiceAccount", "operationId": "readCoreV1NamespacedServiceAccount", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "parameters": [ { "description": "name of the ServiceAccount", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified ServiceAccount", "operationId": "patchCoreV1NamespacedServiceAccount", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "put": { "description": "replace the specified ServiceAccount", "operationId": "replaceCoreV1NamespacedServiceAccount", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccount" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token": { "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "name of the TokenRequest", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create token of a ServiceAccount", "operationId": "createCoreV1NamespacedServiceAccountToken", "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.authentication.v1.TokenRequest" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "authentication.k8s.io", "kind": "TokenRequest", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/services": { "delete": { "description": "delete collection of Service", "operationId": "deleteCoreV1CollectionNamespacedService", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "get": { "description": "list or watch objects of kind Service", "operationId": "listCoreV1NamespacedService", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a Service", "operationId": "createCoreV1NamespacedService", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/services/{name}": { "delete": { "description": "delete a Service", "operationId": "deleteCoreV1NamespacedService", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "get": { "description": "read the specified Service", "operationId": "readCoreV1NamespacedService", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "parameters": [ { "description": "name of the Service", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Service", "operationId": "patchCoreV1NamespacedService", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "put": { "description": "replace the specified Service", "operationId": "replaceCoreV1NamespacedService", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/services/{name}/proxy": { "delete": { "description": "connect DELETE requests to proxy of Service", "operationId": "connectCoreV1DeleteNamespacedServiceProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "get": { "description": "connect GET requests to proxy of Service", "operationId": "connectCoreV1GetNamespacedServiceProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "head": { "description": "connect HEAD requests to proxy of Service", "operationId": "connectCoreV1HeadNamespacedServiceProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "options": { "description": "connect OPTIONS requests to proxy of Service", "operationId": "connectCoreV1OptionsNamespacedServiceProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "parameters": [ { "description": "name of the ServiceProxyOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.", "in": "query", "name": "path", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "connect PATCH requests to proxy of Service", "operationId": "connectCoreV1PatchNamespacedServiceProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "post": { "description": "connect POST requests to proxy of Service", "operationId": "connectCoreV1PostNamespacedServiceProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "put": { "description": "connect PUT requests to proxy of Service", "operationId": "connectCoreV1PutNamespacedServiceProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}": { "delete": { "description": "connect DELETE requests to proxy of Service", "operationId": "connectCoreV1DeleteNamespacedServiceProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "get": { "description": "connect GET requests to proxy of Service", "operationId": "connectCoreV1GetNamespacedServiceProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "head": { "description": "connect HEAD requests to proxy of Service", "operationId": "connectCoreV1HeadNamespacedServiceProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "options": { "description": "connect OPTIONS requests to proxy of Service", "operationId": "connectCoreV1OptionsNamespacedServiceProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "parameters": [ { "description": "name of the ServiceProxyOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "path to the resource", "in": "path", "name": "path", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.", "in": "query", "name": "path", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "connect PATCH requests to proxy of Service", "operationId": "connectCoreV1PatchNamespacedServiceProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "post": { "description": "connect POST requests to proxy of Service", "operationId": "connectCoreV1PostNamespacedServiceProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } }, "put": { "description": "connect PUT requests to proxy of Service", "operationId": "connectCoreV1PutNamespacedServiceProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceProxyOptions", "version": "v1" } } }, "/api/v1/namespaces/{namespace}/services/{name}/status": { "get": { "description": "read status of the specified Service", "operationId": "readCoreV1NamespacedServiceStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "parameters": [ { "description": "name of the Service", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified Service", "operationId": "patchCoreV1NamespacedServiceStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "put": { "description": "replace status of the specified Service", "operationId": "replaceCoreV1NamespacedServiceStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Service" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } } }, "/api/v1/namespaces/{name}": { "delete": { "description": "delete a Namespace", "operationId": "deleteCoreV1Namespace", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } }, "get": { "description": "read the specified Namespace", "operationId": "readCoreV1Namespace", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } }, "parameters": [ { "description": "name of the Namespace", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Namespace", "operationId": "patchCoreV1Namespace", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } }, "put": { "description": "replace the specified Namespace", "operationId": "replaceCoreV1Namespace", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } } }, "/api/v1/namespaces/{name}/finalize": { "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "name of the Namespace", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "put": { "description": "replace finalize of the specified Namespace", "operationId": "replaceCoreV1NamespaceFinalize", "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } } }, "/api/v1/namespaces/{name}/status": { "get": { "description": "read status of the specified Namespace", "operationId": "readCoreV1NamespaceStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } }, "parameters": [ { "description": "name of the Namespace", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified Namespace", "operationId": "patchCoreV1NamespaceStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } }, "put": { "description": "replace status of the specified Namespace", "operationId": "replaceCoreV1NamespaceStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Namespace" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } } }, "/api/v1/nodes": { "delete": { "description": "delete collection of Node", "operationId": "deleteCoreV1CollectionNode", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "get": { "description": "list or watch objects of kind Node", "operationId": "listCoreV1Node", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "parameters": [ { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a Node", "operationId": "createCoreV1Node", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } } }, "/api/v1/nodes/{name}": { "delete": { "description": "delete a Node", "operationId": "deleteCoreV1Node", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "get": { "description": "read the specified Node", "operationId": "readCoreV1Node", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "parameters": [ { "description": "name of the Node", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Node", "operationId": "patchCoreV1Node", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "put": { "description": "replace the specified Node", "operationId": "replaceCoreV1Node", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } } }, "/api/v1/nodes/{name}/proxy": { "delete": { "description": "connect DELETE requests to proxy of Node", "operationId": "connectCoreV1DeleteNodeProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "get": { "description": "connect GET requests to proxy of Node", "operationId": "connectCoreV1GetNodeProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "head": { "description": "connect HEAD requests to proxy of Node", "operationId": "connectCoreV1HeadNodeProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "options": { "description": "connect OPTIONS requests to proxy of Node", "operationId": "connectCoreV1OptionsNodeProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "parameters": [ { "description": "name of the NodeProxyOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "Path is the URL path to use for the current proxy request to node.", "in": "query", "name": "path", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "connect PATCH requests to proxy of Node", "operationId": "connectCoreV1PatchNodeProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "post": { "description": "connect POST requests to proxy of Node", "operationId": "connectCoreV1PostNodeProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "put": { "description": "connect PUT requests to proxy of Node", "operationId": "connectCoreV1PutNodeProxy", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } } }, "/api/v1/nodes/{name}/proxy/{path}": { "delete": { "description": "connect DELETE requests to proxy of Node", "operationId": "connectCoreV1DeleteNodeProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "get": { "description": "connect GET requests to proxy of Node", "operationId": "connectCoreV1GetNodeProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "head": { "description": "connect HEAD requests to proxy of Node", "operationId": "connectCoreV1HeadNodeProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "options": { "description": "connect OPTIONS requests to proxy of Node", "operationId": "connectCoreV1OptionsNodeProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "parameters": [ { "description": "name of the NodeProxyOptions", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "path to the resource", "in": "path", "name": "path", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "Path is the URL path to use for the current proxy request to node.", "in": "query", "name": "path", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "connect PATCH requests to proxy of Node", "operationId": "connectCoreV1PatchNodeProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "post": { "description": "connect POST requests to proxy of Node", "operationId": "connectCoreV1PostNodeProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } }, "put": { "description": "connect PUT requests to proxy of Node", "operationId": "connectCoreV1PutNodeProxyWithPath", "responses": { "200": { "content": { "*/*": { "schema": { "type": "string" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "connect", "x-kubernetes-group-version-kind": { "group": "", "kind": "NodeProxyOptions", "version": "v1" } } }, "/api/v1/nodes/{name}/status": { "get": { "description": "read status of the specified Node", "operationId": "readCoreV1NodeStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "parameters": [ { "description": "name of the Node", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified Node", "operationId": "patchCoreV1NodeStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "put": { "description": "replace status of the specified Node", "operationId": "replaceCoreV1NodeStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.Node" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } } }, "/api/v1/persistentvolumeclaims": { "get": { "description": "list or watch objects of kind PersistentVolumeClaim", "operationId": "listCoreV1PersistentVolumeClaimForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/persistentvolumes": { "delete": { "description": "delete collection of PersistentVolume", "operationId": "deleteCoreV1CollectionPersistentVolume", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "get": { "description": "list or watch objects of kind PersistentVolume", "operationId": "listCoreV1PersistentVolume", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "parameters": [ { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a PersistentVolume", "operationId": "createCoreV1PersistentVolume", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } } }, "/api/v1/persistentvolumes/{name}": { "delete": { "description": "delete a PersistentVolume", "operationId": "deleteCoreV1PersistentVolume", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "get": { "description": "read the specified PersistentVolume", "operationId": "readCoreV1PersistentVolume", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "parameters": [ { "description": "name of the PersistentVolume", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified PersistentVolume", "operationId": "patchCoreV1PersistentVolume", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "put": { "description": "replace the specified PersistentVolume", "operationId": "replaceCoreV1PersistentVolume", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } } }, "/api/v1/persistentvolumes/{name}/status": { "get": { "description": "read status of the specified PersistentVolume", "operationId": "readCoreV1PersistentVolumeStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "parameters": [ { "description": "name of the PersistentVolume", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified PersistentVolume", "operationId": "patchCoreV1PersistentVolumeStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "put": { "description": "replace status of the specified PersistentVolume", "operationId": "replaceCoreV1PersistentVolumeStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolume" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } } }, "/api/v1/pods": { "get": { "description": "list or watch objects of kind Pod", "operationId": "listCoreV1PodForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/podtemplates": { "get": { "description": "list or watch objects of kind PodTemplate", "operationId": "listCoreV1PodTemplateForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/replicationcontrollers": { "get": { "description": "list or watch objects of kind ReplicationController", "operationId": "listCoreV1ReplicationControllerForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ReplicationControllerList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/resourcequotas": { "get": { "description": "list or watch objects of kind ResourceQuota", "operationId": "listCoreV1ResourceQuotaForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceQuotaList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/secrets": { "get": { "description": "list or watch objects of kind Secret", "operationId": "listCoreV1SecretForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/serviceaccounts": { "get": { "description": "list or watch objects of kind ServiceAccount", "operationId": "listCoreV1ServiceAccountForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/services": { "get": { "description": "list or watch objects of kind Service", "operationId": "listCoreV1ServiceForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/configmaps": { "get": { "description": "watch individual changes to a list of ConfigMap. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1ConfigMapListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/endpoints": { "get": { "description": "watch individual changes to a list of Endpoints. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1EndpointsListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/events": { "get": { "description": "watch individual changes to a list of Event. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1EventListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/limitranges": { "get": { "description": "watch individual changes to a list of LimitRange. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1LimitRangeListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces": { "get": { "description": "watch individual changes to a list of Namespace. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespaceList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/configmaps": { "get": { "description": "watch individual changes to a list of ConfigMap. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedConfigMapList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/configmaps/{name}": { "get": { "description": "watch changes to an object of kind ConfigMap. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedConfigMap", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ConfigMap", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the ConfigMap", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/endpoints": { "get": { "description": "watch individual changes to a list of Endpoints. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedEndpointsList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/endpoints/{name}": { "get": { "description": "watch changes to an object of kind Endpoints. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedEndpoints", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Endpoints", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Endpoints", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/events": { "get": { "description": "watch individual changes to a list of Event. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedEventList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/events/{name}": { "get": { "description": "watch changes to an object of kind Event. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedEvent", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Event", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Event", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/limitranges": { "get": { "description": "watch individual changes to a list of LimitRange. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedLimitRangeList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/limitranges/{name}": { "get": { "description": "watch changes to an object of kind LimitRange. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedLimitRange", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "LimitRange", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the LimitRange", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims": { "get": { "description": "watch individual changes to a list of PersistentVolumeClaim. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedPersistentVolumeClaimList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}": { "get": { "description": "watch changes to an object of kind PersistentVolumeClaim. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedPersistentVolumeClaim", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the PersistentVolumeClaim", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/pods": { "get": { "description": "watch individual changes to a list of Pod. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedPodList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/pods/{name}": { "get": { "description": "watch changes to an object of kind Pod. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedPod", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Pod", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/podtemplates": { "get": { "description": "watch individual changes to a list of PodTemplate. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedPodTemplateList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}": { "get": { "description": "watch changes to an object of kind PodTemplate. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedPodTemplate", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the PodTemplate", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/replicationcontrollers": { "get": { "description": "watch individual changes to a list of ReplicationController. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedReplicationControllerList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}": { "get": { "description": "watch changes to an object of kind ReplicationController. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedReplicationController", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the ReplicationController", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/resourcequotas": { "get": { "description": "watch individual changes to a list of ResourceQuota. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedResourceQuotaList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}": { "get": { "description": "watch changes to an object of kind ResourceQuota. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedResourceQuota", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the ResourceQuota", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/secrets": { "get": { "description": "watch individual changes to a list of Secret. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedSecretList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/secrets/{name}": { "get": { "description": "watch changes to an object of kind Secret. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedSecret", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Secret", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/serviceaccounts": { "get": { "description": "watch individual changes to a list of ServiceAccount. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedServiceAccountList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}": { "get": { "description": "watch changes to an object of kind ServiceAccount. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedServiceAccount", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the ServiceAccount", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/services": { "get": { "description": "watch individual changes to a list of Service. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NamespacedServiceList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{namespace}/services/{name}": { "get": { "description": "watch changes to an object of kind Service. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1NamespacedService", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Service", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/namespaces/{name}": { "get": { "description": "watch changes to an object of kind Namespace. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1Namespace", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Namespace", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Namespace", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/nodes": { "get": { "description": "watch individual changes to a list of Node. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1NodeList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/nodes/{name}": { "get": { "description": "watch changes to an object of kind Node. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1Node", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "Node", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Node", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/persistentvolumeclaims": { "get": { "description": "watch individual changes to a list of PersistentVolumeClaim. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1PersistentVolumeClaimListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/persistentvolumes": { "get": { "description": "watch individual changes to a list of PersistentVolume. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1PersistentVolumeList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/persistentvolumes/{name}": { "get": { "description": "watch changes to an object of kind PersistentVolume. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchCoreV1PersistentVolume", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "", "kind": "PersistentVolume", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the PersistentVolume", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/pods": { "get": { "description": "watch individual changes to a list of Pod. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1PodListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Pod", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/podtemplates": { "get": { "description": "watch individual changes to a list of PodTemplate. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1PodTemplateListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "PodTemplate", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/replicationcontrollers": { "get": { "description": "watch individual changes to a list of ReplicationController. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1ReplicationControllerListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "ReplicationController", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/resourcequotas": { "get": { "description": "watch individual changes to a list of ResourceQuota. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1ResourceQuotaListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "ResourceQuota", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/secrets": { "get": { "description": "watch individual changes to a list of Secret. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1SecretListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Secret", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/serviceaccounts": { "get": { "description": "watch individual changes to a list of ServiceAccount. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1ServiceAccountListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "ServiceAccount", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/api/v1/watch/services": { "get": { "description": "watch individual changes to a list of Service. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchCoreV1ServiceListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "core_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "", "kind": "Service", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] } } } kubernetes-client-go-a2dfcab/openapi/openapitest/testdata/apis__apps__v1_openapi.json000066400000000000000000026727331472614177300315140ustar00rootroot00000000000000{ "components": { "schemas": { "io.k8s.api.apps.v1.ControllerRevision": { "description": "ControllerRevision implements an immutable snapshot of state data. Clients are responsible for serializing and deserializing the objects that contain their internal state. Once a ControllerRevision has been successfully created, it can not be updated. The API Server will fail validation of all requests that attempt to mutate the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However, it may be subject to name and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "data": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" } ], "default": {}, "description": "Data is the serialized representation of the state." }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "revision": { "default": 0, "description": "Revision indicates the revision of the state represented by Data.", "format": "int64", "type": "integer" } }, "required": [ "revision" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "ControllerRevision", "version": "v1" } ] }, "io.k8s.api.apps.v1.ControllerRevisionList": { "description": "ControllerRevisionList is a resource containing a list of ControllerRevision objects.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "Items is the list of ControllerRevisions", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "ControllerRevisionList", "version": "v1" } ] }, "io.k8s.api.apps.v1.DaemonSet": { "description": "DaemonSet represents the configuration of a daemon set.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetSpec" } ], "default": {}, "description": "The desired behavior of this daemon set. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetStatus" } ], "default": {}, "description": "The current status of this daemon set. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "DaemonSet", "version": "v1" } ] }, "io.k8s.api.apps.v1.DaemonSetCondition": { "description": "DaemonSetCondition describes the state of a DaemonSet at a certain point.", "properties": { "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time the condition transitioned from one status to another." }, "message": { "description": "A human readable message indicating details about the transition.", "type": "string" }, "reason": { "description": "The reason for the condition's last transition.", "type": "string" }, "status": { "default": "", "description": "Status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "Type of DaemonSet condition.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.apps.v1.DaemonSetList": { "description": "DaemonSetList is a collection of daemon sets.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "A list of daemon sets.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "DaemonSetList", "version": "v1" } ] }, "io.k8s.api.apps.v1.DaemonSetSpec": { "description": "DaemonSetSpec is the specification of a daemon set.", "properties": { "minReadySeconds": { "description": "The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).", "format": "int32", "type": "integer" }, "revisionHistoryLimit": { "description": "The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.", "format": "int32", "type": "integer" }, "selector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" }, "template": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec" } ], "default": {}, "description": "An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template" }, "updateStrategy": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetUpdateStrategy" } ], "default": {}, "description": "An update strategy to replace existing DaemonSet pods with new pods." } }, "required": [ "selector", "template" ], "type": "object" }, "io.k8s.api.apps.v1.DaemonSetStatus": { "description": "DaemonSetStatus represents the current status of a daemon set.", "properties": { "collisionCount": { "description": "Count of hash collisions for the DaemonSet. The DaemonSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.", "format": "int32", "type": "integer" }, "conditions": { "description": "Represents the latest available observations of a DaemonSet's current state.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "currentNumberScheduled": { "default": 0, "description": "The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "format": "int32", "type": "integer" }, "desiredNumberScheduled": { "default": 0, "description": "The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "format": "int32", "type": "integer" }, "numberAvailable": { "description": "The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available (ready for at least spec.minReadySeconds)", "format": "int32", "type": "integer" }, "numberMisscheduled": { "default": 0, "description": "The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "format": "int32", "type": "integer" }, "numberReady": { "default": 0, "description": "numberReady is the number of nodes that should be running the daemon pod and have one or more of the daemon pod running with a Ready Condition.", "format": "int32", "type": "integer" }, "numberUnavailable": { "description": "The number of nodes that should be running the daemon pod and have none of the daemon pod running and available (ready for at least spec.minReadySeconds)", "format": "int32", "type": "integer" }, "observedGeneration": { "description": "The most recent generation observed by the daemon set controller.", "format": "int64", "type": "integer" }, "updatedNumberScheduled": { "description": "The total number of nodes that are running updated daemon pod", "format": "int32", "type": "integer" } }, "required": [ "currentNumberScheduled", "numberMisscheduled", "desiredNumberScheduled", "numberReady" ], "type": "object" }, "io.k8s.api.apps.v1.DaemonSetUpdateStrategy": { "description": "DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.", "properties": { "rollingUpdate": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.RollingUpdateDaemonSet" } ], "description": "Rolling update config params. Present only if type = \"RollingUpdate\"." }, "type": { "description": "Type of daemon set update. Can be \"RollingUpdate\" or \"OnDelete\". Default is RollingUpdate.", "type": "string" } }, "type": "object" }, "io.k8s.api.apps.v1.Deployment": { "description": "Deployment enables declarative updates for Pods and ReplicaSets.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentSpec" } ], "default": {}, "description": "Specification of the desired behavior of the Deployment." }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentStatus" } ], "default": {}, "description": "Most recently observed status of the Deployment." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "Deployment", "version": "v1" } ] }, "io.k8s.api.apps.v1.DeploymentCondition": { "description": "DeploymentCondition describes the state of a deployment at a certain point.", "properties": { "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time the condition transitioned from one status to another." }, "lastUpdateTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "The last time this condition was updated." }, "message": { "description": "A human readable message indicating details about the transition.", "type": "string" }, "reason": { "description": "The reason for the condition's last transition.", "type": "string" }, "status": { "default": "", "description": "Status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "Type of deployment condition.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.apps.v1.DeploymentList": { "description": "DeploymentList is a list of Deployments.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "Items is the list of Deployments.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata." } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "DeploymentList", "version": "v1" } ] }, "io.k8s.api.apps.v1.DeploymentSpec": { "description": "DeploymentSpec is the specification of the desired behavior of the Deployment.", "properties": { "minReadySeconds": { "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", "format": "int32", "type": "integer" }, "paused": { "description": "Indicates that the deployment is paused.", "type": "boolean" }, "progressDeadlineSeconds": { "description": "The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.", "format": "int32", "type": "integer" }, "replicas": { "description": "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.", "format": "int32", "type": "integer" }, "revisionHistoryLimit": { "description": "The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.", "format": "int32", "type": "integer" }, "selector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels." }, "strategy": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentStrategy" } ], "default": {}, "description": "The deployment strategy to use to replace existing pods with new ones.", "x-kubernetes-patch-strategy": "retainKeys" }, "template": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec" } ], "default": {}, "description": "Template describes the pods that will be created." } }, "required": [ "selector", "template" ], "type": "object" }, "io.k8s.api.apps.v1.DeploymentStatus": { "description": "DeploymentStatus is the most recently observed status of the Deployment.", "properties": { "availableReplicas": { "description": "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.", "format": "int32", "type": "integer" }, "collisionCount": { "description": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", "format": "int32", "type": "integer" }, "conditions": { "description": "Represents the latest available observations of a deployment's current state.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "observedGeneration": { "description": "The generation observed by the deployment controller.", "format": "int64", "type": "integer" }, "readyReplicas": { "description": "readyReplicas is the number of pods targeted by this Deployment with a Ready Condition.", "format": "int32", "type": "integer" }, "replicas": { "description": "Total number of non-terminated pods targeted by this deployment (their labels match the selector).", "format": "int32", "type": "integer" }, "unavailableReplicas": { "description": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", "format": "int32", "type": "integer" }, "updatedReplicas": { "description": "Total number of non-terminated pods targeted by this deployment that have the desired template spec.", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.apps.v1.DeploymentStrategy": { "description": "DeploymentStrategy describes how to replace existing pods with new ones.", "properties": { "rollingUpdate": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.RollingUpdateDeployment" } ], "description": "Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate." }, "type": { "description": "Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate.", "type": "string" } }, "type": "object" }, "io.k8s.api.apps.v1.ReplicaSet": { "description": "ReplicaSet ensures that a specified number of pod replicas are running at any given time.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetSpec" } ], "default": {}, "description": "Spec defines the specification of the desired behavior of the ReplicaSet. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetStatus" } ], "default": {}, "description": "Status is the most recently observed status of the ReplicaSet. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "ReplicaSet", "version": "v1" } ] }, "io.k8s.api.apps.v1.ReplicaSetCondition": { "description": "ReplicaSetCondition describes the state of a replica set at a certain point.", "properties": { "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "The last time the condition transitioned from one status to another." }, "message": { "description": "A human readable message indicating details about the transition.", "type": "string" }, "reason": { "description": "The reason for the condition's last transition.", "type": "string" }, "status": { "default": "", "description": "Status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "Type of replica set condition.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.apps.v1.ReplicaSetList": { "description": "ReplicaSetList is a collection of ReplicaSets.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "ReplicaSetList", "version": "v1" } ] }, "io.k8s.api.apps.v1.ReplicaSetSpec": { "description": "ReplicaSetSpec is the specification of a ReplicaSet.", "properties": { "minReadySeconds": { "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", "format": "int32", "type": "integer" }, "replicas": { "description": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", "format": "int32", "type": "integer" }, "selector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "Selector is a label query over pods that should match the replica count. Label keys and values that must match in order to be controlled by this replica set. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" }, "template": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec" } ], "default": {}, "description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template" } }, "required": [ "selector" ], "type": "object" }, "io.k8s.api.apps.v1.ReplicaSetStatus": { "description": "ReplicaSetStatus represents the current status of a ReplicaSet.", "properties": { "availableReplicas": { "description": "The number of available replicas (ready for at least minReadySeconds) for this replica set.", "format": "int32", "type": "integer" }, "conditions": { "description": "Represents the latest available observations of a replica set's current state.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "fullyLabeledReplicas": { "description": "The number of pods that have labels matching the labels of the pod template of the replicaset.", "format": "int32", "type": "integer" }, "observedGeneration": { "description": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet.", "format": "int64", "type": "integer" }, "readyReplicas": { "description": "readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition.", "format": "int32", "type": "integer" }, "replicas": { "default": 0, "description": "Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", "format": "int32", "type": "integer" } }, "required": [ "replicas" ], "type": "object" }, "io.k8s.api.apps.v1.RollingUpdateDaemonSet": { "description": "Spec to control the desired behavior of daemon set rolling update.", "properties": { "maxSurge": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "description": "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption." }, "maxUnavailable": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "description": "The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0 if MaxSurge is 0 Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update." } }, "type": "object" }, "io.k8s.api.apps.v1.RollingUpdateDeployment": { "description": "Spec to control the desired behavior of rolling update.", "properties": { "maxSurge": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "description": "The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods." }, "maxUnavailable": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "description": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods." } }, "type": "object" }, "io.k8s.api.apps.v1.RollingUpdateStatefulSetStrategy": { "description": "RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.", "properties": { "maxUnavailable": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "description": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0. Defaults to 1. This field is alpha-level and is only honored by servers that enable the MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it will be counted towards MaxUnavailable." }, "partition": { "description": "Partition indicates the ordinal at which the StatefulSet should be partitioned for updates. During a rolling update, all pods from ordinal Replicas-1 to Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched. This is helpful in being able to do a canary based deployment. The default value is 0.", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.apps.v1.StatefulSet": { "description": "StatefulSet represents a set of pods with consistent identities. Identities are defined as:\n - Network: A single stable DNS and hostname.\n - Storage: As many VolumeClaims as requested.\n\nThe StatefulSet guarantees that a given network identity will always map to the same storage identity.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetSpec" } ], "default": {}, "description": "Spec defines the desired identities of pods in this set." }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetStatus" } ], "default": {}, "description": "Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "StatefulSet", "version": "v1" } ] }, "io.k8s.api.apps.v1.StatefulSetCondition": { "description": "StatefulSetCondition describes the state of a statefulset at a certain point.", "properties": { "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time the condition transitioned from one status to another." }, "message": { "description": "A human readable message indicating details about the transition.", "type": "string" }, "reason": { "description": "The reason for the condition's last transition.", "type": "string" }, "status": { "default": "", "description": "Status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "Type of statefulset condition.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.apps.v1.StatefulSetList": { "description": "StatefulSetList is a collection of StatefulSets.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "Items is the list of stateful sets.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "apps", "kind": "StatefulSetList", "version": "v1" } ] }, "io.k8s.api.apps.v1.StatefulSetOrdinals": { "description": "StatefulSetOrdinals describes the policy used for replica ordinal assignment in this StatefulSet.", "properties": { "start": { "default": 0, "description": "start is the number representing the first replica's index. It may be used to number replicas from an alternate index (eg: 1-indexed) over the default 0-indexed names, or to orchestrate progressive movement of replicas from one StatefulSet to another. If set, replica indices will be in the range:\n [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).\nIf unset, defaults to 0. Replica indices will be in the range:\n [0, .spec.replicas).", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.apps.v1.StatefulSetPersistentVolumeClaimRetentionPolicy": { "description": "StatefulSetPersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from the StatefulSet VolumeClaimTemplates.", "properties": { "whenDeleted": { "description": "WhenDeleted specifies what happens to PVCs created from StatefulSet VolumeClaimTemplates when the StatefulSet is deleted. The default policy of `Retain` causes PVCs to not be affected by StatefulSet deletion. The `Delete` policy causes those PVCs to be deleted.", "type": "string" }, "whenScaled": { "description": "WhenScaled specifies what happens to PVCs created from StatefulSet VolumeClaimTemplates when the StatefulSet is scaled down. The default policy of `Retain` causes PVCs to not be affected by a scaledown. The `Delete` policy causes the associated PVCs for any excess pods above the replica count to be deleted.", "type": "string" } }, "type": "object" }, "io.k8s.api.apps.v1.StatefulSetSpec": { "description": "A StatefulSetSpec is the specification of a StatefulSet.", "properties": { "minReadySeconds": { "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", "format": "int32", "type": "integer" }, "ordinals": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetOrdinals" } ], "description": "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested. Using the ordinals field requires the StatefulSetStartOrdinal feature gate to be enabled, which is alpha." }, "persistentVolumeClaimRetentionPolicy": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetPersistentVolumeClaimRetentionPolicy" } ], "description": "persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent volume claims created from volumeClaimTemplates. By default, all persistent volume claims are created as needed and retained until manually deleted. This policy allows the lifecycle to be altered, for example by deleting persistent volume claims when their stateful set is deleted, or when their pod is scaled down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha. +optional" }, "podManagementPolicy": { "description": "podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.", "type": "string" }, "replicas": { "description": "replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1.", "format": "int32", "type": "integer" }, "revisionHistoryLimit": { "description": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.", "format": "int32", "type": "integer" }, "selector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" }, "serviceName": { "default": "", "description": "serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.", "type": "string" }, "template": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec" } ], "default": {}, "description": "template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. Each pod will be named with the format -. For example, a pod in a StatefulSet named \"web\" with index number \"3\" would be named \"web-3\"." }, "updateStrategy": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetUpdateStrategy" } ], "default": {}, "description": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template." }, "volumeClaimTemplates": { "description": "volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaim" } ], "default": {} }, "type": "array" } }, "required": [ "selector", "template", "serviceName" ], "type": "object" }, "io.k8s.api.apps.v1.StatefulSetStatus": { "description": "StatefulSetStatus represents the current state of a StatefulSet.", "properties": { "availableReplicas": { "default": 0, "description": "Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset.", "format": "int32", "type": "integer" }, "collisionCount": { "description": "collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.", "format": "int32", "type": "integer" }, "conditions": { "description": "Represents the latest available observations of a statefulset's current state.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "currentReplicas": { "description": "currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision.", "format": "int32", "type": "integer" }, "currentRevision": { "description": "currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).", "type": "string" }, "observedGeneration": { "description": "observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the StatefulSet's generation, which is updated on mutation by the API Server.", "format": "int64", "type": "integer" }, "readyReplicas": { "description": "readyReplicas is the number of pods created for this StatefulSet with a Ready Condition.", "format": "int32", "type": "integer" }, "replicas": { "default": 0, "description": "replicas is the number of Pods created by the StatefulSet controller.", "format": "int32", "type": "integer" }, "updateRevision": { "description": "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)", "type": "string" }, "updatedReplicas": { "description": "updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision.", "format": "int32", "type": "integer" } }, "required": [ "replicas" ], "type": "object" }, "io.k8s.api.apps.v1.StatefulSetUpdateStrategy": { "description": "StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.", "properties": { "rollingUpdate": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.apps.v1.RollingUpdateStatefulSetStrategy" } ], "description": "RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType." }, "type": { "description": "Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate.", "type": "string" } }, "type": "object" }, "io.k8s.api.autoscaling.v1.Scale": { "description": "Scale represents a scaling request for a resource.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata." }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.ScaleSpec" } ], "default": {}, "description": "defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status." }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.ScaleStatus" } ], "default": {}, "description": "current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only." } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "autoscaling", "kind": "Scale", "version": "v1" } ] }, "io.k8s.api.autoscaling.v1.ScaleSpec": { "description": "ScaleSpec describes the attributes of a scale subresource.", "properties": { "replicas": { "description": "desired number of instances for the scaled object.", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.autoscaling.v1.ScaleStatus": { "description": "ScaleStatus represents the current status of a scale subresource.", "properties": { "replicas": { "default": 0, "description": "actual number of observed instances of the scaled object.", "format": "int32", "type": "integer" }, "selector": { "description": "label query over pods that should match the replicas count. This is same as the label selector but in the string format to avoid introspection by clients. The string will be in the same format as the query-param syntax. More info about label selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels#label-selectors", "type": "string" } }, "required": [ "replicas" ], "type": "object" }, "io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource": { "description": "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "string" }, "partition": { "description": "partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).", "format": "int32", "type": "integer" }, "readOnly": { "description": "readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "boolean" }, "volumeID": { "default": "", "description": "volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.Affinity": { "description": "Affinity is a group of affinity scheduling rules.", "properties": { "nodeAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeAffinity" } ], "description": "Describes node affinity scheduling rules for the pod." }, "podAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinity" } ], "description": "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s))." }, "podAntiAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity" } ], "description": "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s))." } }, "type": "object" }, "io.k8s.api.core.v1.AzureDiskVolumeSource": { "description": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", "properties": { "cachingMode": { "description": "cachingMode is the Host Caching mode: None, Read Only, Read Write.", "type": "string" }, "diskName": { "default": "", "description": "diskName is the Name of the data disk in the blob storage", "type": "string" }, "diskURI": { "default": "", "description": "diskURI is the URI of data disk in the blob storage", "type": "string" }, "fsType": { "description": "fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "kind": { "description": "kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared", "type": "string" }, "readOnly": { "description": "readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" } }, "required": [ "diskName", "diskURI" ], "type": "object" }, "io.k8s.api.core.v1.AzureFileVolumeSource": { "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", "properties": { "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretName": { "default": "", "description": "secretName is the name of secret that contains Azure Storage Account Name and Key", "type": "string" }, "shareName": { "default": "", "description": "shareName is the azure share Name", "type": "string" } }, "required": [ "secretName", "shareName" ], "type": "object" }, "io.k8s.api.core.v1.CSIVolumeSource": { "description": "Represents a source location of a volume to mount, managed by an external CSI driver", "properties": { "driver": { "default": "", "description": "driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.", "type": "string" }, "fsType": { "description": "fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.", "type": "string" }, "nodePublishSecretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed." }, "readOnly": { "description": "readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).", "type": "boolean" }, "volumeAttributes": { "additionalProperties": { "default": "", "type": "string" }, "description": "volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.", "type": "object" } }, "required": [ "driver" ], "type": "object" }, "io.k8s.api.core.v1.Capabilities": { "description": "Adds and removes POSIX capabilities from running containers.", "properties": { "add": { "description": "Added capabilities", "items": { "default": "", "type": "string" }, "type": "array" }, "drop": { "description": "Removed capabilities", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.CephFSVolumeSource": { "description": "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", "properties": { "monitors": { "description": "monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "items": { "default": "", "type": "string" }, "type": "array" }, "path": { "description": "path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /", "type": "string" }, "readOnly": { "description": "readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "boolean" }, "secretFile": { "description": "secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "string" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" }, "user": { "description": "user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "string" } }, "required": [ "monitors" ], "type": "object" }, "io.k8s.api.core.v1.CinderVolumeSource": { "description": "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is optional: points to a secret object containing parameters used to connect to OpenStack." }, "volumeID": { "default": "", "description": "volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.ClaimSource": { "description": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.", "properties": { "resourceClaimName": { "description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.", "type": "string" }, "resourceClaimTemplateName": { "description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The name of the ResourceClaim will be -, where is the PodResourceClaim.Name. Pod validation will reject the pod if the concatenated name is not valid for a ResourceClaim (e.g. too long).\n\nAn existing ResourceClaim with that name that is not owned by the pod will not be used for the pod to avoid using an unrelated resource by mistake. Scheduling and pod startup are then blocked until the unrelated ResourceClaim is removed.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ConfigMapEnvSource": { "description": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the ConfigMap must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.ConfigMapKeySelector": { "description": "Selects a key from a ConfigMap.", "properties": { "key": { "default": "", "description": "The key to select.", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the ConfigMap or its key must be defined", "type": "boolean" } }, "required": [ "key" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ConfigMapProjection": { "description": "Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.", "properties": { "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional specify whether the ConfigMap or its keys must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.ConfigMapVolumeSource": { "description": "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional specify whether the ConfigMap or its keys must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.Container": { "description": "A single application container that you want to run within a pod.", "properties": { "args": { "description": "Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "command": { "description": "Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "env": { "description": "List of environment variables to set in the container. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVar" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "envFrom": { "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvFromSource" } ], "default": {} }, "type": "array" }, "image": { "description": "Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", "type": "string" }, "imagePullPolicy": { "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", "type": "string" }, "lifecycle": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Lifecycle" } ], "description": "Actions that the management system should take in response to container lifecycle events. Cannot be updated." }, "livenessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "name": { "default": "", "description": "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", "type": "string" }, "ports": { "description": "List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerPort" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "containerPort", "protocol" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "containerPort", "x-kubernetes-patch-strategy": "merge" }, "readinessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecurityContext" } ], "description": "SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" }, "startupProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "stdin": { "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", "type": "boolean" }, "stdinOnce": { "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", "type": "boolean" }, "terminationMessagePath": { "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", "type": "string" }, "terminationMessagePolicy": { "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", "type": "string" }, "tty": { "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", "type": "boolean" }, "volumeDevices": { "description": "volumeDevices is the list of block devices to be used by the container.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeDevice" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge" }, "volumeMounts": { "description": "Pod volumes to mount into the container's filesystem. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeMount" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, "workingDir": { "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.ContainerPort": { "description": "ContainerPort represents a network port in a single container.", "properties": { "containerPort": { "default": 0, "description": "Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.", "format": "int32", "type": "integer" }, "hostIP": { "description": "What host IP to bind the external port to.", "type": "string" }, "hostPort": { "description": "Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.", "format": "int32", "type": "integer" }, "name": { "description": "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.", "type": "string" }, "protocol": { "default": "TCP", "description": "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".", "type": "string" } }, "required": [ "containerPort" ], "type": "object" }, "io.k8s.api.core.v1.DownwardAPIProjection": { "description": "Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.", "properties": { "items": { "description": "Items is a list of DownwardAPIVolume file", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.DownwardAPIVolumeFile": { "description": "DownwardAPIVolumeFile represents information to create the file containing the pod field", "properties": { "fieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector" } ], "description": "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported." }, "mode": { "description": "Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "path": { "default": "", "description": "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'", "type": "string" }, "resourceFieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector" } ], "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported." } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.DownwardAPIVolumeSource": { "description": "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "Items is a list of downward API volume file", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.EmptyDirVolumeSource": { "description": "Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.", "properties": { "medium": { "description": "medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", "type": "string" }, "sizeLimit": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "description": "sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" } }, "type": "object" }, "io.k8s.api.core.v1.EnvFromSource": { "description": "EnvFromSource represents the source of a set of ConfigMaps", "properties": { "configMapRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource" } ], "description": "The ConfigMap to select from" }, "prefix": { "description": "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", "type": "string" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretEnvSource" } ], "description": "The Secret to select from" } }, "type": "object" }, "io.k8s.api.core.v1.EnvVar": { "description": "EnvVar represents an environment variable present in a Container.", "properties": { "name": { "default": "", "description": "Name of the environment variable. Must be a C_IDENTIFIER.", "type": "string" }, "value": { "description": "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", "type": "string" }, "valueFrom": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVarSource" } ], "description": "Source for the environment variable's value. Cannot be used if value is not empty." } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.EnvVarSource": { "description": "EnvVarSource represents a source for the value of an EnvVar.", "properties": { "configMapKeyRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector" } ], "description": "Selects a key of a ConfigMap." }, "fieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector" } ], "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs." }, "resourceFieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector" } ], "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported." }, "secretKeyRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretKeySelector" } ], "description": "Selects a key of a secret in the pod's namespace" } }, "type": "object" }, "io.k8s.api.core.v1.EphemeralContainer": { "description": "An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.", "properties": { "args": { "description": "Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "command": { "description": "Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "env": { "description": "List of environment variables to set in the container. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVar" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "envFrom": { "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvFromSource" } ], "default": {} }, "type": "array" }, "image": { "description": "Container image name. More info: https://kubernetes.io/docs/concepts/containers/images", "type": "string" }, "imagePullPolicy": { "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", "type": "string" }, "lifecycle": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Lifecycle" } ], "description": "Lifecycle is not allowed for ephemeral containers." }, "livenessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "name": { "default": "", "description": "Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.", "type": "string" }, "ports": { "description": "Ports are not allowed for ephemeral containers.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerPort" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "containerPort", "protocol" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "containerPort", "x-kubernetes-patch-strategy": "merge" }, "readinessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod." }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecurityContext" } ], "description": "Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext." }, "startupProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "stdin": { "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", "type": "boolean" }, "stdinOnce": { "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", "type": "boolean" }, "targetContainerName": { "description": "If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.", "type": "string" }, "terminationMessagePath": { "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", "type": "string" }, "terminationMessagePolicy": { "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", "type": "string" }, "tty": { "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", "type": "boolean" }, "volumeDevices": { "description": "volumeDevices is the list of block devices to be used by the container.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeDevice" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge" }, "volumeMounts": { "description": "Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeMount" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, "workingDir": { "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.EphemeralVolumeSource": { "description": "Represents an ephemeral volume that is handled by a normal storage driver.", "properties": { "volumeClaimTemplate": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate" } ], "description": "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil." } }, "type": "object" }, "io.k8s.api.core.v1.ExecAction": { "description": "ExecAction describes a \"run in container\" action.", "properties": { "command": { "description": "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.FCVolumeSource": { "description": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "lun": { "description": "lun is Optional: FC target lun number", "format": "int32", "type": "integer" }, "readOnly": { "description": "readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "targetWWNs": { "description": "targetWWNs is Optional: FC target worldwide names (WWNs)", "items": { "default": "", "type": "string" }, "type": "array" }, "wwids": { "description": "wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.FlexVolumeSource": { "description": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", "properties": { "driver": { "default": "", "description": "driver is the name of the driver to use for this volume.", "type": "string" }, "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", "type": "string" }, "options": { "additionalProperties": { "default": "", "type": "string" }, "description": "options is Optional: this field holds extra command options if any.", "type": "object" }, "readOnly": { "description": "readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts." } }, "required": [ "driver" ], "type": "object" }, "io.k8s.api.core.v1.FlockerVolumeSource": { "description": "Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.", "properties": { "datasetName": { "description": "datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated", "type": "string" }, "datasetUUID": { "description": "datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.GCEPersistentDiskVolumeSource": { "description": "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "string" }, "partition": { "description": "partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "format": "int32", "type": "integer" }, "pdName": { "default": "", "description": "pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "string" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "boolean" } }, "required": [ "pdName" ], "type": "object" }, "io.k8s.api.core.v1.GRPCAction": { "properties": { "port": { "default": 0, "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", "format": "int32", "type": "integer" }, "service": { "default": "", "description": "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.", "type": "string" } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.GitRepoVolumeSource": { "description": "Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", "properties": { "directory": { "description": "directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.", "type": "string" }, "repository": { "default": "", "description": "repository is the URL", "type": "string" }, "revision": { "description": "revision is the commit hash for the specified revision.", "type": "string" } }, "required": [ "repository" ], "type": "object" }, "io.k8s.api.core.v1.GlusterfsVolumeSource": { "description": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", "properties": { "endpoints": { "default": "", "description": "endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "path": { "default": "", "description": "path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "readOnly": { "description": "readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "boolean" } }, "required": [ "endpoints", "path" ], "type": "object" }, "io.k8s.api.core.v1.HTTPGetAction": { "description": "HTTPGetAction describes an action based on HTTP Get requests.", "properties": { "host": { "description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", "type": "string" }, "httpHeaders": { "description": "Custom headers to set in the request. HTTP allows repeated headers.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPHeader" } ], "default": {} }, "type": "array" }, "path": { "description": "Path to access on the HTTP server.", "type": "string" }, "port": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "default": {}, "description": "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME." }, "scheme": { "description": "Scheme to use for connecting to the host. Defaults to HTTP.", "type": "string" } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.HTTPHeader": { "description": "HTTPHeader describes a custom header to be used in HTTP probes", "properties": { "name": { "default": "", "description": "The header field name", "type": "string" }, "value": { "default": "", "description": "The header field value", "type": "string" } }, "required": [ "name", "value" ], "type": "object" }, "io.k8s.api.core.v1.HostAlias": { "description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.", "properties": { "hostnames": { "description": "Hostnames for the above IP address.", "items": { "default": "", "type": "string" }, "type": "array" }, "ip": { "description": "IP address of the host file entry.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.HostPathVolumeSource": { "description": "Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.", "properties": { "path": { "default": "", "description": "path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", "type": "string" }, "type": { "description": "type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", "type": "string" } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.ISCSIVolumeSource": { "description": "Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", "properties": { "chapAuthDiscovery": { "description": "chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication", "type": "boolean" }, "chapAuthSession": { "description": "chapAuthSession defines whether support iSCSI Session CHAP authentication", "type": "boolean" }, "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", "type": "string" }, "initiatorName": { "description": "initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.", "type": "string" }, "iqn": { "default": "", "description": "iqn is the target iSCSI Qualified Name.", "type": "string" }, "iscsiInterface": { "description": "iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", "type": "string" }, "lun": { "default": 0, "description": "lun represents iSCSI Target Lun number.", "format": "int32", "type": "integer" }, "portals": { "description": "portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", "items": { "default": "", "type": "string" }, "type": "array" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is the CHAP Secret for iSCSI target and initiator authentication" }, "targetPortal": { "default": "", "description": "targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", "type": "string" } }, "required": [ "targetPortal", "iqn", "lun" ], "type": "object" }, "io.k8s.api.core.v1.KeyToPath": { "description": "Maps a string key to a path within a volume.", "properties": { "key": { "default": "", "description": "key is the key to project.", "type": "string" }, "mode": { "description": "mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "path": { "default": "", "description": "path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.", "type": "string" } }, "required": [ "key", "path" ], "type": "object" }, "io.k8s.api.core.v1.Lifecycle": { "description": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", "properties": { "postStart": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LifecycleHandler" } ], "description": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" }, "preStop": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LifecycleHandler" } ], "description": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" } }, "type": "object" }, "io.k8s.api.core.v1.LifecycleHandler": { "description": "LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.", "properties": { "exec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ExecAction" } ], "description": "Exec specifies the action to take." }, "httpGet": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPGetAction" } ], "description": "HTTPGet specifies the http request to perform." }, "tcpSocket": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TCPSocketAction" } ], "description": "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified." } }, "type": "object" }, "io.k8s.api.core.v1.LocalObjectReference": { "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.NFSVolumeSource": { "description": "Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.", "properties": { "path": { "default": "", "description": "path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "string" }, "readOnly": { "description": "readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "boolean" }, "server": { "default": "", "description": "server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "string" } }, "required": [ "server", "path" ], "type": "object" }, "io.k8s.api.core.v1.NodeAffinity": { "description": "Node affinity is a group of node affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" } ], "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node." } }, "type": "object" }, "io.k8s.api.core.v1.NodeSelector": { "description": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", "properties": { "nodeSelectorTerms": { "description": "Required. A list of node selector terms. The terms are ORed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm" } ], "default": {} }, "type": "array" } }, "required": [ "nodeSelectorTerms" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.NodeSelectorRequirement": { "description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "properties": { "key": { "default": "", "description": "The label key that the selector applies to.", "type": "string" }, "operator": { "default": "", "description": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", "type": "string" }, "values": { "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", "items": { "default": "", "type": "string" }, "type": "array" } }, "required": [ "key", "operator" ], "type": "object" }, "io.k8s.api.core.v1.NodeSelectorTerm": { "description": "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.", "properties": { "matchExpressions": { "description": "A list of node selector requirements by node's labels.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement" } ], "default": {} }, "type": "array" }, "matchFields": { "description": "A list of node selector requirements by node's fields.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement" } ], "default": {} }, "type": "array" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ObjectFieldSelector": { "description": "ObjectFieldSelector selects an APIVersioned field of an object.", "properties": { "apiVersion": { "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", "type": "string" }, "fieldPath": { "default": "", "description": "Path of the field to select in the specified API version.", "type": "string" } }, "required": [ "fieldPath" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.PersistentVolumeClaim": { "description": "PersistentVolumeClaim is a user's request for and claim to a persistent volume", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec" } ], "default": {}, "description": "spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimStatus" } ], "default": {}, "description": "status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "PersistentVolumeClaim", "version": "v1" } ] }, "io.k8s.api.core.v1.PersistentVolumeClaimCondition": { "description": "PersistentVolumeClaimCondition contails details about state of pvc", "properties": { "lastProbeTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "lastProbeTime is the time we probed the condition." }, "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "lastTransitionTime is the time the condition transitioned from one status to another." }, "message": { "description": "message is the human-readable message indicating details about last transition.", "type": "string" }, "reason": { "description": "reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports \"ResizeStarted\" that means the underlying persistent volume is being resized.", "type": "string" }, "status": { "default": "", "type": "string" }, "type": { "default": "", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimSpec": { "description": "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes", "properties": { "accessModes": { "description": "accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", "items": { "default": "", "type": "string" }, "type": "array" }, "dataSource": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference" } ], "description": "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource." }, "dataSourceRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TypedObjectReference" } ], "description": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled." }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources" }, "selector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "selector is a label query over volumes to consider for binding." }, "storageClassName": { "description": "storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", "type": "string" }, "volumeMode": { "description": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", "type": "string" }, "volumeName": { "description": "volumeName is the binding reference to the PersistentVolume backing this claim.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimStatus": { "description": "PersistentVolumeClaimStatus is the current status of a persistent volume claim.", "properties": { "accessModes": { "description": "accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", "items": { "default": "", "type": "string" }, "type": "array" }, "allocatedResources": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", "type": "object" }, "capacity": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "capacity represents the actual resources of the underlying volume.", "type": "object" }, "conditions": { "description": "conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimCondition" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "phase": { "description": "phase represents the current phase of PersistentVolumeClaim.", "type": "string" }, "resizeStatus": { "description": "resizeStatus stores status of resize operation. ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty string by resize controller or kubelet. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimTemplate": { "description": "PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.", "properties": { "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation." }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec" } ], "default": {}, "description": "The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here." } }, "required": [ "spec" ], "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource": { "description": "PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).", "properties": { "claimName": { "default": "", "description": "claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", "type": "string" }, "readOnly": { "description": "readOnly Will force the ReadOnly setting in VolumeMounts. Default false.", "type": "boolean" } }, "required": [ "claimName" ], "type": "object" }, "io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource": { "description": "Represents a Photon Controller persistent disk resource.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "pdID": { "default": "", "description": "pdID is the ID that identifies Photon Controller persistent disk", "type": "string" } }, "required": [ "pdID" ], "type": "object" }, "io.k8s.api.core.v1.PodAffinity": { "description": "Pod affinity is a group of inter pod affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodAffinityTerm": { "description": "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running", "properties": { "labelSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "A label query over a set of resources, in this case pods." }, "namespaceSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces." }, "namespaces": { "description": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".", "items": { "default": "", "type": "string" }, "type": "array" }, "topologyKey": { "default": "", "description": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", "type": "string" } }, "required": [ "topologyKey" ], "type": "object" }, "io.k8s.api.core.v1.PodAntiAffinity": { "description": "Pod anti affinity is a group of inter pod anti affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "description": "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodDNSConfig": { "description": "PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.", "properties": { "nameservers": { "description": "A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.", "items": { "default": "", "type": "string" }, "type": "array" }, "options": { "description": "A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption" } ], "default": {} }, "type": "array" }, "searches": { "description": "A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodDNSConfigOption": { "description": "PodDNSConfigOption defines DNS resolver options of a pod.", "properties": { "name": { "description": "Required.", "type": "string" }, "value": { "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PodOS": { "description": "PodOS defines the OS parameters of a pod.", "properties": { "name": { "default": "", "description": "Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodReadinessGate": { "description": "PodReadinessGate contains the reference to a pod condition", "properties": { "conditionType": { "default": "", "description": "ConditionType refers to a condition in the pod's condition list with matching type.", "type": "string" } }, "required": [ "conditionType" ], "type": "object" }, "io.k8s.api.core.v1.PodResourceClaim": { "description": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", "properties": { "name": { "default": "", "description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.", "type": "string" }, "source": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource" } ], "default": {}, "description": "Source describes where to find the ResourceClaim." } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodSchedulingGate": { "description": "PodSchedulingGate is associated to a Pod to guard its scheduling.", "properties": { "name": { "default": "", "description": "Name of the scheduling gate. Each scheduling gate must have a unique name field.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodSecurityContext": { "description": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", "properties": { "fsGroup": { "description": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "fsGroupChangePolicy": { "description": "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.", "type": "string" }, "runAsGroup": { "description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "runAsNonRoot": { "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "boolean" }, "runAsUser": { "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "seLinuxOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SELinuxOptions" } ], "description": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows." }, "seccompProfile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SeccompProfile" } ], "description": "The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows." }, "supplementalGroups": { "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.", "items": { "default": 0, "format": "int64", "type": "integer" }, "type": "array" }, "sysctls": { "description": "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Sysctl" } ], "default": {} }, "type": "array" }, "windowsOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions" } ], "description": "The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux." } }, "type": "object" }, "io.k8s.api.core.v1.PodSpec": { "description": "PodSpec is a description of a pod.", "properties": { "activeDeadlineSeconds": { "description": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", "format": "int64", "type": "integer" }, "affinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Affinity" } ], "description": "If specified, the pod's scheduling constraints" }, "automountServiceAccountToken": { "description": "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.", "type": "boolean" }, "containers": { "description": "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Container" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "dnsConfig": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodDNSConfig" } ], "description": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy." }, "dnsPolicy": { "description": "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", "type": "string" }, "enableServiceLinks": { "description": "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.", "type": "boolean" }, "ephemeralContainers": { "description": "List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EphemeralContainer" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "hostAliases": { "description": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HostAlias" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "ip", "x-kubernetes-patch-strategy": "merge" }, "hostIPC": { "description": "Use the host's ipc namespace. Optional: Default to false.", "type": "boolean" }, "hostNetwork": { "description": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", "type": "boolean" }, "hostPID": { "description": "Use the host's pid namespace. Optional: Default to false.", "type": "boolean" }, "hostUsers": { "description": "Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.", "type": "boolean" }, "hostname": { "description": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", "type": "string" }, "imagePullSecrets": { "description": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "initContainers": { "description": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Container" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "nodeName": { "description": "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", "type": "string" }, "nodeSelector": { "additionalProperties": { "default": "", "type": "string" }, "description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", "type": "object", "x-kubernetes-map-type": "atomic" }, "os": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodOS" } ], "description": "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup" }, "overhead": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md", "type": "object" }, "preemptionPolicy": { "description": "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.", "type": "string" }, "priority": { "description": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.", "format": "int32", "type": "integer" }, "priorityClassName": { "description": "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", "type": "string" }, "readinessGates": { "description": "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodReadinessGate" } ], "default": {} }, "type": "array" }, "resourceClaims": { "description": "ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodResourceClaim" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge,retainKeys" }, "restartPolicy": { "description": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", "type": "string" }, "runtimeClassName": { "description": "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", "type": "string" }, "schedulerName": { "description": "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", "type": "string" }, "schedulingGates": { "description": "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. More info: https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness.\n\nThis is an alpha-level feature enabled by PodSchedulingReadiness feature gate.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSchedulingGate" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSecurityContext" } ], "description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field." }, "serviceAccount": { "description": "DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", "type": "string" }, "serviceAccountName": { "description": "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", "type": "string" }, "setHostnameAsFQDN": { "description": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", "type": "boolean" }, "shareProcessNamespace": { "description": "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.", "type": "boolean" }, "subdomain": { "description": "If specified, the fully qualified Pod hostname will be \"...svc.\". If not specified, the pod will not have a domainname at all.", "type": "string" }, "terminationGracePeriodSeconds": { "description": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", "format": "int64", "type": "integer" }, "tolerations": { "description": "If specified, the pod's tolerations.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Toleration" } ], "default": {} }, "type": "array" }, "topologySpreadConstraints": { "description": "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "topologyKey", "whenUnsatisfiable" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "topologyKey", "x-kubernetes-patch-strategy": "merge" }, "volumes": { "description": "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Volume" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge,retainKeys" } }, "required": [ "containers" ], "type": "object" }, "io.k8s.api.core.v1.PodTemplateSpec": { "description": "PodTemplateSpec describes the data a pod should have when created from a template", "properties": { "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSpec" } ], "default": {}, "description": "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object" }, "io.k8s.api.core.v1.PortworxVolumeSource": { "description": "PortworxVolumeSource represents a Portworx volume resource.", "properties": { "fsType": { "description": "fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "volumeID": { "default": "", "description": "volumeID uniquely identifies a Portworx volume", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.PreferredSchedulingTerm": { "description": "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).", "properties": { "preference": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm" } ], "default": {}, "description": "A node selector term, associated with the corresponding weight." }, "weight": { "default": 0, "description": "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.", "format": "int32", "type": "integer" } }, "required": [ "weight", "preference" ], "type": "object" }, "io.k8s.api.core.v1.Probe": { "description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", "properties": { "exec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ExecAction" } ], "description": "Exec specifies the action to take." }, "failureThreshold": { "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", "format": "int32", "type": "integer" }, "grpc": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GRPCAction" } ], "description": "GRPC specifies an action involving a GRPC port." }, "httpGet": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPGetAction" } ], "description": "HTTPGet specifies the http request to perform." }, "initialDelaySeconds": { "description": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", "type": "integer" }, "periodSeconds": { "description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", "format": "int32", "type": "integer" }, "successThreshold": { "description": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", "format": "int32", "type": "integer" }, "tcpSocket": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TCPSocketAction" } ], "description": "TCPSocket specifies an action involving a TCP port." }, "terminationGracePeriodSeconds": { "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", "format": "int64", "type": "integer" }, "timeoutSeconds": { "description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.core.v1.ProjectedVolumeSource": { "description": "Represents a projected volume source", "properties": { "defaultMode": { "description": "defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "sources": { "description": "sources is the list of volume projections", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeProjection" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.QuobyteVolumeSource": { "description": "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.", "properties": { "group": { "description": "group to map volume access to Default is no group", "type": "string" }, "readOnly": { "description": "readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.", "type": "boolean" }, "registry": { "default": "", "description": "registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes", "type": "string" }, "tenant": { "description": "tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin", "type": "string" }, "user": { "description": "user to map volume access to Defaults to serivceaccount user", "type": "string" }, "volume": { "default": "", "description": "volume is a string that references an already created Quobyte volume by name.", "type": "string" } }, "required": [ "registry", "volume" ], "type": "object" }, "io.k8s.api.core.v1.RBDVolumeSource": { "description": "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", "type": "string" }, "image": { "default": "", "description": "image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "keyring": { "description": "keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "monitors": { "description": "monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "items": { "default": "", "type": "string" }, "type": "array" }, "pool": { "description": "pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" }, "user": { "description": "user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" } }, "required": [ "monitors", "image" ], "type": "object" }, "io.k8s.api.core.v1.ResourceClaim": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "default": "", "description": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.ResourceFieldSelector": { "description": "ResourceFieldSelector represents container resources (cpu, memory) and their output format", "properties": { "containerName": { "description": "Container name: required for volumes, optional for env vars", "type": "string" }, "divisor": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {}, "description": "Specifies the output format of the exposed resources, defaults to \"1\"" }, "resource": { "default": "", "description": "Required: resource to select", "type": "string" } }, "required": [ "resource" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ResourceRequirements": { "description": "ResourceRequirements describes the compute resource requirements.", "properties": { "claims": { "description": "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceClaim" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map" }, "limits": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "type": "object" }, "requests": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "type": "object" } }, "type": "object" }, "io.k8s.api.core.v1.SELinuxOptions": { "description": "SELinuxOptions are the labels to be applied to the container", "properties": { "level": { "description": "Level is SELinux level label that applies to the container.", "type": "string" }, "role": { "description": "Role is a SELinux role label that applies to the container.", "type": "string" }, "type": { "description": "Type is a SELinux type label that applies to the container.", "type": "string" }, "user": { "description": "User is a SELinux user label that applies to the container.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ScaleIOVolumeSource": { "description": "ScaleIOVolumeSource represents a persistent ScaleIO volume", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".", "type": "string" }, "gateway": { "default": "", "description": "gateway is the host address of the ScaleIO API Gateway.", "type": "string" }, "protectionDomain": { "description": "protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.", "type": "string" }, "readOnly": { "description": "readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail." }, "sslEnabled": { "description": "sslEnabled Flag enable/disable SSL communication with Gateway, default false", "type": "boolean" }, "storageMode": { "description": "storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", "type": "string" }, "storagePool": { "description": "storagePool is the ScaleIO Storage Pool associated with the protection domain.", "type": "string" }, "system": { "default": "", "description": "system is the name of the storage system as configured in ScaleIO.", "type": "string" }, "volumeName": { "description": "volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.", "type": "string" } }, "required": [ "gateway", "system", "secretRef" ], "type": "object" }, "io.k8s.api.core.v1.SeccompProfile": { "description": "SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.", "properties": { "localhostProfile": { "description": "localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".", "type": "string" }, "type": { "default": "", "description": "type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.", "type": "string" } }, "required": [ "type" ], "type": "object", "x-kubernetes-unions": [ { "discriminator": "type", "fields-to-discriminateBy": { "localhostProfile": "LocalhostProfile" } } ] }, "io.k8s.api.core.v1.SecretEnvSource": { "description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the Secret must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.SecretKeySelector": { "description": "SecretKeySelector selects a key of a Secret.", "properties": { "key": { "default": "", "description": "The key of the secret to select from. Must be a valid secret key.", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the Secret or its key must be defined", "type": "boolean" } }, "required": [ "key" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.SecretProjection": { "description": "Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.", "properties": { "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional field specify whether the Secret or its key must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.SecretVolumeSource": { "description": "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "optional": { "description": "optional field specify whether the Secret or its keys must be defined", "type": "boolean" }, "secretName": { "description": "secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.SecurityContext": { "description": "SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.", "properties": { "allowPrivilegeEscalation": { "description": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "capabilities": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Capabilities" } ], "description": "The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows." }, "privileged": { "description": "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "procMount": { "description": "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.", "type": "string" }, "readOnlyRootFilesystem": { "description": "Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "runAsGroup": { "description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "runAsNonRoot": { "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "boolean" }, "runAsUser": { "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "seLinuxOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SELinuxOptions" } ], "description": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows." }, "seccompProfile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SeccompProfile" } ], "description": "The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows." }, "windowsOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions" } ], "description": "The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux." } }, "type": "object" }, "io.k8s.api.core.v1.ServiceAccountTokenProjection": { "description": "ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).", "properties": { "audience": { "description": "audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.", "type": "string" }, "expirationSeconds": { "description": "expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.", "format": "int64", "type": "integer" }, "path": { "default": "", "description": "path is the path relative to the mount point of the file to project the token into.", "type": "string" } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.StorageOSVolumeSource": { "description": "Represents a StorageOS persistent volume resource.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted." }, "volumeName": { "description": "volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", "type": "string" }, "volumeNamespace": { "description": "volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.Sysctl": { "description": "Sysctl defines a kernel parameter to be set", "properties": { "name": { "default": "", "description": "Name of a property to set", "type": "string" }, "value": { "default": "", "description": "Value of a property to set", "type": "string" } }, "required": [ "name", "value" ], "type": "object" }, "io.k8s.api.core.v1.TCPSocketAction": { "description": "TCPSocketAction describes an action based on opening a socket", "properties": { "host": { "description": "Optional: Host name to connect to, defaults to the pod IP.", "type": "string" }, "port": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "default": {}, "description": "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME." } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.Toleration": { "description": "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .", "properties": { "effect": { "description": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.", "type": "string" }, "key": { "description": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", "type": "string" }, "operator": { "description": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.", "type": "string" }, "tolerationSeconds": { "description": "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.", "format": "int64", "type": "integer" }, "value": { "description": "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.TopologySpreadConstraint": { "description": "TopologySpreadConstraint specifies how to spread matching pods among the given topology.", "properties": { "labelSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain." }, "matchLabelKeys": { "description": "MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "maxSkew": { "default": 0, "description": "MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. The global minimum is the minimum number of matching pods in an eligible domain or zero if the number of eligible domains is less than MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 2/2/1: In this case, the global minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.", "format": "int32", "type": "integer" }, "minDomains": { "description": "MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule.\n\nFor example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew.\n\nThis is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).", "format": "int32", "type": "integer" }, "nodeAffinityPolicy": { "description": "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", "type": "string" }, "nodeTaintsPolicy": { "description": "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", "type": "string" }, "topologyKey": { "default": "", "description": "TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a \"bucket\", and try to put balanced number of pods into each bucket. We define a domain as a particular instance of a topology. Also, we define an eligible domain as a domain whose nodes meet the requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey is \"kubernetes.io/hostname\", each Node is a domain of that topology. And, if TopologyKey is \"topology.kubernetes.io/zone\", each zone is a domain of that topology. It's a required field.", "type": "string" }, "whenUnsatisfiable": { "default": "", "description": "WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.", "type": "string" } }, "required": [ "maxSkew", "topologyKey", "whenUnsatisfiable" ], "type": "object" }, "io.k8s.api.core.v1.TypedLocalObjectReference": { "description": "TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.", "properties": { "apiGroup": { "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", "type": "string" }, "kind": { "default": "", "description": "Kind is the type of resource being referenced", "type": "string" }, "name": { "default": "", "description": "Name is the name of resource being referenced", "type": "string" } }, "required": [ "kind", "name" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.TypedObjectReference": { "properties": { "apiGroup": { "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", "type": "string" }, "kind": { "default": "", "description": "Kind is the type of resource being referenced", "type": "string" }, "name": { "default": "", "description": "Name is the name of resource being referenced", "type": "string" }, "namespace": { "description": "Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", "type": "string" } }, "required": [ "kind", "name" ], "type": "object" }, "io.k8s.api.core.v1.Volume": { "description": "Volume represents a named volume in a pod that may be accessed by any container in the pod.", "properties": { "awsElasticBlockStore": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource" } ], "description": "awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" }, "azureDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource" } ], "description": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod." }, "azureFile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource" } ], "description": "azureFile represents an Azure File Service mount on the host and bind mount to the pod." }, "cephfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource" } ], "description": "cephFS represents a Ceph FS mount on the host that shares a pod's lifetime" }, "cinder": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource" } ], "description": "cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" }, "configMap": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource" } ], "description": "configMap represents a configMap that should populate this volume" }, "csi": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource" } ], "description": "csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature)." }, "downwardAPI": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource" } ], "description": "downwardAPI represents downward API about the pod that should populate this volume" }, "emptyDir": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource" } ], "description": "emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" }, "ephemeral": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource" } ], "description": "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time." }, "fc": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FCVolumeSource" } ], "description": "fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod." }, "flexVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource" } ], "description": "flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin." }, "flocker": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource" } ], "description": "flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running" }, "gcePersistentDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource" } ], "description": "gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" }, "gitRepo": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource" } ], "description": "gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container." }, "glusterfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource" } ], "description": "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md" }, "hostPath": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource" } ], "description": "hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath" }, "iscsi": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource" } ], "description": "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md" }, "name": { "default": "", "description": "name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "nfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource" } ], "description": "nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" }, "persistentVolumeClaim": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource" } ], "description": "persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" }, "photonPersistentDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource" } ], "description": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" }, "portworxVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource" } ], "description": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine" }, "projected": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource" } ], "description": "projected items for all in one resources secrets, configmaps, and downward API" }, "quobyte": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource" } ], "description": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime" }, "rbd": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource" } ], "description": "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md" }, "scaleIO": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource" } ], "description": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes." }, "secret": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource" } ], "description": "secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret" }, "storageos": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource" } ], "description": "storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." }, "vsphereVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource" } ], "description": "vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.VolumeDevice": { "description": "volumeDevice describes a mapping of a raw block device within a container.", "properties": { "devicePath": { "default": "", "description": "devicePath is the path inside of the container that the device will be mapped to.", "type": "string" }, "name": { "default": "", "description": "name must match the name of a persistentVolumeClaim in the pod", "type": "string" } }, "required": [ "name", "devicePath" ], "type": "object" }, "io.k8s.api.core.v1.VolumeMount": { "description": "VolumeMount describes a mounting of a Volume within a container.", "properties": { "mountPath": { "default": "", "description": "Path within the container at which the volume should be mounted. Must not contain ':'.", "type": "string" }, "mountPropagation": { "description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.", "type": "string" }, "name": { "default": "", "description": "This must match the Name of a Volume.", "type": "string" }, "readOnly": { "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.", "type": "boolean" }, "subPath": { "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", "type": "string" }, "subPathExpr": { "description": "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.", "type": "string" } }, "required": [ "name", "mountPath" ], "type": "object" }, "io.k8s.api.core.v1.VolumeProjection": { "description": "Projection that may be projected along with other supported volume types", "properties": { "configMap": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection" } ], "description": "configMap information about the configMap data to project" }, "downwardAPI": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection" } ], "description": "downwardAPI information about the downwardAPI data to project" }, "secret": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretProjection" } ], "description": "secret information about the secret data to project" }, "serviceAccountToken": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection" } ], "description": "serviceAccountToken is information about the serviceAccountToken data to project" } }, "type": "object" }, "io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource": { "description": "Represents a vSphere volume resource.", "properties": { "fsType": { "description": "fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "storagePolicyID": { "description": "storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.", "type": "string" }, "storagePolicyName": { "description": "storagePolicyName is the storage Policy Based Management (SPBM) profile name.", "type": "string" }, "volumePath": { "default": "", "description": "volumePath is the path that identifies vSphere volume vmdk", "type": "string" } }, "required": [ "volumePath" ], "type": "object" }, "io.k8s.api.core.v1.WeightedPodAffinityTerm": { "description": "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)", "properties": { "podAffinityTerm": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {}, "description": "Required. A pod affinity term, associated with the corresponding weight." }, "weight": { "default": 0, "description": "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.", "format": "int32", "type": "integer" } }, "required": [ "weight", "podAffinityTerm" ], "type": "object" }, "io.k8s.api.core.v1.WindowsSecurityContextOptions": { "description": "WindowsSecurityContextOptions contain Windows-specific options and credentials.", "properties": { "gmsaCredentialSpec": { "description": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.", "type": "string" }, "gmsaCredentialSpecName": { "description": "GMSACredentialSpecName is the name of the GMSA credential spec to use.", "type": "string" }, "hostProcess": { "description": "HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.", "type": "boolean" }, "runAsUserName": { "description": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.api.resource.Quantity": { "description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource": { "description": "APIResource specifies the name of a resource and whether it is namespaced.", "properties": { "categories": { "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", "items": { "default": "", "type": "string" }, "type": "array" }, "group": { "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", "type": "string" }, "kind": { "default": "", "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", "type": "string" }, "name": { "default": "", "description": "name is the plural name of the resource.", "type": "string" }, "namespaced": { "default": false, "description": "namespaced indicates if a resource is namespaced or not.", "type": "boolean" }, "shortNames": { "description": "shortNames is a list of suggested short names of the resource.", "items": { "default": "", "type": "string" }, "type": "array" }, "singularName": { "default": "", "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", "type": "string" }, "storageVersionHash": { "description": "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", "type": "string" }, "verbs": { "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", "items": { "default": "", "type": "string" }, "type": "array" }, "version": { "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", "type": "string" } }, "required": [ "name", "singularName", "namespaced", "kind", "verbs" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList": { "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "groupVersion": { "default": "", "description": "groupVersion is the group and version this APIResourceList is for.", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "resources": { "description": "resources contains the name of the resources and if they are namespaced.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource" } ], "default": {} }, "type": "array" } }, "required": [ "groupVersion", "resources" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "APIResourceList", "version": "v1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions": { "description": "DeleteOptions may be provided when deleting an API object.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "dryRun": { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "items": { "default": "", "type": "string" }, "type": "array" }, "gracePeriodSeconds": { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "format": "int64", "type": "integer" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "orphanDependents": { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "type": "boolean" }, "preconditions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" } ], "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." }, "propagationPolicy": { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta2" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "extensions", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1": { "description": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector": { "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", "properties": { "matchExpressions": { "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement" } ], "default": {} }, "type": "array" }, "matchLabels": { "additionalProperties": { "default": "", "type": "string" }, "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", "type": "object" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement": { "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "properties": { "key": { "default": "", "description": "key is the label key that the selector applies to.", "type": "string", "x-kubernetes-patch-merge-key": "key", "x-kubernetes-patch-strategy": "merge" }, "operator": { "default": "", "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", "type": "string" }, "values": { "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", "items": { "default": "", "type": "string" }, "type": "array" } }, "required": [ "key", "operator" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta": { "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", "properties": { "continue": { "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", "type": "string" }, "remainingItemCount": { "description": "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", "format": "int64", "type": "integer" }, "resourceVersion": { "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry": { "description": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", "properties": { "apiVersion": { "description": "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", "type": "string" }, "fieldsType": { "description": "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", "type": "string" }, "fieldsV1": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1" } ], "description": "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type." }, "manager": { "description": "Manager is an identifier of the workflow managing these fields.", "type": "string" }, "operation": { "description": "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", "type": "string" }, "subresource": { "description": "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", "type": "string" }, "time": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over." } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta": { "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", "properties": { "annotations": { "additionalProperties": { "default": "", "type": "string" }, "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", "type": "object" }, "creationTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "deletionGracePeriodSeconds": { "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", "format": "int64", "type": "integer" }, "deletionTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "finalizers": { "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-patch-strategy": "merge" }, "generateName": { "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", "type": "string" }, "generation": { "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", "format": "int64", "type": "integer" }, "labels": { "additionalProperties": { "default": "", "type": "string" }, "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", "type": "object" }, "managedFields": { "description": "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry" } ], "default": {} }, "type": "array" }, "name": { "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "namespace": { "description": "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", "type": "string" }, "ownerReferences": { "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "uid", "x-kubernetes-patch-strategy": "merge" }, "resourceVersion": { "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" }, "uid": { "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference": { "description": "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", "properties": { "apiVersion": { "default": "", "description": "API version of the referent.", "type": "string" }, "blockOwnerDeletion": { "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", "type": "boolean" }, "controller": { "description": "If true, this reference points to the managing controller.", "type": "boolean" }, "kind": { "default": "", "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "default": "", "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "uid": { "default": "", "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "required": [ "apiVersion", "kind", "name", "uid" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Patch": { "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions": { "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", "properties": { "resourceVersion": { "description": "Specifies the target ResourceVersion", "type": "string" }, "uid": { "description": "Specifies the target UID.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Status": { "description": "Status is a return value for calls that don't return other objects.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "code": { "description": "Suggested HTTP return code for this status, 0 if not set.", "format": "int32", "type": "integer" }, "details": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails" } ], "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type." }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "message": { "description": "A human-readable description of the status of this operation.", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" }, "reason": { "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", "type": "string" }, "status": { "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Status", "version": "v1" }, { "group": "resource.k8s.io", "kind": "Status", "version": "v1alpha1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause": { "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", "properties": { "field": { "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", "type": "string" }, "message": { "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", "type": "string" }, "reason": { "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": { "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", "properties": { "causes": { "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause" } ], "default": {} }, "type": "array" }, "group": { "description": "The group attribute of the resource associated with the status StatusReason.", "type": "string" }, "kind": { "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", "type": "string" }, "retryAfterSeconds": { "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", "format": "int32", "type": "integer" }, "uid": { "description": "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Time": { "description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", "format": "date-time", "type": "string" }, "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent": { "description": "Event represents a single event to a watched resource.", "properties": { "object": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" } ], "default": {}, "description": "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context." }, "type": { "default": "", "type": "string" } }, "required": [ "type", "object" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta2" }, { "group": "batch", "kind": "WatchEvent", "version": "v1" }, { "group": "batch", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "extensions", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.runtime.RawExtension": { "description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", "type": "object" }, "io.k8s.apimachinery.pkg.util.intstr.IntOrString": { "description": "IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.", "format": "int-or-string", "oneOf": [ { "type": "integer" }, { "type": "string" } ] } }, "securitySchemes": { "BearerToken": { "description": "Bearer Token authentication", "in": "header", "name": "authorization", "type": "apiKey" } } }, "info": { "title": "Kubernetes", "version": "unversioned" }, "openapi": "3.0.0", "paths": { "/apis/apps/v1/": { "get": { "description": "get available resources", "operationId": "getAppsV1APIResources", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ] } }, "/apis/apps/v1/controllerrevisions": { "get": { "description": "list or watch objects of kind ControllerRevision", "operationId": "listAppsV1ControllerRevisionForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/daemonsets": { "get": { "description": "list or watch objects of kind DaemonSet", "operationId": "listAppsV1DaemonSetForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/deployments": { "get": { "description": "list or watch objects of kind Deployment", "operationId": "listAppsV1DeploymentForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions": { "delete": { "description": "delete collection of ControllerRevision", "operationId": "deleteAppsV1CollectionNamespacedControllerRevision", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "get": { "description": "list or watch objects of kind ControllerRevision", "operationId": "listAppsV1NamespacedControllerRevision", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevisionList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a ControllerRevision", "operationId": "createAppsV1NamespacedControllerRevision", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}": { "delete": { "description": "delete a ControllerRevision", "operationId": "deleteAppsV1NamespacedControllerRevision", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "get": { "description": "read the specified ControllerRevision", "operationId": "readAppsV1NamespacedControllerRevision", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "parameters": [ { "description": "name of the ControllerRevision", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified ControllerRevision", "operationId": "patchAppsV1NamespacedControllerRevision", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "put": { "description": "replace the specified ControllerRevision", "operationId": "replaceAppsV1NamespacedControllerRevision", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ControllerRevision" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/daemonsets": { "delete": { "description": "delete collection of DaemonSet", "operationId": "deleteAppsV1CollectionNamespacedDaemonSet", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "get": { "description": "list or watch objects of kind DaemonSet", "operationId": "listAppsV1NamespacedDaemonSet", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSetList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a DaemonSet", "operationId": "createAppsV1NamespacedDaemonSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}": { "delete": { "description": "delete a DaemonSet", "operationId": "deleteAppsV1NamespacedDaemonSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "get": { "description": "read the specified DaemonSet", "operationId": "readAppsV1NamespacedDaemonSet", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "parameters": [ { "description": "name of the DaemonSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified DaemonSet", "operationId": "patchAppsV1NamespacedDaemonSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "put": { "description": "replace the specified DaemonSet", "operationId": "replaceAppsV1NamespacedDaemonSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status": { "get": { "description": "read status of the specified DaemonSet", "operationId": "readAppsV1NamespacedDaemonSetStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "parameters": [ { "description": "name of the DaemonSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified DaemonSet", "operationId": "patchAppsV1NamespacedDaemonSetStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "put": { "description": "replace status of the specified DaemonSet", "operationId": "replaceAppsV1NamespacedDaemonSetStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DaemonSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/deployments": { "delete": { "description": "delete collection of Deployment", "operationId": "deleteAppsV1CollectionNamespacedDeployment", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "get": { "description": "list or watch objects of kind Deployment", "operationId": "listAppsV1NamespacedDeployment", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.DeploymentList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a Deployment", "operationId": "createAppsV1NamespacedDeployment", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}": { "delete": { "description": "delete a Deployment", "operationId": "deleteAppsV1NamespacedDeployment", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "get": { "description": "read the specified Deployment", "operationId": "readAppsV1NamespacedDeployment", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "parameters": [ { "description": "name of the Deployment", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Deployment", "operationId": "patchAppsV1NamespacedDeployment", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "put": { "description": "replace the specified Deployment", "operationId": "replaceAppsV1NamespacedDeployment", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale": { "get": { "description": "read scale of the specified Deployment", "operationId": "readAppsV1NamespacedDeploymentScale", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } }, "parameters": [ { "description": "name of the Scale", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update scale of the specified Deployment", "operationId": "patchAppsV1NamespacedDeploymentScale", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } }, "put": { "description": "replace scale of the specified Deployment", "operationId": "replaceAppsV1NamespacedDeploymentScale", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status": { "get": { "description": "read status of the specified Deployment", "operationId": "readAppsV1NamespacedDeploymentStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "parameters": [ { "description": "name of the Deployment", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified Deployment", "operationId": "patchAppsV1NamespacedDeploymentStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "put": { "description": "replace status of the specified Deployment", "operationId": "replaceAppsV1NamespacedDeploymentStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.Deployment" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/replicasets": { "delete": { "description": "delete collection of ReplicaSet", "operationId": "deleteAppsV1CollectionNamespacedReplicaSet", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "get": { "description": "list or watch objects of kind ReplicaSet", "operationId": "listAppsV1NamespacedReplicaSet", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a ReplicaSet", "operationId": "createAppsV1NamespacedReplicaSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}": { "delete": { "description": "delete a ReplicaSet", "operationId": "deleteAppsV1NamespacedReplicaSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "get": { "description": "read the specified ReplicaSet", "operationId": "readAppsV1NamespacedReplicaSet", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "parameters": [ { "description": "name of the ReplicaSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified ReplicaSet", "operationId": "patchAppsV1NamespacedReplicaSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "put": { "description": "replace the specified ReplicaSet", "operationId": "replaceAppsV1NamespacedReplicaSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale": { "get": { "description": "read scale of the specified ReplicaSet", "operationId": "readAppsV1NamespacedReplicaSetScale", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } }, "parameters": [ { "description": "name of the Scale", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update scale of the specified ReplicaSet", "operationId": "patchAppsV1NamespacedReplicaSetScale", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } }, "put": { "description": "replace scale of the specified ReplicaSet", "operationId": "replaceAppsV1NamespacedReplicaSetScale", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status": { "get": { "description": "read status of the specified ReplicaSet", "operationId": "readAppsV1NamespacedReplicaSetStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "parameters": [ { "description": "name of the ReplicaSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified ReplicaSet", "operationId": "patchAppsV1NamespacedReplicaSetStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "put": { "description": "replace status of the specified ReplicaSet", "operationId": "replaceAppsV1NamespacedReplicaSetStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/statefulsets": { "delete": { "description": "delete collection of StatefulSet", "operationId": "deleteAppsV1CollectionNamespacedStatefulSet", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "get": { "description": "list or watch objects of kind StatefulSet", "operationId": "listAppsV1NamespacedStatefulSet", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a StatefulSet", "operationId": "createAppsV1NamespacedStatefulSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}": { "delete": { "description": "delete a StatefulSet", "operationId": "deleteAppsV1NamespacedStatefulSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "get": { "description": "read the specified StatefulSet", "operationId": "readAppsV1NamespacedStatefulSet", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "parameters": [ { "description": "name of the StatefulSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified StatefulSet", "operationId": "patchAppsV1NamespacedStatefulSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "put": { "description": "replace the specified StatefulSet", "operationId": "replaceAppsV1NamespacedStatefulSet", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale": { "get": { "description": "read scale of the specified StatefulSet", "operationId": "readAppsV1NamespacedStatefulSetScale", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } }, "parameters": [ { "description": "name of the Scale", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update scale of the specified StatefulSet", "operationId": "patchAppsV1NamespacedStatefulSetScale", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } }, "put": { "description": "replace scale of the specified StatefulSet", "operationId": "replaceAppsV1NamespacedStatefulSetScale", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.autoscaling.v1.Scale" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "autoscaling", "kind": "Scale", "version": "v1" } } }, "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status": { "get": { "description": "read status of the specified StatefulSet", "operationId": "readAppsV1NamespacedStatefulSetStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "parameters": [ { "description": "name of the StatefulSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified StatefulSet", "operationId": "patchAppsV1NamespacedStatefulSetStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "put": { "description": "replace status of the specified StatefulSet", "operationId": "replaceAppsV1NamespacedStatefulSetStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSet" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } } }, "/apis/apps/v1/replicasets": { "get": { "description": "list or watch objects of kind ReplicaSet", "operationId": "listAppsV1ReplicaSetForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.ReplicaSetList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/statefulsets": { "get": { "description": "list or watch objects of kind StatefulSet", "operationId": "listAppsV1StatefulSetForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.apps.v1.StatefulSetList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/controllerrevisions": { "get": { "description": "watch individual changes to a list of ControllerRevision. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1ControllerRevisionListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/daemonsets": { "get": { "description": "watch individual changes to a list of DaemonSet. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1DaemonSetListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/deployments": { "get": { "description": "watch individual changes to a list of Deployment. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1DeploymentListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions": { "get": { "description": "watch individual changes to a list of ControllerRevision. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1NamespacedControllerRevisionList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}": { "get": { "description": "watch changes to an object of kind ControllerRevision. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchAppsV1NamespacedControllerRevision", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ControllerRevision", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the ControllerRevision", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets": { "get": { "description": "watch individual changes to a list of DaemonSet. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1NamespacedDaemonSetList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}": { "get": { "description": "watch changes to an object of kind DaemonSet. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchAppsV1NamespacedDaemonSet", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "DaemonSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the DaemonSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/deployments": { "get": { "description": "watch individual changes to a list of Deployment. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1NamespacedDeploymentList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}": { "get": { "description": "watch changes to an object of kind Deployment. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchAppsV1NamespacedDeployment", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "Deployment", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Deployment", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/replicasets": { "get": { "description": "watch individual changes to a list of ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1NamespacedReplicaSetList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}": { "get": { "description": "watch changes to an object of kind ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchAppsV1NamespacedReplicaSet", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the ReplicaSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets": { "get": { "description": "watch individual changes to a list of StatefulSet. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1NamespacedStatefulSetList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}": { "get": { "description": "watch changes to an object of kind StatefulSet. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchAppsV1NamespacedStatefulSet", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the StatefulSet", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/replicasets": { "get": { "description": "watch individual changes to a list of ReplicaSet. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1ReplicaSetListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "ReplicaSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/apps/v1/watch/statefulsets": { "get": { "description": "watch individual changes to a list of StatefulSet. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchAppsV1StatefulSetListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "apps_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "apps", "kind": "StatefulSet", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] } } } kubernetes-client-go-a2dfcab/openapi/openapitest/testdata/apis__batch__v1_openapi.json000066400000000000000000015502221472614177300316150ustar00rootroot00000000000000{ "components": { "schemas": { "io.k8s.api.batch.v1.CronJob": { "description": "CronJob represents the configuration of a single cron job.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobSpec" } ], "default": {}, "description": "Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobStatus" } ], "default": {}, "description": "Current status of a cron job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "batch", "kind": "CronJob", "version": "v1" } ] }, "io.k8s.api.batch.v1.CronJobList": { "description": "CronJobList is a collection of cron jobs.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "items is the list of CronJobs.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "batch", "kind": "CronJobList", "version": "v1" } ] }, "io.k8s.api.batch.v1.CronJobSpec": { "description": "CronJobSpec describes how the job execution will look like and when it will actually run.", "properties": { "concurrencyPolicy": { "description": "Specifies how to treat concurrent executions of a Job. Valid values are:\n\n- \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one", "type": "string" }, "failedJobsHistoryLimit": { "description": "The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1.", "format": "int32", "type": "integer" }, "jobTemplate": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobTemplateSpec" } ], "default": {}, "description": "Specifies the job that will be created when executing a CronJob." }, "schedule": { "default": "", "description": "The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.", "type": "string" }, "startingDeadlineSeconds": { "description": "Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.", "format": "int64", "type": "integer" }, "successfulJobsHistoryLimit": { "description": "The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3.", "format": "int32", "type": "integer" }, "suspend": { "description": "This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.", "type": "boolean" }, "timeZone": { "description": "The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. The set of valid time zone names and the time zone offset is loaded from the system-wide time zone database by the API server during CronJob validation and the controller manager during execution. If no system-wide time zone database can be found a bundled version of the database is used instead. If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host configuration, the controller will stop creating new new Jobs and will create a system event with the reason UnknownTimeZone. More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones.", "type": "string" } }, "required": [ "schedule", "jobTemplate" ], "type": "object" }, "io.k8s.api.batch.v1.CronJobStatus": { "description": "CronJobStatus represents the current state of a cron job.", "properties": { "active": { "description": "A list of pointers to currently running jobs.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" }, "lastScheduleTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Information when was the last time the job was successfully scheduled." }, "lastSuccessfulTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Information when was the last time the job successfully completed." } }, "type": "object" }, "io.k8s.api.batch.v1.Job": { "description": "Job represents the configuration of a single job.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobSpec" } ], "default": {}, "description": "Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" }, "status": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobStatus" } ], "default": {}, "description": "Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "batch", "kind": "Job", "version": "v1" } ] }, "io.k8s.api.batch.v1.JobCondition": { "description": "JobCondition describes current state of a job.", "properties": { "lastProbeTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time the condition was checked." }, "lastTransitionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "Last time the condition transit from one status to another." }, "message": { "description": "Human readable message indicating details about last transition.", "type": "string" }, "reason": { "description": "(brief) reason for the condition's last transition.", "type": "string" }, "status": { "default": "", "description": "Status of the condition, one of True, False, Unknown.", "type": "string" }, "type": { "default": "", "description": "Type of job condition, Complete or Failed.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.batch.v1.JobList": { "description": "JobList is a collection of jobs.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "items is the list of Jobs.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "batch", "kind": "JobList", "version": "v1" } ] }, "io.k8s.api.batch.v1.JobSpec": { "description": "JobSpec describes how the job execution will look like.", "properties": { "activeDeadlineSeconds": { "description": "Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.", "format": "int64", "type": "integer" }, "backoffLimit": { "description": "Specifies the number of retries before marking this job failed. Defaults to 6", "format": "int32", "type": "integer" }, "completionMode": { "description": "completionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.\n\n`NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other.\n\n`Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`.\n\nMore completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, which is possible during upgrades due to version skew, the controller skips updates for the Job.", "type": "string" }, "completions": { "description": "Specifies the desired number of successfully finished pods the job should be run with. Setting to null means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "format": "int32", "type": "integer" }, "manualSelector": { "description": "manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector", "type": "boolean" }, "parallelism": { "description": "Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "format": "int32", "type": "integer" }, "podFailurePolicy": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.PodFailurePolicy" } ], "description": "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.\n\nThis field is alpha-level. To use this field, you must enable the `JobPodFailurePolicy` feature gate (disabled by default)." }, "selector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" }, "suspend": { "description": "suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.", "type": "boolean" }, "template": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodTemplateSpec" } ], "default": {}, "description": "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/" }, "ttlSecondsAfterFinished": { "description": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes.", "format": "int32", "type": "integer" } }, "required": [ "template" ], "type": "object" }, "io.k8s.api.batch.v1.JobStatus": { "description": "JobStatus represents the current state of a Job.", "properties": { "active": { "description": "The number of pending and running pods.", "format": "int32", "type": "integer" }, "completedIndexes": { "description": "completedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".", "type": "string" }, "completionTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is only set when the job finishes successfully." }, "conditions": { "description": "The latest available observations of an object's current state. When a Job fails, one of the conditions will have type \"Failed\" and status true. When a Job is suspended, one of the conditions will have type \"Suspended\" and status true; when the Job is resumed, the status of this condition will become false. When a Job is completed, one of the conditions will have type \"Complete\" and status true. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobCondition" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge" }, "failed": { "description": "The number of pods which reached phase Failed.", "format": "int32", "type": "integer" }, "ready": { "description": "The number of pods which have a Ready condition.\n\nThis field is beta-level. The job controller populates the field when the feature gate JobReadyPods is enabled (enabled by default).", "format": "int32", "type": "integer" }, "startTime": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Represents time when the job controller started processing a job. When a Job is created in the suspended state, this field is not set until the first time it is resumed. This field is reset every time a Job is resumed from suspension. It is represented in RFC3339 form and is in UTC." }, "succeeded": { "description": "The number of pods which reached phase Succeeded.", "format": "int32", "type": "integer" }, "uncountedTerminatedPods": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.UncountedTerminatedPods" } ], "description": "uncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status:\n\n1. Add the pod UID to the arrays in this field. 2. Remove the pod finalizer. 3. Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nOld jobs might not be tracked using this field, in which case the field remains null." } }, "type": "object" }, "io.k8s.api.batch.v1.JobTemplateSpec": { "description": "JobTemplateSpec describes the data a Job should have when created from a template", "properties": { "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobSpec" } ], "default": {}, "description": "Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object" }, "io.k8s.api.batch.v1.PodFailurePolicy": { "description": "PodFailurePolicy describes how failed pods influence the backoffLimit.", "properties": { "rules": { "description": "A list of pod failure policy rules. The rules are evaluated in order. Once a rule matches a Pod failure, the remaining of the rules are ignored. When no rule matches the Pod failure, the default handling applies - the counter of pod failures is incremented and it is checked against the backoffLimit. At most 20 elements are allowed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.PodFailurePolicyRule" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" } }, "required": [ "rules" ], "type": "object" }, "io.k8s.api.batch.v1.PodFailurePolicyOnExitCodesRequirement": { "description": "PodFailurePolicyOnExitCodesRequirement describes the requirement for handling a failed pod based on its container exit codes. In particular, it lookups the .state.terminated.exitCode for each app container and init container status, represented by the .status.containerStatuses and .status.initContainerStatuses fields in the Pod status, respectively. Containers completed with success (exit code 0) are excluded from the requirement check.", "properties": { "containerName": { "description": "Restricts the check for exit codes to the container with the specified name. When null, the rule applies to all containers. When specified, it should match one the container or initContainer names in the pod template.", "type": "string" }, "operator": { "default": "", "description": "Represents the relationship between the container exit code(s) and the specified values. Containers completed with success (exit code 0) are excluded from the requirement check. Possible values are:\n\n- In: the requirement is satisfied if at least one container exit code\n (might be multiple if there are multiple containers not restricted\n by the 'containerName' field) is in the set of specified values.\n- NotIn: the requirement is satisfied if at least one container exit code\n (might be multiple if there are multiple containers not restricted\n by the 'containerName' field) is not in the set of specified values.\nAdditional values are considered to be added in the future. Clients should react to an unknown operator by assuming the requirement is not satisfied.", "type": "string" }, "values": { "description": "Specifies the set of values. Each returned container exit code (might be multiple in case of multiple containers) is checked against this set of values with respect to the operator. The list of values must be ordered and must not contain duplicates. Value '0' cannot be used for the In operator. At least one element is required. At most 255 elements are allowed.", "items": { "default": 0, "format": "int32", "type": "integer" }, "type": "array", "x-kubernetes-list-type": "set" } }, "required": [ "operator", "values" ], "type": "object" }, "io.k8s.api.batch.v1.PodFailurePolicyOnPodConditionsPattern": { "description": "PodFailurePolicyOnPodConditionsPattern describes a pattern for matching an actual pod condition type.", "properties": { "status": { "default": "", "description": "Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True.", "type": "string" }, "type": { "default": "", "description": "Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type.", "type": "string" } }, "required": [ "type", "status" ], "type": "object" }, "io.k8s.api.batch.v1.PodFailurePolicyRule": { "description": "PodFailurePolicyRule describes how a pod failure is handled when the requirements are met. One of onExitCodes and onPodConditions, but not both, can be used in each rule.", "properties": { "action": { "default": "", "description": "Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:\n\n- FailJob: indicates that the pod's job is marked as Failed and all\n running pods are terminated.\n- Ignore: indicates that the counter towards the .backoffLimit is not\n incremented and a replacement pod is created.\n- Count: indicates that the pod is handled in the default way - the\n counter towards the .backoffLimit is incremented.\nAdditional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.", "type": "string" }, "onExitCodes": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.PodFailurePolicyOnExitCodesRequirement" } ], "description": "Represents the requirement on the container exit codes." }, "onPodConditions": { "description": "Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.batch.v1.PodFailurePolicyOnPodConditionsPattern" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" } }, "required": [ "action", "onPodConditions" ], "type": "object" }, "io.k8s.api.batch.v1.UncountedTerminatedPods": { "description": "UncountedTerminatedPods holds UIDs of Pods that have terminated but haven't been accounted in Job status counters.", "properties": { "failed": { "description": "failed holds UIDs of failed Pods.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-list-type": "set" }, "succeeded": { "description": "succeeded holds UIDs of succeeded Pods.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-list-type": "set" } }, "type": "object" }, "io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource": { "description": "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "string" }, "partition": { "description": "partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).", "format": "int32", "type": "integer" }, "readOnly": { "description": "readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "boolean" }, "volumeID": { "default": "", "description": "volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.Affinity": { "description": "Affinity is a group of affinity scheduling rules.", "properties": { "nodeAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeAffinity" } ], "description": "Describes node affinity scheduling rules for the pod." }, "podAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinity" } ], "description": "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s))." }, "podAntiAffinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity" } ], "description": "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s))." } }, "type": "object" }, "io.k8s.api.core.v1.AzureDiskVolumeSource": { "description": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", "properties": { "cachingMode": { "description": "cachingMode is the Host Caching mode: None, Read Only, Read Write.", "type": "string" }, "diskName": { "default": "", "description": "diskName is the Name of the data disk in the blob storage", "type": "string" }, "diskURI": { "default": "", "description": "diskURI is the URI of data disk in the blob storage", "type": "string" }, "fsType": { "description": "fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "kind": { "description": "kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared", "type": "string" }, "readOnly": { "description": "readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" } }, "required": [ "diskName", "diskURI" ], "type": "object" }, "io.k8s.api.core.v1.AzureFileVolumeSource": { "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", "properties": { "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretName": { "default": "", "description": "secretName is the name of secret that contains Azure Storage Account Name and Key", "type": "string" }, "shareName": { "default": "", "description": "shareName is the azure share Name", "type": "string" } }, "required": [ "secretName", "shareName" ], "type": "object" }, "io.k8s.api.core.v1.CSIVolumeSource": { "description": "Represents a source location of a volume to mount, managed by an external CSI driver", "properties": { "driver": { "default": "", "description": "driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.", "type": "string" }, "fsType": { "description": "fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.", "type": "string" }, "nodePublishSecretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed." }, "readOnly": { "description": "readOnly specifies a read-only configuration for the volume. Defaults to false (read/write).", "type": "boolean" }, "volumeAttributes": { "additionalProperties": { "default": "", "type": "string" }, "description": "volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.", "type": "object" } }, "required": [ "driver" ], "type": "object" }, "io.k8s.api.core.v1.Capabilities": { "description": "Adds and removes POSIX capabilities from running containers.", "properties": { "add": { "description": "Added capabilities", "items": { "default": "", "type": "string" }, "type": "array" }, "drop": { "description": "Removed capabilities", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.CephFSVolumeSource": { "description": "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", "properties": { "monitors": { "description": "monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "items": { "default": "", "type": "string" }, "type": "array" }, "path": { "description": "path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /", "type": "string" }, "readOnly": { "description": "readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "boolean" }, "secretFile": { "description": "secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "string" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" }, "user": { "description": "user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", "type": "string" } }, "required": [ "monitors" ], "type": "object" }, "io.k8s.api.core.v1.CinderVolumeSource": { "description": "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is optional: points to a secret object containing parameters used to connect to OpenStack." }, "volumeID": { "default": "", "description": "volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.ClaimSource": { "description": "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.", "properties": { "resourceClaimName": { "description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.", "type": "string" }, "resourceClaimTemplateName": { "description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The name of the ResourceClaim will be -, where is the PodResourceClaim.Name. Pod validation will reject the pod if the concatenated name is not valid for a ResourceClaim (e.g. too long).\n\nAn existing ResourceClaim with that name that is not owned by the pod will not be used for the pod to avoid using an unrelated resource by mistake. Scheduling and pod startup are then blocked until the unrelated ResourceClaim is removed.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ConfigMapEnvSource": { "description": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the ConfigMap must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.ConfigMapKeySelector": { "description": "Selects a key from a ConfigMap.", "properties": { "key": { "default": "", "description": "The key to select.", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the ConfigMap or its key must be defined", "type": "boolean" } }, "required": [ "key" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ConfigMapProjection": { "description": "Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.", "properties": { "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional specify whether the ConfigMap or its keys must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.ConfigMapVolumeSource": { "description": "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional specify whether the ConfigMap or its keys must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.Container": { "description": "A single application container that you want to run within a pod.", "properties": { "args": { "description": "Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "command": { "description": "Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "env": { "description": "List of environment variables to set in the container. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVar" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "envFrom": { "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvFromSource" } ], "default": {} }, "type": "array" }, "image": { "description": "Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", "type": "string" }, "imagePullPolicy": { "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", "type": "string" }, "lifecycle": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Lifecycle" } ], "description": "Actions that the management system should take in response to container lifecycle events. Cannot be updated." }, "livenessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "name": { "default": "", "description": "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", "type": "string" }, "ports": { "description": "List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerPort" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "containerPort", "protocol" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "containerPort", "x-kubernetes-patch-strategy": "merge" }, "readinessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecurityContext" } ], "description": "SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" }, "startupProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" }, "stdin": { "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", "type": "boolean" }, "stdinOnce": { "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", "type": "boolean" }, "terminationMessagePath": { "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", "type": "string" }, "terminationMessagePolicy": { "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", "type": "string" }, "tty": { "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", "type": "boolean" }, "volumeDevices": { "description": "volumeDevices is the list of block devices to be used by the container.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeDevice" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge" }, "volumeMounts": { "description": "Pod volumes to mount into the container's filesystem. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeMount" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, "workingDir": { "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.ContainerPort": { "description": "ContainerPort represents a network port in a single container.", "properties": { "containerPort": { "default": 0, "description": "Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.", "format": "int32", "type": "integer" }, "hostIP": { "description": "What host IP to bind the external port to.", "type": "string" }, "hostPort": { "description": "Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.", "format": "int32", "type": "integer" }, "name": { "description": "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.", "type": "string" }, "protocol": { "default": "TCP", "description": "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".", "type": "string" } }, "required": [ "containerPort" ], "type": "object" }, "io.k8s.api.core.v1.DownwardAPIProjection": { "description": "Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.", "properties": { "items": { "description": "Items is a list of DownwardAPIVolume file", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.DownwardAPIVolumeFile": { "description": "DownwardAPIVolumeFile represents information to create the file containing the pod field", "properties": { "fieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector" } ], "description": "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported." }, "mode": { "description": "Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "path": { "default": "", "description": "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'", "type": "string" }, "resourceFieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector" } ], "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported." } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.DownwardAPIVolumeSource": { "description": "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "Items is a list of downward API volume file", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeFile" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.EmptyDirVolumeSource": { "description": "Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.", "properties": { "medium": { "description": "medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", "type": "string" }, "sizeLimit": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "description": "sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" } }, "type": "object" }, "io.k8s.api.core.v1.EnvFromSource": { "description": "EnvFromSource represents the source of a set of ConfigMaps", "properties": { "configMapRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapEnvSource" } ], "description": "The ConfigMap to select from" }, "prefix": { "description": "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", "type": "string" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretEnvSource" } ], "description": "The Secret to select from" } }, "type": "object" }, "io.k8s.api.core.v1.EnvVar": { "description": "EnvVar represents an environment variable present in a Container.", "properties": { "name": { "default": "", "description": "Name of the environment variable. Must be a C_IDENTIFIER.", "type": "string" }, "value": { "description": "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", "type": "string" }, "valueFrom": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVarSource" } ], "description": "Source for the environment variable's value. Cannot be used if value is not empty." } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.EnvVarSource": { "description": "EnvVarSource represents a source for the value of an EnvVar.", "properties": { "configMapKeyRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapKeySelector" } ], "description": "Selects a key of a ConfigMap." }, "fieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectFieldSelector" } ], "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs." }, "resourceFieldRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceFieldSelector" } ], "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported." }, "secretKeyRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretKeySelector" } ], "description": "Selects a key of a secret in the pod's namespace" } }, "type": "object" }, "io.k8s.api.core.v1.EphemeralContainer": { "description": "An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation.\n\nTo add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted.", "properties": { "args": { "description": "Arguments to the entrypoint. The image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "command": { "description": "Entrypoint array. Not executed within a shell. The image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", "items": { "default": "", "type": "string" }, "type": "array" }, "env": { "description": "List of environment variables to set in the container. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvVar" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "envFrom": { "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EnvFromSource" } ], "default": {} }, "type": "array" }, "image": { "description": "Container image name. More info: https://kubernetes.io/docs/concepts/containers/images", "type": "string" }, "imagePullPolicy": { "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", "type": "string" }, "lifecycle": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Lifecycle" } ], "description": "Lifecycle is not allowed for ephemeral containers." }, "livenessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "name": { "default": "", "description": "Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.", "type": "string" }, "ports": { "description": "Ports are not allowed for ephemeral containers.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerPort" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "containerPort", "protocol" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "containerPort", "x-kubernetes-patch-strategy": "merge" }, "readinessProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod." }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecurityContext" } ], "description": "Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext." }, "startupProbe": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Probe" } ], "description": "Probes are not allowed for ephemeral containers." }, "stdin": { "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", "type": "boolean" }, "stdinOnce": { "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", "type": "boolean" }, "targetContainerName": { "description": "If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec.\n\nThe container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined.", "type": "string" }, "terminationMessagePath": { "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", "type": "string" }, "terminationMessagePolicy": { "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", "type": "string" }, "tty": { "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", "type": "boolean" }, "volumeDevices": { "description": "volumeDevices is the list of block devices to be used by the container.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeDevice" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge" }, "volumeMounts": { "description": "Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeMount" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, "workingDir": { "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.EphemeralVolumeSource": { "description": "Represents an ephemeral volume that is handled by a normal storage driver.", "properties": { "volumeClaimTemplate": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimTemplate" } ], "description": "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil." } }, "type": "object" }, "io.k8s.api.core.v1.ExecAction": { "description": "ExecAction describes a \"run in container\" action.", "properties": { "command": { "description": "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.FCVolumeSource": { "description": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "lun": { "description": "lun is Optional: FC target lun number", "format": "int32", "type": "integer" }, "readOnly": { "description": "readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "targetWWNs": { "description": "targetWWNs is Optional: FC target worldwide names (WWNs)", "items": { "default": "", "type": "string" }, "type": "array" }, "wwids": { "description": "wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.FlexVolumeSource": { "description": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", "properties": { "driver": { "default": "", "description": "driver is the name of the driver to use for this volume.", "type": "string" }, "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", "type": "string" }, "options": { "additionalProperties": { "default": "", "type": "string" }, "description": "options is Optional: this field holds extra command options if any.", "type": "object" }, "readOnly": { "description": "readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts." } }, "required": [ "driver" ], "type": "object" }, "io.k8s.api.core.v1.FlockerVolumeSource": { "description": "Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.", "properties": { "datasetName": { "description": "datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated", "type": "string" }, "datasetUUID": { "description": "datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.GCEPersistentDiskVolumeSource": { "description": "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "string" }, "partition": { "description": "partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "format": "int32", "type": "integer" }, "pdName": { "default": "", "description": "pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "string" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", "type": "boolean" } }, "required": [ "pdName" ], "type": "object" }, "io.k8s.api.core.v1.GRPCAction": { "properties": { "port": { "default": 0, "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", "format": "int32", "type": "integer" }, "service": { "default": "", "description": "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.", "type": "string" } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.GitRepoVolumeSource": { "description": "Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", "properties": { "directory": { "description": "directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.", "type": "string" }, "repository": { "default": "", "description": "repository is the URL", "type": "string" }, "revision": { "description": "revision is the commit hash for the specified revision.", "type": "string" } }, "required": [ "repository" ], "type": "object" }, "io.k8s.api.core.v1.GlusterfsVolumeSource": { "description": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", "properties": { "endpoints": { "default": "", "description": "endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "path": { "default": "", "description": "path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "string" }, "readOnly": { "description": "readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", "type": "boolean" } }, "required": [ "endpoints", "path" ], "type": "object" }, "io.k8s.api.core.v1.HTTPGetAction": { "description": "HTTPGetAction describes an action based on HTTP Get requests.", "properties": { "host": { "description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", "type": "string" }, "httpHeaders": { "description": "Custom headers to set in the request. HTTP allows repeated headers.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPHeader" } ], "default": {} }, "type": "array" }, "path": { "description": "Path to access on the HTTP server.", "type": "string" }, "port": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "default": {}, "description": "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME." }, "scheme": { "description": "Scheme to use for connecting to the host. Defaults to HTTP.", "type": "string" } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.HTTPHeader": { "description": "HTTPHeader describes a custom header to be used in HTTP probes", "properties": { "name": { "default": "", "description": "The header field name", "type": "string" }, "value": { "default": "", "description": "The header field value", "type": "string" } }, "required": [ "name", "value" ], "type": "object" }, "io.k8s.api.core.v1.HostAlias": { "description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.", "properties": { "hostnames": { "description": "Hostnames for the above IP address.", "items": { "default": "", "type": "string" }, "type": "array" }, "ip": { "description": "IP address of the host file entry.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.HostPathVolumeSource": { "description": "Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.", "properties": { "path": { "default": "", "description": "path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", "type": "string" }, "type": { "description": "type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", "type": "string" } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.ISCSIVolumeSource": { "description": "Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", "properties": { "chapAuthDiscovery": { "description": "chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication", "type": "boolean" }, "chapAuthSession": { "description": "chapAuthSession defines whether support iSCSI Session CHAP authentication", "type": "boolean" }, "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", "type": "string" }, "initiatorName": { "description": "initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.", "type": "string" }, "iqn": { "default": "", "description": "iqn is the target iSCSI Qualified Name.", "type": "string" }, "iscsiInterface": { "description": "iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", "type": "string" }, "lun": { "default": 0, "description": "lun represents iSCSI Target Lun number.", "format": "int32", "type": "integer" }, "portals": { "description": "portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", "items": { "default": "", "type": "string" }, "type": "array" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is the CHAP Secret for iSCSI target and initiator authentication" }, "targetPortal": { "default": "", "description": "targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", "type": "string" } }, "required": [ "targetPortal", "iqn", "lun" ], "type": "object" }, "io.k8s.api.core.v1.KeyToPath": { "description": "Maps a string key to a path within a volume.", "properties": { "key": { "default": "", "description": "key is the key to project.", "type": "string" }, "mode": { "description": "mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "path": { "default": "", "description": "path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.", "type": "string" } }, "required": [ "key", "path" ], "type": "object" }, "io.k8s.api.core.v1.Lifecycle": { "description": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", "properties": { "postStart": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LifecycleHandler" } ], "description": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" }, "preStop": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LifecycleHandler" } ], "description": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" } }, "type": "object" }, "io.k8s.api.core.v1.LifecycleHandler": { "description": "LifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields, except TCPSocket must be specified.", "properties": { "exec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ExecAction" } ], "description": "Exec specifies the action to take." }, "httpGet": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPGetAction" } ], "description": "HTTPGet specifies the http request to perform." }, "tcpSocket": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TCPSocketAction" } ], "description": "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified." } }, "type": "object" }, "io.k8s.api.core.v1.LocalObjectReference": { "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.NFSVolumeSource": { "description": "Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.", "properties": { "path": { "default": "", "description": "path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "string" }, "readOnly": { "description": "readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "boolean" }, "server": { "default": "", "description": "server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", "type": "string" } }, "required": [ "server", "path" ], "type": "object" }, "io.k8s.api.core.v1.NodeAffinity": { "description": "Node affinity is a group of node affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PreferredSchedulingTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelector" } ], "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node." } }, "type": "object" }, "io.k8s.api.core.v1.NodeSelector": { "description": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", "properties": { "nodeSelectorTerms": { "description": "Required. A list of node selector terms. The terms are ORed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm" } ], "default": {} }, "type": "array" } }, "required": [ "nodeSelectorTerms" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.NodeSelectorRequirement": { "description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "properties": { "key": { "default": "", "description": "The label key that the selector applies to.", "type": "string" }, "operator": { "default": "", "description": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", "type": "string" }, "values": { "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", "items": { "default": "", "type": "string" }, "type": "array" } }, "required": [ "key", "operator" ], "type": "object" }, "io.k8s.api.core.v1.NodeSelectorTerm": { "description": "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.", "properties": { "matchExpressions": { "description": "A list of node selector requirements by node's labels.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement" } ], "default": {} }, "type": "array" }, "matchFields": { "description": "A list of node selector requirements by node's fields.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement" } ], "default": {} }, "type": "array" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ObjectFieldSelector": { "description": "ObjectFieldSelector selects an APIVersioned field of an object.", "properties": { "apiVersion": { "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", "type": "string" }, "fieldPath": { "default": "", "description": "Path of the field to select in the specified API version.", "type": "string" } }, "required": [ "fieldPath" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ObjectReference": { "description": "ObjectReference contains enough information to let you inspect or modify the referred object.", "properties": { "apiVersion": { "description": "API version of the referent.", "type": "string" }, "fieldPath": { "description": "If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.", "type": "string" }, "kind": { "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "namespace": { "description": "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", "type": "string" }, "resourceVersion": { "description": "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "uid": { "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids", "type": "string" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.PersistentVolumeClaimSpec": { "description": "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes", "properties": { "accessModes": { "description": "accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", "items": { "default": "", "type": "string" }, "type": "array" }, "dataSource": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TypedLocalObjectReference" } ], "description": "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource." }, "dataSourceRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TypedObjectReference" } ], "description": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled." }, "resources": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceRequirements" } ], "default": {}, "description": "resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources" }, "selector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "selector is a label query over volumes to consider for binding." }, "storageClassName": { "description": "storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", "type": "string" }, "volumeMode": { "description": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", "type": "string" }, "volumeName": { "description": "volumeName is the binding reference to the PersistentVolume backing this claim.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimTemplate": { "description": "PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.", "properties": { "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation." }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimSpec" } ], "default": {}, "description": "The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here." } }, "required": [ "spec" ], "type": "object" }, "io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource": { "description": "PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).", "properties": { "claimName": { "default": "", "description": "claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", "type": "string" }, "readOnly": { "description": "readOnly Will force the ReadOnly setting in VolumeMounts. Default false.", "type": "boolean" } }, "required": [ "claimName" ], "type": "object" }, "io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource": { "description": "Represents a Photon Controller persistent disk resource.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "pdID": { "default": "", "description": "pdID is the ID that identifies Photon Controller persistent disk", "type": "string" } }, "required": [ "pdID" ], "type": "object" }, "io.k8s.api.core.v1.PodAffinity": { "description": "Pod affinity is a group of inter pod affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodAffinityTerm": { "description": "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running", "properties": { "labelSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "A label query over a set of resources, in this case pods." }, "namespaceSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces." }, "namespaces": { "description": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".", "items": { "default": "", "type": "string" }, "type": "array" }, "topologyKey": { "default": "", "description": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", "type": "string" } }, "required": [ "topologyKey" ], "type": "object" }, "io.k8s.api.core.v1.PodAntiAffinity": { "description": "Pod anti affinity is a group of inter pod anti affinity scheduling rules.", "properties": { "preferredDuringSchedulingIgnoredDuringExecution": { "description": "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WeightedPodAffinityTerm" } ], "default": {} }, "type": "array" }, "requiredDuringSchedulingIgnoredDuringExecution": { "description": "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodDNSConfig": { "description": "PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.", "properties": { "nameservers": { "description": "A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.", "items": { "default": "", "type": "string" }, "type": "array" }, "options": { "description": "A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodDNSConfigOption" } ], "default": {} }, "type": "array" }, "searches": { "description": "A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.", "items": { "default": "", "type": "string" }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.PodDNSConfigOption": { "description": "PodDNSConfigOption defines DNS resolver options of a pod.", "properties": { "name": { "description": "Required.", "type": "string" }, "value": { "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.PodOS": { "description": "PodOS defines the OS parameters of a pod.", "properties": { "name": { "default": "", "description": "Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodReadinessGate": { "description": "PodReadinessGate contains the reference to a pod condition", "properties": { "conditionType": { "default": "", "description": "ConditionType refers to a condition in the pod's condition list with matching type.", "type": "string" } }, "required": [ "conditionType" ], "type": "object" }, "io.k8s.api.core.v1.PodResourceClaim": { "description": "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", "properties": { "name": { "default": "", "description": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.", "type": "string" }, "source": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ClaimSource" } ], "default": {}, "description": "Source describes where to find the ResourceClaim." } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodSchedulingGate": { "description": "PodSchedulingGate is associated to a Pod to guard its scheduling.", "properties": { "name": { "default": "", "description": "Name of the scheduling gate. Each scheduling gate must have a unique name field.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.PodSecurityContext": { "description": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", "properties": { "fsGroup": { "description": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "fsGroupChangePolicy": { "description": "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.", "type": "string" }, "runAsGroup": { "description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "runAsNonRoot": { "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "boolean" }, "runAsUser": { "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "seLinuxOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SELinuxOptions" } ], "description": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows." }, "seccompProfile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SeccompProfile" } ], "description": "The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows." }, "supplementalGroups": { "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.", "items": { "default": 0, "format": "int64", "type": "integer" }, "type": "array" }, "sysctls": { "description": "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Sysctl" } ], "default": {} }, "type": "array" }, "windowsOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions" } ], "description": "The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux." } }, "type": "object" }, "io.k8s.api.core.v1.PodSpec": { "description": "PodSpec is a description of a pod.", "properties": { "activeDeadlineSeconds": { "description": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", "format": "int64", "type": "integer" }, "affinity": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Affinity" } ], "description": "If specified, the pod's scheduling constraints" }, "automountServiceAccountToken": { "description": "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.", "type": "boolean" }, "containers": { "description": "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Container" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "dnsConfig": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodDNSConfig" } ], "description": "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy." }, "dnsPolicy": { "description": "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", "type": "string" }, "enableServiceLinks": { "description": "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.", "type": "boolean" }, "ephemeralContainers": { "description": "List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EphemeralContainer" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "hostAliases": { "description": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HostAlias" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "ip", "x-kubernetes-patch-strategy": "merge" }, "hostIPC": { "description": "Use the host's ipc namespace. Optional: Default to false.", "type": "boolean" }, "hostNetwork": { "description": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", "type": "boolean" }, "hostPID": { "description": "Use the host's pid namespace. Optional: Default to false.", "type": "boolean" }, "hostUsers": { "description": "Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.", "type": "boolean" }, "hostname": { "description": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", "type": "string" }, "imagePullSecrets": { "description": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "initContainers": { "description": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Container" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "nodeName": { "description": "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", "type": "string" }, "nodeSelector": { "additionalProperties": { "default": "", "type": "string" }, "description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", "type": "object", "x-kubernetes-map-type": "atomic" }, "os": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodOS" } ], "description": "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup" }, "overhead": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md", "type": "object" }, "preemptionPolicy": { "description": "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.", "type": "string" }, "priority": { "description": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.", "format": "int32", "type": "integer" }, "priorityClassName": { "description": "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", "type": "string" }, "readinessGates": { "description": "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodReadinessGate" } ], "default": {} }, "type": "array" }, "resourceClaims": { "description": "ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodResourceClaim" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge,retainKeys" }, "restartPolicy": { "description": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", "type": "string" }, "runtimeClassName": { "description": "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", "type": "string" }, "schedulerName": { "description": "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", "type": "string" }, "schedulingGates": { "description": "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. More info: https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness.\n\nThis is an alpha-level feature enabled by PodSchedulingReadiness feature gate.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSchedulingGate" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, "securityContext": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSecurityContext" } ], "description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field." }, "serviceAccount": { "description": "DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", "type": "string" }, "serviceAccountName": { "description": "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", "type": "string" }, "setHostnameAsFQDN": { "description": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", "type": "boolean" }, "shareProcessNamespace": { "description": "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.", "type": "boolean" }, "subdomain": { "description": "If specified, the fully qualified Pod hostname will be \"...svc.\". If not specified, the pod will not have a domainname at all.", "type": "string" }, "terminationGracePeriodSeconds": { "description": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", "format": "int64", "type": "integer" }, "tolerations": { "description": "If specified, the pod's tolerations.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Toleration" } ], "default": {} }, "type": "array" }, "topologySpreadConstraints": { "description": "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TopologySpreadConstraint" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "topologyKey", "whenUnsatisfiable" ], "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "topologyKey", "x-kubernetes-patch-strategy": "merge" }, "volumes": { "description": "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Volume" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge,retainKeys" } }, "required": [ "containers" ], "type": "object" }, "io.k8s.api.core.v1.PodTemplateSpec": { "description": "PodTemplateSpec describes the data a pod should have when created from a template", "properties": { "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "spec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodSpec" } ], "default": {}, "description": "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" } }, "type": "object" }, "io.k8s.api.core.v1.PortworxVolumeSource": { "description": "PortworxVolumeSource represents a Portworx volume resource.", "properties": { "fsType": { "description": "fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "volumeID": { "default": "", "description": "volumeID uniquely identifies a Portworx volume", "type": "string" } }, "required": [ "volumeID" ], "type": "object" }, "io.k8s.api.core.v1.PreferredSchedulingTerm": { "description": "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).", "properties": { "preference": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm" } ], "default": {}, "description": "A node selector term, associated with the corresponding weight." }, "weight": { "default": 0, "description": "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.", "format": "int32", "type": "integer" } }, "required": [ "weight", "preference" ], "type": "object" }, "io.k8s.api.core.v1.Probe": { "description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", "properties": { "exec": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ExecAction" } ], "description": "Exec specifies the action to take." }, "failureThreshold": { "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", "format": "int32", "type": "integer" }, "grpc": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GRPCAction" } ], "description": "GRPC specifies an action involving a GRPC port." }, "httpGet": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HTTPGetAction" } ], "description": "HTTPGet specifies the http request to perform." }, "initialDelaySeconds": { "description": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", "type": "integer" }, "periodSeconds": { "description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", "format": "int32", "type": "integer" }, "successThreshold": { "description": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", "format": "int32", "type": "integer" }, "tcpSocket": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.TCPSocketAction" } ], "description": "TCPSocket specifies an action involving a TCP port." }, "terminationGracePeriodSeconds": { "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", "format": "int64", "type": "integer" }, "timeoutSeconds": { "description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", "type": "integer" } }, "type": "object" }, "io.k8s.api.core.v1.ProjectedVolumeSource": { "description": "Represents a projected volume source", "properties": { "defaultMode": { "description": "defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "sources": { "description": "sources is the list of volume projections", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VolumeProjection" } ], "default": {} }, "type": "array" } }, "type": "object" }, "io.k8s.api.core.v1.QuobyteVolumeSource": { "description": "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.", "properties": { "group": { "description": "group to map volume access to Default is no group", "type": "string" }, "readOnly": { "description": "readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.", "type": "boolean" }, "registry": { "default": "", "description": "registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes", "type": "string" }, "tenant": { "description": "tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin", "type": "string" }, "user": { "description": "user to map volume access to Defaults to serivceaccount user", "type": "string" }, "volume": { "default": "", "description": "volume is a string that references an already created Quobyte volume by name.", "type": "string" } }, "required": [ "registry", "volume" ], "type": "object" }, "io.k8s.api.core.v1.RBDVolumeSource": { "description": "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", "properties": { "fsType": { "description": "fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", "type": "string" }, "image": { "default": "", "description": "image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "keyring": { "description": "keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "monitors": { "description": "monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "items": { "default": "", "type": "string" }, "type": "array" }, "pool": { "description": "pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" }, "readOnly": { "description": "readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" }, "user": { "description": "user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", "type": "string" } }, "required": [ "monitors", "image" ], "type": "object" }, "io.k8s.api.core.v1.ResourceClaim": { "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.", "properties": { "name": { "default": "", "description": "Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.ResourceFieldSelector": { "description": "ResourceFieldSelector represents container resources (cpu, memory) and their output format", "properties": { "containerName": { "description": "Container name: required for volumes, optional for env vars", "type": "string" }, "divisor": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {}, "description": "Specifies the output format of the exposed resources, defaults to \"1\"" }, "resource": { "default": "", "description": "Required: resource to select", "type": "string" } }, "required": [ "resource" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.ResourceRequirements": { "description": "ResourceRequirements describes the compute resource requirements.", "properties": { "claims": { "description": "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ResourceClaim" } ], "default": {} }, "type": "array", "x-kubernetes-list-map-keys": [ "name" ], "x-kubernetes-list-type": "map" }, "limits": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "type": "object" }, "requests": { "additionalProperties": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity" } ], "default": {} }, "description": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", "type": "object" } }, "type": "object" }, "io.k8s.api.core.v1.SELinuxOptions": { "description": "SELinuxOptions are the labels to be applied to the container", "properties": { "level": { "description": "Level is SELinux level label that applies to the container.", "type": "string" }, "role": { "description": "Role is a SELinux role label that applies to the container.", "type": "string" }, "type": { "description": "Type is a SELinux type label that applies to the container.", "type": "string" }, "user": { "description": "User is a SELinux user label that applies to the container.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.ScaleIOVolumeSource": { "description": "ScaleIOVolumeSource represents a persistent ScaleIO volume", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".", "type": "string" }, "gateway": { "default": "", "description": "gateway is the host address of the ScaleIO API Gateway.", "type": "string" }, "protectionDomain": { "description": "protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.", "type": "string" }, "readOnly": { "description": "readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail." }, "sslEnabled": { "description": "sslEnabled Flag enable/disable SSL communication with Gateway, default false", "type": "boolean" }, "storageMode": { "description": "storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", "type": "string" }, "storagePool": { "description": "storagePool is the ScaleIO Storage Pool associated with the protection domain.", "type": "string" }, "system": { "default": "", "description": "system is the name of the storage system as configured in ScaleIO.", "type": "string" }, "volumeName": { "description": "volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source.", "type": "string" } }, "required": [ "gateway", "system", "secretRef" ], "type": "object" }, "io.k8s.api.core.v1.SeccompProfile": { "description": "SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.", "properties": { "localhostProfile": { "description": "localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".", "type": "string" }, "type": { "default": "", "description": "type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.", "type": "string" } }, "required": [ "type" ], "type": "object", "x-kubernetes-unions": [ { "discriminator": "type", "fields-to-discriminateBy": { "localhostProfile": "LocalhostProfile" } } ] }, "io.k8s.api.core.v1.SecretEnvSource": { "description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.", "properties": { "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the Secret must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.SecretKeySelector": { "description": "SecretKeySelector selects a key of a Secret.", "properties": { "key": { "default": "", "description": "The key of the secret to select from. Must be a valid secret key.", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "Specify whether the Secret or its key must be defined", "type": "boolean" } }, "required": [ "key" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.SecretProjection": { "description": "Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.", "properties": { "items": { "description": "items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "optional": { "description": "optional field specify whether the Secret or its key must be defined", "type": "boolean" } }, "type": "object" }, "io.k8s.api.core.v1.SecretVolumeSource": { "description": "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.", "properties": { "defaultMode": { "description": "defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, "items": { "description": "items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.KeyToPath" } ], "default": {} }, "type": "array" }, "optional": { "description": "optional field specify whether the Secret or its keys must be defined", "type": "boolean" }, "secretName": { "description": "secretName is the name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.SecurityContext": { "description": "SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.", "properties": { "allowPrivilegeEscalation": { "description": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "capabilities": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.Capabilities" } ], "description": "The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows." }, "privileged": { "description": "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "procMount": { "description": "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.", "type": "string" }, "readOnlyRootFilesystem": { "description": "Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.", "type": "boolean" }, "runAsGroup": { "description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "runAsNonRoot": { "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "boolean" }, "runAsUser": { "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows.", "format": "int64", "type": "integer" }, "seLinuxOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SELinuxOptions" } ], "description": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows." }, "seccompProfile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SeccompProfile" } ], "description": "The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows." }, "windowsOptions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.WindowsSecurityContextOptions" } ], "description": "The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux." } }, "type": "object" }, "io.k8s.api.core.v1.ServiceAccountTokenProjection": { "description": "ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).", "properties": { "audience": { "description": "audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.", "type": "string" }, "expirationSeconds": { "description": "expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.", "format": "int64", "type": "integer" }, "path": { "default": "", "description": "path is the path relative to the mount point of the file to project the token into.", "type": "string" } }, "required": [ "path" ], "type": "object" }, "io.k8s.api.core.v1.StorageOSVolumeSource": { "description": "Represents a StorageOS persistent volume resource.", "properties": { "fsType": { "description": "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "readOnly": { "description": "readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", "type": "boolean" }, "secretRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.LocalObjectReference" } ], "description": "secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted." }, "volumeName": { "description": "volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", "type": "string" }, "volumeNamespace": { "description": "volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.Sysctl": { "description": "Sysctl defines a kernel parameter to be set", "properties": { "name": { "default": "", "description": "Name of a property to set", "type": "string" }, "value": { "default": "", "description": "Value of a property to set", "type": "string" } }, "required": [ "name", "value" ], "type": "object" }, "io.k8s.api.core.v1.TCPSocketAction": { "description": "TCPSocketAction describes an action based on opening a socket", "properties": { "host": { "description": "Optional: Host name to connect to, defaults to the pod IP.", "type": "string" }, "port": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.util.intstr.IntOrString" } ], "default": {}, "description": "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME." } }, "required": [ "port" ], "type": "object" }, "io.k8s.api.core.v1.Toleration": { "description": "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .", "properties": { "effect": { "description": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.", "type": "string" }, "key": { "description": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", "type": "string" }, "operator": { "description": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.", "type": "string" }, "tolerationSeconds": { "description": "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.", "format": "int64", "type": "integer" }, "value": { "description": "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.", "type": "string" } }, "type": "object" }, "io.k8s.api.core.v1.TopologySpreadConstraint": { "description": "TopologySpreadConstraint specifies how to spread matching pods among the given topology.", "properties": { "labelSelector": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" } ], "description": "LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain." }, "matchLabelKeys": { "description": "MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-list-type": "atomic" }, "maxSkew": { "default": 0, "description": "MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. The global minimum is the minimum number of matching pods in an eligible domain or zero if the number of eligible domains is less than MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 2/2/1: In this case, the global minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.", "format": "int32", "type": "integer" }, "minDomains": { "description": "MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule.\n\nFor example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew.\n\nThis is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).", "format": "int32", "type": "integer" }, "nodeAffinityPolicy": { "description": "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", "type": "string" }, "nodeTaintsPolicy": { "description": "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", "type": "string" }, "topologyKey": { "default": "", "description": "TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a \"bucket\", and try to put balanced number of pods into each bucket. We define a domain as a particular instance of a topology. Also, we define an eligible domain as a domain whose nodes meet the requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey is \"kubernetes.io/hostname\", each Node is a domain of that topology. And, if TopologyKey is \"topology.kubernetes.io/zone\", each zone is a domain of that topology. It's a required field.", "type": "string" }, "whenUnsatisfiable": { "default": "", "description": "WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.", "type": "string" } }, "required": [ "maxSkew", "topologyKey", "whenUnsatisfiable" ], "type": "object" }, "io.k8s.api.core.v1.TypedLocalObjectReference": { "description": "TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.", "properties": { "apiGroup": { "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", "type": "string" }, "kind": { "default": "", "description": "Kind is the type of resource being referenced", "type": "string" }, "name": { "default": "", "description": "Name is the name of resource being referenced", "type": "string" } }, "required": [ "kind", "name" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.TypedObjectReference": { "properties": { "apiGroup": { "description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", "type": "string" }, "kind": { "default": "", "description": "Kind is the type of resource being referenced", "type": "string" }, "name": { "default": "", "description": "Name is the name of resource being referenced", "type": "string" }, "namespace": { "description": "Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", "type": "string" } }, "required": [ "kind", "name" ], "type": "object" }, "io.k8s.api.core.v1.Volume": { "description": "Volume represents a named volume in a pod that may be accessed by any container in the pod.", "properties": { "awsElasticBlockStore": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource" } ], "description": "awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" }, "azureDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AzureDiskVolumeSource" } ], "description": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod." }, "azureFile": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.AzureFileVolumeSource" } ], "description": "azureFile represents an Azure File Service mount on the host and bind mount to the pod." }, "cephfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CephFSVolumeSource" } ], "description": "cephFS represents a Ceph FS mount on the host that shares a pod's lifetime" }, "cinder": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CinderVolumeSource" } ], "description": "cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" }, "configMap": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapVolumeSource" } ], "description": "configMap represents a configMap that should populate this volume" }, "csi": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.CSIVolumeSource" } ], "description": "csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature)." }, "downwardAPI": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIVolumeSource" } ], "description": "downwardAPI represents downward API about the pod that should populate this volume" }, "emptyDir": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EmptyDirVolumeSource" } ], "description": "emptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" }, "ephemeral": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.EphemeralVolumeSource" } ], "description": "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time." }, "fc": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FCVolumeSource" } ], "description": "fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod." }, "flexVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FlexVolumeSource" } ], "description": "flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin." }, "flocker": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.FlockerVolumeSource" } ], "description": "flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running" }, "gcePersistentDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource" } ], "description": "gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" }, "gitRepo": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GitRepoVolumeSource" } ], "description": "gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container." }, "glusterfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.GlusterfsVolumeSource" } ], "description": "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md" }, "hostPath": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.HostPathVolumeSource" } ], "description": "hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath" }, "iscsi": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ISCSIVolumeSource" } ], "description": "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md" }, "name": { "default": "", "description": "name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "nfs": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NFSVolumeSource" } ], "description": "nfs represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" }, "persistentVolumeClaim": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource" } ], "description": "persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" }, "photonPersistentDisk": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource" } ], "description": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" }, "portworxVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PortworxVolumeSource" } ], "description": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine" }, "projected": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ProjectedVolumeSource" } ], "description": "projected items for all in one resources secrets, configmaps, and downward API" }, "quobyte": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.QuobyteVolumeSource" } ], "description": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime" }, "rbd": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.RBDVolumeSource" } ], "description": "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md" }, "scaleIO": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ScaleIOVolumeSource" } ], "description": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes." }, "secret": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretVolumeSource" } ], "description": "secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret" }, "storageos": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.StorageOSVolumeSource" } ], "description": "storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." }, "vsphereVolume": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource" } ], "description": "vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine" } }, "required": [ "name" ], "type": "object" }, "io.k8s.api.core.v1.VolumeDevice": { "description": "volumeDevice describes a mapping of a raw block device within a container.", "properties": { "devicePath": { "default": "", "description": "devicePath is the path inside of the container that the device will be mapped to.", "type": "string" }, "name": { "default": "", "description": "name must match the name of a persistentVolumeClaim in the pod", "type": "string" } }, "required": [ "name", "devicePath" ], "type": "object" }, "io.k8s.api.core.v1.VolumeMount": { "description": "VolumeMount describes a mounting of a Volume within a container.", "properties": { "mountPath": { "default": "", "description": "Path within the container at which the volume should be mounted. Must not contain ':'.", "type": "string" }, "mountPropagation": { "description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.", "type": "string" }, "name": { "default": "", "description": "This must match the Name of a Volume.", "type": "string" }, "readOnly": { "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.", "type": "boolean" }, "subPath": { "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", "type": "string" }, "subPathExpr": { "description": "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.", "type": "string" } }, "required": [ "name", "mountPath" ], "type": "object" }, "io.k8s.api.core.v1.VolumeProjection": { "description": "Projection that may be projected along with other supported volume types", "properties": { "configMap": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ConfigMapProjection" } ], "description": "configMap information about the configMap data to project" }, "downwardAPI": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.DownwardAPIProjection" } ], "description": "downwardAPI information about the downwardAPI data to project" }, "secret": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.SecretProjection" } ], "description": "secret information about the secret data to project" }, "serviceAccountToken": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ServiceAccountTokenProjection" } ], "description": "serviceAccountToken is information about the serviceAccountToken data to project" } }, "type": "object" }, "io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource": { "description": "Represents a vSphere volume resource.", "properties": { "fsType": { "description": "fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", "type": "string" }, "storagePolicyID": { "description": "storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.", "type": "string" }, "storagePolicyName": { "description": "storagePolicyName is the storage Policy Based Management (SPBM) profile name.", "type": "string" }, "volumePath": { "default": "", "description": "volumePath is the path that identifies vSphere volume vmdk", "type": "string" } }, "required": [ "volumePath" ], "type": "object" }, "io.k8s.api.core.v1.WeightedPodAffinityTerm": { "description": "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)", "properties": { "podAffinityTerm": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.PodAffinityTerm" } ], "default": {}, "description": "Required. A pod affinity term, associated with the corresponding weight." }, "weight": { "default": 0, "description": "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.", "format": "int32", "type": "integer" } }, "required": [ "weight", "podAffinityTerm" ], "type": "object" }, "io.k8s.api.core.v1.WindowsSecurityContextOptions": { "description": "WindowsSecurityContextOptions contain Windows-specific options and credentials.", "properties": { "gmsaCredentialSpec": { "description": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.", "type": "string" }, "gmsaCredentialSpecName": { "description": "GMSACredentialSpecName is the name of the GMSA credential spec to use.", "type": "string" }, "hostProcess": { "description": "HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.", "type": "boolean" }, "runAsUserName": { "description": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.api.resource.Quantity": { "description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource": { "description": "APIResource specifies the name of a resource and whether it is namespaced.", "properties": { "categories": { "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", "items": { "default": "", "type": "string" }, "type": "array" }, "group": { "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", "type": "string" }, "kind": { "default": "", "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", "type": "string" }, "name": { "default": "", "description": "name is the plural name of the resource.", "type": "string" }, "namespaced": { "default": false, "description": "namespaced indicates if a resource is namespaced or not.", "type": "boolean" }, "shortNames": { "description": "shortNames is a list of suggested short names of the resource.", "items": { "default": "", "type": "string" }, "type": "array" }, "singularName": { "default": "", "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", "type": "string" }, "storageVersionHash": { "description": "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", "type": "string" }, "verbs": { "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", "items": { "default": "", "type": "string" }, "type": "array" }, "version": { "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", "type": "string" } }, "required": [ "name", "singularName", "namespaced", "kind", "verbs" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList": { "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "groupVersion": { "default": "", "description": "groupVersion is the group and version this APIResourceList is for.", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "resources": { "description": "resources contains the name of the resources and if they are namespaced.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource" } ], "default": {} }, "type": "array" } }, "required": [ "groupVersion", "resources" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "APIResourceList", "version": "v1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions": { "description": "DeleteOptions may be provided when deleting an API object.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "dryRun": { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "items": { "default": "", "type": "string" }, "type": "array" }, "gracePeriodSeconds": { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "format": "int64", "type": "integer" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "orphanDependents": { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "type": "boolean" }, "preconditions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" } ], "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." }, "propagationPolicy": { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta2" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "extensions", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1": { "description": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector": { "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", "properties": { "matchExpressions": { "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement" } ], "default": {} }, "type": "array" }, "matchLabels": { "additionalProperties": { "default": "", "type": "string" }, "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", "type": "object" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement": { "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "properties": { "key": { "default": "", "description": "key is the label key that the selector applies to.", "type": "string", "x-kubernetes-patch-merge-key": "key", "x-kubernetes-patch-strategy": "merge" }, "operator": { "default": "", "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", "type": "string" }, "values": { "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", "items": { "default": "", "type": "string" }, "type": "array" } }, "required": [ "key", "operator" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta": { "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", "properties": { "continue": { "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", "type": "string" }, "remainingItemCount": { "description": "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", "format": "int64", "type": "integer" }, "resourceVersion": { "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry": { "description": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", "properties": { "apiVersion": { "description": "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", "type": "string" }, "fieldsType": { "description": "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", "type": "string" }, "fieldsV1": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1" } ], "description": "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type." }, "manager": { "description": "Manager is an identifier of the workflow managing these fields.", "type": "string" }, "operation": { "description": "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", "type": "string" }, "subresource": { "description": "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", "type": "string" }, "time": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over." } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta": { "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", "properties": { "annotations": { "additionalProperties": { "default": "", "type": "string" }, "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", "type": "object" }, "creationTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "deletionGracePeriodSeconds": { "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", "format": "int64", "type": "integer" }, "deletionTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "finalizers": { "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-patch-strategy": "merge" }, "generateName": { "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", "type": "string" }, "generation": { "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", "format": "int64", "type": "integer" }, "labels": { "additionalProperties": { "default": "", "type": "string" }, "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", "type": "object" }, "managedFields": { "description": "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry" } ], "default": {} }, "type": "array" }, "name": { "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "namespace": { "description": "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", "type": "string" }, "ownerReferences": { "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "uid", "x-kubernetes-patch-strategy": "merge" }, "resourceVersion": { "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" }, "uid": { "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference": { "description": "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", "properties": { "apiVersion": { "default": "", "description": "API version of the referent.", "type": "string" }, "blockOwnerDeletion": { "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", "type": "boolean" }, "controller": { "description": "If true, this reference points to the managing controller.", "type": "boolean" }, "kind": { "default": "", "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "default": "", "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "uid": { "default": "", "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "required": [ "apiVersion", "kind", "name", "uid" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Patch": { "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions": { "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", "properties": { "resourceVersion": { "description": "Specifies the target ResourceVersion", "type": "string" }, "uid": { "description": "Specifies the target UID.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Status": { "description": "Status is a return value for calls that don't return other objects.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "code": { "description": "Suggested HTTP return code for this status, 0 if not set.", "format": "int32", "type": "integer" }, "details": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails" } ], "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type." }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "message": { "description": "A human-readable description of the status of this operation.", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" }, "reason": { "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", "type": "string" }, "status": { "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Status", "version": "v1" }, { "group": "resource.k8s.io", "kind": "Status", "version": "v1alpha1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause": { "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", "properties": { "field": { "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", "type": "string" }, "message": { "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", "type": "string" }, "reason": { "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": { "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", "properties": { "causes": { "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause" } ], "default": {} }, "type": "array" }, "group": { "description": "The group attribute of the resource associated with the status StatusReason.", "type": "string" }, "kind": { "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", "type": "string" }, "retryAfterSeconds": { "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", "format": "int32", "type": "integer" }, "uid": { "description": "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Time": { "description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", "format": "date-time", "type": "string" }, "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent": { "description": "Event represents a single event to a watched resource.", "properties": { "object": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" } ], "default": {}, "description": "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context." }, "type": { "default": "", "type": "string" } }, "required": [ "type", "object" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta2" }, { "group": "batch", "kind": "WatchEvent", "version": "v1" }, { "group": "batch", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "extensions", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.runtime.RawExtension": { "description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", "type": "object" }, "io.k8s.apimachinery.pkg.util.intstr.IntOrString": { "description": "IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.", "format": "int-or-string", "oneOf": [ { "type": "integer" }, { "type": "string" } ] } }, "securitySchemes": { "BearerToken": { "description": "Bearer Token authentication", "in": "header", "name": "authorization", "type": "apiKey" } } }, "info": { "title": "Kubernetes", "version": "unversioned" }, "openapi": "3.0.0", "paths": { "/apis/batch/v1/": { "get": { "description": "get available resources", "operationId": "getBatchV1APIResources", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ] } }, "/apis/batch/v1/cronjobs": { "get": { "description": "list or watch objects of kind CronJob", "operationId": "listBatchV1CronJobForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/batch/v1/jobs": { "get": { "description": "list or watch objects of kind Job", "operationId": "listBatchV1JobForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/batch/v1/namespaces/{namespace}/cronjobs": { "delete": { "description": "delete collection of CronJob", "operationId": "deleteBatchV1CollectionNamespacedCronJob", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "get": { "description": "list or watch objects of kind CronJob", "operationId": "listBatchV1NamespacedCronJob", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJobList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a CronJob", "operationId": "createBatchV1NamespacedCronJob", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } } }, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}": { "delete": { "description": "delete a CronJob", "operationId": "deleteBatchV1NamespacedCronJob", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "get": { "description": "read the specified CronJob", "operationId": "readBatchV1NamespacedCronJob", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "parameters": [ { "description": "name of the CronJob", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified CronJob", "operationId": "patchBatchV1NamespacedCronJob", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "put": { "description": "replace the specified CronJob", "operationId": "replaceBatchV1NamespacedCronJob", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } } }, "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status": { "get": { "description": "read status of the specified CronJob", "operationId": "readBatchV1NamespacedCronJobStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "parameters": [ { "description": "name of the CronJob", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified CronJob", "operationId": "patchBatchV1NamespacedCronJobStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "put": { "description": "replace status of the specified CronJob", "operationId": "replaceBatchV1NamespacedCronJobStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.CronJob" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } } }, "/apis/batch/v1/namespaces/{namespace}/jobs": { "delete": { "description": "delete collection of Job", "operationId": "deleteBatchV1CollectionNamespacedJob", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "get": { "description": "list or watch objects of kind Job", "operationId": "listBatchV1NamespacedJob", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.JobList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create a Job", "operationId": "createBatchV1NamespacedJob", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } } }, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}": { "delete": { "description": "delete a Job", "operationId": "deleteBatchV1NamespacedJob", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "get": { "description": "read the specified Job", "operationId": "readBatchV1NamespacedJob", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "parameters": [ { "description": "name of the Job", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified Job", "operationId": "patchBatchV1NamespacedJob", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "put": { "description": "replace the specified Job", "operationId": "replaceBatchV1NamespacedJob", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } } }, "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status": { "get": { "description": "read status of the specified Job", "operationId": "readBatchV1NamespacedJobStatus", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "parameters": [ { "description": "name of the Job", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update status of the specified Job", "operationId": "patchBatchV1NamespacedJobStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "put": { "description": "replace status of the specified Job", "operationId": "replaceBatchV1NamespacedJobStatus", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.batch.v1.Job" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } } }, "/apis/batch/v1/watch/cronjobs": { "get": { "description": "watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchBatchV1CronJobListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/batch/v1/watch/jobs": { "get": { "description": "watch individual changes to a list of Job. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchBatchV1JobListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/batch/v1/watch/namespaces/{namespace}/cronjobs": { "get": { "description": "watch individual changes to a list of CronJob. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchBatchV1NamespacedCronJobList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/batch/v1/watch/namespaces/{namespace}/cronjobs/{name}": { "get": { "description": "watch changes to an object of kind CronJob. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchBatchV1NamespacedCronJob", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "CronJob", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the CronJob", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/batch/v1/watch/namespaces/{namespace}/jobs": { "get": { "description": "watch individual changes to a list of Job. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchBatchV1NamespacedJobList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}": { "get": { "description": "watch changes to an object of kind Job. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchBatchV1NamespacedJob", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "batch_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "batch", "kind": "Job", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the Job", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] } } } kubernetes-client-go-a2dfcab/openapi/openapitest/testdata/apis__discovery.k8s.io__v1_openapi.json000066400000000000000000004154061472614177300336600ustar00rootroot00000000000000{ "components": { "schemas": { "io.k8s.api.core.v1.ObjectReference": { "description": "ObjectReference contains enough information to let you inspect or modify the referred object.", "properties": { "apiVersion": { "description": "API version of the referent.", "type": "string" }, "fieldPath": { "description": "If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.", "type": "string" }, "kind": { "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", "type": "string" }, "namespace": { "description": "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", "type": "string" }, "resourceVersion": { "description": "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "uid": { "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids", "type": "string" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.discovery.v1.Endpoint": { "description": "Endpoint represents a single logical \"backend\" implementing a service.", "properties": { "addresses": { "description": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-list-type": "set" }, "conditions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointConditions" } ], "default": {}, "description": "conditions contains information about the current status of the endpoint." }, "deprecatedTopology": { "additionalProperties": { "default": "", "type": "string" }, "description": "deprecatedTopology contains topology information part of the v1beta1 API. This field is deprecated, and will be removed when the v1beta1 API is removed (no sooner than kubernetes v1.24). While this field can hold values, it is not writable through the v1 API, and any attempts to write to it will be silently ignored. Topology information can be found in the zone and nodeName fields instead.", "type": "object" }, "hints": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointHints" } ], "description": "hints contains information associated with how an endpoint should be consumed." }, "hostname": { "description": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS Label (RFC 1123) validation.", "type": "string" }, "nodeName": { "description": "nodeName represents the name of the Node hosting this endpoint. This can be used to determine endpoints local to a Node.", "type": "string" }, "targetRef": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.ObjectReference" } ], "description": "targetRef is a reference to a Kubernetes object that represents this endpoint." }, "zone": { "description": "zone is the name of the Zone this endpoint exists in.", "type": "string" } }, "required": [ "addresses" ], "type": "object" }, "io.k8s.api.discovery.v1.EndpointConditions": { "description": "EndpointConditions represents the current condition of an endpoint.", "properties": { "ready": { "description": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints.", "type": "boolean" }, "serving": { "description": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", "type": "boolean" }, "terminating": { "description": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", "type": "boolean" } }, "type": "object" }, "io.k8s.api.discovery.v1.EndpointHints": { "description": "EndpointHints provides hints describing how an endpoint should be consumed.", "properties": { "forZones": { "description": "forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.ForZone" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" } }, "type": "object" }, "io.k8s.api.discovery.v1.EndpointPort": { "description": "EndpointPort represents a Port used by an EndpointSlice", "properties": { "appProtocol": { "description": "appProtocol represents the application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol.", "type": "string" }, "name": { "description": "name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", "type": "string" }, "port": { "description": "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.", "format": "int32", "type": "integer" }, "protocol": { "description": "protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", "type": "string" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.discovery.v1.EndpointSlice": { "description": "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.", "properties": { "addressType": { "default": "", "description": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.", "type": "string" }, "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "endpoints": { "description": "endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.Endpoint" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" } ], "default": {}, "description": "Standard object's metadata." }, "ports": { "description": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointPort" } ], "default": {} }, "type": "array", "x-kubernetes-list-type": "atomic" } }, "required": [ "addressType", "endpoints" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } ] }, "io.k8s.api.discovery.v1.EndpointSliceList": { "description": "EndpointSliceList represents a list of endpoint slices", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "items": { "description": "items is the list of endpoint slices", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } ], "default": {} }, "type": "array" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata." } }, "required": [ "items" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "discovery.k8s.io", "kind": "EndpointSliceList", "version": "v1" } ] }, "io.k8s.api.discovery.v1.ForZone": { "description": "ForZone provides information about which zones should consume this endpoint.", "properties": { "name": { "default": "", "description": "name represents the name of the zone.", "type": "string" } }, "required": [ "name" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource": { "description": "APIResource specifies the name of a resource and whether it is namespaced.", "properties": { "categories": { "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", "items": { "default": "", "type": "string" }, "type": "array" }, "group": { "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", "type": "string" }, "kind": { "default": "", "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", "type": "string" }, "name": { "default": "", "description": "name is the plural name of the resource.", "type": "string" }, "namespaced": { "default": false, "description": "namespaced indicates if a resource is namespaced or not.", "type": "boolean" }, "shortNames": { "description": "shortNames is a list of suggested short names of the resource.", "items": { "default": "", "type": "string" }, "type": "array" }, "singularName": { "default": "", "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", "type": "string" }, "storageVersionHash": { "description": "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", "type": "string" }, "verbs": { "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", "items": { "default": "", "type": "string" }, "type": "array" }, "version": { "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", "type": "string" } }, "required": [ "name", "singularName", "namespaced", "kind", "verbs" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList": { "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "groupVersion": { "default": "", "description": "groupVersion is the group and version this APIResourceList is for.", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "resources": { "description": "resources contains the name of the resources and if they are namespaced.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource" } ], "default": {} }, "type": "array" } }, "required": [ "groupVersion", "resources" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "APIResourceList", "version": "v1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions": { "description": "DeleteOptions may be provided when deleting an API object.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "dryRun": { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "items": { "default": "", "type": "string" }, "type": "array" }, "gracePeriodSeconds": { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "format": "int64", "type": "integer" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "orphanDependents": { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "type": "boolean" }, "preconditions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" } ], "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." }, "propagationPolicy": { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta2" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "extensions", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1": { "description": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta": { "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", "properties": { "continue": { "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", "type": "string" }, "remainingItemCount": { "description": "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", "format": "int64", "type": "integer" }, "resourceVersion": { "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry": { "description": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", "properties": { "apiVersion": { "description": "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", "type": "string" }, "fieldsType": { "description": "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", "type": "string" }, "fieldsV1": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1" } ], "description": "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type." }, "manager": { "description": "Manager is an identifier of the workflow managing these fields.", "type": "string" }, "operation": { "description": "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", "type": "string" }, "subresource": { "description": "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", "type": "string" }, "time": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over." } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta": { "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", "properties": { "annotations": { "additionalProperties": { "default": "", "type": "string" }, "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", "type": "object" }, "creationTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "deletionGracePeriodSeconds": { "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", "format": "int64", "type": "integer" }, "deletionTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "finalizers": { "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-patch-strategy": "merge" }, "generateName": { "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", "type": "string" }, "generation": { "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", "format": "int64", "type": "integer" }, "labels": { "additionalProperties": { "default": "", "type": "string" }, "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", "type": "object" }, "managedFields": { "description": "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry" } ], "default": {} }, "type": "array" }, "name": { "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "namespace": { "description": "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", "type": "string" }, "ownerReferences": { "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "uid", "x-kubernetes-patch-strategy": "merge" }, "resourceVersion": { "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" }, "uid": { "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference": { "description": "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", "properties": { "apiVersion": { "default": "", "description": "API version of the referent.", "type": "string" }, "blockOwnerDeletion": { "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", "type": "boolean" }, "controller": { "description": "If true, this reference points to the managing controller.", "type": "boolean" }, "kind": { "default": "", "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "default": "", "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "uid": { "default": "", "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "required": [ "apiVersion", "kind", "name", "uid" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Patch": { "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions": { "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", "properties": { "resourceVersion": { "description": "Specifies the target ResourceVersion", "type": "string" }, "uid": { "description": "Specifies the target UID.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Status": { "description": "Status is a return value for calls that don't return other objects.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "code": { "description": "Suggested HTTP return code for this status, 0 if not set.", "format": "int32", "type": "integer" }, "details": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails" } ], "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type." }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "message": { "description": "A human-readable description of the status of this operation.", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" }, "reason": { "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", "type": "string" }, "status": { "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Status", "version": "v1" }, { "group": "resource.k8s.io", "kind": "Status", "version": "v1alpha1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause": { "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", "properties": { "field": { "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", "type": "string" }, "message": { "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", "type": "string" }, "reason": { "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": { "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", "properties": { "causes": { "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause" } ], "default": {} }, "type": "array" }, "group": { "description": "The group attribute of the resource associated with the status StatusReason.", "type": "string" }, "kind": { "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", "type": "string" }, "retryAfterSeconds": { "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", "format": "int32", "type": "integer" }, "uid": { "description": "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Time": { "description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", "format": "date-time", "type": "string" }, "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent": { "description": "Event represents a single event to a watched resource.", "properties": { "object": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" } ], "default": {}, "description": "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context." }, "type": { "default": "", "type": "string" } }, "required": [ "type", "object" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta2" }, { "group": "batch", "kind": "WatchEvent", "version": "v1" }, { "group": "batch", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "extensions", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.runtime.RawExtension": { "description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", "type": "object" } }, "securitySchemes": { "BearerToken": { "description": "Bearer Token authentication", "in": "header", "name": "authorization", "type": "apiKey" } } }, "info": { "title": "Kubernetes", "version": "unversioned" }, "openapi": "3.0.0", "paths": { "/apis/discovery.k8s.io/v1/": { "get": { "description": "get available resources", "operationId": "getDiscoveryV1APIResources", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ] } }, "/apis/discovery.k8s.io/v1/endpointslices": { "get": { "description": "list or watch objects of kind EndpointSlice", "operationId": "listDiscoveryV1EndpointSliceForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices": { "delete": { "description": "delete collection of EndpointSlice", "operationId": "deleteDiscoveryV1CollectionNamespacedEndpointSlice", "parameters": [ { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "deletecollection", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "get": { "description": "list or watch objects of kind EndpointSlice", "operationId": "listDiscoveryV1NamespacedEndpointSlice", "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSliceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "list", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "parameters": [ { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "post": { "description": "create an EndpointSlice", "operationId": "createDiscoveryV1NamespacedEndpointSlice", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } }, "description": "Created" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "post", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } } }, "/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}": { "delete": { "description": "delete an EndpointSlice", "operationId": "deleteDiscoveryV1NamespacedEndpointSlice", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "in": "query", "name": "gracePeriodSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "in": "query", "name": "orphanDependents", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "in": "query", "name": "propagationPolicy", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "OK" }, "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status" } } }, "description": "Accepted" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "delete", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "get": { "description": "read the specified EndpointSlice", "operationId": "readDiscoveryV1NamespacedEndpointSlice", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "get", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "parameters": [ { "description": "name of the EndpointSlice", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } } ], "patch": { "description": "partially update the specified EndpointSlice", "operationId": "patchDiscoveryV1NamespacedEndpointSlice", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", "in": "query", "name": "force", "schema": { "type": "boolean", "uniqueItems": true } } ], "requestBody": { "content": { "application/apply-patch+yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } }, "application/strategic-merge-patch+json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "patch", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "put": { "description": "replace the specified EndpointSlice", "operationId": "replaceDiscoveryV1NamespacedEndpointSlice", "parameters": [ { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "in": "query", "name": "dryRun", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", "in": "query", "name": "fieldManager", "schema": { "type": "string", "uniqueItems": true } }, { "description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", "in": "query", "name": "fieldValidation", "schema": { "type": "string", "uniqueItems": true } } ], "requestBody": { "content": { "*/*": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } }, "description": "OK" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.api.discovery.v1.EndpointSlice" } } }, "description": "Created" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "put", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } } }, "/apis/discovery.k8s.io/v1/watch/endpointslices": { "get": { "description": "watch individual changes to a list of EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchDiscoveryV1EndpointSliceListForAllNamespaces", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/discovery.k8s.io/v1/watch/namespaces/{namespace}/endpointslices": { "get": { "description": "watch individual changes to a list of EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead.", "operationId": "watchDiscoveryV1NamespacedEndpointSliceList", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "watchlist", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] }, "/apis/discovery.k8s.io/v1/watch/namespaces/{namespace}/endpointslices/{name}": { "get": { "description": "watch changes to an object of kind EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", "operationId": "watchDiscoveryV1NamespacedEndpointSlice", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/json;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/vnd.kubernetes.protobuf;stream=watch": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "discovery_v1" ], "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "discovery.k8s.io", "kind": "EndpointSlice", "version": "v1" } }, "parameters": [ { "description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", "in": "query", "name": "allowWatchBookmarks", "schema": { "type": "boolean", "uniqueItems": true } }, { "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "in": "query", "name": "continue", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "in": "query", "name": "fieldSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "in": "query", "name": "labelSelector", "schema": { "type": "string", "uniqueItems": true } }, { "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "in": "query", "name": "limit", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "name of the EndpointSlice", "in": "path", "name": "name", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "object name and auth scope, such as for teams and projects", "in": "path", "name": "namespace", "required": true, "schema": { "type": "string", "uniqueItems": true } }, { "description": "If 'true', then the output is pretty printed.", "in": "query", "name": "pretty", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersion", "schema": { "type": "string", "uniqueItems": true } }, { "description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", "in": "query", "name": "resourceVersionMatch", "schema": { "type": "string", "uniqueItems": true } }, { "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "in": "query", "name": "timeoutSeconds", "schema": { "type": "integer", "uniqueItems": true } }, { "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "in": "query", "name": "watch", "schema": { "type": "boolean", "uniqueItems": true } } ] } } } apis__networking.k8s.io__v1alpha1_openapi.json000066400000000000000000001562271472614177300350530ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/openapi/openapitest/testdata{ "components": { "schemas": { "io.k8s.api.core.v1.NodeSelector": { "description": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", "properties": { "nodeSelectorTerms": { "description": "Required. A list of node selector terms. The terms are ORed.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorTerm" } ], "default": {} }, "type": "array" } }, "required": [ "nodeSelectorTerms" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.api.core.v1.NodeSelectorRequirement": { "description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "properties": { "key": { "default": "", "description": "The label key that the selector applies to.", "type": "string" }, "operator": { "default": "", "description": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", "type": "string" }, "values": { "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", "items": { "default": "", "type": "string" }, "type": "array" } }, "required": [ "key", "operator" ], "type": "object" }, "io.k8s.api.core.v1.NodeSelectorTerm": { "description": "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.", "properties": { "matchExpressions": { "description": "A list of node selector requirements by node's labels.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement" } ], "default": {} }, "type": "array" }, "matchFields": { "description": "A list of node selector requirements by node's fields.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.api.core.v1.NodeSelectorRequirement" } ], "default": {} }, "type": "array" } }, "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource": { "description": "APIResource specifies the name of a resource and whether it is namespaced.", "properties": { "categories": { "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", "items": { "default": "", "type": "string" }, "type": "array" }, "group": { "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", "type": "string" }, "kind": { "default": "", "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", "type": "string" }, "name": { "default": "", "description": "name is the plural name of the resource.", "type": "string" }, "namespaced": { "default": false, "description": "namespaced indicates if a resource is namespaced or not.", "type": "boolean" }, "shortNames": { "description": "shortNames is a list of suggested short names of the resource.", "items": { "default": "", "type": "string" }, "type": "array" }, "singularName": { "default": "", "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", "type": "string" }, "storageVersionHash": { "description": "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", "type": "string" }, "verbs": { "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", "items": { "default": "", "type": "string" }, "type": "array" }, "version": { "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", "type": "string" } }, "required": [ "name", "singularName", "namespaced", "kind", "verbs" ], "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList": { "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "groupVersion": { "default": "", "description": "groupVersion is the group and version this APIResourceList is for.", "type": "string" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "resources": { "description": "resources contains the name of the resources and if they are namespaced.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource" } ], "default": {} }, "type": "array" } }, "required": [ "groupVersion", "resources" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "APIResourceList", "version": "v1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions": { "description": "DeleteOptions may be provided when deleting an API object.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "dryRun": { "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", "items": { "default": "", "type": "string" }, "type": "array" }, "gracePeriodSeconds": { "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", "format": "int64", "type": "integer" }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "orphanDependents": { "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", "type": "boolean" }, "preconditions": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" } ], "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." }, "propagationPolicy": { "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admission.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "apps", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta1" }, { "group": "autoscaling", "kind": "DeleteOptions", "version": "v2beta2" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1" }, { "group": "batch", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "events.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "extensions", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1" }, { "group": "policy", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "DeleteOptions", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1": { "description": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta": { "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", "properties": { "continue": { "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", "type": "string" }, "remainingItemCount": { "description": "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", "format": "int64", "type": "integer" }, "resourceVersion": { "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry": { "description": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", "properties": { "apiVersion": { "description": "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", "type": "string" }, "fieldsType": { "description": "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", "type": "string" }, "fieldsV1": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1" } ], "description": "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type." }, "manager": { "description": "Manager is an identifier of the workflow managing these fields.", "type": "string" }, "operation": { "description": "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", "type": "string" }, "subresource": { "description": "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", "type": "string" }, "time": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over." } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta": { "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", "properties": { "annotations": { "additionalProperties": { "default": "", "type": "string" }, "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", "type": "object" }, "creationTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "default": {}, "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "deletionGracePeriodSeconds": { "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", "format": "int64", "type": "integer" }, "deletionTimestamp": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Time" } ], "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" }, "finalizers": { "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", "items": { "default": "", "type": "string" }, "type": "array", "x-kubernetes-patch-strategy": "merge" }, "generateName": { "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", "type": "string" }, "generation": { "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", "format": "int64", "type": "integer" }, "labels": { "additionalProperties": { "default": "", "type": "string" }, "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", "type": "object" }, "managedFields": { "description": "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry" } ], "default": {} }, "type": "array" }, "name": { "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "namespace": { "description": "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", "type": "string" }, "ownerReferences": { "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" } ], "default": {} }, "type": "array", "x-kubernetes-patch-merge-key": "uid", "x-kubernetes-patch-strategy": "merge" }, "resourceVersion": { "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "type": "string" }, "selfLink": { "description": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", "type": "string" }, "uid": { "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference": { "description": "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", "properties": { "apiVersion": { "default": "", "description": "API version of the referent.", "type": "string" }, "blockOwnerDeletion": { "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", "type": "boolean" }, "controller": { "description": "If true, this reference points to the managing controller.", "type": "boolean" }, "kind": { "default": "", "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "default": "", "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", "type": "string" }, "uid": { "default": "", "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "required": [ "apiVersion", "kind", "name", "uid" ], "type": "object", "x-kubernetes-map-type": "atomic" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Patch": { "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions": { "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", "properties": { "resourceVersion": { "description": "Specifies the target ResourceVersion", "type": "string" }, "uid": { "description": "Specifies the target UID.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Status": { "description": "Status is a return value for calls that don't return other objects.", "properties": { "apiVersion": { "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", "type": "string" }, "code": { "description": "Suggested HTTP return code for this status, 0 if not set.", "format": "int32", "type": "integer" }, "details": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails" } ], "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type." }, "kind": { "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "message": { "description": "A human-readable description of the status of this operation.", "type": "string" }, "metadata": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" } ], "default": {}, "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" }, "reason": { "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", "type": "string" }, "status": { "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "type": "string" } }, "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "Status", "version": "v1" }, { "group": "resource.k8s.io", "kind": "Status", "version": "v1alpha1" } ] }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause": { "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", "properties": { "field": { "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", "type": "string" }, "message": { "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", "type": "string" }, "reason": { "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available.", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": { "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", "properties": { "causes": { "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", "items": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause" } ], "default": {} }, "type": "array" }, "group": { "description": "The group attribute of the resource associated with the status StatusReason.", "type": "string" }, "kind": { "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "type": "string" }, "name": { "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", "type": "string" }, "retryAfterSeconds": { "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", "format": "int32", "type": "integer" }, "uid": { "description": "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", "type": "string" } }, "type": "object" }, "io.k8s.apimachinery.pkg.apis.meta.v1.Time": { "description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", "format": "date-time", "type": "string" }, "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent": { "description": "Event represents a single event to a watched resource.", "properties": { "object": { "allOf": [ { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.runtime.RawExtension" } ], "default": {}, "description": "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context." }, "type": { "default": "", "type": "string" } }, "required": [ "type", "object" ], "type": "object", "x-kubernetes-group-version-kind": [ { "group": "", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admission.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "admissionregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiextensions.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "apiregistration.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "apps", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "authentication.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta1" }, { "group": "autoscaling", "kind": "WatchEvent", "version": "v2beta2" }, { "group": "batch", "kind": "WatchEvent", "version": "v1" }, { "group": "batch", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "certificates.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "coordination.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "discovery.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "events.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "extensions", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta2" }, { "group": "flowcontrol.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1beta3" }, { "group": "imagepolicy.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "internal.apiserver.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "networking.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "node.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1" }, { "group": "policy", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "rbac.authorization.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "resource.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "scheduling.k8s.io", "kind": "WatchEvent", "version": "v1beta1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1alpha1" }, { "group": "storage.k8s.io", "kind": "WatchEvent", "version": "v1beta1" } ] }, "io.k8s.apimachinery.pkg.runtime.RawExtension": { "description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", "type": "object" } }, "securitySchemes": { "BearerToken": { "description": "Bearer Token authentication", "in": "header", "name": "authorization", "type": "apiKey" } } }, "info": { "title": "Kubernetes", "version": "unversioned" }, "openapi": "3.0.0", "paths": { "/apis/networking.k8s.io/v1alpha1/": { "get": { "description": "get available resources", "operationId": "getNetworkingV1alpha1APIResources", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/vnd.kubernetes.protobuf": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } }, "application/yaml": { "schema": { "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" } } }, "description": "OK" }, "401": { "description": "Unauthorized" } }, "tags": [ "networking_v1alpha1" ] } } } } kubernetes-client-go-a2dfcab/openapi/typeconverter.go000066400000000000000000000026361472614177300233020ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapi import ( "encoding/json" "fmt" "k8s.io/apimachinery/pkg/util/managedfields" "k8s.io/kube-openapi/pkg/spec3" "k8s.io/kube-openapi/pkg/validation/spec" ) func NewTypeConverter(client Client, preserveUnknownFields bool) (managedfields.TypeConverter, error) { spec := map[string]*spec.Schema{} paths, err := client.Paths() if err != nil { return nil, fmt.Errorf("failed to list paths: %w", err) } for _, gv := range paths { s, err := gv.Schema("application/json") if err != nil { return nil, fmt.Errorf("failed to download schema: %w", err) } var openapi spec3.OpenAPI if err := json.Unmarshal(s, &openapi); err != nil { return nil, fmt.Errorf("failed to parse schema: %w", err) } for k, v := range openapi.Components.Schemas { spec[k] = v } } return managedfields.NewTypeConverter(spec, preserveUnknownFields) } kubernetes-client-go-a2dfcab/openapi3/000077500000000000000000000000001472614177300201165ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/openapi3/root.go000066400000000000000000000132561472614177300214370ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapi3 import ( "encoding/json" "fmt" "sort" "strings" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/openapi" "k8s.io/kube-openapi/pkg/spec3" ) // Root interface defines functions implemented against the root // OpenAPI V3 document. The root OpenAPI V3 document maps the // API Server relative url for all GroupVersions to the relative // url for the OpenAPI relative url. Example for single GroupVersion // apps/v1: // // "apis/apps/v1": { // "ServerRelativeURL": "/openapi/v3/apis/apps/v1?hash=" // } type Root interface { // GroupVersions returns every GroupVersion for which there is an // OpenAPI V3 GroupVersion document. Returns an error for problems // retrieving or parsing the OpenAPI V3 root document. GroupVersions() ([]schema.GroupVersion, error) // GVSpec returns the specification for all the resources in a // GroupVersion as a pointer to a spec3.OpenAPI struct. // Returns an error for problems retrieving or parsing the root // document or GroupVersion OpenAPI V3 document. GVSpec(gv schema.GroupVersion) (*spec3.OpenAPI, error) // GVSpecAsMap returns the specification for all the resources in a // GroupVersion as unstructured bytes. Returns an error for // problems retrieving or parsing the root or GroupVersion // OpenAPI V3 document. GVSpecAsMap(gv schema.GroupVersion) (map[string]interface{}, error) } // root implements the Root interface, and encapsulates the // fields to retrieve, store the parsed OpenAPI V3 root document. type root struct { // OpenAPI client to retrieve the OpenAPI V3 documents. client openapi.Client } // Validate root implements the Root interface. var _ Root = &root{} // NewRoot returns a structure implementing the Root interface, // created with the passed rest client. func NewRoot(client openapi.Client) Root { return &root{client: client} } func (r *root) GroupVersions() ([]schema.GroupVersion, error) { paths, err := r.client.Paths() if err != nil { return nil, err } // Example GroupVersion API path: "apis/apps/v1" gvs := make([]schema.GroupVersion, 0, len(paths)) for gvAPIPath := range paths { gv, err := pathToGroupVersion(gvAPIPath) if err != nil { // Ignore paths which do not parse to GroupVersion continue } gvs = append(gvs, gv) } // Sort GroupVersions alphabetically sort.Slice(gvs, func(i, j int) bool { return gvs[i].String() < gvs[j].String() }) return gvs, nil } func (r *root) GVSpec(gv schema.GroupVersion) (*spec3.OpenAPI, error) { openAPISchemaBytes, err := r.retrieveGVBytes(gv) if err != nil { return nil, err } // Unmarshal the downloaded Group/Version bytes into the spec3.OpenAPI struct. var parsedV3Schema spec3.OpenAPI err = json.Unmarshal(openAPISchemaBytes, &parsedV3Schema) return &parsedV3Schema, err } func (r *root) GVSpecAsMap(gv schema.GroupVersion) (map[string]interface{}, error) { gvOpenAPIBytes, err := r.retrieveGVBytes(gv) if err != nil { return nil, err } // GroupVersion bytes into unstructured map[string] -> empty interface. var gvMap map[string]interface{} err = json.Unmarshal(gvOpenAPIBytes, &gvMap) return gvMap, err } // retrieveGVBytes returns the schema for a passed GroupVersion as an // unstructured slice of bytes or an error if there is a problem downloading // or if the passed GroupVersion is not supported. func (r *root) retrieveGVBytes(gv schema.GroupVersion) ([]byte, error) { paths, err := r.client.Paths() if err != nil { return nil, err } apiPath := gvToAPIPath(gv) gvOpenAPI, found := paths[apiPath] if !found { return nil, &GroupVersionNotFoundError{gv: gv} } return gvOpenAPI.Schema(runtime.ContentTypeJSON) } // gvToAPIPath maps the passed GroupVersion to a relative api // server url. Example: // // GroupVersion{Group: "apps", Version: "v1"} -> "apis/apps/v1". func gvToAPIPath(gv schema.GroupVersion) string { var resourcePath string if len(gv.Group) == 0 { resourcePath = fmt.Sprintf("api/%s", gv.Version) } else { resourcePath = fmt.Sprintf("apis/%s/%s", gv.Group, gv.Version) } return resourcePath } // pathToGroupVersion is a helper function parsing the passed relative // url into a GroupVersion. // // Example: apis/apps/v1 -> GroupVersion{Group: "apps", Version: "v1"} // Example: api/v1 -> GroupVersion{Group: "", Version: "v1"} func pathToGroupVersion(path string) (schema.GroupVersion, error) { var gv schema.GroupVersion parts := strings.Split(path, "/") if len(parts) < 2 { return gv, fmt.Errorf("Unable to parse api relative path: %s", path) } apiPrefix := parts[0] if apiPrefix == "apis" { // Example: apis/apps (without version) if len(parts) < 3 { return gv, fmt.Errorf("Group without Version not allowed") } gv.Group = parts[1] gv.Version = parts[2] } else if apiPrefix == "api" { gv.Version = parts[1] } else { return gv, fmt.Errorf("Unable to parse api relative path: %s", path) } return gv, nil } // Encapsulates GroupVersion not found as one of the paths // at OpenAPI V3 endpoint. type GroupVersionNotFoundError struct { gv schema.GroupVersion } func (r *GroupVersionNotFoundError) Error() string { return fmt.Sprintf("GroupVersion (%v) not found as OpenAPI V3 path", r.gv) } kubernetes-client-go-a2dfcab/openapi3/root_test.go000066400000000000000000000207051472614177300224730ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package openapi3 import ( "fmt" "reflect" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/openapi" "k8s.io/client-go/openapi/openapitest" ) func TestOpenAPIV3Root_GroupVersions(t *testing.T) { tests := []struct { name string paths map[string]openapi.GroupVersion expectedGVs []schema.GroupVersion forcedErr error }{ { name: "OpenAPI V3 Root: No openapi.Paths() equals no GroupVersions.", expectedGVs: []schema.GroupVersion{}, }, { name: "OpenAPI V3 Root: Single openapi.Path equals one GroupVersion.", paths: map[string]openapi.GroupVersion{ "apis/apps/v1": nil, }, expectedGVs: []schema.GroupVersion{ {Group: "apps", Version: "v1"}, }, }, { name: "OpenAPI V3 Root: Multiple openapi.Paths equals multiple GroupVersions.", paths: map[string]openapi.GroupVersion{ "apis/apps/v1": nil, "api/v1": nil, "apis/batch/v1beta1": nil, }, // Alphabetical ordering, since GV's are returned sorted. expectedGVs: []schema.GroupVersion{ {Group: "apps", Version: "v1"}, {Group: "batch", Version: "v1beta1"}, {Group: "", Version: "v1"}, }, }, { name: "Multiple GroupVersions, some invalid", paths: map[string]openapi.GroupVersion{ "apis/batch/v1beta1": nil, "api/v1": nil, "foo/apps/v1": nil, // bad prefix "apis/networking.k8s.io/v1alpha1": nil, "api": nil, // No version "apis/apps": nil, // Missing Version "apis/apps/v1": nil, }, // Alphabetical ordering, since GV's are returned sorted. expectedGVs: []schema.GroupVersion{ {Group: "apps", Version: "v1"}, {Group: "batch", Version: "v1beta1"}, {Group: "networking.k8s.io", Version: "v1alpha1"}, {Group: "", Version: "v1"}, }, }, { name: "OpenAPI V3 Root: Forced error returns error.", forcedErr: fmt.Errorf("openapi client error"), }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { fakeClient := openapitest.FakeClient{ PathsMap: test.paths, ForcedErr: test.forcedErr, } root := NewRoot(fakeClient) actualGVs, err := root.GroupVersions() if test.forcedErr != nil { require.Error(t, err) } else { require.NoError(t, err) } if !reflect.DeepEqual(test.expectedGVs, actualGVs) { t.Errorf("expected GroupVersions (%s), got (%s): (%s)\n", test.expectedGVs, actualGVs, err) } }) } } func TestOpenAPIV3Root_GVSpec(t *testing.T) { tests := []struct { name string gv schema.GroupVersion expectedPaths []string err error }{ { name: "OpenAPI V3 for apps/v1 works", gv: schema.GroupVersion{Group: "apps", Version: "v1"}, expectedPaths: []string{ "/apis/apps/v1/", "/apis/apps/v1/deployments", "/apis/apps/v1/replicasets", "/apis/apps/v1/daemonsets", }, }, { name: "OpenAPI V3 for networking/v1alpha1 works", gv: schema.GroupVersion{Group: "networking.k8s.io", Version: "v1alpha1"}, expectedPaths: []string{ "/apis/networking.k8s.io/v1alpha1/", }, }, { name: "OpenAPI V3 for batch/v1 works", gv: schema.GroupVersion{Group: "batch", Version: "v1"}, expectedPaths: []string{ "/apis/batch/v1/", "/apis/batch/v1/jobs", "/apis/batch/v1/cronjobs", }, }, { name: "OpenAPI V3 spec not found", gv: schema.GroupVersion{Group: "not", Version: "found"}, err: &GroupVersionNotFoundError{gv: schema.GroupVersion{Group: "not", Version: "found"}}, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { client := openapitest.NewEmbeddedFileClient() root := NewRoot(client) gvSpec, err := root.GVSpec(test.gv) if test.err != nil { assert.True(t, reflect.DeepEqual(test.err, err)) return } require.NoError(t, err) for _, path := range test.expectedPaths { if _, found := gvSpec.Paths.Paths[path]; !found { assert.True(t, found, "expected path not found (%s)\n", path) } } }) } } func TestOpenAPIV3Root_GVSpecAsMap(t *testing.T) { tests := []struct { name string gv schema.GroupVersion expectedPaths []string err error }{ { name: "OpenAPI V3 for apps/v1 works", gv: schema.GroupVersion{Group: "apps", Version: "v1"}, expectedPaths: []string{ "/apis/apps/v1/", "/apis/apps/v1/deployments", "/apis/apps/v1/replicasets", "/apis/apps/v1/daemonsets", }, }, { name: "OpenAPI V3 for networking/v1alpha1 works", gv: schema.GroupVersion{Group: "networking.k8s.io", Version: "v1alpha1"}, expectedPaths: []string{ "/apis/networking.k8s.io/v1alpha1/", }, }, { name: "OpenAPI V3 for batch/v1 works", gv: schema.GroupVersion{Group: "batch", Version: "v1"}, expectedPaths: []string{ "/apis/batch/v1/", "/apis/batch/v1/jobs", "/apis/batch/v1/cronjobs", }, }, { name: "OpenAPI V3 spec not found", gv: schema.GroupVersion{Group: "not", Version: "found"}, err: &GroupVersionNotFoundError{gv: schema.GroupVersion{Group: "not", Version: "found"}}, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { root := NewRoot(openapitest.NewEmbeddedFileClient()) gvSpecAsMap, err := root.GVSpecAsMap(test.gv) if test.err != nil { assert.True(t, reflect.DeepEqual(test.err, err)) return } require.NoError(t, err) for _, path := range test.expectedPaths { pathsMap := gvSpecAsMap["paths"] if _, found := pathsMap.(map[string]interface{})[path]; !found { assert.True(t, found, "expected path not found (%s)\n", path) } } }) } } func TestOpenAPIV3Root_GroupVersionToPath(t *testing.T) { tests := []struct { name string groupVersion schema.GroupVersion expectedPath string }{ { name: "OpenAPI V3 Root: Path to GroupVersion apps group", groupVersion: schema.GroupVersion{ Group: "apps", Version: "v1", }, expectedPath: "apis/apps/v1", }, { name: "OpenAPI V3 Root: Path to GroupVersion batch group", groupVersion: schema.GroupVersion{ Group: "batch", Version: "v1beta1", }, expectedPath: "apis/batch/v1beta1", }, { name: "OpenAPI V3 Root: Path to GroupVersion core group", groupVersion: schema.GroupVersion{ Version: "v1", }, expectedPath: "api/v1", }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { actualPath := gvToAPIPath(test.groupVersion) assert.Equal(t, test.expectedPath, actualPath, "expected API path (%s), got (%s)", test.expectedPath, actualPath) }) } } func TestOpenAPIV3Root_PathToGroupVersion(t *testing.T) { tests := []struct { name string path string expectedGV schema.GroupVersion expectedErr bool }{ { name: "OpenAPI V3 Root: Path to GroupVersion apps/v1 group", path: "apis/apps/v1", expectedGV: schema.GroupVersion{ Group: "apps", Version: "v1", }, }, { name: "Group without Version throws error", path: "apis/apps", expectedErr: true, }, { name: "OpenAPI V3 Root: Path to GroupVersion batch group", path: "apis/batch/v1beta1", expectedGV: schema.GroupVersion{ Group: "batch", Version: "v1beta1", }, }, { name: "OpenAPI V3 Root: Path to GroupVersion core group", path: "api/v1", expectedGV: schema.GroupVersion{ Version: "v1", }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { actualGV, err := pathToGroupVersion(test.path) if test.expectedErr { require.Error(t, err, "should have received error for path: %s", test.path) } else { require.NoError(t, err, "expected no error, got (%v)", err) assert.Equal(t, test.expectedGV, actualGV, "expected GroupVersion (%s), got (%s)", test.expectedGV, actualGV) } }) } } kubernetes-client-go-a2dfcab/pkg/000077500000000000000000000000001472614177300171615ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/pkg/apis/000077500000000000000000000000001472614177300201155ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/000077500000000000000000000000001472614177300243335ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/OWNERS000066400000000000000000000003231472614177300252710ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners # approval on api packages bubbles to api-approvers reviewers: - sig-auth-authenticators-approvers - sig-auth-authenticators-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/doc.go000066400000000000000000000013341472614177300254300ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:deepcopy-gen=package // +groupName=client.authentication.k8s.io package clientauthentication // import "k8s.io/client-go/pkg/apis/clientauthentication" kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/install/000077500000000000000000000000001472614177300260015ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/install/install.go000066400000000000000000000023271472614177300300020ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package install installs the experimental API group, making it available as // an option to all of the API encoding/decoding machinery. package install import ( "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/pkg/apis/clientauthentication" "k8s.io/client-go/pkg/apis/clientauthentication/v1" "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" ) // Install registers the API group and adds types to a scheme func Install(scheme *runtime.Scheme) { utilruntime.Must(clientauthentication.AddToScheme(scheme)) utilruntime.Must(v1.AddToScheme(scheme)) utilruntime.Must(v1beta1.AddToScheme(scheme)) } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/register.go000066400000000000000000000030601472614177300265050ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientauthentication import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "client.authentication.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) schema.GroupKind { return SchemeGroupVersion.WithKind(kind).GroupKind() } // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &ExecCredential{}, ) return nil } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/types.go000066400000000000000000000120501472614177300260240ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientauthentication import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ExecCredential is used by exec-based plugins to communicate credentials to // HTTP transports. type ExecCredential struct { metav1.TypeMeta // Spec holds information passed to the plugin by the transport. This contains // request and runtime specific information, such as if the session is interactive. Spec ExecCredentialSpec // Status is filled in by the plugin and holds the credentials that the transport // should use to contact the API. // +optional Status *ExecCredentialStatus } // ExecCredentialSpec holds request and runtime specific information provided by // the transport. type ExecCredentialSpec struct { // Interactive is true when the transport detects the command is being called from an // interactive prompt, i.e., when stdin has been passed to this exec plugin. // +optional Interactive bool // Cluster contains information to allow an exec plugin to communicate with the // kubernetes cluster being authenticated to. Note that Cluster is non-nil only // when provideClusterInfo is set to true in the exec provider config (i.e., // ExecConfig.ProvideClusterInfo). // +optional Cluster *Cluster } // ExecCredentialStatus holds credentials for the transport to use. type ExecCredentialStatus struct { // ExpirationTimestamp indicates a time when the provided credentials expire. // +optional ExpirationTimestamp *metav1.Time // Token is a bearer token used by the client for request authentication. // +optional Token string `datapolicy:"token"` // PEM-encoded client TLS certificate. // +optional ClientCertificateData string // PEM-encoded client TLS private key. // +optional ClientKeyData string `datapolicy:"secret-key"` } // Cluster contains information to allow an exec plugin to communicate // with the kubernetes cluster being authenticated to. // // To ensure that this struct contains everything someone would need to communicate // with a kubernetes cluster (just like they would via a kubeconfig), the fields // should shadow "k8s.io/client-go/tools/clientcmd/api/v1".Cluster, with the exception // of CertificateAuthority, since CA data will always be passed to the plugin as bytes. type Cluster struct { // Server is the address of the kubernetes cluster (https://hostname:port). Server string // TLSServerName is passed to the server for SNI and is used in the client to // check server certificates against. If ServerName is empty, the hostname // used to contact the server is used. // +optional TLSServerName string // InsecureSkipTLSVerify skips the validity check for the server's certificate. // This will make your HTTPS connections insecure. // +optional InsecureSkipTLSVerify bool // CAData contains PEM-encoded certificate authority certificates. // If empty, system roots should be used. // +listType=atomic // +optional CertificateAuthorityData []byte // ProxyURL is the URL to the proxy to be used for all requests to this // cluster. // +optional ProxyURL string // DisableCompression allows client to opt-out of response compression for all requests to the server. This is useful // to speed up requests (specifically lists) when client-server network bandwidth is ample, by saving time on // compression (server-side) and decompression (client-side): https://github.com/kubernetes/kubernetes/issues/112296. // +optional DisableCompression bool // Config holds additional config data that is specific to the exec // plugin with regards to the cluster being authenticated to. // // This data is sourced from the clientcmd Cluster object's // extensions[client.authentication.k8s.io/exec] field: // // clusters: // - name: my-cluster // cluster: // ... // extensions: // - name: client.authentication.k8s.io/exec # reserved extension name for per cluster exec config // extension: // audience: 06e3fbd18de8 # arbitrary config // // In some environments, the user config may be exactly the same across many clusters // (i.e. call this exec plugin) minus some details that are specific to each cluster // such as the audience. This field allows the per cluster config to be directly // specified with the cluster info. Using this field to store secret data is not // recommended as one of the prime benefits of exec plugins is that no secrets need // to be stored directly in the kubeconfig. // +optional Config runtime.Object } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1/000077500000000000000000000000001472614177300246615ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1/doc.go000066400000000000000000000015141472614177300257560ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:deepcopy-gen=package // +k8s:conversion-gen=k8s.io/client-go/pkg/apis/clientauthentication // +k8s:openapi-gen=true // +k8s:defaulter-gen=TypeMeta // +groupName=client.authentication.k8s.io package v1 // import "k8s.io/client-go/pkg/apis/clientauthentication/v1" kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1/register.go000066400000000000000000000033741472614177300270430ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "client.authentication.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( SchemeBuilder runtime.SchemeBuilder localSchemeBuilder = &SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. localSchemeBuilder.Register(addKnownTypes) } func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &ExecCredential{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1/types.go000066400000000000000000000130271472614177300263570ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ExecCredential is used by exec-based plugins to communicate credentials to // HTTP transports. type ExecCredential struct { metav1.TypeMeta `json:",inline"` // Spec holds information passed to the plugin by the transport. Spec ExecCredentialSpec `json:"spec,omitempty"` // Status is filled in by the plugin and holds the credentials that the transport // should use to contact the API. // +optional Status *ExecCredentialStatus `json:"status,omitempty"` } // ExecCredentialSpec holds request and runtime specific information provided by // the transport. type ExecCredentialSpec struct { // Cluster contains information to allow an exec plugin to communicate with the // kubernetes cluster being authenticated to. Note that Cluster is non-nil only // when provideClusterInfo is set to true in the exec provider config (i.e., // ExecConfig.ProvideClusterInfo). // +optional Cluster *Cluster `json:"cluster,omitempty"` // Interactive declares whether stdin has been passed to this exec plugin. Interactive bool `json:"interactive"` } // ExecCredentialStatus holds credentials for the transport to use. // // Token and ClientKeyData are sensitive fields. This data should only be // transmitted in-memory between client and exec plugin process. Exec plugin // itself should at least be protected via file permissions. type ExecCredentialStatus struct { // ExpirationTimestamp indicates a time when the provided credentials expire. // +optional ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"` // Token is a bearer token used by the client for request authentication. Token string `json:"token,omitempty" datapolicy:"token"` // PEM-encoded client TLS certificates (including intermediates, if any). ClientCertificateData string `json:"clientCertificateData,omitempty"` // PEM-encoded private key for the above certificate. ClientKeyData string `json:"clientKeyData,omitempty" datapolicy:"security-key"` } // Cluster contains information to allow an exec plugin to communicate // with the kubernetes cluster being authenticated to. // // To ensure that this struct contains everything someone would need to communicate // with a kubernetes cluster (just like they would via a kubeconfig), the fields // should shadow "k8s.io/client-go/tools/clientcmd/api/v1".Cluster, with the exception // of CertificateAuthority, since CA data will always be passed to the plugin as bytes. type Cluster struct { // Server is the address of the kubernetes cluster (https://hostname:port). Server string `json:"server"` // TLSServerName is passed to the server for SNI and is used in the client to // check server certificates against. If ServerName is empty, the hostname // used to contact the server is used. // +optional TLSServerName string `json:"tls-server-name,omitempty"` // InsecureSkipTLSVerify skips the validity check for the server's certificate. // This will make your HTTPS connections insecure. // +optional InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"` // CAData contains PEM-encoded certificate authority certificates. // If empty, system roots should be used. // +listType=atomic // +optional CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"` // ProxyURL is the URL to the proxy to be used for all requests to this // cluster. // +optional ProxyURL string `json:"proxy-url,omitempty"` // DisableCompression allows client to opt-out of response compression for all requests to the server. This is useful // to speed up requests (specifically lists) when client-server network bandwidth is ample, by saving time on // compression (server-side) and decompression (client-side): https://github.com/kubernetes/kubernetes/issues/112296. // +optional DisableCompression bool `json:"disable-compression,omitempty"` // Config holds additional config data that is specific to the exec // plugin with regards to the cluster being authenticated to. // // This data is sourced from the clientcmd Cluster object's // extensions[client.authentication.k8s.io/exec] field: // // clusters: // - name: my-cluster // cluster: // ... // extensions: // - name: client.authentication.k8s.io/exec # reserved extension name for per cluster exec config // extension: // audience: 06e3fbd18de8 # arbitrary config // // In some environments, the user config may be exactly the same across many clusters // (i.e. call this exec plugin) minus some details that are specific to each cluster // such as the audience. This field allows the per cluster config to be directly // specified with the cluster info. Using this field to store secret data is not // recommended as one of the prime benefits of exec plugins is that no secrets need // to be stored directly in the kubeconfig. // +optional Config runtime.RawExtension `json:"config,omitempty"` } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1/zz_generated.conversion.go000066400000000000000000000244311472614177300320610ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by conversion-gen. DO NOT EDIT. package v1 import ( unsafe "unsafe" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" clientauthentication "k8s.io/client-go/pkg/apis/clientauthentication" ) func init() { localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*clientauthentication.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_Cluster_To_clientauthentication_Cluster(a.(*Cluster), b.(*clientauthentication.Cluster), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*clientauthentication.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_clientauthentication_Cluster_To_v1_Cluster(a.(*clientauthentication.Cluster), b.(*Cluster), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*ExecCredential)(nil), (*clientauthentication.ExecCredential)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_ExecCredential_To_clientauthentication_ExecCredential(a.(*ExecCredential), b.(*clientauthentication.ExecCredential), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*clientauthentication.ExecCredential)(nil), (*ExecCredential)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_clientauthentication_ExecCredential_To_v1_ExecCredential(a.(*clientauthentication.ExecCredential), b.(*ExecCredential), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*ExecCredentialSpec)(nil), (*clientauthentication.ExecCredentialSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(a.(*ExecCredentialSpec), b.(*clientauthentication.ExecCredentialSpec), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*clientauthentication.ExecCredentialSpec)(nil), (*ExecCredentialSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_clientauthentication_ExecCredentialSpec_To_v1_ExecCredentialSpec(a.(*clientauthentication.ExecCredentialSpec), b.(*ExecCredentialSpec), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*ExecCredentialStatus)(nil), (*clientauthentication.ExecCredentialStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(a.(*ExecCredentialStatus), b.(*clientauthentication.ExecCredentialStatus), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*clientauthentication.ExecCredentialStatus)(nil), (*ExecCredentialStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_clientauthentication_ExecCredentialStatus_To_v1_ExecCredentialStatus(a.(*clientauthentication.ExecCredentialStatus), b.(*ExecCredentialStatus), scope) }); err != nil { return err } return nil } func autoConvert_v1_Cluster_To_clientauthentication_Cluster(in *Cluster, out *clientauthentication.Cluster, s conversion.Scope) error { out.Server = in.Server out.TLSServerName = in.TLSServerName out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) out.ProxyURL = in.ProxyURL out.DisableCompression = in.DisableCompression if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Config, &out.Config, s); err != nil { return err } return nil } // Convert_v1_Cluster_To_clientauthentication_Cluster is an autogenerated conversion function. func Convert_v1_Cluster_To_clientauthentication_Cluster(in *Cluster, out *clientauthentication.Cluster, s conversion.Scope) error { return autoConvert_v1_Cluster_To_clientauthentication_Cluster(in, out, s) } func autoConvert_clientauthentication_Cluster_To_v1_Cluster(in *clientauthentication.Cluster, out *Cluster, s conversion.Scope) error { out.Server = in.Server out.TLSServerName = in.TLSServerName out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) out.ProxyURL = in.ProxyURL out.DisableCompression = in.DisableCompression if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Config, &out.Config, s); err != nil { return err } return nil } // Convert_clientauthentication_Cluster_To_v1_Cluster is an autogenerated conversion function. func Convert_clientauthentication_Cluster_To_v1_Cluster(in *clientauthentication.Cluster, out *Cluster, s conversion.Scope) error { return autoConvert_clientauthentication_Cluster_To_v1_Cluster(in, out, s) } func autoConvert_v1_ExecCredential_To_clientauthentication_ExecCredential(in *ExecCredential, out *clientauthentication.ExecCredential, s conversion.Scope) error { if err := Convert_v1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(&in.Spec, &out.Spec, s); err != nil { return err } out.Status = (*clientauthentication.ExecCredentialStatus)(unsafe.Pointer(in.Status)) return nil } // Convert_v1_ExecCredential_To_clientauthentication_ExecCredential is an autogenerated conversion function. func Convert_v1_ExecCredential_To_clientauthentication_ExecCredential(in *ExecCredential, out *clientauthentication.ExecCredential, s conversion.Scope) error { return autoConvert_v1_ExecCredential_To_clientauthentication_ExecCredential(in, out, s) } func autoConvert_clientauthentication_ExecCredential_To_v1_ExecCredential(in *clientauthentication.ExecCredential, out *ExecCredential, s conversion.Scope) error { if err := Convert_clientauthentication_ExecCredentialSpec_To_v1_ExecCredentialSpec(&in.Spec, &out.Spec, s); err != nil { return err } out.Status = (*ExecCredentialStatus)(unsafe.Pointer(in.Status)) return nil } // Convert_clientauthentication_ExecCredential_To_v1_ExecCredential is an autogenerated conversion function. func Convert_clientauthentication_ExecCredential_To_v1_ExecCredential(in *clientauthentication.ExecCredential, out *ExecCredential, s conversion.Scope) error { return autoConvert_clientauthentication_ExecCredential_To_v1_ExecCredential(in, out, s) } func autoConvert_v1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in *ExecCredentialSpec, out *clientauthentication.ExecCredentialSpec, s conversion.Scope) error { if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster *out = new(clientauthentication.Cluster) if err := Convert_v1_Cluster_To_clientauthentication_Cluster(*in, *out, s); err != nil { return err } } else { out.Cluster = nil } out.Interactive = in.Interactive return nil } // Convert_v1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec is an autogenerated conversion function. func Convert_v1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in *ExecCredentialSpec, out *clientauthentication.ExecCredentialSpec, s conversion.Scope) error { return autoConvert_v1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in, out, s) } func autoConvert_clientauthentication_ExecCredentialSpec_To_v1_ExecCredentialSpec(in *clientauthentication.ExecCredentialSpec, out *ExecCredentialSpec, s conversion.Scope) error { out.Interactive = in.Interactive if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster *out = new(Cluster) if err := Convert_clientauthentication_Cluster_To_v1_Cluster(*in, *out, s); err != nil { return err } } else { out.Cluster = nil } return nil } // Convert_clientauthentication_ExecCredentialSpec_To_v1_ExecCredentialSpec is an autogenerated conversion function. func Convert_clientauthentication_ExecCredentialSpec_To_v1_ExecCredentialSpec(in *clientauthentication.ExecCredentialSpec, out *ExecCredentialSpec, s conversion.Scope) error { return autoConvert_clientauthentication_ExecCredentialSpec_To_v1_ExecCredentialSpec(in, out, s) } func autoConvert_v1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in *ExecCredentialStatus, out *clientauthentication.ExecCredentialStatus, s conversion.Scope) error { out.ExpirationTimestamp = (*metav1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) out.Token = in.Token out.ClientCertificateData = in.ClientCertificateData out.ClientKeyData = in.ClientKeyData return nil } // Convert_v1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus is an autogenerated conversion function. func Convert_v1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in *ExecCredentialStatus, out *clientauthentication.ExecCredentialStatus, s conversion.Scope) error { return autoConvert_v1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in, out, s) } func autoConvert_clientauthentication_ExecCredentialStatus_To_v1_ExecCredentialStatus(in *clientauthentication.ExecCredentialStatus, out *ExecCredentialStatus, s conversion.Scope) error { out.ExpirationTimestamp = (*metav1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) out.Token = in.Token out.ClientCertificateData = in.ClientCertificateData out.ClientKeyData = in.ClientKeyData return nil } // Convert_clientauthentication_ExecCredentialStatus_To_v1_ExecCredentialStatus is an autogenerated conversion function. func Convert_clientauthentication_ExecCredentialStatus_To_v1_ExecCredentialStatus(in *clientauthentication.ExecCredentialStatus, out *ExecCredentialStatus, s conversion.Scope) error { return autoConvert_clientauthentication_ExecCredentialStatus_To_v1_ExecCredentialStatus(in, out, s) } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1/zz_generated.deepcopy.go000066400000000000000000000066001472614177300315020ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by deepcopy-gen. DO NOT EDIT. package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in if in.CertificateAuthorityData != nil { in, out := &in.CertificateAuthorityData, &out.CertificateAuthorityData *out = make([]byte, len(*in)) copy(*out, *in) } in.Config.DeepCopyInto(&out.Config) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. func (in *Cluster) DeepCopy() *Cluster { if in == nil { return nil } out := new(Cluster) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredential) DeepCopyInto(out *ExecCredential) { *out = *in out.TypeMeta = in.TypeMeta in.Spec.DeepCopyInto(&out.Spec) if in.Status != nil { in, out := &in.Status, &out.Status *out = new(ExecCredentialStatus) (*in).DeepCopyInto(*out) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredential. func (in *ExecCredential) DeepCopy() *ExecCredential { if in == nil { return nil } out := new(ExecCredential) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *ExecCredential) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredentialSpec) DeepCopyInto(out *ExecCredentialSpec) { *out = *in if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster *out = new(Cluster) (*in).DeepCopyInto(*out) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialSpec. func (in *ExecCredentialSpec) DeepCopy() *ExecCredentialSpec { if in == nil { return nil } out := new(ExecCredentialSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredentialStatus) DeepCopyInto(out *ExecCredentialStatus) { *out = *in if in.ExpirationTimestamp != nil { in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp *out = (*in).DeepCopy() } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialStatus. func (in *ExecCredentialStatus) DeepCopy() *ExecCredentialStatus { if in == nil { return nil } out := new(ExecCredentialStatus) in.DeepCopyInto(out) return out } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1/zz_generated.defaults.go000066400000000000000000000017571472614177300315110ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by defaulter-gen. DO NOT EDIT. package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // RegisterDefaults adds defaulters functions to the given scheme. // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { return nil } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1beta1/000077500000000000000000000000001472614177300255765ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1beta1/doc.go000066400000000000000000000015261472614177300266760ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:deepcopy-gen=package // +k8s:conversion-gen=k8s.io/client-go/pkg/apis/clientauthentication // +k8s:openapi-gen=true // +k8s:defaulter-gen=TypeMeta // +groupName=client.authentication.k8s.io package v1beta1 // import "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1beta1/register.go000066400000000000000000000034061472614177300277540ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "client.authentication.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( SchemeBuilder runtime.SchemeBuilder localSchemeBuilder = &SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. localSchemeBuilder.Register(addKnownTypes) } func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &ExecCredential{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1beta1/types.go000066400000000000000000000130341472614177300272720ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ExecCredential is used by exec-based plugins to communicate credentials to // HTTP transports. type ExecCredential struct { metav1.TypeMeta `json:",inline"` // Spec holds information passed to the plugin by the transport. Spec ExecCredentialSpec `json:"spec,omitempty"` // Status is filled in by the plugin and holds the credentials that the transport // should use to contact the API. // +optional Status *ExecCredentialStatus `json:"status,omitempty"` } // ExecCredentialSpec holds request and runtime specific information provided by // the transport. type ExecCredentialSpec struct { // Cluster contains information to allow an exec plugin to communicate with the // kubernetes cluster being authenticated to. Note that Cluster is non-nil only // when provideClusterInfo is set to true in the exec provider config (i.e., // ExecConfig.ProvideClusterInfo). // +optional Cluster *Cluster `json:"cluster,omitempty"` // Interactive declares whether stdin has been passed to this exec plugin. Interactive bool `json:"interactive"` } // ExecCredentialStatus holds credentials for the transport to use. // // Token and ClientKeyData are sensitive fields. This data should only be // transmitted in-memory between client and exec plugin process. Exec plugin // itself should at least be protected via file permissions. type ExecCredentialStatus struct { // ExpirationTimestamp indicates a time when the provided credentials expire. // +optional ExpirationTimestamp *metav1.Time `json:"expirationTimestamp,omitempty"` // Token is a bearer token used by the client for request authentication. Token string `json:"token,omitempty" datapolicy:"token"` // PEM-encoded client TLS certificates (including intermediates, if any). ClientCertificateData string `json:"clientCertificateData,omitempty"` // PEM-encoded private key for the above certificate. ClientKeyData string `json:"clientKeyData,omitempty" datapolicy:"security-key"` } // Cluster contains information to allow an exec plugin to communicate // with the kubernetes cluster being authenticated to. // // To ensure that this struct contains everything someone would need to communicate // with a kubernetes cluster (just like they would via a kubeconfig), the fields // should shadow "k8s.io/client-go/tools/clientcmd/api/v1".Cluster, with the exception // of CertificateAuthority, since CA data will always be passed to the plugin as bytes. type Cluster struct { // Server is the address of the kubernetes cluster (https://hostname:port). Server string `json:"server"` // TLSServerName is passed to the server for SNI and is used in the client to // check server certificates against. If ServerName is empty, the hostname // used to contact the server is used. // +optional TLSServerName string `json:"tls-server-name,omitempty"` // InsecureSkipTLSVerify skips the validity check for the server's certificate. // This will make your HTTPS connections insecure. // +optional InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"` // CAData contains PEM-encoded certificate authority certificates. // If empty, system roots should be used. // +listType=atomic // +optional CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"` // ProxyURL is the URL to the proxy to be used for all requests to this // cluster. // +optional ProxyURL string `json:"proxy-url,omitempty"` // DisableCompression allows client to opt-out of response compression for all requests to the server. This is useful // to speed up requests (specifically lists) when client-server network bandwidth is ample, by saving time on // compression (server-side) and decompression (client-side): https://github.com/kubernetes/kubernetes/issues/112296. // +optional DisableCompression bool `json:"disable-compression,omitempty"` // Config holds additional config data that is specific to the exec // plugin with regards to the cluster being authenticated to. // // This data is sourced from the clientcmd Cluster object's // extensions[client.authentication.k8s.io/exec] field: // // clusters: // - name: my-cluster // cluster: // ... // extensions: // - name: client.authentication.k8s.io/exec # reserved extension name for per cluster exec config // extension: // audience: 06e3fbd18de8 # arbitrary config // // In some environments, the user config may be exactly the same across many clusters // (i.e. call this exec plugin) minus some details that are specific to each cluster // such as the audience. This field allows the per cluster config to be directly // specified with the cluster info. Using this field to store secret data is not // recommended as one of the prime benefits of exec plugins is that no secrets need // to be stored directly in the kubeconfig. // +optional Config runtime.RawExtension `json:"config,omitempty"` } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go000066400000000000000000000247561472614177300330100ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by conversion-gen. DO NOT EDIT. package v1beta1 import ( unsafe "unsafe" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" clientauthentication "k8s.io/client-go/pkg/apis/clientauthentication" ) func init() { localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*clientauthentication.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Cluster_To_clientauthentication_Cluster(a.(*Cluster), b.(*clientauthentication.Cluster), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*clientauthentication.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_clientauthentication_Cluster_To_v1beta1_Cluster(a.(*clientauthentication.Cluster), b.(*Cluster), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*ExecCredential)(nil), (*clientauthentication.ExecCredential)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ExecCredential_To_clientauthentication_ExecCredential(a.(*ExecCredential), b.(*clientauthentication.ExecCredential), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*clientauthentication.ExecCredential)(nil), (*ExecCredential)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_clientauthentication_ExecCredential_To_v1beta1_ExecCredential(a.(*clientauthentication.ExecCredential), b.(*ExecCredential), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*ExecCredentialSpec)(nil), (*clientauthentication.ExecCredentialSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(a.(*ExecCredentialSpec), b.(*clientauthentication.ExecCredentialSpec), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*clientauthentication.ExecCredentialSpec)(nil), (*ExecCredentialSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSpec(a.(*clientauthentication.ExecCredentialSpec), b.(*ExecCredentialSpec), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*ExecCredentialStatus)(nil), (*clientauthentication.ExecCredentialStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(a.(*ExecCredentialStatus), b.(*clientauthentication.ExecCredentialStatus), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*clientauthentication.ExecCredentialStatus)(nil), (*ExecCredentialStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_clientauthentication_ExecCredentialStatus_To_v1beta1_ExecCredentialStatus(a.(*clientauthentication.ExecCredentialStatus), b.(*ExecCredentialStatus), scope) }); err != nil { return err } return nil } func autoConvert_v1beta1_Cluster_To_clientauthentication_Cluster(in *Cluster, out *clientauthentication.Cluster, s conversion.Scope) error { out.Server = in.Server out.TLSServerName = in.TLSServerName out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) out.ProxyURL = in.ProxyURL out.DisableCompression = in.DisableCompression if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Config, &out.Config, s); err != nil { return err } return nil } // Convert_v1beta1_Cluster_To_clientauthentication_Cluster is an autogenerated conversion function. func Convert_v1beta1_Cluster_To_clientauthentication_Cluster(in *Cluster, out *clientauthentication.Cluster, s conversion.Scope) error { return autoConvert_v1beta1_Cluster_To_clientauthentication_Cluster(in, out, s) } func autoConvert_clientauthentication_Cluster_To_v1beta1_Cluster(in *clientauthentication.Cluster, out *Cluster, s conversion.Scope) error { out.Server = in.Server out.TLSServerName = in.TLSServerName out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) out.ProxyURL = in.ProxyURL out.DisableCompression = in.DisableCompression if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Config, &out.Config, s); err != nil { return err } return nil } // Convert_clientauthentication_Cluster_To_v1beta1_Cluster is an autogenerated conversion function. func Convert_clientauthentication_Cluster_To_v1beta1_Cluster(in *clientauthentication.Cluster, out *Cluster, s conversion.Scope) error { return autoConvert_clientauthentication_Cluster_To_v1beta1_Cluster(in, out, s) } func autoConvert_v1beta1_ExecCredential_To_clientauthentication_ExecCredential(in *ExecCredential, out *clientauthentication.ExecCredential, s conversion.Scope) error { if err := Convert_v1beta1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(&in.Spec, &out.Spec, s); err != nil { return err } out.Status = (*clientauthentication.ExecCredentialStatus)(unsafe.Pointer(in.Status)) return nil } // Convert_v1beta1_ExecCredential_To_clientauthentication_ExecCredential is an autogenerated conversion function. func Convert_v1beta1_ExecCredential_To_clientauthentication_ExecCredential(in *ExecCredential, out *clientauthentication.ExecCredential, s conversion.Scope) error { return autoConvert_v1beta1_ExecCredential_To_clientauthentication_ExecCredential(in, out, s) } func autoConvert_clientauthentication_ExecCredential_To_v1beta1_ExecCredential(in *clientauthentication.ExecCredential, out *ExecCredential, s conversion.Scope) error { if err := Convert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSpec(&in.Spec, &out.Spec, s); err != nil { return err } out.Status = (*ExecCredentialStatus)(unsafe.Pointer(in.Status)) return nil } // Convert_clientauthentication_ExecCredential_To_v1beta1_ExecCredential is an autogenerated conversion function. func Convert_clientauthentication_ExecCredential_To_v1beta1_ExecCredential(in *clientauthentication.ExecCredential, out *ExecCredential, s conversion.Scope) error { return autoConvert_clientauthentication_ExecCredential_To_v1beta1_ExecCredential(in, out, s) } func autoConvert_v1beta1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in *ExecCredentialSpec, out *clientauthentication.ExecCredentialSpec, s conversion.Scope) error { if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster *out = new(clientauthentication.Cluster) if err := Convert_v1beta1_Cluster_To_clientauthentication_Cluster(*in, *out, s); err != nil { return err } } else { out.Cluster = nil } out.Interactive = in.Interactive return nil } // Convert_v1beta1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec is an autogenerated conversion function. func Convert_v1beta1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in *ExecCredentialSpec, out *clientauthentication.ExecCredentialSpec, s conversion.Scope) error { return autoConvert_v1beta1_ExecCredentialSpec_To_clientauthentication_ExecCredentialSpec(in, out, s) } func autoConvert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSpec(in *clientauthentication.ExecCredentialSpec, out *ExecCredentialSpec, s conversion.Scope) error { out.Interactive = in.Interactive if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster *out = new(Cluster) if err := Convert_clientauthentication_Cluster_To_v1beta1_Cluster(*in, *out, s); err != nil { return err } } else { out.Cluster = nil } return nil } // Convert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSpec is an autogenerated conversion function. func Convert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSpec(in *clientauthentication.ExecCredentialSpec, out *ExecCredentialSpec, s conversion.Scope) error { return autoConvert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSpec(in, out, s) } func autoConvert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in *ExecCredentialStatus, out *clientauthentication.ExecCredentialStatus, s conversion.Scope) error { out.ExpirationTimestamp = (*v1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) out.Token = in.Token out.ClientCertificateData = in.ClientCertificateData out.ClientKeyData = in.ClientKeyData return nil } // Convert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus is an autogenerated conversion function. func Convert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in *ExecCredentialStatus, out *clientauthentication.ExecCredentialStatus, s conversion.Scope) error { return autoConvert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in, out, s) } func autoConvert_clientauthentication_ExecCredentialStatus_To_v1beta1_ExecCredentialStatus(in *clientauthentication.ExecCredentialStatus, out *ExecCredentialStatus, s conversion.Scope) error { out.ExpirationTimestamp = (*v1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) out.Token = in.Token out.ClientCertificateData = in.ClientCertificateData out.ClientKeyData = in.ClientKeyData return nil } // Convert_clientauthentication_ExecCredentialStatus_To_v1beta1_ExecCredentialStatus is an autogenerated conversion function. func Convert_clientauthentication_ExecCredentialStatus_To_v1beta1_ExecCredentialStatus(in *clientauthentication.ExecCredentialStatus, out *ExecCredentialStatus, s conversion.Scope) error { return autoConvert_clientauthentication_ExecCredentialStatus_To_v1beta1_ExecCredentialStatus(in, out, s) } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1beta1/zz_generated.deepcopy.go000066400000000000000000000066051472614177300324240ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by deepcopy-gen. DO NOT EDIT. package v1beta1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in if in.CertificateAuthorityData != nil { in, out := &in.CertificateAuthorityData, &out.CertificateAuthorityData *out = make([]byte, len(*in)) copy(*out, *in) } in.Config.DeepCopyInto(&out.Config) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. func (in *Cluster) DeepCopy() *Cluster { if in == nil { return nil } out := new(Cluster) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredential) DeepCopyInto(out *ExecCredential) { *out = *in out.TypeMeta = in.TypeMeta in.Spec.DeepCopyInto(&out.Spec) if in.Status != nil { in, out := &in.Status, &out.Status *out = new(ExecCredentialStatus) (*in).DeepCopyInto(*out) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredential. func (in *ExecCredential) DeepCopy() *ExecCredential { if in == nil { return nil } out := new(ExecCredential) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *ExecCredential) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredentialSpec) DeepCopyInto(out *ExecCredentialSpec) { *out = *in if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster *out = new(Cluster) (*in).DeepCopyInto(*out) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialSpec. func (in *ExecCredentialSpec) DeepCopy() *ExecCredentialSpec { if in == nil { return nil } out := new(ExecCredentialSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredentialStatus) DeepCopyInto(out *ExecCredentialStatus) { *out = *in if in.ExpirationTimestamp != nil { in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp *out = (*in).DeepCopy() } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialStatus. func (in *ExecCredentialStatus) DeepCopy() *ExecCredentialStatus { if in == nil { return nil } out := new(ExecCredentialStatus) in.DeepCopyInto(out) return out } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/v1beta1/zz_generated.defaults.go000066400000000000000000000017641472614177300324240ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by defaulter-gen. DO NOT EDIT. package v1beta1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // RegisterDefaults adds defaulters functions to the given scheme. // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { return nil } kubernetes-client-go-a2dfcab/pkg/apis/clientauthentication/zz_generated.deepcopy.go000066400000000000000000000066611472614177300311630ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by deepcopy-gen. DO NOT EDIT. package clientauthentication import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in if in.CertificateAuthorityData != nil { in, out := &in.CertificateAuthorityData, &out.CertificateAuthorityData *out = make([]byte, len(*in)) copy(*out, *in) } if in.Config != nil { out.Config = in.Config.DeepCopyObject() } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. func (in *Cluster) DeepCopy() *Cluster { if in == nil { return nil } out := new(Cluster) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredential) DeepCopyInto(out *ExecCredential) { *out = *in out.TypeMeta = in.TypeMeta in.Spec.DeepCopyInto(&out.Spec) if in.Status != nil { in, out := &in.Status, &out.Status *out = new(ExecCredentialStatus) (*in).DeepCopyInto(*out) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredential. func (in *ExecCredential) DeepCopy() *ExecCredential { if in == nil { return nil } out := new(ExecCredential) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *ExecCredential) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredentialSpec) DeepCopyInto(out *ExecCredentialSpec) { *out = *in if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster *out = new(Cluster) (*in).DeepCopyInto(*out) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialSpec. func (in *ExecCredentialSpec) DeepCopy() *ExecCredentialSpec { if in == nil { return nil } out := new(ExecCredentialSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecCredentialStatus) DeepCopyInto(out *ExecCredentialStatus) { *out = *in if in.ExpirationTimestamp != nil { in, out := &in.ExpirationTimestamp, &out.ExpirationTimestamp *out = (*in).DeepCopy() } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecCredentialStatus. func (in *ExecCredentialStatus) DeepCopy() *ExecCredentialStatus { if in == nil { return nil } out := new(ExecCredentialStatus) in.DeepCopyInto(out) return out } kubernetes-client-go-a2dfcab/pkg/version/000077500000000000000000000000001472614177300206465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/pkg/version/base.go000066400000000000000000000056621472614177300221200ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package version // Base version information. // // This is the fallback data used when version information from git is not // provided via go ldflags. It provides an approximation of the Kubernetes // version for ad-hoc builds (e.g. `go build`) that cannot get the version // information from git. // // If you are looking at these fields in the git tree, they look // strange. They are modified on the fly by the build process. The // in-tree values are dummy values used for "git archive", which also // works for GitHub tar downloads. // // When releasing a new Kubernetes version, this file is updated by // build/mark_new_version.sh to reflect the new version, and then a // git annotated tag (using format vX.Y where X == Major version and Y // == Minor version) is created to point to the commit that updates // pkg/version/base.go var ( // TODO: Deprecate gitMajor and gitMinor, use only gitVersion // instead. First step in deprecation, keep the fields but make // them irrelevant. (Next we'll take it out, which may muck with // scripts consuming the kubectl version output - but most of // these should be looking at gitVersion already anyways.) gitMajor string = "" // major version, always numeric gitMinor string = "" // minor version, numeric possibly followed by "+" // semantic version, derived by build scripts (see // https://github.com/kubernetes/sig-release/blob/master/release-engineering/versioning.md#kubernetes-release-versioning // https://kubernetes.io/releases/version-skew-policy/ // for a detailed discussion of this field) // // TODO: This field is still called "gitVersion" for legacy // reasons. For prerelease versions, the build metadata on the // semantic version is a git hash, but the version itself is no // longer the direct output of "git describe", but a slight // translation to be semver compliant. // NOTE: The $Format strings are replaced during 'git archive' thanks to the // companion .gitattributes file containing 'export-subst' in this same // directory. See also https://git-scm.com/docs/gitattributes gitVersion string = "v0.0.0-master+$Format:%H$" gitCommit string = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD) gitTreeState string = "" // state of git tree, either "clean" or "dirty" buildDate string = "1970-01-01T00:00:00Z" // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ') ) kubernetes-client-go-a2dfcab/pkg/version/doc.go000066400000000000000000000013631472614177300217450ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:openapi-gen=true // Package version supplies version information collected at build time to // kubernetes components. package version // import "k8s.io/client-go/pkg/version" kubernetes-client-go-a2dfcab/pkg/version/version.go000066400000000000000000000024051472614177300226630ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package version import ( "fmt" "runtime" apimachineryversion "k8s.io/apimachinery/pkg/version" ) // Get returns the overall codebase version. It's for detecting // what code a binary was built from. func Get() apimachineryversion.Info { // These variables typically come from -ldflags settings and in // their absence fallback to the settings in pkg/version/base.go return apimachineryversion.Info{ Major: gitMajor, Minor: gitMinor, GitVersion: gitVersion, GitCommit: gitCommit, GitTreeState: gitTreeState, BuildDate: buildDate, GoVersion: runtime.Version(), Compiler: runtime.Compiler, Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), } } kubernetes-client-go-a2dfcab/plugin/000077500000000000000000000000001472614177300176765ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/000077500000000000000000000000001472614177300204575ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/client/000077500000000000000000000000001472614177300217355ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/000077500000000000000000000000001472614177300226765ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/OWNERS000066400000000000000000000002521472614177300236350ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-auth-authenticators-approvers reviewers: - sig-auth-authenticators-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/azure/000077500000000000000000000000001472614177300240245ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/azure/azure_stub.go000066400000000000000000000023221472614177300265350ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package azure import ( "errors" "k8s.io/client-go/rest" "k8s.io/klog/v2" ) func init() { if err := rest.RegisterAuthProviderPlugin("azure", newAzureAuthProvider); err != nil { klog.Fatalf("Failed to register azure auth plugin: %v", err) } } func newAzureAuthProvider(_ string, _ map[string]string, _ rest.AuthProviderConfigPersister) (rest.AuthProvider, error) { return nil, errors.New(`The azure auth plugin has been removed. Please use the https://github.com/Azure/kubelogin kubectl/client-go credential plugin instead. See https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins for further details`) } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/exec/000077500000000000000000000000001472614177300236225ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/exec/exec.go000066400000000000000000000401331472614177300250760ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package exec import ( "bytes" "crypto/tls" "crypto/x509" "errors" "fmt" "io" "net" "net/http" "os" "os/exec" "reflect" "strings" "sync" "time" "golang.org/x/term" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/dump" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/client-go/pkg/apis/clientauthentication" "k8s.io/client-go/pkg/apis/clientauthentication/install" clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/tools/metrics" "k8s.io/client-go/transport" "k8s.io/client-go/util/connrotation" "k8s.io/klog/v2" "k8s.io/utils/clock" ) const execInfoEnv = "KUBERNETES_EXEC_INFO" const installHintVerboseHelp = ` It looks like you are trying to use a client-go credential plugin that is not installed. To learn more about this feature, consult the documentation available at: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins` var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) func init() { install.Install(scheme) } var ( // Since transports can be constantly re-initialized by programs like kubectl, // keep a cache of initialized authenticators keyed by a hash of their config. globalCache = newCache() // The list of API versions we accept. apiVersions = map[string]schema.GroupVersion{ clientauthenticationv1beta1.SchemeGroupVersion.String(): clientauthenticationv1beta1.SchemeGroupVersion, clientauthenticationv1.SchemeGroupVersion.String(): clientauthenticationv1.SchemeGroupVersion, } ) func newCache() *cache { return &cache{m: make(map[string]*Authenticator)} } func cacheKey(conf *api.ExecConfig, cluster *clientauthentication.Cluster) string { key := struct { conf *api.ExecConfig cluster *clientauthentication.Cluster }{ conf: conf, cluster: cluster, } return dump.Pretty(key) } type cache struct { mu sync.Mutex m map[string]*Authenticator } func (c *cache) get(s string) (*Authenticator, bool) { c.mu.Lock() defer c.mu.Unlock() a, ok := c.m[s] return a, ok } // put inserts an authenticator into the cache. If an authenticator is already // associated with the key, the first one is returned instead. func (c *cache) put(s string, a *Authenticator) *Authenticator { c.mu.Lock() defer c.mu.Unlock() existing, ok := c.m[s] if ok { return existing } c.m[s] = a return a } // sometimes rate limits how often a function f() is called. Specifically, Do() // will run the provided function f() up to threshold times every interval // duration. type sometimes struct { threshold int interval time.Duration clock clock.Clock mu sync.Mutex count int // times we have called f() in this window window time.Time // beginning of current window of length interval } func (s *sometimes) Do(f func()) { s.mu.Lock() defer s.mu.Unlock() now := s.clock.Now() if s.window.IsZero() { s.window = now } // If we are no longer in our saved time window, then we get to reset our run // count back to 0 and start increasing towards the threshold again. if inWindow := now.Sub(s.window) < s.interval; !inWindow { s.window = now s.count = 0 } // If we have not run the function more than threshold times in this current // time window, we get to run it now! if underThreshold := s.count < s.threshold; underThreshold { s.count++ f() } } // GetAuthenticator returns an exec-based plugin for providing client credentials. func GetAuthenticator(config *api.ExecConfig, cluster *clientauthentication.Cluster) (*Authenticator, error) { return newAuthenticator(globalCache, term.IsTerminal, config, cluster) } func newAuthenticator(c *cache, isTerminalFunc func(int) bool, config *api.ExecConfig, cluster *clientauthentication.Cluster) (*Authenticator, error) { key := cacheKey(config, cluster) if a, ok := c.get(key); ok { return a, nil } gv, ok := apiVersions[config.APIVersion] if !ok { return nil, fmt.Errorf("exec plugin: invalid apiVersion %q", config.APIVersion) } connTracker := connrotation.NewConnectionTracker() defaultDialer := connrotation.NewDialerWithTracker( (&net.Dialer{Timeout: 30 * time.Second, KeepAlive: 30 * time.Second}).DialContext, connTracker, ) a := &Authenticator{ cmd: config.Command, args: config.Args, group: gv, cluster: cluster, provideClusterInfo: config.ProvideClusterInfo, installHint: config.InstallHint, sometimes: &sometimes{ threshold: 10, interval: time.Hour, clock: clock.RealClock{}, }, stdin: os.Stdin, stderr: os.Stderr, interactiveFunc: func() (bool, error) { return isInteractive(isTerminalFunc, config) }, now: time.Now, environ: os.Environ, connTracker: connTracker, } for _, env := range config.Env { a.env = append(a.env, env.Name+"="+env.Value) } // these functions are made comparable and stored in the cache so that repeated clientset // construction with the same rest.Config results in a single TLS cache and Authenticator a.getCert = &transport.GetCertHolder{GetCert: a.cert} a.dial = &transport.DialHolder{Dial: defaultDialer.DialContext} return c.put(key, a), nil } func isInteractive(isTerminalFunc func(int) bool, config *api.ExecConfig) (bool, error) { var shouldBeInteractive bool switch config.InteractiveMode { case api.NeverExecInteractiveMode: shouldBeInteractive = false case api.IfAvailableExecInteractiveMode: shouldBeInteractive = !config.StdinUnavailable && isTerminalFunc(int(os.Stdin.Fd())) case api.AlwaysExecInteractiveMode: if !isTerminalFunc(int(os.Stdin.Fd())) { return false, errors.New("standard input is not a terminal") } if config.StdinUnavailable { suffix := "" if len(config.StdinUnavailableMessage) > 0 { // only print extra ": " if the user actually specified a message suffix = fmt.Sprintf(": %s", config.StdinUnavailableMessage) } return false, fmt.Errorf("standard input is unavailable%s", suffix) } shouldBeInteractive = true default: return false, fmt.Errorf("unknown interactiveMode: %q", config.InteractiveMode) } return shouldBeInteractive, nil } // Authenticator is a client credential provider that rotates credentials by executing a plugin. // The plugin input and output are defined by the API group client.authentication.k8s.io. type Authenticator struct { // Set by the config cmd string args []string group schema.GroupVersion env []string cluster *clientauthentication.Cluster provideClusterInfo bool // Used to avoid log spew by rate limiting install hint printing. We didn't do // this by interval based rate limiting alone since that way may have prevented // the install hint from showing up for kubectl users. sometimes *sometimes installHint string // Stubbable for testing stdin io.Reader stderr io.Writer interactiveFunc func() (bool, error) now func() time.Time environ func() []string // connTracker tracks all connections opened that we need to close when rotating a client certificate connTracker *connrotation.ConnectionTracker // Cached results. // // The mutex also guards calling the plugin. Since the plugin could be // interactive we want to make sure it's only called once. mu sync.Mutex cachedCreds *credentials exp time.Time // getCert makes Authenticator.cert comparable to support TLS config caching getCert *transport.GetCertHolder // dial is used for clients which do not specify a custom dialer // it is comparable to support TLS config caching dial *transport.DialHolder } type credentials struct { token string `datapolicy:"token"` cert *tls.Certificate `datapolicy:"secret-key"` } // UpdateTransportConfig updates the transport.Config to use credentials // returned by the plugin. func (a *Authenticator) UpdateTransportConfig(c *transport.Config) error { // If a bearer token is present in the request - avoid the GetCert callback when // setting up the transport, as that triggers the exec action if the server is // also configured to allow client certificates for authentication. For requests // like "kubectl get --token (token) pods" we should assume the intention is to // use the provided token for authentication. The same can be said for when the // user specifies basic auth or cert auth. if c.HasTokenAuth() || c.HasBasicAuth() || c.HasCertAuth() { return nil } c.Wrap(func(rt http.RoundTripper) http.RoundTripper { return &roundTripper{a, rt} }) if c.HasCertCallback() { return errors.New("can't add TLS certificate callback: transport.Config.TLS.GetCert already set") } c.TLS.GetCertHolder = a.getCert // comparable for TLS config caching if c.DialHolder != nil { if c.DialHolder.Dial == nil { return errors.New("invalid transport.Config.DialHolder: wrapped Dial function is nil") } // if c has a custom dialer, we have to wrap it // TLS config caching is not supported for this config d := connrotation.NewDialerWithTracker(c.DialHolder.Dial, a.connTracker) c.DialHolder = &transport.DialHolder{Dial: d.DialContext} } else { c.DialHolder = a.dial // comparable for TLS config caching } return nil } var _ utilnet.RoundTripperWrapper = &roundTripper{} type roundTripper struct { a *Authenticator base http.RoundTripper } func (r *roundTripper) WrappedRoundTripper() http.RoundTripper { return r.base } func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { // If a user has already set credentials, use that. This makes commands like // "kubectl get --token (token) pods" work. if req.Header.Get("Authorization") != "" { return r.base.RoundTrip(req) } creds, err := r.a.getCreds() if err != nil { return nil, fmt.Errorf("getting credentials: %v", err) } if creds.token != "" { req.Header.Set("Authorization", "Bearer "+creds.token) } res, err := r.base.RoundTrip(req) if err != nil { return nil, err } if res.StatusCode == http.StatusUnauthorized { if err := r.a.maybeRefreshCreds(creds); err != nil { klog.Errorf("refreshing credentials: %v", err) } } return res, nil } func (a *Authenticator) credsExpired() bool { if a.exp.IsZero() { return false } return a.now().After(a.exp) } func (a *Authenticator) cert() (*tls.Certificate, error) { creds, err := a.getCreds() if err != nil { return nil, err } return creds.cert, nil } func (a *Authenticator) getCreds() (*credentials, error) { a.mu.Lock() defer a.mu.Unlock() if a.cachedCreds != nil && !a.credsExpired() { return a.cachedCreds, nil } if err := a.refreshCredsLocked(); err != nil { return nil, err } return a.cachedCreds, nil } // maybeRefreshCreds executes the plugin to force a rotation of the // credentials, unless they were rotated already. func (a *Authenticator) maybeRefreshCreds(creds *credentials) error { a.mu.Lock() defer a.mu.Unlock() // Since we're not making a new pointer to a.cachedCreds in getCreds, no // need to do deep comparison. if creds != a.cachedCreds { // Credentials already rotated. return nil } return a.refreshCredsLocked() } // refreshCredsLocked executes the plugin and reads the credentials from // stdout. It must be called while holding the Authenticator's mutex. func (a *Authenticator) refreshCredsLocked() error { interactive, err := a.interactiveFunc() if err != nil { return fmt.Errorf("exec plugin cannot support interactive mode: %w", err) } cred := &clientauthentication.ExecCredential{ Spec: clientauthentication.ExecCredentialSpec{ Interactive: interactive, }, } if a.provideClusterInfo { cred.Spec.Cluster = a.cluster } env := append(a.environ(), a.env...) data, err := runtime.Encode(codecs.LegacyCodec(a.group), cred) if err != nil { return fmt.Errorf("encode ExecCredentials: %v", err) } env = append(env, fmt.Sprintf("%s=%s", execInfoEnv, data)) stdout := &bytes.Buffer{} cmd := exec.Command(a.cmd, a.args...) cmd.Env = env cmd.Stderr = a.stderr cmd.Stdout = stdout if interactive { cmd.Stdin = a.stdin } err = cmd.Run() incrementCallsMetric(err) if err != nil { return a.wrapCmdRunErrorLocked(err) } _, gvk, err := codecs.UniversalDecoder(a.group).Decode(stdout.Bytes(), nil, cred) if err != nil { return fmt.Errorf("decoding stdout: %v", err) } if gvk.Group != a.group.Group || gvk.Version != a.group.Version { return fmt.Errorf("exec plugin is configured to use API version %s, plugin returned version %s", a.group, schema.GroupVersion{Group: gvk.Group, Version: gvk.Version}) } if cred.Status == nil { return fmt.Errorf("exec plugin didn't return a status field") } if cred.Status.Token == "" && cred.Status.ClientCertificateData == "" && cred.Status.ClientKeyData == "" { return fmt.Errorf("exec plugin didn't return a token or cert/key pair") } if (cred.Status.ClientCertificateData == "") != (cred.Status.ClientKeyData == "") { return fmt.Errorf("exec plugin returned only certificate or key, not both") } if cred.Status.ExpirationTimestamp != nil { a.exp = cred.Status.ExpirationTimestamp.Time } else { a.exp = time.Time{} } newCreds := &credentials{ token: cred.Status.Token, } if cred.Status.ClientKeyData != "" && cred.Status.ClientCertificateData != "" { cert, err := tls.X509KeyPair([]byte(cred.Status.ClientCertificateData), []byte(cred.Status.ClientKeyData)) if err != nil { return fmt.Errorf("failed parsing client key/certificate: %v", err) } // Leaf is initialized to be nil: // https://golang.org/pkg/crypto/tls/#X509KeyPair // Leaf certificate is the first certificate: // https://golang.org/pkg/crypto/tls/#Certificate // Populating leaf is useful for quickly accessing the underlying x509 // certificate values. cert.Leaf, err = x509.ParseCertificate(cert.Certificate[0]) if err != nil { return fmt.Errorf("failed parsing client leaf certificate: %v", err) } newCreds.cert = &cert } oldCreds := a.cachedCreds a.cachedCreds = newCreds // Only close all connections when TLS cert rotates. Token rotation doesn't // need the extra noise. if oldCreds != nil && !reflect.DeepEqual(oldCreds.cert, a.cachedCreds.cert) { // Can be nil if the exec auth plugin only returned token auth. if oldCreds.cert != nil && oldCreds.cert.Leaf != nil { metrics.ClientCertRotationAge.Observe(time.Since(oldCreds.cert.Leaf.NotBefore)) } a.connTracker.CloseAll() } expiry := time.Time{} if a.cachedCreds.cert != nil && a.cachedCreds.cert.Leaf != nil { expiry = a.cachedCreds.cert.Leaf.NotAfter } expirationMetrics.set(a, expiry) return nil } // wrapCmdRunErrorLocked pulls out the code to construct a helpful error message // for when the exec plugin's binary fails to Run(). // // It must be called while holding the Authenticator's mutex. func (a *Authenticator) wrapCmdRunErrorLocked(err error) error { switch err.(type) { case *exec.Error: // Binary does not exist (see exec.Error). builder := strings.Builder{} fmt.Fprintf(&builder, "exec: executable %s not found", a.cmd) a.sometimes.Do(func() { fmt.Fprint(&builder, installHintVerboseHelp) if a.installHint != "" { fmt.Fprintf(&builder, "\n\n%s", a.installHint) } }) return errors.New(builder.String()) case *exec.ExitError: // Binary execution failed (see exec.Cmd.Run()). e := err.(*exec.ExitError) return fmt.Errorf( "exec: executable %s failed with exit code %d", a.cmd, e.ProcessState.ExitCode(), ) default: return fmt.Errorf("exec: %v", err) } } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/exec/exec_cache_test.go000066400000000000000000000065551472614177300272720ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package exec_test // separate package to prevent circular import import ( "context" "testing" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilnet "k8s.io/apimachinery/pkg/util/net" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) // TestExecTLSCache asserts the semantics of the TLS cache when exec auth is used. // // In particular, when: // - multiple identical rest configs exist as distinct objects, and // - these rest configs use exec auth, and // - these rest configs are used to create distinct clientsets, then // // the underlying TLS config is shared between those clientsets. func TestExecTLSCache(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) t.Cleanup(cancel) config1 := &rest.Config{ Host: "https://localhost", ExecProvider: &clientcmdapi.ExecConfig{ Command: "./testdata/test-plugin.sh", APIVersion: "client.authentication.k8s.io/v1", InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, } client1 := clientset.NewForConfigOrDie(config1) config2 := &rest.Config{ Host: "https://localhost", ExecProvider: &clientcmdapi.ExecConfig{ Command: "./testdata/test-plugin.sh", APIVersion: "client.authentication.k8s.io/v1", InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, } client2 := clientset.NewForConfigOrDie(config2) config3 := &rest.Config{ Host: "https://localhost", ExecProvider: &clientcmdapi.ExecConfig{ Command: "./testdata/test-plugin.sh", Args: []string{"make this exec auth different"}, APIVersion: "client.authentication.k8s.io/v1", InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, } client3 := clientset.NewForConfigOrDie(config3) _, _ = client1.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) _, _ = client2.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) _, _ = client3.CoreV1().PersistentVolumes().List(ctx, metav1.ListOptions{}) rt1 := client1.RESTClient().(*rest.RESTClient).Client.Transport rt2 := client2.RESTClient().(*rest.RESTClient).Client.Transport rt3 := client3.RESTClient().(*rest.RESTClient).Client.Transport tlsConfig1, err := utilnet.TLSClientConfig(rt1) if err != nil { t.Fatal(err) } tlsConfig2, err := utilnet.TLSClientConfig(rt2) if err != nil { t.Fatal(err) } tlsConfig3, err := utilnet.TLSClientConfig(rt3) if err != nil { t.Fatal(err) } if tlsConfig1 == nil || tlsConfig2 == nil || tlsConfig3 == nil { t.Fatal("expected non-nil TLS configs") } if tlsConfig1 != tlsConfig2 { t.Fatal("expected the same TLS config for matching exec config via rest config") } if tlsConfig1 == tlsConfig3 { t.Fatal("expected different TLS config for non-matching exec config via rest config") } } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/exec/exec_test.go000066400000000000000000001046051472614177300261420ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package exec import ( "bytes" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/tls" "crypto/x509" "crypto/x509/pkix" "encoding/json" "encoding/pem" "fmt" "io" "math/big" "net/http" "net/http/httptest" "reflect" "strconv" "strings" "testing" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/pkg/apis/clientauthentication" "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/transport" testingclock "k8s.io/utils/clock/testing" ) var ( certData = []byte(`-----BEGIN CERTIFICATE----- MIIC6jCCAdSgAwIBAgIBCzALBgkqhkiG9w0BAQswIzEhMB8GA1UEAwwYMTAuMTMu MTI5LjEwNkAxNDIxMzU5MDU4MB4XDTE1MDExNTIyMDEzMVoXDTE2MDExNTIyMDEz MlowGzEZMBcGA1UEAxMQb3BlbnNoaWZ0LWNsaWVudDCCASIwDQYJKoZIhvcNAQEB BQADggEPADCCAQoCggEBAKtdhz0+uCLXw5cSYns9rU/XifFSpb/x24WDdrm72S/v b9BPYsAStiP148buylr1SOuNi8sTAZmlVDDIpIVwMLff+o2rKYDicn9fjbrTxTOj lI4pHJBH+JU3AJ0tbajupioh70jwFS0oYpwtneg2zcnE2Z4l6mhrj2okrc5Q1/X2 I2HChtIU4JYTisObtin10QKJX01CLfYXJLa8upWzKZ4/GOcHG+eAV3jXWoXidtjb 1Usw70amoTZ6mIVCkiu1QwCoa8+ycojGfZhvqMsAp1536ZcCul+Na+AbCv4zKS7F kQQaImVrXdUiFansIoofGlw/JNuoKK6ssVpS5Ic3pgcCAwEAAaM1MDMwDgYDVR0P AQH/BAQDAgCgMBMGA1UdJQQMMAoGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwCwYJ KoZIhvcNAQELA4IBAQCKLREH7bXtXtZ+8vI6cjD7W3QikiArGqbl36bAhhWsJLp/ p/ndKz39iFNaiZ3GlwIURWOOKx3y3GA0x9m8FR+Llthf0EQ8sUjnwaknWs0Y6DQ3 jjPFZOpV3KPCFrdMJ3++E3MgwFC/Ih/N2ebFX9EcV9Vcc6oVWMdwT0fsrhu683rq 6GSR/3iVX1G/pmOiuaR0fNUaCyCfYrnI4zHBDgSfnlm3vIvN2lrsR/DQBakNL8DJ HBgKxMGeUPoneBv+c8DMXIL0EhaFXRlBv9QW45/GiAIOuyFJ0i6hCtGZpJjq4OpQ BRjCI+izPzFTjsxD4aORE+WOkyWFCGPWKfNejfw0 -----END CERTIFICATE-----`) keyData = []byte(`-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAq12HPT64ItfDlxJiez2tT9eJ8VKlv/HbhYN2ubvZL+9v0E9i wBK2I/Xjxu7KWvVI642LyxMBmaVUMMikhXAwt9/6jaspgOJyf1+NutPFM6OUjikc kEf4lTcAnS1tqO6mKiHvSPAVLShinC2d6DbNycTZniXqaGuPaiStzlDX9fYjYcKG 0hTglhOKw5u2KfXRAolfTUIt9hcktry6lbMpnj8Y5wcb54BXeNdaheJ22NvVSzDv RqahNnqYhUKSK7VDAKhrz7JyiMZ9mG+oywCnXnfplwK6X41r4BsK/jMpLsWRBBoi ZWtd1SIVqewiih8aXD8k26gorqyxWlLkhzemBwIDAQABAoIBAD2XYRs3JrGHQUpU FkdbVKZkvrSY0vAZOqBTLuH0zUv4UATb8487anGkWBjRDLQCgxH+jucPTrztekQK aW94clo0S3aNtV4YhbSYIHWs1a0It0UdK6ID7CmdWkAj6s0T8W8lQT7C46mWYVLm 5mFnCTHi6aB42jZrqmEpC7sivWwuU0xqj3Ml8kkxQCGmyc9JjmCB4OrFFC8NNt6M ObvQkUI6Z3nO4phTbpxkE1/9dT0MmPIF7GhHVzJMS+EyyRYUDllZ0wvVSOM3qZT0 JMUaBerkNwm9foKJ1+dv2nMKZZbJajv7suUDCfU44mVeaEO+4kmTKSGCGjjTBGkr 7L1ySDECgYEA5ElIMhpdBzIivCuBIH8LlUeuzd93pqssO1G2Xg0jHtfM4tz7fyeI cr90dc8gpli24dkSxzLeg3Tn3wIj/Bu64m2TpZPZEIlukYvgdgArmRIPQVxerYey OkrfTNkxU1HXsYjLCdGcGXs5lmb+K/kuTcFxaMOs7jZi7La+jEONwf8CgYEAwCs/ rUOOA0klDsWWisbivOiNPII79c9McZCNBqncCBfMUoiGe8uWDEO4TFHN60vFuVk9 8PkwpCfvaBUX+ajvbafIfHxsnfk1M04WLGCeqQ/ym5Q4sQoQOcC1b1y9qc/xEWfg nIUuia0ukYRpl7qQa3tNg+BNFyjypW8zukUAC/kCgYB1/Kojuxx5q5/oQVPrx73k 2bevD+B3c+DYh9MJqSCNwFtUpYIWpggPxoQan4LwdsmO0PKzocb/ilyNFj4i/vII NToqSc/WjDFpaDIKyuu9oWfhECye45NqLWhb/6VOuu4QA/Nsj7luMhIBehnEAHW+ GkzTKM8oD1PxpEG3nPKXYQKBgQC6AuMPRt3XBl1NkCrpSBy/uObFlFaP2Enpf39S 3OZ0Gv0XQrnSaL1kP8TMcz68rMrGX8DaWYsgytstR4W+jyy7WvZwsUu+GjTJ5aMG 77uEcEBpIi9CBzivfn7hPccE8ZgqPf+n4i6q66yxBJflW5xhvafJqDtW2LcPNbW/ bvzdmQKBgExALRUXpq+5dbmkdXBHtvXdRDZ6rVmrnjy4nI5bPw+1GqQqk6uAR6B/ F6NmLCQOO4PDG/cuatNHIr2FrwTmGdEL6ObLUGWn9Oer9gJhHVqqsY5I4sEPo4XX stR0Yiw0buV6DL/moUO0HIM9Bjh96HJp+LxiIS6UCdIhMPp5HoQa -----END RSA PRIVATE KEY-----`) validCert *tls.Certificate ) func init() { cert, err := tls.X509KeyPair(certData, keyData) if err != nil { panic(err) } cert.Leaf, err = x509.ParseCertificate(cert.Certificate[0]) if err != nil { panic(err) } validCert = &cert } func TestCacheKey(t *testing.T) { c1 := &api.ExecConfig{ Command: "foo-bar", Args: []string{"1", "2"}, Env: []api.ExecEnvVar{ {Name: "3", Value: "4"}, {Name: "5", Value: "6"}, {Name: "7", Value: "8"}, }, APIVersion: "client.authentication.k8s.io/v1beta1", ProvideClusterInfo: true, } c1c := &clientauthentication.Cluster{ Server: "foo", TLSServerName: "bar", CertificateAuthorityData: []byte("baz"), Config: &runtime.Unknown{ TypeMeta: runtime.TypeMeta{ APIVersion: "", Kind: "", }, Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"audience":"snorlax"}}`), ContentEncoding: "", ContentType: "application/json", }, } c2 := &api.ExecConfig{ Command: "foo-bar", Args: []string{"1", "2"}, Env: []api.ExecEnvVar{ {Name: "3", Value: "4"}, {Name: "5", Value: "6"}, {Name: "7", Value: "8"}, }, APIVersion: "client.authentication.k8s.io/v1beta1", ProvideClusterInfo: true, } c2c := &clientauthentication.Cluster{ Server: "foo", TLSServerName: "bar", CertificateAuthorityData: []byte("baz"), Config: &runtime.Unknown{ TypeMeta: runtime.TypeMeta{ APIVersion: "", Kind: "", }, Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"audience":"snorlax"}}`), ContentEncoding: "", ContentType: "application/json", }, } c3 := &api.ExecConfig{ Command: "foo-bar", Args: []string{"1", "2"}, Env: []api.ExecEnvVar{ {Name: "3", Value: "4"}, {Name: "5", Value: "6"}, }, APIVersion: "client.authentication.k8s.io/v1beta1", } c3c := &clientauthentication.Cluster{ Server: "foo", TLSServerName: "bar", CertificateAuthorityData: []byte("baz"), Config: &runtime.Unknown{ TypeMeta: runtime.TypeMeta{ APIVersion: "", Kind: "", }, Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"audience":"snorlax"}}`), ContentEncoding: "", ContentType: "application/json", }, } c4 := &api.ExecConfig{ Command: "foo-bar", Args: []string{"1", "2"}, Env: []api.ExecEnvVar{ {Name: "3", Value: "4"}, {Name: "5", Value: "6"}, }, APIVersion: "client.authentication.k8s.io/v1beta1", } c4c := &clientauthentication.Cluster{ Server: "foo", TLSServerName: "bar", CertificateAuthorityData: []byte("baz"), Config: &runtime.Unknown{ TypeMeta: runtime.TypeMeta{ APIVersion: "", Kind: "", }, Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"audience":"panda"}}`), ContentEncoding: "", ContentType: "application/json", }, } // c5/c5c should be the same as c4/c4c, except c5 has ProvideClusterInfo set to true. c5 := &api.ExecConfig{ Command: "foo-bar", Args: []string{"1", "2"}, Env: []api.ExecEnvVar{ {Name: "3", Value: "4"}, {Name: "5", Value: "6"}, }, APIVersion: "client.authentication.k8s.io/v1beta1", ProvideClusterInfo: true, } c5c := &clientauthentication.Cluster{ Server: "foo", TLSServerName: "bar", CertificateAuthorityData: []byte("baz"), Config: &runtime.Unknown{ TypeMeta: runtime.TypeMeta{ APIVersion: "", Kind: "", }, Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"audience":"panda"}}`), ContentEncoding: "", ContentType: "application/json", }, } // c6 should be the same as c4, except c6 is passed with a nil cluster c6 := &api.ExecConfig{ Command: "foo-bar", Args: []string{"1", "2"}, Env: []api.ExecEnvVar{ {Name: "3", Value: "4"}, {Name: "5", Value: "6"}, }, APIVersion: "client.authentication.k8s.io/v1betaa1", } // c7 should be the same as c6, except c7 has stdin marked as unavailable c7 := &api.ExecConfig{ Command: "foo-bar", Args: []string{"1", "2"}, Env: []api.ExecEnvVar{ {Name: "3", Value: "4"}, {Name: "5", Value: "6"}, }, APIVersion: "client.authentication.k8s.io/v1beta1", StdinUnavailable: true, } key1 := cacheKey(c1, c1c) key2 := cacheKey(c2, c2c) key3 := cacheKey(c3, c3c) key4 := cacheKey(c4, c4c) key5 := cacheKey(c5, c5c) key6 := cacheKey(c6, nil) key7 := cacheKey(c7, nil) if key1 != key2 { t.Error("key1 and key2 didn't match") } if key1 == key3 { t.Error("key1 and key3 matched") } if key2 == key3 { t.Error("key2 and key3 matched") } if key3 == key4 { t.Error("key3 and key4 matched") } if key4 == key5 { t.Error("key3 and key4 matched") } if key6 == key4 { t.Error("key6 and key4 matched") } if key6 == key7 { t.Error("key6 and key7 matched") } } func compJSON(t *testing.T, got, want []byte) { t.Helper() gotJSON := &bytes.Buffer{} wantJSON := &bytes.Buffer{} if err := json.Indent(gotJSON, got, "", " "); err != nil { t.Errorf("got invalid JSON: %v", err) } if err := json.Indent(wantJSON, want, "", " "); err != nil { t.Errorf("want invalid JSON: %v", err) } g := strings.TrimSpace(gotJSON.String()) w := strings.TrimSpace(wantJSON.String()) if g != w { t.Errorf("wanted %q, got %q", w, g) } } func TestRefreshCreds(t *testing.T) { tests := []struct { name string config api.ExecConfig stdinUnavailable bool exitCode int cluster *clientauthentication.Cluster output string isTerminal bool wantInput string wantCreds credentials wantExpiry time.Time wantErr bool wantErrSubstr string }{ { name: "beta-with-TLS-credentials", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, wantInput: `{ "kind":"ExecCredential", "apiVersion":"client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: fmt.Sprintf(`{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "clientKeyData": %q, "clientCertificateData": %q } }`, keyData, certData), wantCreds: credentials{cert: validCert}, }, { name: "beta-with-bad-TLS-credentials", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "clientKeyData": "foo", "clientCertificateData": "bar" } }`, wantErr: true, }, { name: "beta-cert-but-no-key", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, output: fmt.Sprintf(`{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "clientCertificateData": %q } }`, certData), wantErr: true, }, { name: "beta-basic-request", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-basic-request-with-never-interactive-mode", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.NeverExecInteractiveMode, }, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-basic-request-with-never-interactive-mode-and-stdin-unavailable", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.NeverExecInteractiveMode, StdinUnavailable: true, }, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-basic-request-with-if-available-interactive-mode", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-basic-request-with-if-available-interactive-mode-and-stdin-unavailable", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, StdinUnavailable: true, }, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-basic-request-with-if-available-interactive-mode-and-terminal", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, isTerminal: true, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": true } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-basic-request-with-if-available-interactive-mode-and-terminal-and-stdin-unavailable", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, StdinUnavailable: true, }, isTerminal: true, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-basic-request-with-always-interactive-mode", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.AlwaysExecInteractiveMode, }, wantErr: true, wantErrSubstr: "exec plugin cannot support interactive mode: standard input is not a terminal", }, { name: "beta-basic-request-with-always-interactive-mode-and-terminal-and-stdin-unavailable", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.AlwaysExecInteractiveMode, StdinUnavailable: true, }, isTerminal: true, wantErr: true, wantErrSubstr: "exec plugin cannot support interactive mode: standard input is unavailable", }, { name: "beta-basic-request-with-always-interactive-mode-and-terminal-and-stdin-unavailable-with-message", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.AlwaysExecInteractiveMode, StdinUnavailable: true, StdinUnavailableMessage: "some message", }, isTerminal: true, wantErr: true, wantErrSubstr: "exec plugin cannot support interactive mode: standard input is unavailable: some message", }, { name: "beta-basic-request-with-always-interactive-mode-and-terminal", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.AlwaysExecInteractiveMode, }, isTerminal: true, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": true } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-expiry", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar", "expirationTimestamp": "2006-01-02T15:04:05Z" } }`, wantExpiry: time.Date(2006, 01, 02, 15, 04, 05, 0, time.UTC), wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-no-group-version", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, output: `{ "kind": "ExecCredential", "status": { "token": "foo-bar" } }`, wantErr: true, }, { name: "beta-no-status", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, output: `{ "kind": "ExecCredential", "apiVersion":"client.authentication.k8s.io/v1beta1" }`, wantErr: true, }, { name: "beta-no-token", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, output: `{ "kind": "ExecCredential", "apiVersion":"client.authentication.k8s.io/v1beta1", "status": {} }`, wantErr: true, }, { name: "unknown-binary", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", Command: "does not exist", InstallHint: "some install hint", InteractiveMode: api.IfAvailableExecInteractiveMode, }, wantErr: true, wantErrSubstr: "some install hint", }, { name: "binary-fails", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, exitCode: 73, wantErr: true, wantErrSubstr: "73", }, { name: "beta-with-cluster-and-provide-cluster-info-is-serialized", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", ProvideClusterInfo: true, InteractiveMode: api.IfAvailableExecInteractiveMode, }, cluster: &clientauthentication.Cluster{ Server: "foo", TLSServerName: "bar", CertificateAuthorityData: []byte("baz"), Config: &runtime.Unknown{ TypeMeta: runtime.TypeMeta{ APIVersion: "", Kind: "", }, Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"audience":"snorlax"}}`), ContentEncoding: "", ContentType: "application/json", }, }, wantInput: `{ "kind":"ExecCredential", "apiVersion":"client.authentication.k8s.io/v1beta1", "spec": { "cluster": { "server": "foo", "tls-server-name": "bar", "certificate-authority-data": "YmF6", "config": { "apiVersion": "group/v1", "kind": "PluginConfig", "spec": { "audience": "snorlax" } } }, "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "beta-with-cluster-and-without-provide-cluster-info-is-not-serialized", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, cluster: &clientauthentication.Cluster{ Server: "foo", TLSServerName: "bar", CertificateAuthorityData: []byte("baz"), Config: &runtime.Unknown{ TypeMeta: runtime.TypeMeta{ APIVersion: "", Kind: "", }, Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"audience":"snorlax"}}`), ContentEncoding: "", ContentType: "application/json", }, }, wantInput: `{ "kind":"ExecCredential", "apiVersion":"client.authentication.k8s.io/v1beta1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "v1-basic-request", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, wantInput: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1", "spec": { "interactive": false } }`, output: `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1", "status": { "token": "foo-bar" } }`, wantCreds: credentials{token: "foo-bar"}, }, { name: "v1-with-missing-interactive-mode", config: api.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1", }, wantErr: true, wantErrSubstr: `exec plugin cannot support interactive mode: unknown interactiveMode: ""`, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { c := test.config if c.Command == "" { c.Command = "./testdata/test-plugin.sh" c.Env = append(c.Env, api.ExecEnvVar{ Name: "TEST_OUTPUT", Value: test.output, }) c.Env = append(c.Env, api.ExecEnvVar{ Name: "TEST_EXIT_CODE", Value: strconv.Itoa(test.exitCode), }) } a, err := newAuthenticator(newCache(), func(_ int) bool { return test.isTerminal }, &c, test.cluster) if err != nil { t.Fatal(err) } stderr := &bytes.Buffer{} a.stderr = stderr a.environ = func() []string { return nil } if err := a.refreshCredsLocked(); err != nil { if !test.wantErr { t.Errorf("get token %v", err) } else if !strings.Contains(err.Error(), test.wantErrSubstr) { t.Errorf("expected error with substring '%v' got '%v'", test.wantErrSubstr, err.Error()) } return } if test.wantErr { t.Fatal("expected error getting token") } if !reflect.DeepEqual(a.cachedCreds, &test.wantCreds) { t.Errorf("expected credentials %+v got %+v", &test.wantCreds, a.cachedCreds) } if !a.exp.Equal(test.wantExpiry) { t.Errorf("expected expiry %v got %v", test.wantExpiry, a.exp) } if test.wantInput == "" { if got := strings.TrimSpace(stderr.String()); got != "" { t.Errorf("expected no input parameters, got %q", got) } return } compJSON(t, stderr.Bytes(), []byte(test.wantInput)) }) } } func TestRoundTripper(t *testing.T) { wantToken := "" n := time.Now() now := func() time.Time { return n } env := []string{""} environ := func() []string { s := make([]string, len(env)) copy(s, env) return s } setOutput := func(s string) { env[0] = "TEST_OUTPUT=" + s } handler := func(w http.ResponseWriter, r *http.Request) { gotToken := "" parts := strings.Split(r.Header.Get("Authorization"), " ") if len(parts) > 1 && strings.EqualFold(parts[0], "bearer") { gotToken = parts[1] } if wantToken != gotToken { http.Error(w, "Unauthorized", http.StatusUnauthorized) return } fmt.Fprintln(w, "ok") } server := httptest.NewServer(http.HandlerFunc(handler)) c := api.ExecConfig{ Command: "./testdata/test-plugin.sh", APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, } a, err := newAuthenticator(newCache(), func(_ int) bool { return false }, &c, nil) if err != nil { t.Fatal(err) } a.environ = environ a.now = now a.stderr = io.Discard tc := &transport.Config{} if err := a.UpdateTransportConfig(tc); err != nil { t.Fatal(err) } client := http.Client{ Transport: tc.WrapTransport(http.DefaultTransport), } get := func(t *testing.T, statusCode int) { t.Helper() resp, err := client.Get(server.URL) if err != nil { t.Fatal(err) } defer resp.Body.Close() if resp.StatusCode != statusCode { t.Errorf("wanted status %d got %d", statusCode, resp.StatusCode) } } setOutput(`{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "token1" } }`) wantToken = "token1" get(t, http.StatusOK) setOutput(`{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "token2" } }`) // Previous token should be cached get(t, http.StatusOK) wantToken = "token2" // Token is still cached, hits unauthorized but causes token to rotate. get(t, http.StatusUnauthorized) // Follow up request uses the rotated token. get(t, http.StatusOK) setOutput(`{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "token3", "expirationTimestamp": "` + now().Add(time.Hour).Format(time.RFC3339Nano) + `" } }`) wantToken = "token3" // Token is still cached, hit's unauthorized but causes rotation to token with an expiry. get(t, http.StatusUnauthorized) get(t, http.StatusOK) // Move time forward 2 hours, "token3" is now expired. n = n.Add(time.Hour * 2) setOutput(`{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "token4", "expirationTimestamp": "` + now().Add(time.Hour).Format(time.RFC3339Nano) + `" } }`) wantToken = "token4" // Old token is expired, should refresh automatically without hitting a 401. get(t, http.StatusOK) } func TestAuthorizationHeaderPresentCancelsExecAction(t *testing.T) { tests := []struct { name string setTransportConfig func(*transport.Config) }{ { name: "bearer token", setTransportConfig: func(config *transport.Config) { config.BearerToken = "token1f" }, }, { name: "basic auth", setTransportConfig: func(config *transport.Config) { config.Username = "marshmallow" config.Password = "zelda" }, }, { name: "cert auth", setTransportConfig: func(config *transport.Config) { config.TLS.CertData = []byte("some-cert-data") config.TLS.KeyData = []byte("some-key-data") }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { a, err := newAuthenticator(newCache(), func(_ int) bool { return false }, &api.ExecConfig{ Command: "./testdata/test-plugin.sh", APIVersion: "client.authentication.k8s.io/v1beta1", }, nil) if err != nil { t.Fatal(err) } // UpdateTransportConfig returns error on existing TLS certificate callback, unless a bearer token is present in the // transport config, in which case it takes precedence cert := func() (*tls.Certificate, error) { return nil, nil } tc := &transport.Config{TLS: transport.TLSConfig{Insecure: true, GetCertHolder: &transport.GetCertHolder{GetCert: cert}}} test.setTransportConfig(tc) if err := a.UpdateTransportConfig(tc); err != nil { t.Error("Expected presence of bearer token in config to cancel exec action") } }) } } func TestTLSCredentials(t *testing.T) { now := time.Now() certPool := x509.NewCertPool() cert, key := genClientCert(t) if !certPool.AppendCertsFromPEM(cert) { t.Fatal("failed to add client cert to CertPool") } server := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "ok") })) server.TLS = &tls.Config{ ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: certPool, } server.StartTLS() defer server.Close() a, err := newAuthenticator(newCache(), func(_ int) bool { return false }, &api.ExecConfig{ Command: "./testdata/test-plugin.sh", APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, }, nil) if err != nil { t.Fatal(err) } var output *clientauthentication.ExecCredential a.environ = func() []string { data, err := runtime.Encode(codecs.LegacyCodec(a.group), output) if err != nil { t.Fatal(err) } return []string{"TEST_OUTPUT=" + string(data)} } a.now = func() time.Time { return now } a.stderr = io.Discard // We're not interested in server's cert, this test is about client cert. tc := &transport.Config{TLS: transport.TLSConfig{Insecure: true}} if err := a.UpdateTransportConfig(tc); err != nil { t.Fatal(err) } get := func(t *testing.T, desc string, wantErr bool) { t.Run(desc, func(t *testing.T) { tlsCfg, err := transport.TLSConfigFor(tc) if err != nil { t.Fatal("TLSConfigFor:", err) } client := http.Client{ Transport: &http.Transport{TLSClientConfig: tlsCfg}, } resp, err := client.Get(server.URL) switch { case err != nil && !wantErr: t.Errorf("got client.Get error: %q, want nil", err) case err == nil && wantErr: t.Error("got nil client.Get error, want non-nil") } if err == nil { resp.Body.Close() } }) } output = &clientauthentication.ExecCredential{ Status: &clientauthentication.ExecCredentialStatus{ ClientCertificateData: string(cert), ClientKeyData: string(key), ExpirationTimestamp: &v1.Time{Time: now.Add(time.Hour)}, }, } get(t, "valid TLS cert", false) // Advance time to force re-exec. nCert, nKey := genClientCert(t) now = now.Add(time.Hour * 2) output = &clientauthentication.ExecCredential{ Status: &clientauthentication.ExecCredentialStatus{ ClientCertificateData: string(nCert), ClientKeyData: string(nKey), ExpirationTimestamp: &v1.Time{Time: now.Add(time.Hour)}, }, } get(t, "untrusted TLS cert", true) now = now.Add(time.Hour * 2) output = &clientauthentication.ExecCredential{ Status: &clientauthentication.ExecCredentialStatus{ ClientCertificateData: string(cert), ClientKeyData: string(key), ExpirationTimestamp: &v1.Time{Time: now.Add(time.Hour)}, }, } get(t, "valid TLS cert again", false) } func TestConcurrentUpdateTransportConfig(t *testing.T) { n := time.Now() now := func() time.Time { return n } env := []string{""} environ := func() []string { s := make([]string, len(env)) copy(s, env) return s } c := api.ExecConfig{ Command: "./testdata/test-plugin.sh", APIVersion: "client.authentication.k8s.io/v1beta1", } a, err := newAuthenticator(newCache(), func(_ int) bool { return false }, &c, nil) if err != nil { t.Fatal(err) } a.environ = environ a.now = now a.stderr = io.Discard stopCh := make(chan struct{}) defer close(stopCh) numConcurrent := 2 for i := 0; i < numConcurrent; i++ { go func() { for { tc := &transport.Config{} a.UpdateTransportConfig(tc) select { case <-stopCh: return default: continue } } }() } time.Sleep(2 * time.Second) } func TestInstallHintRateLimit(t *testing.T) { tests := []struct { name string threshold int interval time.Duration calls int perCallAdvance time.Duration wantInstallHint int }{ { name: "print-up-to-threshold", threshold: 2, interval: time.Second, calls: 10, wantInstallHint: 2, }, { name: "after-interval-threshold-resets", threshold: 2, interval: time.Second * 5, calls: 10, perCallAdvance: time.Second, wantInstallHint: 4, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { c := api.ExecConfig{ Command: "does not exist", APIVersion: "client.authentication.k8s.io/v1beta1", InstallHint: "some install hint", InteractiveMode: api.IfAvailableExecInteractiveMode, } a, err := newAuthenticator(newCache(), func(_ int) bool { return false }, &c, nil) if err != nil { t.Fatal(err) } a.sometimes.threshold = test.threshold a.sometimes.interval = test.interval clock := testingclock.NewFakeClock(time.Now()) a.sometimes.clock = clock count := 0 for i := 0; i < test.calls; i++ { err := a.refreshCredsLocked() if strings.Contains(err.Error(), c.InstallHint) { count++ } clock.SetTime(clock.Now().Add(test.perCallAdvance)) } if test.wantInstallHint != count { t.Errorf( "%s: expected install hint %d times got %d", test.name, test.wantInstallHint, count, ) } }) } } // genClientCert generates an x509 certificate for testing. Certificate and key // are returned in PEM encoding. The generated cert expires in 24 hours. func genClientCert(t *testing.T) ([]byte, []byte) { key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) if err != nil { t.Fatal(err) } keyRaw, err := x509.MarshalECPrivateKey(key) if err != nil { t.Fatal(err) } serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) if err != nil { t.Fatal(err) } cert := &x509.Certificate{ SerialNumber: serialNumber, Subject: pkix.Name{Organization: []string{"Acme Co"}}, NotBefore: time.Now(), NotAfter: time.Now().Add(24 * time.Hour), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth}, BasicConstraintsValid: true, } certRaw, err := x509.CreateCertificate(rand.Reader, cert, cert, key.Public(), key) if err != nil { t.Fatal(err) } return pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: certRaw}), pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: keyRaw}) } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/exec/metrics.go000066400000000000000000000070721472614177300256250ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package exec import ( "errors" "io/fs" "os/exec" "reflect" "sync" "time" "k8s.io/klog/v2" "k8s.io/client-go/tools/metrics" ) // The following constants shadow the special values used in the prometheus metrics implementation. const ( // noError indicates that the plugin process was successfully started and exited with an exit // code of 0. noError = "no_error" // pluginExecutionError indicates that the plugin process was successfully started and then // it returned a non-zero exit code. pluginExecutionError = "plugin_execution_error" // pluginNotFoundError indicates that we could not find the exec plugin. pluginNotFoundError = "plugin_not_found_error" // clientInternalError indicates that we attempted to start the plugin process, but failed // for some reason. clientInternalError = "client_internal_error" // successExitCode represents an exec plugin invocation that was successful. successExitCode = 0 // failureExitCode represents an exec plugin invocation that was not successful. This code is // used in some failure modes (e.g., plugin not found, client internal error) so that someone // can more easily monitor all unsuccessful invocations. failureExitCode = 1 ) type certificateExpirationTracker struct { mu sync.RWMutex m map[*Authenticator]time.Time metricSet func(*time.Time) } var expirationMetrics = &certificateExpirationTracker{ m: map[*Authenticator]time.Time{}, metricSet: func(e *time.Time) { metrics.ClientCertExpiry.Set(e) }, } // set stores the given expiration time and updates the updates the certificate // expiry metric to the earliest expiration time. func (c *certificateExpirationTracker) set(a *Authenticator, t time.Time) { c.mu.Lock() defer c.mu.Unlock() c.m[a] = t earliest := time.Time{} for _, t := range c.m { if t.IsZero() { continue } if earliest.IsZero() || earliest.After(t) { earliest = t } } if earliest.IsZero() { c.metricSet(nil) } else { c.metricSet(&earliest) } } // incrementCallsMetric increments a global metrics counter for the number of calls to an exec // plugin, partitioned by exit code. The provided err should be the return value from // exec.Cmd.Run(). func incrementCallsMetric(err error) { execExitError := &exec.ExitError{} execError := &exec.Error{} pathError := &fs.PathError{} switch { case err == nil: // Binary execution succeeded. metrics.ExecPluginCalls.Increment(successExitCode, noError) case errors.As(err, &execExitError): // Binary execution failed (see "os/exec".Cmd.Run()). metrics.ExecPluginCalls.Increment(execExitError.ExitCode(), pluginExecutionError) case errors.As(err, &execError), errors.As(err, &pathError): // Binary does not exist (see exec.Error, fs.PathError). metrics.ExecPluginCalls.Increment(failureExitCode, pluginNotFoundError) default: // We don't know about this error type. klog.V(2).InfoS("unexpected exec plugin return error type", "type", reflect.TypeOf(err).String(), "err", err) metrics.ExecPluginCalls.Increment(failureExitCode, clientInternalError) } } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/exec/metrics_test.go000066400000000000000000000130071472614177300266570ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package exec import ( "fmt" "io" "testing" "time" "github.com/google/go-cmp/cmp" "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/tools/metrics" ) type mockExpiryGauge struct { v *time.Time } func (m *mockExpiryGauge) Set(t *time.Time) { m.v = t } func ptr(t time.Time) *time.Time { return &t } func TestCertificateExpirationTracker(t *testing.T) { now := time.Now() mockMetric := &mockExpiryGauge{} tracker := &certificateExpirationTracker{ m: map[*Authenticator]time.Time{}, metricSet: mockMetric.Set, } firstAuthenticator := &Authenticator{} secondAuthenticator := &Authenticator{} for _, tc := range []struct { desc string auth *Authenticator time time.Time want *time.Time }{ { desc: "ttl for one authenticator", auth: firstAuthenticator, time: now.Add(time.Minute * 10), want: ptr(now.Add(time.Minute * 10)), }, { desc: "second authenticator shorter ttl", auth: secondAuthenticator, time: now.Add(time.Minute * 5), want: ptr(now.Add(time.Minute * 5)), }, { desc: "update shorter to be longer", auth: secondAuthenticator, time: now.Add(time.Minute * 15), want: ptr(now.Add(time.Minute * 10)), }, { desc: "update shorter to be zero time", auth: firstAuthenticator, time: time.Time{}, want: ptr(now.Add(time.Minute * 15)), }, { desc: "update last to be zero time records nil", auth: secondAuthenticator, time: time.Time{}, want: nil, }, } { // Must run in series as the tests build off each other. t.Run(tc.desc, func(t *testing.T) { tracker.set(tc.auth, tc.time) if mockMetric.v != nil && tc.want != nil { if !mockMetric.v.Equal(*tc.want) { t.Errorf("got: %s; want: %s", mockMetric.v, tc.want) } } else if mockMetric.v != tc.want { t.Errorf("got: %s; want: %s", mockMetric.v, tc.want) } }) } } type mockCallsMetric struct { exitCode int errorType string } type mockCallsMetricCounter struct { calls []mockCallsMetric } func (f *mockCallsMetricCounter) Increment(exitCode int, errorType string) { f.calls = append(f.calls, mockCallsMetric{exitCode: exitCode, errorType: errorType}) } func TestCallsMetric(t *testing.T) { const ( goodOutput = `{ "kind": "ExecCredential", "apiVersion": "client.authentication.k8s.io/v1beta1", "status": { "token": "foo-bar" } }` ) callsMetricCounter := &mockCallsMetricCounter{} originalExecPluginCalls := metrics.ExecPluginCalls t.Cleanup(func() { metrics.ExecPluginCalls = originalExecPluginCalls }) metrics.ExecPluginCalls = callsMetricCounter exitCodes := []int{0, 1, 2, 0} var wantCallsMetrics []mockCallsMetric for _, exitCode := range exitCodes { c := api.ExecConfig{ Command: "./testdata/test-plugin.sh", APIVersion: "client.authentication.k8s.io/v1beta1", Env: []api.ExecEnvVar{ {Name: "TEST_EXIT_CODE", Value: fmt.Sprintf("%d", exitCode)}, {Name: "TEST_OUTPUT", Value: goodOutput}, }, InteractiveMode: api.IfAvailableExecInteractiveMode, } a, err := newAuthenticator(newCache(), func(_ int) bool { return false }, &c, nil) if err != nil { t.Fatal(err) } a.stderr = io.Discard // Run refresh creds twice so that our test validates that the metrics are set correctly twice // in a row with the same authenticator. refreshCreds := func() { if err := a.refreshCredsLocked(); (err == nil) != (exitCode == 0) { if err != nil { t.Fatalf("wanted no error, but got %q", err.Error()) } else { t.Fatal("wanted error, but got nil") } } mockCallsMetric := mockCallsMetric{exitCode: exitCode, errorType: "no_error"} if exitCode != 0 { mockCallsMetric.errorType = "plugin_execution_error" } wantCallsMetrics = append(wantCallsMetrics, mockCallsMetric) } refreshCreds() refreshCreds() } // Run some iterations of the authenticator where the exec plugin fails to run to test special // metric values. refreshCreds := func(command string) { c := api.ExecConfig{ Command: command, APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: api.IfAvailableExecInteractiveMode, } a, err := newAuthenticator(newCache(), func(_ int) bool { return false }, &c, nil) if err != nil { t.Fatal(err) } a.stderr = io.Discard if err := a.refreshCredsLocked(); err == nil { t.Fatal("expected the authenticator to fail because the plugin does not exist") } wantCallsMetrics = append(wantCallsMetrics, mockCallsMetric{exitCode: 1, errorType: "plugin_not_found_error"}) } refreshCreds("does not exist without path slashes") refreshCreds("./does/not/exist/with/relative/path") refreshCreds("/does/not/exist/with/absolute/path") callsMetricComparer := cmp.Comparer(func(a, b mockCallsMetric) bool { return a.exitCode == b.exitCode && a.errorType == b.errorType }) actuallCallsMetrics := callsMetricCounter.calls if diff := cmp.Diff(wantCallsMetrics, actuallCallsMetrics, callsMetricComparer); diff != "" { t.Fatalf("got unexpected metrics calls; -want, +got:\n%s", diff) } } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/exec/testdata/000077500000000000000000000000001472614177300254335ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/exec/testdata/test-plugin.sh000077500000000000000000000012551472614177300302500ustar00rootroot00000000000000#!/bin/bash -e # Copyright 2018 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. >&2 echo "$KUBERNETES_EXEC_INFO" echo "$TEST_OUTPUT" exit "${TEST_EXIT_CODE:-0}" kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/gcp/000077500000000000000000000000001472614177300234475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/gcp/gcp_stub.go000066400000000000000000000022601472614177300256040ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package gcp import ( "errors" "k8s.io/client-go/rest" "k8s.io/klog/v2" ) func init() { if err := rest.RegisterAuthProviderPlugin("gcp", newGCPAuthProvider); err != nil { klog.Fatalf("Failed to register gcp auth plugin: %v", err) } } func newGCPAuthProvider(_ string, _ map[string]string, _ rest.AuthProviderConfigPersister) (rest.AuthProvider, error) { return nil, errors.New(`The gcp auth plugin has been removed. Please use the "gke-gcloud-auth-plugin" kubectl/client-go credential plugin instead. See https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke for further details`) } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/oidc/000077500000000000000000000000001472614177300236145ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/oidc/oidc.go000066400000000000000000000253611472614177300250700ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package oidc import ( "context" "encoding/base64" "encoding/json" "errors" "fmt" "io" "net/http" "strings" "sync" "time" "golang.org/x/oauth2" "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" "k8s.io/klog/v2" ) const ( cfgIssuerURL = "idp-issuer-url" cfgClientID = "client-id" cfgClientSecret = "client-secret" cfgCertificateAuthority = "idp-certificate-authority" cfgCertificateAuthorityData = "idp-certificate-authority-data" cfgIDToken = "id-token" cfgRefreshToken = "refresh-token" // Unused. Scopes aren't sent during refreshing. cfgExtraScopes = "extra-scopes" ) func init() { if err := restclient.RegisterAuthProviderPlugin("oidc", newOIDCAuthProvider); err != nil { klog.Fatalf("Failed to register oidc auth plugin: %v", err) } } // expiryDelta determines how earlier a token should be considered // expired than its actual expiration time. It is used to avoid late // expirations due to client-server time mismatches. // // NOTE(ericchiang): this is take from golang.org/x/oauth2 const expiryDelta = 10 * time.Second var cache = newClientCache() // Like TLS transports, keep a cache of OIDC clients indexed by issuer URL. This ensures // current requests from different clients don't concurrently attempt to refresh the same // set of credentials. type clientCache struct { mu sync.RWMutex cache map[cacheKey]*oidcAuthProvider } func newClientCache() *clientCache { return &clientCache{cache: make(map[cacheKey]*oidcAuthProvider)} } type cacheKey struct { clusterAddress string // Canonical issuer URL string of the provider. issuerURL string clientID string } func (c *clientCache) getClient(clusterAddress, issuer, clientID string) (*oidcAuthProvider, bool) { c.mu.RLock() defer c.mu.RUnlock() client, ok := c.cache[cacheKey{clusterAddress: clusterAddress, issuerURL: issuer, clientID: clientID}] return client, ok } // setClient attempts to put the client in the cache but may return any clients // with the same keys set before. This is so there's only ever one client for a provider. func (c *clientCache) setClient(clusterAddress, issuer, clientID string, client *oidcAuthProvider) *oidcAuthProvider { c.mu.Lock() defer c.mu.Unlock() key := cacheKey{clusterAddress: clusterAddress, issuerURL: issuer, clientID: clientID} // If another client has already initialized a client for the given provider we want // to use that client instead of the one we're trying to set. This is so all transports // share a client and can coordinate around the same mutex when refreshing and writing // to the kubeconfig. if oldClient, ok := c.cache[key]; ok { return oldClient } c.cache[key] = client return client } func newOIDCAuthProvider(clusterAddress string, cfg map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) { issuer := cfg[cfgIssuerURL] if issuer == "" { return nil, fmt.Errorf("Must provide %s", cfgIssuerURL) } clientID := cfg[cfgClientID] if clientID == "" { return nil, fmt.Errorf("Must provide %s", cfgClientID) } // Check cache for existing provider. if provider, ok := cache.getClient(clusterAddress, issuer, clientID); ok { return provider, nil } if len(cfg[cfgExtraScopes]) > 0 { klog.V(2).Infof("%s auth provider field depricated, refresh request don't send scopes", cfgExtraScopes) } var certAuthData []byte var err error if cfg[cfgCertificateAuthorityData] != "" { certAuthData, err = base64.StdEncoding.DecodeString(cfg[cfgCertificateAuthorityData]) if err != nil { return nil, err } } clientConfig := restclient.Config{ TLSClientConfig: restclient.TLSClientConfig{ CAFile: cfg[cfgCertificateAuthority], CAData: certAuthData, }, } trans, err := restclient.TransportFor(&clientConfig) if err != nil { return nil, err } hc := &http.Client{Transport: trans} provider := &oidcAuthProvider{ client: hc, now: time.Now, cfg: cfg, persister: persister, } return cache.setClient(clusterAddress, issuer, clientID, provider), nil } type oidcAuthProvider struct { client *http.Client // Method for determining the current time. now func() time.Time // Mutex guards persisting to the kubeconfig file and allows synchronized // updates to the in-memory config. It also ensures concurrent calls to // the RoundTripper only trigger a single refresh request. mu sync.Mutex cfg map[string]string persister restclient.AuthProviderConfigPersister } func (p *oidcAuthProvider) WrapTransport(rt http.RoundTripper) http.RoundTripper { return &roundTripper{ wrapped: rt, provider: p, } } func (p *oidcAuthProvider) Login() error { return errors.New("not yet implemented") } type roundTripper struct { provider *oidcAuthProvider wrapped http.RoundTripper } var _ net.RoundTripperWrapper = &roundTripper{} func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { if len(req.Header.Get("Authorization")) != 0 { return r.wrapped.RoundTrip(req) } token, err := r.provider.idToken() if err != nil { return nil, err } // shallow copy of the struct r2 := new(http.Request) *r2 = *req // deep copy of the Header so we don't modify the original // request's Header (as per RoundTripper contract). r2.Header = make(http.Header) for k, s := range req.Header { r2.Header[k] = s } r2.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) return r.wrapped.RoundTrip(r2) } func (r *roundTripper) WrappedRoundTripper() http.RoundTripper { return r.wrapped } func (p *oidcAuthProvider) idToken() (string, error) { p.mu.Lock() defer p.mu.Unlock() if idToken, ok := p.cfg[cfgIDToken]; ok && len(idToken) > 0 { valid, err := idTokenExpired(p.now, idToken) if err != nil { return "", err } if valid { // If the cached id token is still valid use it. return idToken, nil } } // Try to request a new token using the refresh token. rt, ok := p.cfg[cfgRefreshToken] if !ok || len(rt) == 0 { return "", errors.New("No valid id-token, and cannot refresh without refresh-token") } // Determine provider's OAuth2 token endpoint. tokenURL, err := tokenEndpoint(p.client, p.cfg[cfgIssuerURL]) if err != nil { return "", err } config := oauth2.Config{ ClientID: p.cfg[cfgClientID], ClientSecret: p.cfg[cfgClientSecret], Endpoint: oauth2.Endpoint{TokenURL: tokenURL}, } ctx := context.WithValue(context.Background(), oauth2.HTTPClient, p.client) token, err := config.TokenSource(ctx, &oauth2.Token{RefreshToken: rt}).Token() if err != nil { return "", fmt.Errorf("failed to refresh token: %v", err) } idToken, ok := token.Extra("id_token").(string) if !ok { // id_token isn't a required part of a refresh token response, so some // providers (Okta) don't return this value. // // See https://github.com/kubernetes/kubernetes/issues/36847 return "", fmt.Errorf("token response did not contain an id_token, either the scope \"openid\" wasn't requested upon login, or the provider doesn't support id_tokens as part of the refresh response") } // Create a new config to persist. newCfg := make(map[string]string) for key, val := range p.cfg { newCfg[key] = val } // Update the refresh token if the server returned another one. if token.RefreshToken != "" && token.RefreshToken != rt { newCfg[cfgRefreshToken] = token.RefreshToken } newCfg[cfgIDToken] = idToken // Persist new config and if successful, update the in memory config. if err = p.persister.Persist(newCfg); err != nil { return "", fmt.Errorf("could not persist new tokens: %v", err) } p.cfg = newCfg return idToken, nil } // tokenEndpoint uses OpenID Connect discovery to determine the OAuth2 token // endpoint for the provider, the endpoint the client will use the refresh // token against. func tokenEndpoint(client *http.Client, issuer string) (string, error) { // Well known URL for getting OpenID Connect metadata. // // https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig wellKnown := strings.TrimSuffix(issuer, "/") + "/.well-known/openid-configuration" resp, err := client.Get(wellKnown) if err != nil { return "", err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return "", err } if resp.StatusCode != http.StatusOK { // Don't produce an error that's too huge (e.g. if we get HTML back for some reason). const n = 80 if len(body) > n { body = append(body[:n], []byte("...")...) } return "", fmt.Errorf("oidc: failed to query metadata endpoint %s: %q", resp.Status, body) } // Metadata object. We only care about the token_endpoint, the thing endpoint // we'll be refreshing against. // // https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata var metadata struct { TokenURL string `json:"token_endpoint"` } if err := json.Unmarshal(body, &metadata); err != nil { return "", fmt.Errorf("oidc: failed to decode provider discovery object: %v", err) } if metadata.TokenURL == "" { return "", fmt.Errorf("oidc: discovery object doesn't contain a token_endpoint") } return metadata.TokenURL, nil } func idTokenExpired(now func() time.Time, idToken string) (bool, error) { parts := strings.Split(idToken, ".") if len(parts) != 3 { return false, fmt.Errorf("ID Token is not a valid JWT") } payload, err := base64.RawURLEncoding.DecodeString(parts[1]) if err != nil { return false, err } var claims struct { Expiry jsonTime `json:"exp"` } if err := json.Unmarshal(payload, &claims); err != nil { return false, fmt.Errorf("parsing claims: %v", err) } return now().Add(expiryDelta).Before(time.Time(claims.Expiry)), nil } // jsonTime is a json.Unmarshaler that parses a unix timestamp. // Because JSON numbers don't differentiate between ints and floats, // we want to ensure we can parse either. type jsonTime time.Time func (j *jsonTime) UnmarshalJSON(b []byte) error { var n json.Number if err := json.Unmarshal(b, &n); err != nil { return err } var unix int64 if t, err := n.Int64(); err == nil { unix = t } else { f, err := n.Float64() if err != nil { return err } unix = int64(f) } *j = jsonTime(time.Unix(unix, 0)) return nil } func (j jsonTime) MarshalJSON() ([]byte, error) { return json.Marshal(time.Time(j).Unix()) } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/oidc/oidc_test.go000066400000000000000000000070721472614177300261260ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package oidc import ( "encoding/base64" "encoding/json" "fmt" "testing" "time" ) func TestJSONTime(t *testing.T) { data := `{ "t1": 1493851263, "t2": 1.493851263e9 }` var v struct { T1 jsonTime `json:"t1"` T2 jsonTime `json:"t2"` } if err := json.Unmarshal([]byte(data), &v); err != nil { t.Fatal(err) } wantT1 := time.Unix(1493851263, 0) wantT2 := time.Unix(1493851263, 0) gotT1 := time.Time(v.T1) gotT2 := time.Time(v.T2) if !wantT1.Equal(gotT1) { t.Errorf("t1 value: wanted %s got %s", wantT1, gotT1) } if !wantT2.Equal(gotT2) { t.Errorf("t2 value: wanted %s got %s", wantT2, gotT2) } } func encodeJWT(header, payload, sig string) string { e := func(s string) string { return base64.RawURLEncoding.EncodeToString([]byte(s)) } return e(header) + "." + e(payload) + "." + e(sig) } func TestExpired(t *testing.T) { now := time.Now() nowFunc := func() time.Time { return now } tests := []struct { name string idToken string wantErr bool wantExpired bool }{ { name: "valid", idToken: encodeJWT( "{}", fmt.Sprintf(`{"exp":%d}`, now.Add(time.Hour).Unix()), "blah", // signature isn't veified. ), }, { name: "expired", idToken: encodeJWT( "{}", fmt.Sprintf(`{"exp":%d}`, now.Add(-time.Hour).Unix()), "blah", // signature isn't veified. ), wantExpired: true, }, { name: "bad exp claim", idToken: encodeJWT( "{}", `{"exp":"foobar"}`, "blah", // signature isn't veified. ), wantErr: true, }, { name: "not an id token", idToken: "notanidtoken", wantErr: true, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { valid, err := idTokenExpired(nowFunc, test.idToken) if err != nil { if !test.wantErr { t.Errorf("parse error: %v", err) } return } if test.wantExpired == valid { t.Errorf("wanted expired %t, got %t", test.wantExpired, !valid) } }) } } func TestClientCache(t *testing.T) { cache := newClientCache() if _, ok := cache.getClient("cluster1", "issuer1", "id1"); ok { t.Fatalf("got client before putting one in the cache") } assertCacheLen(t, cache, 0) cli1 := new(oidcAuthProvider) cli2 := new(oidcAuthProvider) cli3 := new(oidcAuthProvider) gotcli := cache.setClient("cluster1", "issuer1", "id1", cli1) if cli1 != gotcli { t.Fatalf("set first client and got a different one") } assertCacheLen(t, cache, 1) gotcli = cache.setClient("cluster1", "issuer1", "id1", cli2) if cli1 != gotcli { t.Fatalf("set a second client and didn't get the first") } assertCacheLen(t, cache, 1) gotcli = cache.setClient("cluster2", "issuer1", "id1", cli3) if cli1 == gotcli { t.Fatalf("set a third client and got the first") } if cli3 != gotcli { t.Fatalf("set third client and got a different one") } assertCacheLen(t, cache, 2) } func assertCacheLen(t *testing.T, cache *clientCache, length int) { t.Helper() if len(cache.cache) != length { t.Errorf("expected cache length %d got %d", length, len(cache.cache)) } } kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/plugins.go000066400000000000000000000012611472614177300247060ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package auth import ( // Initialize common client auth plugins. _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" ) kubernetes-client-go-a2dfcab/plugin/pkg/client/auth/plugins_providers.go000066400000000000000000000013601472614177300270030ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package auth import ( // Initialize client auth plugins for cloud providers. _ "k8s.io/client-go/plugin/pkg/client/auth/azure" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" ) kubernetes-client-go-a2dfcab/rest/000077500000000000000000000000001472614177300173555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/rest/OWNERS000066400000000000000000000003101472614177300203070ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners reviewers: - thockin - smarterclayton - caesarxuchao - wojtek-t - deads2k - liggitt - sttts - luxas - dims - cjcullen - lojies kubernetes-client-go-a2dfcab/rest/client.go000066400000000000000000000152051472614177300211650ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "net/http" "net/url" "os" "strconv" "strings" "time" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/flowcontrol" ) const ( // Environment variables: Note that the duration should be long enough that the backoff // persists for some reasonable time (i.e. 120 seconds). The typical base might be "1". envBackoffBase = "KUBE_CLIENT_BACKOFF_BASE" envBackoffDuration = "KUBE_CLIENT_BACKOFF_DURATION" ) // Interface captures the set of operations for generically interacting with Kubernetes REST apis. type Interface interface { GetRateLimiter() flowcontrol.RateLimiter Verb(verb string) *Request Post() *Request Put() *Request Patch(pt types.PatchType) *Request Get() *Request Delete() *Request APIVersion() schema.GroupVersion } // ClientContentConfig controls how RESTClient communicates with the server. // // TODO: ContentConfig will be updated to accept a Negotiator instead of a // NegotiatedSerializer and NegotiatedSerializer will be removed. type ClientContentConfig struct { // AcceptContentTypes specifies the types the client will accept and is optional. // If not set, ContentType will be used to define the Accept header AcceptContentTypes string // ContentType specifies the wire format used to communicate with the server. // This value will be set as the Accept header on requests made to the server if // AcceptContentTypes is not set, and as the default content type on any object // sent to the server. If not set, "application/json" is used. ContentType string // GroupVersion is the API version to talk to. Must be provided when initializing // a RESTClient directly. When initializing a Client, will be set with the default // code version. This is used as the default group version for VersionedParams. GroupVersion schema.GroupVersion // Negotiator is used for obtaining encoders and decoders for multiple // supported media types. Negotiator runtime.ClientNegotiator } // RESTClient imposes common Kubernetes API conventions on a set of resource paths. // The baseURL is expected to point to an HTTP or HTTPS path that is the parent // of one or more resources. The server should return a decodable API resource // object, or an api.Status object which contains information about the reason for // any failure. // // Most consumers should use client.New() to get a Kubernetes API client. type RESTClient struct { // base is the root URL for all invocations of the client base *url.URL // versionedAPIPath is a path segment connecting the base URL to the resource root versionedAPIPath string // content describes how a RESTClient encodes and decodes responses. content ClientContentConfig // creates BackoffManager that is passed to requests. createBackoffMgr func() BackoffManager // rateLimiter is shared among all requests created by this client unless specifically // overridden. rateLimiter flowcontrol.RateLimiter // warningHandler is shared among all requests created by this client. // If not set, defaultWarningHandler is used. warningHandler WarningHandler // Set specific behavior of the client. If not set http.DefaultClient will be used. Client *http.Client } // NewRESTClient creates a new RESTClient. This client performs generic REST functions // such as Get, Put, Post, and Delete on specified paths. func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ClientContentConfig, rateLimiter flowcontrol.RateLimiter, client *http.Client) (*RESTClient, error) { if len(config.ContentType) == 0 { config.ContentType = "application/json" } base := *baseURL if !strings.HasSuffix(base.Path, "/") { base.Path += "/" } base.RawQuery = "" base.Fragment = "" return &RESTClient{ base: &base, versionedAPIPath: versionedAPIPath, content: config, createBackoffMgr: readExpBackoffConfig, rateLimiter: rateLimiter, Client: client, }, nil } // GetRateLimiter returns rate limiter for a given client, or nil if it's called on a nil client func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter { if c == nil { return nil } return c.rateLimiter } // readExpBackoffConfig handles the internal logic of determining what the // backoff policy is. By default if no information is available, NoBackoff. // TODO Generalize this see #17727 . func readExpBackoffConfig() BackoffManager { backoffBase := os.Getenv(envBackoffBase) backoffDuration := os.Getenv(envBackoffDuration) backoffBaseInt, errBase := strconv.ParseInt(backoffBase, 10, 64) backoffDurationInt, errDuration := strconv.ParseInt(backoffDuration, 10, 64) if errBase != nil || errDuration != nil { return &NoBackoff{} } return &URLBackoff{ Backoff: flowcontrol.NewBackOff( time.Duration(backoffBaseInt)*time.Second, time.Duration(backoffDurationInt)*time.Second)} } // Verb begins a request with a verb (GET, POST, PUT, DELETE). // // Example usage of RESTClient's request building interface: // c, err := NewRESTClient(...) // if err != nil { ... } // resp, err := c.Verb("GET"). // // Path("pods"). // SelectorParam("labels", "area=staging"). // Timeout(10*time.Second). // Do() // // if err != nil { ... } // list, ok := resp.(*api.PodList) func (c *RESTClient) Verb(verb string) *Request { return NewRequest(c).Verb(verb) } // Post begins a POST request. Short for c.Verb("POST"). func (c *RESTClient) Post() *Request { return c.Verb("POST") } // Put begins a PUT request. Short for c.Verb("PUT"). func (c *RESTClient) Put() *Request { return c.Verb("PUT") } // Patch begins a PATCH request. Short for c.Verb("Patch"). func (c *RESTClient) Patch(pt types.PatchType) *Request { return c.Verb("PATCH").SetHeader("Content-Type", string(pt)) } // Get begins a GET request. Short for c.Verb("GET"). func (c *RESTClient) Get() *Request { return c.Verb("GET") } // Delete begins a DELETE request. Short for c.Verb("DELETE"). func (c *RESTClient) Delete() *Request { return c.Verb("DELETE") } // APIVersion returns the APIVersion this RESTClient is expected to use. func (c *RESTClient) APIVersion() schema.GroupVersion { return c.content.GroupVersion } kubernetes-client-go-a2dfcab/rest/client_test.go000066400000000000000000000264051472614177300222300ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "fmt" "net/http" "net/http/httptest" "net/http/httputil" "net/url" "reflect" "testing" "time" v1 "k8s.io/api/core/v1" v1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" utiltesting "k8s.io/client-go/util/testing" "github.com/google/go-cmp/cmp" ) type TestParam struct { actualError error expectingError bool actualCreated bool expCreated bool expStatus *metav1.Status testBody bool testBodyErrorIsNotNil bool } // TestSerializer makes sure that you're always able to decode metav1.Status func TestSerializer(t *testing.T) { gv := v1beta1.SchemeGroupVersion contentConfig := ContentConfig{ ContentType: "application/json", GroupVersion: &gv, NegotiatedSerializer: scheme.Codecs.WithoutConversion(), } n := runtime.NewClientNegotiator(contentConfig.NegotiatedSerializer, gv) d, err := n.Decoder("application/json", nil) if err != nil { t.Fatal(err) } // bytes based on actual return from API server when encoding an "unversioned" object obj, err := runtime.Decode(d, []byte(`{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success"}`)) t.Log(obj) if err != nil { t.Fatal(err) } } func TestDoRequestSuccess(t *testing.T) { testServer, fakeHandler, status := testServerEnv(t, 200) defer testServer.Close() c, err := restClient(testServer) if err != nil { t.Fatalf("unexpected error: %v", err) } body, err := c.Get().Prefix("test").Do(context.Background()).Raw() testParam := TestParam{actualError: err, expectingError: false, expCreated: true, expStatus: status, testBody: true, testBodyErrorIsNotNil: false} validate(testParam, t, body, fakeHandler) } func TestDoRequestFailed(t *testing.T) { status := &metav1.Status{ Code: http.StatusNotFound, Status: metav1.StatusFailure, Reason: metav1.StatusReasonNotFound, Message: " \"\" not found", Details: &metav1.StatusDetails{}, } expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), status) fakeHandler := utiltesting.FakeHandler{ StatusCode: 404, ResponseBody: string(expectedBody), T: t, } testServer := httptest.NewServer(&fakeHandler) defer testServer.Close() c, err := restClient(testServer) if err != nil { t.Fatalf("unexpected error: %v", err) } err = c.Get().Do(context.Background()).Error() if err == nil { t.Errorf("unexpected non-error") } ss, ok := err.(errors.APIStatus) if !ok { t.Errorf("unexpected error type %v", err) } actual := ss.Status() if !reflect.DeepEqual(status, &actual) { t.Errorf("Unexpected mis-match: %s", cmp.Diff(status, &actual)) } } func TestDoRawRequestFailed(t *testing.T) { status := &metav1.Status{ Code: http.StatusNotFound, Status: metav1.StatusFailure, Reason: metav1.StatusReasonNotFound, Message: "the server could not find the requested resource", Details: &metav1.StatusDetails{ Causes: []metav1.StatusCause{ {Type: metav1.CauseTypeUnexpectedServerResponse, Message: "unknown"}, }, }, } expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), status) fakeHandler := utiltesting.FakeHandler{ StatusCode: 404, ResponseBody: string(expectedBody), T: t, } testServer := httptest.NewServer(&fakeHandler) defer testServer.Close() c, err := restClient(testServer) if err != nil { t.Fatalf("unexpected error: %v", err) } body, err := c.Get().Do(context.Background()).Raw() if err == nil || body == nil { t.Errorf("unexpected non-error: %#v", body) } ss, ok := err.(errors.APIStatus) if !ok { t.Errorf("unexpected error type %v", err) } actual := ss.Status() if !reflect.DeepEqual(status, &actual) { t.Errorf("Unexpected mis-match: %s", cmp.Diff(status, &actual)) } } func TestDoRequestCreated(t *testing.T) { testServer, fakeHandler, status := testServerEnv(t, 201) defer testServer.Close() c, err := restClient(testServer) if err != nil { t.Fatalf("unexpected error: %v", err) } created := false body, err := c.Get().Prefix("test").Do(context.Background()).WasCreated(&created).Raw() testParam := TestParam{actualError: err, expectingError: false, expCreated: true, expStatus: status, testBody: false} validate(testParam, t, body, fakeHandler) } func TestDoRequestNotCreated(t *testing.T) { testServer, fakeHandler, expectedStatus := testServerEnv(t, 202) defer testServer.Close() c, err := restClient(testServer) if err != nil { t.Fatalf("unexpected error: %v", err) } created := false body, err := c.Get().Prefix("test").Do(context.Background()).WasCreated(&created).Raw() testParam := TestParam{actualError: err, expectingError: false, expCreated: false, expStatus: expectedStatus, testBody: false} validate(testParam, t, body, fakeHandler) } func TestDoRequestAcceptedNoContentReturned(t *testing.T) { testServer, fakeHandler, _ := testServerEnv(t, 204) defer testServer.Close() c, err := restClient(testServer) if err != nil { t.Fatalf("unexpected error: %v", err) } created := false body, err := c.Get().Prefix("test").Do(context.Background()).WasCreated(&created).Raw() testParam := TestParam{actualError: err, expectingError: false, expCreated: false, testBody: false} validate(testParam, t, body, fakeHandler) } func TestBadRequest(t *testing.T) { testServer, fakeHandler, _ := testServerEnv(t, 400) defer testServer.Close() c, err := restClient(testServer) if err != nil { t.Fatalf("unexpected error: %v", err) } created := false body, err := c.Get().Prefix("test").Do(context.Background()).WasCreated(&created).Raw() testParam := TestParam{actualError: err, expectingError: true, expCreated: false, testBody: true} validate(testParam, t, body, fakeHandler) } func validate(testParam TestParam, t *testing.T, body []byte, fakeHandler *utiltesting.FakeHandler) { switch { case testParam.expectingError && testParam.actualError == nil: t.Errorf("Expected error") case !testParam.expectingError && testParam.actualError != nil: t.Error(testParam.actualError) } if !testParam.expCreated { if testParam.actualCreated { t.Errorf("Expected object not to be created") } } statusOut, err := runtime.Decode(scheme.Codecs.UniversalDeserializer(), body) if testParam.testBody { if testParam.testBodyErrorIsNotNil && err == nil { t.Errorf("Expected Error") } if !testParam.testBodyErrorIsNotNil && err != nil { t.Errorf("Unexpected Error: %v", err) } } if testParam.expStatus != nil { if !reflect.DeepEqual(testParam.expStatus, statusOut) { t.Errorf("Unexpected mis-match. Expected %#v. Saw %#v", testParam.expStatus, statusOut) } } fakeHandler.ValidateRequest(t, "/"+v1.SchemeGroupVersion.String()+"/test", "GET", nil) } func TestHTTPMethods(t *testing.T) { testServer, _, _ := testServerEnv(t, 200) defer testServer.Close() c, _ := restClient(testServer) request := c.Post() if request == nil { t.Errorf("Post : Object returned should not be nil") } request = c.Get() if request == nil { t.Errorf("Get: Object returned should not be nil") } request = c.Put() if request == nil { t.Errorf("Put : Object returned should not be nil") } request = c.Delete() if request == nil { t.Errorf("Delete : Object returned should not be nil") } request = c.Patch(types.JSONPatchType) if request == nil { t.Errorf("Patch : Object returned should not be nil") } } func TestHTTPProxy(t *testing.T) { ctx := context.Background() testServer, fh, _ := testServerEnv(t, 200) fh.ResponseBody = "backend data" defer testServer.Close() testProxyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { to, err := url.Parse(req.RequestURI) if err != nil { t.Fatalf("err: %v", err) } w.Write([]byte("proxied: ")) httputil.NewSingleHostReverseProxy(to).ServeHTTP(w, req) })) defer testProxyServer.Close() t.Logf(testProxyServer.URL) u, err := url.Parse(testProxyServer.URL) if err != nil { t.Fatalf("Failed to parse test proxy server url: %v", err) } c, err := RESTClientFor(&Config{ Host: testServer.URL, ContentConfig: ContentConfig{ GroupVersion: &v1.SchemeGroupVersion, NegotiatedSerializer: scheme.Codecs.WithoutConversion(), }, Proxy: http.ProxyURL(u), Username: "user", Password: "pass", }) if err != nil { t.Fatalf("Failed to create client: %v", err) } request := c.Get() if request == nil { t.Fatalf("Get: Object returned should not be nil") } b, err := request.DoRaw(ctx) if err != nil { t.Fatalf("unexpected err: %v", err) } if got, want := string(b), "proxied: backend data"; !cmp.Equal(got, want) { t.Errorf("unexpected body: %v", cmp.Diff(want, got)) } } func TestCreateBackoffManager(t *testing.T) { theUrl, _ := url.Parse("http://localhost") // 1 second base backoff + duration of 2 seconds -> exponential backoff for requests. t.Setenv(envBackoffBase, "1") t.Setenv(envBackoffDuration, "2") backoff := readExpBackoffConfig() backoff.UpdateBackoff(theUrl, nil, 500) backoff.UpdateBackoff(theUrl, nil, 500) if backoff.CalculateBackoff(theUrl)/time.Second != 2 { t.Errorf("Backoff env not working.") } // 0 duration -> no backoff. t.Setenv(envBackoffBase, "1") t.Setenv(envBackoffDuration, "0") backoff.UpdateBackoff(theUrl, nil, 500) backoff.UpdateBackoff(theUrl, nil, 500) backoff = readExpBackoffConfig() if backoff.CalculateBackoff(theUrl)/time.Second != 0 { t.Errorf("Zero backoff duration, but backoff still occurring.") } // No env -> No backoff. t.Setenv(envBackoffBase, "") t.Setenv(envBackoffDuration, "") backoff = readExpBackoffConfig() backoff.UpdateBackoff(theUrl, nil, 500) backoff.UpdateBackoff(theUrl, nil, 500) if backoff.CalculateBackoff(theUrl)/time.Second != 0 { t.Errorf("Backoff should have been 0.") } } func testServerEnv(t *testing.T, statusCode int) (*httptest.Server, *utiltesting.FakeHandler, *metav1.Status) { status := &metav1.Status{TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Status"}, Status: fmt.Sprintf("%s", metav1.StatusSuccess)} expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), status) fakeHandler := utiltesting.FakeHandler{ StatusCode: statusCode, ResponseBody: string(expectedBody), T: t, } testServer := httptest.NewServer(&fakeHandler) return testServer, &fakeHandler, status } func restClient(testServer *httptest.Server) (*RESTClient, error) { c, err := RESTClientFor(&Config{ Host: testServer.URL, ContentConfig: ContentConfig{ GroupVersion: &v1.SchemeGroupVersion, NegotiatedSerializer: scheme.Codecs.WithoutConversion(), }, Username: "user", Password: "pass", }) return c, err } kubernetes-client-go-a2dfcab/rest/config.go000066400000000000000000000544521472614177300211630ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "errors" "fmt" "net" "net/http" "net/url" "os" "path/filepath" gruntime "runtime" "strings" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/pkg/version" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/transport" certutil "k8s.io/client-go/util/cert" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" ) const ( DefaultQPS float32 = 5.0 DefaultBurst int = 10 ) var ErrNotInCluster = errors.New("unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined") // Config holds the common attributes that can be passed to a Kubernetes client on // initialization. type Config struct { // Host must be a host string, a host:port pair, or a URL to the base of the apiserver. // If a URL is given then the (optional) Path of that URL represents a prefix that must // be appended to all request URIs used to access the apiserver. This allows a frontend // proxy to easily relocate all of the apiserver endpoints. Host string // APIPath is a sub-path that points to an API root. APIPath string // ContentConfig contains settings that affect how objects are transformed when // sent to the server. ContentConfig // Server requires Basic authentication Username string Password string `datapolicy:"password"` // Server requires Bearer authentication. This client will not attempt to use // refresh tokens for an OAuth2 flow. // TODO: demonstrate an OAuth2 compatible client. BearerToken string `datapolicy:"token"` // Path to a file containing a BearerToken. // If set, the contents are periodically read. // The last successfully read value takes precedence over BearerToken. BearerTokenFile string // Impersonate is the configuration that RESTClient will use for impersonation. Impersonate ImpersonationConfig // Server requires plugin-specified authentication. AuthProvider *clientcmdapi.AuthProviderConfig // Callback to persist config for AuthProvider. AuthConfigPersister AuthProviderConfigPersister // Exec-based authentication provider. ExecProvider *clientcmdapi.ExecConfig // TLSClientConfig contains settings to enable transport layer security TLSClientConfig // UserAgent is an optional field that specifies the caller of this request. UserAgent string // DisableCompression bypasses automatic GZip compression requests to the // server. DisableCompression bool // Transport may be used for custom HTTP behavior. This attribute may not // be specified with the TLS client certificate options. Use WrapTransport // to provide additional per-server middleware behavior. Transport http.RoundTripper // WrapTransport will be invoked for custom HTTP behavior after the underlying // transport is initialized (either the transport created from TLSClientConfig, // Transport, or http.DefaultTransport). The config may layer other RoundTrippers // on top of the returned RoundTripper. // // A future release will change this field to an array. Use config.Wrap() // instead of setting this value directly. WrapTransport transport.WrapperFunc // QPS indicates the maximum QPS to the master from this client. // If it's zero, the created RESTClient will use DefaultQPS: 5 QPS float32 // Maximum burst for throttle. // If it's zero, the created RESTClient will use DefaultBurst: 10. Burst int // Rate limiter for limiting connections to the master from this client. If present overwrites QPS/Burst RateLimiter flowcontrol.RateLimiter // WarningHandler handles warnings in server responses. // If not set, the default warning handler is used. // See documentation for SetDefaultWarningHandler() for details. WarningHandler WarningHandler // The maximum length of time to wait before giving up on a server request. A value of zero means no timeout. Timeout time.Duration // Dial specifies the dial function for creating unencrypted TCP connections. Dial func(ctx context.Context, network, address string) (net.Conn, error) // Proxy is the proxy func to be used for all requests made by this // transport. If Proxy is nil, http.ProxyFromEnvironment is used. If Proxy // returns a nil *URL, no proxy is used. // // socks5 proxying does not currently support spdy streaming endpoints. Proxy func(*http.Request) (*url.URL, error) // Version forces a specific version to be used (if registered) // Do we need this? // Version string } var _ fmt.Stringer = new(Config) var _ fmt.GoStringer = new(Config) type sanitizedConfig *Config type sanitizedAuthConfigPersister struct{ AuthProviderConfigPersister } func (sanitizedAuthConfigPersister) GoString() string { return "rest.AuthProviderConfigPersister(--- REDACTED ---)" } func (sanitizedAuthConfigPersister) String() string { return "rest.AuthProviderConfigPersister(--- REDACTED ---)" } type sanitizedObject struct{ runtime.Object } func (sanitizedObject) GoString() string { return "runtime.Object(--- REDACTED ---)" } func (sanitizedObject) String() string { return "runtime.Object(--- REDACTED ---)" } // GoString implements fmt.GoStringer and sanitizes sensitive fields of Config // to prevent accidental leaking via logs. func (c *Config) GoString() string { return c.String() } // String implements fmt.Stringer and sanitizes sensitive fields of Config to // prevent accidental leaking via logs. func (c *Config) String() string { if c == nil { return "" } cc := sanitizedConfig(CopyConfig(c)) // Explicitly mark non-empty credential fields as redacted. if cc.Password != "" { cc.Password = "--- REDACTED ---" } if cc.BearerToken != "" { cc.BearerToken = "--- REDACTED ---" } if cc.AuthConfigPersister != nil { cc.AuthConfigPersister = sanitizedAuthConfigPersister{cc.AuthConfigPersister} } if cc.ExecProvider != nil && cc.ExecProvider.Config != nil { cc.ExecProvider.Config = sanitizedObject{Object: cc.ExecProvider.Config} } return fmt.Sprintf("%#v", cc) } // ImpersonationConfig has all the available impersonation options type ImpersonationConfig struct { // UserName is the username to impersonate on each request. UserName string // UID is a unique value that identifies the user. UID string // Groups are the groups to impersonate on each request. Groups []string // Extra is a free-form field which can be used to link some authentication information // to authorization information. This field allows you to impersonate it. Extra map[string][]string } // +k8s:deepcopy-gen=true // TLSClientConfig contains settings to enable transport layer security type TLSClientConfig struct { // Server should be accessed without verifying the TLS certificate. For testing only. Insecure bool // ServerName is passed to the server for SNI and is used in the client to check server // certificates against. If ServerName is empty, the hostname used to contact the // server is used. ServerName string // Server requires TLS client certificate authentication CertFile string // Server requires TLS client certificate authentication KeyFile string // Trusted root certificates for server CAFile string // CertData holds PEM-encoded bytes (typically read from a client certificate file). // CertData takes precedence over CertFile CertData []byte // KeyData holds PEM-encoded bytes (typically read from a client certificate key file). // KeyData takes precedence over KeyFile KeyData []byte `datapolicy:"security-key"` // CAData holds PEM-encoded bytes (typically read from a root certificates bundle). // CAData takes precedence over CAFile CAData []byte // NextProtos is a list of supported application level protocols, in order of preference. // Used to populate tls.Config.NextProtos. // To indicate to the server http/1.1 is preferred over http/2, set to ["http/1.1", "h2"] (though the server is free to ignore that preference). // To use only http/1.1, set to ["http/1.1"]. NextProtos []string } var _ fmt.Stringer = TLSClientConfig{} var _ fmt.GoStringer = TLSClientConfig{} type sanitizedTLSClientConfig TLSClientConfig // GoString implements fmt.GoStringer and sanitizes sensitive fields of // TLSClientConfig to prevent accidental leaking via logs. func (c TLSClientConfig) GoString() string { return c.String() } // String implements fmt.Stringer and sanitizes sensitive fields of // TLSClientConfig to prevent accidental leaking via logs. func (c TLSClientConfig) String() string { cc := sanitizedTLSClientConfig{ Insecure: c.Insecure, ServerName: c.ServerName, CertFile: c.CertFile, KeyFile: c.KeyFile, CAFile: c.CAFile, CertData: c.CertData, KeyData: c.KeyData, CAData: c.CAData, NextProtos: c.NextProtos, } // Explicitly mark non-empty credential fields as redacted. if len(cc.CertData) != 0 { cc.CertData = []byte("--- TRUNCATED ---") } if len(cc.KeyData) != 0 { cc.KeyData = []byte("--- REDACTED ---") } return fmt.Sprintf("%#v", cc) } type ContentConfig struct { // AcceptContentTypes specifies the types the client will accept and is optional. // If not set, ContentType will be used to define the Accept header AcceptContentTypes string // ContentType specifies the wire format used to communicate with the server. // This value will be set as the Accept header on requests made to the server, and // as the default content type on any object sent to the server. If not set, // "application/json" is used. ContentType string // GroupVersion is the API version to talk to. Must be provided when initializing // a RESTClient directly. When initializing a Client, will be set with the default // code version. GroupVersion *schema.GroupVersion // NegotiatedSerializer is used for obtaining encoders and decoders for multiple // supported media types. // // TODO: NegotiatedSerializer will be phased out as internal clients are removed // from Kubernetes. NegotiatedSerializer runtime.NegotiatedSerializer } // RESTClientFor returns a RESTClient that satisfies the requested attributes on a client Config // object. Note that a RESTClient may require fields that are optional when initializing a Client. // A RESTClient created by this method is generic - it expects to operate on an API that follows // the Kubernetes conventions, but may not be the Kubernetes API. // RESTClientFor is equivalent to calling RESTClientForConfigAndClient(config, httpClient), // where httpClient was generated with HTTPClientFor(config). func RESTClientFor(config *Config) (*RESTClient, error) { if config.GroupVersion == nil { return nil, fmt.Errorf("GroupVersion is required when initializing a RESTClient") } if config.NegotiatedSerializer == nil { return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient") } // Validate config.Host before constructing the transport/client so we can fail fast. // ServerURL will be obtained later in RESTClientForConfigAndClient() _, _, err := DefaultServerUrlFor(config) if err != nil { return nil, err } httpClient, err := HTTPClientFor(config) if err != nil { return nil, err } return RESTClientForConfigAndClient(config, httpClient) } // RESTClientForConfigAndClient returns a RESTClient that satisfies the requested attributes on a // client Config object. // Unlike RESTClientFor, RESTClientForConfigAndClient allows to pass an http.Client that is shared // between all the API Groups and Versions. // Note that the http client takes precedence over the transport values configured. // The http client defaults to the `http.DefaultClient` if nil. func RESTClientForConfigAndClient(config *Config, httpClient *http.Client) (*RESTClient, error) { if config.GroupVersion == nil { return nil, fmt.Errorf("GroupVersion is required when initializing a RESTClient") } if config.NegotiatedSerializer == nil { return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient") } baseURL, versionedAPIPath, err := DefaultServerUrlFor(config) if err != nil { return nil, err } rateLimiter := config.RateLimiter if rateLimiter == nil { qps := config.QPS if config.QPS == 0.0 { qps = DefaultQPS } burst := config.Burst if config.Burst == 0 { burst = DefaultBurst } if qps > 0 { rateLimiter = flowcontrol.NewTokenBucketRateLimiter(qps, burst) } } var gv schema.GroupVersion if config.GroupVersion != nil { gv = *config.GroupVersion } clientContent := ClientContentConfig{ AcceptContentTypes: config.AcceptContentTypes, ContentType: config.ContentType, GroupVersion: gv, Negotiator: runtime.NewClientNegotiator(config.NegotiatedSerializer, gv), } restClient, err := NewRESTClient(baseURL, versionedAPIPath, clientContent, rateLimiter, httpClient) if err == nil && config.WarningHandler != nil { restClient.warningHandler = config.WarningHandler } return restClient, err } // UnversionedRESTClientFor is the same as RESTClientFor, except that it allows // the config.Version to be empty. func UnversionedRESTClientFor(config *Config) (*RESTClient, error) { if config.NegotiatedSerializer == nil { return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient") } // Validate config.Host before constructing the transport/client so we can fail fast. // ServerURL will be obtained later in UnversionedRESTClientForConfigAndClient() _, _, err := DefaultServerUrlFor(config) if err != nil { return nil, err } httpClient, err := HTTPClientFor(config) if err != nil { return nil, err } return UnversionedRESTClientForConfigAndClient(config, httpClient) } // UnversionedRESTClientForConfigAndClient is the same as RESTClientForConfigAndClient, // except that it allows the config.Version to be empty. func UnversionedRESTClientForConfigAndClient(config *Config, httpClient *http.Client) (*RESTClient, error) { if config.NegotiatedSerializer == nil { return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient") } baseURL, versionedAPIPath, err := DefaultServerUrlFor(config) if err != nil { return nil, err } rateLimiter := config.RateLimiter if rateLimiter == nil { qps := config.QPS if config.QPS == 0.0 { qps = DefaultQPS } burst := config.Burst if config.Burst == 0 { burst = DefaultBurst } if qps > 0 { rateLimiter = flowcontrol.NewTokenBucketRateLimiter(qps, burst) } } gv := metav1.SchemeGroupVersion if config.GroupVersion != nil { gv = *config.GroupVersion } clientContent := ClientContentConfig{ AcceptContentTypes: config.AcceptContentTypes, ContentType: config.ContentType, GroupVersion: gv, Negotiator: runtime.NewClientNegotiator(config.NegotiatedSerializer, gv), } restClient, err := NewRESTClient(baseURL, versionedAPIPath, clientContent, rateLimiter, httpClient) if err == nil && config.WarningHandler != nil { restClient.warningHandler = config.WarningHandler } return restClient, err } // SetKubernetesDefaults sets default values on the provided client config for accessing the // Kubernetes API or returns an error if any of the defaults are impossible or invalid. func SetKubernetesDefaults(config *Config) error { if len(config.UserAgent) == 0 { config.UserAgent = DefaultKubernetesUserAgent() } return nil } // adjustCommit returns sufficient significant figures of the commit's git hash. func adjustCommit(c string) string { if len(c) == 0 { return "unknown" } if len(c) > 7 { return c[:7] } return c } // adjustVersion strips "alpha", "beta", etc. from version in form // major.minor.patch-[alpha|beta|etc]. func adjustVersion(v string) string { if len(v) == 0 { return "unknown" } seg := strings.SplitN(v, "-", 2) return seg[0] } // adjustCommand returns the last component of the // OS-specific command path for use in User-Agent. func adjustCommand(p string) string { // Unlikely, but better than returning "". if len(p) == 0 { return "unknown" } return filepath.Base(p) } // buildUserAgent builds a User-Agent string from given args. func buildUserAgent(command, version, os, arch, commit string) string { return fmt.Sprintf( "%s/%s (%s/%s) kubernetes/%s", command, version, os, arch, commit) } // DefaultKubernetesUserAgent returns a User-Agent string built from static global vars. func DefaultKubernetesUserAgent() string { return buildUserAgent( adjustCommand(os.Args[0]), adjustVersion(version.Get().GitVersion), gruntime.GOOS, gruntime.GOARCH, adjustCommit(version.Get().GitCommit)) } // InClusterConfig returns a config object which uses the service account // kubernetes gives to pods. It's intended for clients that expect to be // running inside a pod running on kubernetes. It will return ErrNotInCluster // if called from a process not running in a kubernetes environment. func InClusterConfig() (*Config, error) { const ( tokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token" rootCAFile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" ) host, port := os.Getenv("KUBERNETES_SERVICE_HOST"), os.Getenv("KUBERNETES_SERVICE_PORT") if len(host) == 0 || len(port) == 0 { return nil, ErrNotInCluster } token, err := os.ReadFile(tokenFile) if err != nil { return nil, err } tlsClientConfig := TLSClientConfig{} if _, err := certutil.NewPool(rootCAFile); err != nil { klog.Errorf("Expected to load root CA config from %s, but got err: %v", rootCAFile, err) } else { tlsClientConfig.CAFile = rootCAFile } return &Config{ // TODO: switch to using cluster DNS. Host: "https://" + net.JoinHostPort(host, port), TLSClientConfig: tlsClientConfig, BearerToken: string(token), BearerTokenFile: tokenFile, }, nil } // IsConfigTransportTLS returns true if and only if the provided // config will result in a protected connection to the server when it // is passed to restclient.RESTClientFor(). Use to determine when to // send credentials over the wire. // // Note: the Insecure flag is ignored when testing for this value, so MITM attacks are // still possible. func IsConfigTransportTLS(config Config) bool { baseURL, _, err := DefaultServerUrlFor(&config) if err != nil { return false } return baseURL.Scheme == "https" } // LoadTLSFiles copies the data from the CertFile, KeyFile, and CAFile fields into the CertData, // KeyData, and CAFile fields, or returns an error. If no error is returned, all three fields are // either populated or were empty to start. func LoadTLSFiles(c *Config) error { var err error c.CAData, err = dataFromSliceOrFile(c.CAData, c.CAFile) if err != nil { return err } c.CertData, err = dataFromSliceOrFile(c.CertData, c.CertFile) if err != nil { return err } c.KeyData, err = dataFromSliceOrFile(c.KeyData, c.KeyFile) return err } // dataFromSliceOrFile returns data from the slice (if non-empty), or from the file, // or an error if an error occurred reading the file func dataFromSliceOrFile(data []byte, file string) ([]byte, error) { if len(data) > 0 { return data, nil } if len(file) > 0 { fileData, err := os.ReadFile(file) if err != nil { return []byte{}, err } return fileData, nil } return nil, nil } func AddUserAgent(config *Config, userAgent string) *Config { fullUserAgent := DefaultKubernetesUserAgent() + "/" + userAgent config.UserAgent = fullUserAgent return config } // AnonymousClientConfig returns a copy of the given config with all user credentials (cert/key, bearer token, and username/password) and custom transports (WrapTransport, Transport) removed func AnonymousClientConfig(config *Config) *Config { // copy only known safe fields return &Config{ Host: config.Host, APIPath: config.APIPath, ContentConfig: config.ContentConfig, TLSClientConfig: TLSClientConfig{ Insecure: config.Insecure, ServerName: config.ServerName, CAFile: config.TLSClientConfig.CAFile, CAData: config.TLSClientConfig.CAData, NextProtos: config.TLSClientConfig.NextProtos, }, RateLimiter: config.RateLimiter, WarningHandler: config.WarningHandler, UserAgent: config.UserAgent, DisableCompression: config.DisableCompression, QPS: config.QPS, Burst: config.Burst, Timeout: config.Timeout, Dial: config.Dial, Proxy: config.Proxy, } } // CopyConfig returns a copy of the given config func CopyConfig(config *Config) *Config { c := &Config{ Host: config.Host, APIPath: config.APIPath, ContentConfig: config.ContentConfig, Username: config.Username, Password: config.Password, BearerToken: config.BearerToken, BearerTokenFile: config.BearerTokenFile, Impersonate: ImpersonationConfig{ UserName: config.Impersonate.UserName, UID: config.Impersonate.UID, Groups: config.Impersonate.Groups, Extra: config.Impersonate.Extra, }, AuthProvider: config.AuthProvider, AuthConfigPersister: config.AuthConfigPersister, ExecProvider: config.ExecProvider, TLSClientConfig: TLSClientConfig{ Insecure: config.TLSClientConfig.Insecure, ServerName: config.TLSClientConfig.ServerName, CertFile: config.TLSClientConfig.CertFile, KeyFile: config.TLSClientConfig.KeyFile, CAFile: config.TLSClientConfig.CAFile, CertData: config.TLSClientConfig.CertData, KeyData: config.TLSClientConfig.KeyData, CAData: config.TLSClientConfig.CAData, NextProtos: config.TLSClientConfig.NextProtos, }, UserAgent: config.UserAgent, DisableCompression: config.DisableCompression, Transport: config.Transport, WrapTransport: config.WrapTransport, QPS: config.QPS, Burst: config.Burst, RateLimiter: config.RateLimiter, WarningHandler: config.WarningHandler, Timeout: config.Timeout, Dial: config.Dial, Proxy: config.Proxy, } if config.ExecProvider != nil && config.ExecProvider.Config != nil { c.ExecProvider.Config = config.ExecProvider.Config.DeepCopyObject() } return c } kubernetes-client-go-a2dfcab/rest/config_test.go000066400000000000000000000466101472614177300222170ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "errors" "fmt" "io" "net" "net/http" "net/url" "path/filepath" "reflect" "strings" "testing" "time" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes/scheme" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/transport" "k8s.io/client-go/util/flowcontrol" "github.com/google/go-cmp/cmp" fuzz "github.com/google/gofuzz" "github.com/stretchr/testify/assert" ) func TestIsConfigTransportTLS(t *testing.T) { testCases := []struct { Config *Config TransportTLS bool }{ { Config: &Config{}, TransportTLS: false, }, { Config: &Config{ Host: "https://localhost", }, TransportTLS: true, }, { Config: &Config{ Host: "localhost", TLSClientConfig: TLSClientConfig{ CertFile: "foo", }, }, TransportTLS: true, }, { Config: &Config{ Host: "///:://localhost", TLSClientConfig: TLSClientConfig{ CertFile: "foo", }, }, TransportTLS: false, }, { Config: &Config{ Host: "1.2.3.4:567", TLSClientConfig: TLSClientConfig{ Insecure: true, }, }, TransportTLS: true, }, } for _, testCase := range testCases { if err := SetKubernetesDefaults(testCase.Config); err != nil { t.Errorf("setting defaults failed for %#v: %v", testCase.Config, err) continue } useTLS := IsConfigTransportTLS(*testCase.Config) if testCase.TransportTLS != useTLS { t.Errorf("expected %v for %#v", testCase.TransportTLS, testCase.Config) } } } func TestSetKubernetesDefaultsUserAgent(t *testing.T) { config := &Config{} if err := SetKubernetesDefaults(config); err != nil { t.Errorf("unexpected error: %v", err) } if !strings.Contains(config.UserAgent, "kubernetes/") { t.Errorf("no user agent set: %#v", config) } } func TestAdjustVersion(t *testing.T) { assert := assert.New(t) assert.Equal("1.2.3", adjustVersion("1.2.3-alpha4")) assert.Equal("1.2.3", adjustVersion("1.2.3-alpha")) assert.Equal("1.2.3", adjustVersion("1.2.3")) assert.Equal("unknown", adjustVersion("")) } func TestAdjustCommit(t *testing.T) { assert := assert.New(t) assert.Equal("1234567", adjustCommit("1234567890")) assert.Equal("123456", adjustCommit("123456")) assert.Equal("unknown", adjustCommit("")) } func TestAdjustCommand(t *testing.T) { assert := assert.New(t) assert.Equal("beans", adjustCommand(filepath.Join("home", "bob", "Downloads", "beans"))) assert.Equal("beans", adjustCommand(filepath.Join(".", "beans"))) assert.Equal("beans", adjustCommand("beans")) assert.Equal("unknown", adjustCommand("")) } func TestBuildUserAgent(t *testing.T) { assert.New(t).Equal( "lynx/nicest (beos/itanium) kubernetes/baaaaaaaaad", buildUserAgent( "lynx", "nicest", "beos", "itanium", "baaaaaaaaad")) } // This function untestable since it doesn't accept arguments. func TestDefaultKubernetesUserAgent(t *testing.T) { assert.New(t).Contains(DefaultKubernetesUserAgent(), "kubernetes") } func TestRESTClientRequires(t *testing.T) { if _, err := RESTClientFor(&Config{Host: "127.0.0.1", ContentConfig: ContentConfig{NegotiatedSerializer: scheme.Codecs}}); err == nil { t.Errorf("unexpected non-error") } if _, err := RESTClientFor(&Config{Host: "127.0.0.1", ContentConfig: ContentConfig{GroupVersion: &v1.SchemeGroupVersion}}); err == nil { t.Errorf("unexpected non-error") } if _, err := RESTClientFor(&Config{Host: "127.0.0.1", ContentConfig: ContentConfig{GroupVersion: &v1.SchemeGroupVersion, NegotiatedSerializer: scheme.Codecs}}); err != nil { t.Errorf("unexpected error: %v", err) } } func TestRESTClientLimiter(t *testing.T) { testCases := []struct { Name string Config Config Limiter flowcontrol.RateLimiter }{ { Name: "with no QPS", Config: Config{}, Limiter: flowcontrol.NewTokenBucketRateLimiter(5, 10), }, { Name: "with QPS:10", Config: Config{QPS: 10}, Limiter: flowcontrol.NewTokenBucketRateLimiter(10, 10), }, { Name: "with QPS:-1", Config: Config{QPS: -1}, Limiter: nil, }, { Name: "with RateLimiter", Config: Config{ RateLimiter: flowcontrol.NewTokenBucketRateLimiter(11, 12), }, Limiter: flowcontrol.NewTokenBucketRateLimiter(11, 12), }, } for _, testCase := range testCases { t.Run("Versioned_"+testCase.Name, func(t *testing.T) { config := testCase.Config config.Host = "127.0.0.1" config.ContentConfig = ContentConfig{GroupVersion: &v1.SchemeGroupVersion, NegotiatedSerializer: scheme.Codecs} client, err := RESTClientFor(&config) if err != nil { t.Fatalf("unexpected error: %v", err) } if !reflect.DeepEqual(testCase.Limiter, client.rateLimiter) { t.Fatalf("unexpected rate limiter: %#v, expected %#v at %s", client.rateLimiter, testCase.Limiter, testCase.Name) } }) t.Run("Unversioned_"+testCase.Name, func(t *testing.T) { config := testCase.Config config.Host = "127.0.0.1" config.ContentConfig = ContentConfig{GroupVersion: &v1.SchemeGroupVersion, NegotiatedSerializer: scheme.Codecs} client, err := UnversionedRESTClientFor(&config) if err != nil { t.Fatalf("unexpected error: %v", err) } if !reflect.DeepEqual(testCase.Limiter, client.rateLimiter) { t.Fatalf("unexpected rate limiter: %#v, expected %#v at %s", client.rateLimiter, testCase.Limiter, testCase.Name) } }) } } type fakeLimiter struct { FakeSaturation float64 FakeQPS float32 } func (t *fakeLimiter) TryAccept() bool { return true } func (t *fakeLimiter) Saturation() float64 { return t.FakeSaturation } func (t *fakeLimiter) QPS() float32 { return t.FakeQPS } func (t *fakeLimiter) Wait(ctx context.Context) error { return nil } func (t *fakeLimiter) Stop() {} func (t *fakeLimiter) Accept() {} type fakeCodec struct{} func (c *fakeCodec) Decode([]byte, *schema.GroupVersionKind, runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) { return nil, nil, nil } func (c *fakeCodec) Encode(obj runtime.Object, stream io.Writer) error { return nil } func (c *fakeCodec) Identifier() runtime.Identifier { return runtime.Identifier("fake") } type fakeRoundTripper struct{} func (r *fakeRoundTripper) RoundTrip(*http.Request) (*http.Response, error) { return nil, nil } var fakeWrapperFunc = func(http.RoundTripper) http.RoundTripper { return &fakeRoundTripper{} } type fakeWarningHandler struct{} func (f fakeWarningHandler) HandleWarningHeader(code int, agent string, message string) {} type fakeNegotiatedSerializer struct{} func (n *fakeNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInfo { return nil } func (n *fakeNegotiatedSerializer) EncoderForVersion(serializer runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder { return &fakeCodec{} } func (n *fakeNegotiatedSerializer) DecoderToVersion(serializer runtime.Decoder, gv runtime.GroupVersioner) runtime.Decoder { return &fakeCodec{} } var fakeDialFunc = func(ctx context.Context, network, addr string) (net.Conn, error) { return nil, fakeDialerError } var fakeDialerError = errors.New("fakedialer") func fakeProxyFunc(*http.Request) (*url.URL, error) { return nil, errors.New("fakeproxy") } type fakeAuthProviderConfigPersister struct{} func (fakeAuthProviderConfigPersister) Persist(map[string]string) error { return fakeAuthProviderConfigPersisterError } var fakeAuthProviderConfigPersisterError = errors.New("fakeAuthProviderConfigPersisterError") func TestAnonymousAuthConfig(t *testing.T) { f := fuzz.New().NilChance(0.0).NumElements(1, 1) f.Funcs( func(r *runtime.Codec, f fuzz.Continue) { codec := &fakeCodec{} f.Fuzz(codec) *r = codec }, func(r *http.RoundTripper, f fuzz.Continue) { roundTripper := &fakeRoundTripper{} f.Fuzz(roundTripper) *r = roundTripper }, func(fn *func(http.RoundTripper) http.RoundTripper, f fuzz.Continue) { *fn = fakeWrapperFunc }, func(fn *transport.WrapperFunc, f fuzz.Continue) { *fn = fakeWrapperFunc }, func(r *runtime.NegotiatedSerializer, f fuzz.Continue) { serializer := &fakeNegotiatedSerializer{} f.Fuzz(serializer) *r = serializer }, func(r *flowcontrol.RateLimiter, f fuzz.Continue) { limiter := &fakeLimiter{} f.Fuzz(limiter) *r = limiter }, func(h *WarningHandler, f fuzz.Continue) { *h = &fakeWarningHandler{} }, // Authentication does not require fuzzer func(r *AuthProviderConfigPersister, f fuzz.Continue) {}, func(r *clientcmdapi.AuthProviderConfig, f fuzz.Continue) { r.Config = map[string]string{} }, func(r *func(ctx context.Context, network, addr string) (net.Conn, error), f fuzz.Continue) { *r = fakeDialFunc }, func(r *func(*http.Request) (*url.URL, error), f fuzz.Continue) { *r = fakeProxyFunc }, func(r *runtime.Object, f fuzz.Continue) { unknown := &runtime.Unknown{} f.Fuzz(unknown) *r = unknown }, ) for i := 0; i < 20; i++ { original := &Config{} f.Fuzz(original) actual := AnonymousClientConfig(original) expected := *original // this is the list of known security related fields, add to this list if a new field // is added to Config, update AnonymousClientConfig to preserve the field otherwise. expected.Impersonate = ImpersonationConfig{} expected.BearerToken = "" expected.BearerTokenFile = "" expected.Username = "" expected.Password = "" expected.AuthProvider = nil expected.AuthConfigPersister = nil expected.ExecProvider = nil expected.TLSClientConfig.CertData = nil expected.TLSClientConfig.CertFile = "" expected.TLSClientConfig.KeyData = nil expected.TLSClientConfig.KeyFile = "" expected.Transport = nil expected.WrapTransport = nil if actual.Dial != nil { _, actualError := actual.Dial(context.Background(), "", "") _, expectedError := expected.Dial(context.Background(), "", "") if !reflect.DeepEqual(expectedError, actualError) { t.Fatalf("AnonymousClientConfig dropped the Dial field") } } actual.Dial = nil expected.Dial = nil if actual.Proxy != nil { _, actualError := actual.Proxy(nil) _, expectedError := expected.Proxy(nil) if !reflect.DeepEqual(expectedError, actualError) { t.Fatalf("AnonymousClientConfig dropped the Proxy field") } } actual.Proxy = nil expected.Proxy = nil if diff := cmp.Diff(*actual, expected); diff != "" { t.Fatalf("AnonymousClientConfig dropped unexpected fields, identify whether they are security related or not (-got, +want): %s", diff) } } } func TestCopyConfig(t *testing.T) { f := fuzz.New().NilChance(0.0).NumElements(1, 1) f.Funcs( func(r *runtime.Codec, f fuzz.Continue) { codec := &fakeCodec{} f.Fuzz(codec) *r = codec }, func(r *http.RoundTripper, f fuzz.Continue) { roundTripper := &fakeRoundTripper{} f.Fuzz(roundTripper) *r = roundTripper }, func(fn *func(http.RoundTripper) http.RoundTripper, f fuzz.Continue) { *fn = fakeWrapperFunc }, func(fn *transport.WrapperFunc, f fuzz.Continue) { *fn = fakeWrapperFunc }, func(r *runtime.NegotiatedSerializer, f fuzz.Continue) { serializer := &fakeNegotiatedSerializer{} f.Fuzz(serializer) *r = serializer }, func(r *flowcontrol.RateLimiter, f fuzz.Continue) { limiter := &fakeLimiter{} f.Fuzz(limiter) *r = limiter }, func(h *WarningHandler, f fuzz.Continue) { *h = &fakeWarningHandler{} }, func(r *AuthProviderConfigPersister, f fuzz.Continue) { *r = fakeAuthProviderConfigPersister{} }, func(r *func(ctx context.Context, network, addr string) (net.Conn, error), f fuzz.Continue) { *r = fakeDialFunc }, func(r *func(*http.Request) (*url.URL, error), f fuzz.Continue) { *r = fakeProxyFunc }, func(r *runtime.Object, f fuzz.Continue) { unknown := &runtime.Unknown{} f.Fuzz(unknown) *r = unknown }, ) for i := 0; i < 20; i++ { original := &Config{} f.Fuzz(original) actual := CopyConfig(original) expected := *original // this is the list of known risky fields, add to this list if a new field // is added to Config, update CopyConfig to preserve the field otherwise. // The DeepEqual cannot handle the func comparison, so we just verify if the // function return the expected object. if actual.WrapTransport == nil || !reflect.DeepEqual(expected.WrapTransport(nil), &fakeRoundTripper{}) { t.Fatalf("CopyConfig dropped the WrapTransport field") } actual.WrapTransport = nil expected.WrapTransport = nil if actual.Dial != nil { _, actualError := actual.Dial(context.Background(), "", "") _, expectedError := expected.Dial(context.Background(), "", "") if !reflect.DeepEqual(expectedError, actualError) { t.Fatalf("CopyConfig dropped the Dial field") } } actual.Dial = nil expected.Dial = nil if actual.AuthConfigPersister != nil { actualError := actual.AuthConfigPersister.Persist(nil) expectedError := expected.AuthConfigPersister.Persist(nil) if !reflect.DeepEqual(expectedError, actualError) { t.Fatalf("CopyConfig dropped the Dial field") } } actual.AuthConfigPersister = nil expected.AuthConfigPersister = nil if actual.Proxy != nil { _, actualError := actual.Proxy(nil) _, expectedError := expected.Proxy(nil) if !reflect.DeepEqual(expectedError, actualError) { t.Fatalf("CopyConfig dropped the Proxy field") } } actual.Proxy = nil expected.Proxy = nil if diff := cmp.Diff(*actual, expected); diff != "" { t.Fatalf("CopyConfig dropped unexpected fields, identify whether they are security related or not (-got, +want): %s", diff) } } } func TestConfigStringer(t *testing.T) { formatBytes := func(b []byte) string { // %#v for []byte always pre-pends "[]byte{". // %#v for struct with []byte field always pre-pends "[]uint8{". return strings.Replace(fmt.Sprintf("%#v", b), "byte", "uint8", 1) } tests := []struct { desc string c *Config expectContent []string prohibitContent []string }{ { desc: "nil config", c: nil, expectContent: []string{""}, }, { desc: "non-sensitive config", c: &Config{ Host: "localhost:8080", APIPath: "v1", UserAgent: "gobot", }, expectContent: []string{"localhost:8080", "v1", "gobot"}, }, { desc: "sensitive config", c: &Config{ Host: "localhost:8080", Username: "gopher", Password: "g0ph3r", BearerToken: "1234567890", TLSClientConfig: TLSClientConfig{ CertFile: "a.crt", KeyFile: "a.key", CertData: []byte("fake cert"), KeyData: []byte("fake key"), }, AuthProvider: &clientcmdapi.AuthProviderConfig{ Config: map[string]string{"secret": "s3cr3t"}, }, ExecProvider: &clientcmdapi.ExecConfig{ Args: []string{"secret"}, Env: []clientcmdapi.ExecEnvVar{{Name: "secret", Value: "s3cr3t"}}, Config: &runtime.Unknown{Raw: []byte("here is some config data")}, }, }, expectContent: []string{ "localhost:8080", "gopher", "a.crt", "a.key", "--- REDACTED ---", formatBytes([]byte("--- REDACTED ---")), formatBytes([]byte("--- TRUNCATED ---")), }, prohibitContent: []string{ "g0ph3r", "1234567890", formatBytes([]byte("fake cert")), formatBytes([]byte("fake key")), "secret", "s3cr3t", "here is some config data", formatBytes([]byte("super secret password")), }, }, } for _, tt := range tests { t.Run(tt.desc, func(t *testing.T) { got := tt.c.String() t.Logf("formatted config: %q", got) for _, expect := range tt.expectContent { if !strings.Contains(got, expect) { t.Errorf("missing expected string %q", expect) } } for _, prohibit := range tt.prohibitContent { if strings.Contains(got, prohibit) { t.Errorf("found prohibited string %q", prohibit) } } }) } } func TestConfigSprint(t *testing.T) { c := &Config{ Host: "localhost:8080", APIPath: "v1", ContentConfig: ContentConfig{ AcceptContentTypes: "application/json", ContentType: "application/json", }, Username: "gopher", Password: "g0ph3r", BearerToken: "1234567890", Impersonate: ImpersonationConfig{ UserName: "gopher2", UID: "uid123", }, AuthProvider: &clientcmdapi.AuthProviderConfig{ Name: "gopher", Config: map[string]string{"secret": "s3cr3t"}, }, AuthConfigPersister: fakeAuthProviderConfigPersister{}, ExecProvider: &clientcmdapi.ExecConfig{ Command: "sudo", Args: []string{"secret"}, Env: []clientcmdapi.ExecEnvVar{{Name: "secret", Value: "s3cr3t"}}, ProvideClusterInfo: true, Config: &runtime.Unknown{Raw: []byte("super secret password")}, }, TLSClientConfig: TLSClientConfig{ CertFile: "a.crt", KeyFile: "a.key", CertData: []byte("fake cert"), KeyData: []byte("fake key"), NextProtos: []string{"h2", "http/1.1"}, }, UserAgent: "gobot", Transport: &fakeRoundTripper{}, WrapTransport: fakeWrapperFunc, QPS: 1, Burst: 2, RateLimiter: &fakeLimiter{}, WarningHandler: fakeWarningHandler{}, Timeout: 3 * time.Second, Dial: fakeDialFunc, Proxy: fakeProxyFunc, } want := fmt.Sprintf( `&rest.Config{Host:"localhost:8080", APIPath:"v1", ContentConfig:rest.ContentConfig{AcceptContentTypes:"application/json", ContentType:"application/json", GroupVersion:(*schema.GroupVersion)(nil), NegotiatedSerializer:runtime.NegotiatedSerializer(nil)}, Username:"gopher", Password:"--- REDACTED ---", BearerToken:"--- REDACTED ---", BearerTokenFile:"", Impersonate:rest.ImpersonationConfig{UserName:"gopher2", UID:"uid123", Groups:[]string(nil), Extra:map[string][]string(nil)}, AuthProvider:api.AuthProviderConfig{Name: "gopher", Config: map[string]string{--- REDACTED ---}}, AuthConfigPersister:rest.AuthProviderConfigPersister(--- REDACTED ---), ExecProvider:api.ExecConfig{Command: "sudo", Args: []string{"--- REDACTED ---"}, Env: []ExecEnvVar{--- REDACTED ---}, APIVersion: "", ProvideClusterInfo: true, Config: runtime.Object(--- REDACTED ---), StdinUnavailable: false}, TLSClientConfig:rest.sanitizedTLSClientConfig{Insecure:false, ServerName:"", CertFile:"a.crt", KeyFile:"a.key", CAFile:"", CertData:[]uint8{0x2d, 0x2d, 0x2d, 0x20, 0x54, 0x52, 0x55, 0x4e, 0x43, 0x41, 0x54, 0x45, 0x44, 0x20, 0x2d, 0x2d, 0x2d}, KeyData:[]uint8{0x2d, 0x2d, 0x2d, 0x20, 0x52, 0x45, 0x44, 0x41, 0x43, 0x54, 0x45, 0x44, 0x20, 0x2d, 0x2d, 0x2d}, CAData:[]uint8(nil), NextProtos:[]string{"h2", "http/1.1"}}, UserAgent:"gobot", DisableCompression:false, Transport:(*rest.fakeRoundTripper)(%p), WrapTransport:(transport.WrapperFunc)(%p), QPS:1, Burst:2, RateLimiter:(*rest.fakeLimiter)(%p), WarningHandler:rest.fakeWarningHandler{}, Timeout:3000000000, Dial:(func(context.Context, string, string) (net.Conn, error))(%p), Proxy:(func(*http.Request) (*url.URL, error))(%p)}`, c.Transport, fakeWrapperFunc, c.RateLimiter, fakeDialFunc, fakeProxyFunc, ) for _, f := range []string{"%s", "%v", "%+v", "%#v"} { if got := fmt.Sprintf(f, c); want != got { t.Errorf("fmt.Sprintf(%q, c)\ngot: %q\nwant: %q", f, got, want) } } } kubernetes-client-go-a2dfcab/rest/connection_test.go000066400000000000000000000247541472614177300231160ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "fmt" "io" "net" "net/http" "net/http/httptest" "net/url" "strconv" "strings" "sync/atomic" "testing" "time" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/wait" ) type tcpLB struct { t *testing.T ln net.Listener serverURL string dials int32 } func (lb *tcpLB) handleConnection(in net.Conn, stopCh chan struct{}) { out, err := net.Dial("tcp", lb.serverURL) if err != nil { lb.t.Log(err) return } go io.Copy(out, in) go io.Copy(in, out) <-stopCh if err := out.Close(); err != nil { lb.t.Fatalf("failed to close connection: %v", err) } } func (lb *tcpLB) serve(stopCh chan struct{}) { conn, err := lb.ln.Accept() if err != nil { lb.t.Fatalf("failed to accept: %v", err) } atomic.AddInt32(&lb.dials, 1) go lb.handleConnection(conn, stopCh) } func newLB(t *testing.T, serverURL string) *tcpLB { ln, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("failed to bind: %v", err) } lb := tcpLB{ serverURL: serverURL, ln: ln, t: t, } return &lb } const ( readIdleTimeout int = 1 pingTimeout int = 1 ) func TestReconnectBrokenTCP(t *testing.T) { t.Setenv("HTTP2_READ_IDLE_TIMEOUT_SECONDS", strconv.Itoa(readIdleTimeout)) t.Setenv("HTTP2_PING_TIMEOUT_SECONDS", strconv.Itoa(pingTimeout)) t.Setenv("DISABLE_HTTP2", "") ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, %s", r.Proto) })) ts.EnableHTTP2 = true ts.StartTLS() defer ts.Close() u, err := url.Parse(ts.URL) if err != nil { t.Fatalf("failed to parse URL from %q: %v", ts.URL, err) } lb := newLB(t, u.Host) defer lb.ln.Close() stopCh := make(chan struct{}) go lb.serve(stopCh) transport, ok := ts.Client().Transport.(*http.Transport) if !ok { t.Fatalf("failed to assert *http.Transport") } config := &Config{ Host: "https://" + lb.ln.Addr().String(), Transport: utilnet.SetTransportDefaults(transport), Timeout: 1 * time.Second, // These fields are required to create a REST client. ContentConfig: ContentConfig{ GroupVersion: &schema.GroupVersion{}, NegotiatedSerializer: &serializer.CodecFactory{}, }, } client, err := RESTClientFor(config) if err != nil { t.Fatalf("failed to create REST client: %v", err) } data, err := client.Get().AbsPath("/").DoRaw(context.TODO()) if err != nil { t.Fatalf("unexpected err: %s: %v", data, err) } if string(data) != "Hello, HTTP/2.0" { t.Fatalf("unexpected response: %s", data) } // Deliberately let the LB stop proxying traffic for the current // connection. This mimics a broken TCP connection that's not properly // closed. close(stopCh) stopCh = make(chan struct{}) go lb.serve(stopCh) // Sleep enough time for the HTTP/2 health check to detect and close // the broken TCP connection. time.Sleep(time.Duration(1+readIdleTimeout+pingTimeout) * time.Second) // If the HTTP/2 health check were disabled, the broken connection // would still be in the connection pool, the following request would // then reuse the broken connection instead of creating a new one, and // thus would fail. data, err = client.Get().AbsPath("/").DoRaw(context.TODO()) if err != nil { t.Fatalf("unexpected err: %v", err) } if string(data) != "Hello, HTTP/2.0" { t.Fatalf("unexpected response: %s", data) } dials := atomic.LoadInt32(&lb.dials) if dials != 2 { t.Fatalf("expected %d dials, got %d", 2, dials) } } // 1. connect to https server with http1.1 using a TCP proxy // 2. the connection has keepalive enabled so it will be reused // 3. break the TCP connection stopping the proxy // 4. close the idle connection to force creating a new connection // 5. count that there are 2 connections to the server (we didn't reuse the original connection) func TestReconnectBrokenTCP_HTTP1(t *testing.T) { ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, %s", r.Proto) })) ts.EnableHTTP2 = false ts.StartTLS() defer ts.Close() u, err := url.Parse(ts.URL) if err != nil { t.Fatalf("failed to parse URL from %q: %v", ts.URL, err) } lb := newLB(t, u.Host) defer lb.ln.Close() stopCh := make(chan struct{}) go lb.serve(stopCh) transport, ok := ts.Client().Transport.(*http.Transport) if !ok { t.Fatal("failed to assert *http.Transport") } config := &Config{ Host: "https://" + lb.ln.Addr().String(), Transport: utilnet.SetTransportDefaults(transport), // large timeout, otherwise the broken connection will be cleaned by it Timeout: wait.ForeverTestTimeout, // These fields are required to create a REST client. ContentConfig: ContentConfig{ GroupVersion: &schema.GroupVersion{}, NegotiatedSerializer: &serializer.CodecFactory{}, }, } config.TLSClientConfig.NextProtos = []string{"http/1.1"} client, err := RESTClientFor(config) if err != nil { t.Fatalf("failed to create REST client: %v", err) } data, err := client.Get().AbsPath("/").DoRaw(context.TODO()) if err != nil { t.Fatalf("unexpected err: %s: %v", data, err) } if string(data) != "Hello, HTTP/1.1" { t.Fatalf("unexpected response: %s", data) } // Deliberately let the LB stop proxying traffic for the current // connection. This mimics a broken TCP connection that's not properly // closed. close(stopCh) stopCh = make(chan struct{}) go lb.serve(stopCh) // Close the idle connections utilnet.CloseIdleConnectionsFor(client.Client.Transport) // If the client didn't close the idle connections, the broken connection // would still be in the connection pool, the following request would // then reuse the broken connection instead of creating a new one, and // thus would fail. data, err = client.Get().AbsPath("/").DoRaw(context.TODO()) if err != nil { t.Fatalf("unexpected err: %v", err) } if string(data) != "Hello, HTTP/1.1" { t.Fatalf("unexpected response: %s", data) } dials := atomic.LoadInt32(&lb.dials) if dials != 2 { t.Fatalf("expected %d dials, got %d", 2, dials) } } // 1. connect to https server with http1.1 using a TCP proxy making the connection to timeout // 2. the connection has keepalive enabled so it will be reused // 3. close the in-flight connection to force creating a new connection // 4. count that there are 2 connections on the LB but only one succeeds func TestReconnectBrokenTCPInFlight_HTTP1(t *testing.T) { done := make(chan struct{}) defer close(done) received := make(chan struct{}) ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/hang" { conn, _, _ := w.(http.Hijacker).Hijack() close(received) <-done conn.Close() } fmt.Fprintf(w, "Hello, %s", r.Proto) })) ts.EnableHTTP2 = false ts.StartTLS() defer ts.Close() u, err := url.Parse(ts.URL) if err != nil { t.Fatalf("failed to parse URL from %q: %v", ts.URL, err) } lb := newLB(t, u.Host) defer lb.ln.Close() stopCh := make(chan struct{}) go lb.serve(stopCh) transport, ok := ts.Client().Transport.(*http.Transport) if !ok { t.Fatal("failed to assert *http.Transport") } config := &Config{ Host: "https://" + lb.ln.Addr().String(), Transport: utilnet.SetTransportDefaults(transport), // Use something extraordinary large to not hit the timeout Timeout: wait.ForeverTestTimeout, // These fields are required to create a REST client. ContentConfig: ContentConfig{ GroupVersion: &schema.GroupVersion{}, NegotiatedSerializer: &serializer.CodecFactory{}, }, } config.TLSClientConfig.NextProtos = []string{"http/1.1"} client, err := RESTClientFor(config) if err != nil { t.Fatalf("failed to create REST client: %v", err) } // The request will connect, hang and eventually time out // but we can use a context to close once the test is done // we are only interested in have an inflight connection ctx, cancel := context.WithCancel(context.Background()) reqErrCh := make(chan error, 1) defer close(reqErrCh) go func() { _, err = client.Get().AbsPath("/hang").DoRaw(ctx) reqErrCh <- err }() // wait until it connect to the server select { case <-received: case <-time.After(wait.ForeverTestTimeout): t.Fatal("Test timed out waiting for first request to fail") } // Deliberately let the LB stop proxying traffic for the current // connection. This mimics a broken TCP connection that's not properly // closed. close(stopCh) stopCh = make(chan struct{}) go lb.serve(stopCh) // New request will fail if tries to reuse the connection data, err := client.Get().AbsPath("/").DoRaw(context.Background()) if err != nil { t.Fatalf("unexpected err: %v", err) } if string(data) != "Hello, HTTP/1.1" { t.Fatalf("unexpected response: %s", data) } dials := atomic.LoadInt32(&lb.dials) if dials != 2 { t.Fatalf("expected %d dials, got %d", 2, dials) } // cancel the in-flight connection cancel() select { case <-reqErrCh: if err == nil { t.Fatal("Connection succeeded but was expected to timeout") } case <-time.After(10 * time.Second): t.Fatal("Test timed out waiting for the request to fail") } } func TestRestClientTimeout(t *testing.T) { ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(2 * time.Second) fmt.Fprintf(w, "Hello, %s", r.Proto) })) ts.Start() defer ts.Close() config := &Config{ Host: ts.URL, Timeout: 1 * time.Second, // These fields are required to create a REST client. ContentConfig: ContentConfig{ GroupVersion: &schema.GroupVersion{}, NegotiatedSerializer: &serializer.CodecFactory{}, }, } client, err := RESTClientFor(config) if err != nil { t.Fatalf("failed to create REST client: %v", err) } _, err = client.Get().AbsPath("/").DoRaw(context.TODO()) if err == nil { t.Fatalf("timeout error expected") } if !strings.Contains(err.Error(), "deadline exceeded") { t.Fatalf("timeout error expected, received %v", err) } } kubernetes-client-go-a2dfcab/rest/exec.go000066400000000000000000000053361472614177300206370ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "fmt" "net/http" "net/url" clientauthenticationapi "k8s.io/client-go/pkg/apis/clientauthentication" ) // This file contains Config logic related to exec credential plugins. // ConfigToExecCluster creates a clientauthenticationapi.Cluster with the corresponding fields from // the provided Config. func ConfigToExecCluster(config *Config) (*clientauthenticationapi.Cluster, error) { caData, err := dataFromSliceOrFile(config.CAData, config.CAFile) if err != nil { return nil, fmt.Errorf("failed to load CA bundle for execProvider: %v", err) } var proxyURL string if config.Proxy != nil { req, err := http.NewRequest("", config.Host, nil) if err != nil { return nil, fmt.Errorf("failed to create proxy URL request for execProvider: %w", err) } url, err := config.Proxy(req) if err != nil { return nil, fmt.Errorf("failed to get proxy URL for execProvider: %w", err) } if url != nil { proxyURL = url.String() } } return &clientauthenticationapi.Cluster{ Server: config.Host, TLSServerName: config.ServerName, InsecureSkipTLSVerify: config.Insecure, CertificateAuthorityData: caData, ProxyURL: proxyURL, DisableCompression: config.DisableCompression, Config: config.ExecProvider.Config, }, nil } // ExecClusterToConfig creates a Config with the corresponding fields from the provided // clientauthenticationapi.Cluster. The returned Config will be anonymous (i.e., it will not have // any authentication-related fields set). func ExecClusterToConfig(cluster *clientauthenticationapi.Cluster) (*Config, error) { var proxy func(*http.Request) (*url.URL, error) if cluster.ProxyURL != "" { proxyURL, err := url.Parse(cluster.ProxyURL) if err != nil { return nil, fmt.Errorf("cannot parse proxy URL: %w", err) } proxy = http.ProxyURL(proxyURL) } return &Config{ Host: cluster.Server, TLSClientConfig: TLSClientConfig{ Insecure: cluster.InsecureSkipTLSVerify, ServerName: cluster.TLSServerName, CAData: cluster.CertificateAuthorityData, }, Proxy: proxy, DisableCompression: cluster.DisableCompression, }, nil } kubernetes-client-go-a2dfcab/rest/exec_test.go000066400000000000000000000247211472614177300216750ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "errors" "net" "net/http" "net/url" "strings" "testing" "github.com/google/go-cmp/cmp" fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/runtime" clientauthenticationapi "k8s.io/client-go/pkg/apis/clientauthentication" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/transport" "k8s.io/client-go/util/flowcontrol" ) func TestConfigToExecCluster(t *testing.T) { t.Parallel() const proxyURL = "https://some-proxy-url.com/tuna/fish" proxy := func(r *http.Request) (*url.URL, error) { return url.Parse(proxyURL) } tests := []struct { name string in Config wantOut clientauthenticationapi.Cluster wantErrorPrefix string }{ { name: "CA data from memory", in: Config{ ExecProvider: &clientcmdapi.ExecConfig{ ProvideClusterInfo: true, Config: &runtime.Unknown{ Raw: []byte("stuff"), }, }, Host: "some-host", TLSClientConfig: TLSClientConfig{ ServerName: "some-server-name", Insecure: true, CAData: []byte("some-ca-data"), }, Proxy: proxy, }, wantOut: clientauthenticationapi.Cluster{ Server: "some-host", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: proxyURL, Config: &runtime.Unknown{ Raw: []byte("stuff"), }, }, }, { name: "CA data from file", in: Config{ ExecProvider: &clientcmdapi.ExecConfig{ ProvideClusterInfo: true, Config: &runtime.Unknown{ Raw: []byte("stuff"), }, }, Host: "some-host", TLSClientConfig: TLSClientConfig{ ServerName: "some-server-name", Insecure: true, CAFile: "testdata/ca.pem", }, Proxy: proxy, }, wantOut: clientauthenticationapi.Cluster{ Server: "some-host", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("a CA bundle lives here"), ProxyURL: proxyURL, Config: &runtime.Unknown{ Raw: []byte("stuff"), }, }, }, { name: "no CA data", in: Config{ ExecProvider: &clientcmdapi.ExecConfig{ ProvideClusterInfo: true, }, TLSClientConfig: TLSClientConfig{ CAFile: "this-file-does-not-exist", }, }, wantErrorPrefix: "failed to load CA bundle for execProvider: ", }, { name: "nil proxy", in: Config{ ExecProvider: &clientcmdapi.ExecConfig{ ProvideClusterInfo: true, Config: &runtime.Unknown{ Raw: []byte("stuff"), }, }, Host: "some-host", TLSClientConfig: TLSClientConfig{ ServerName: "some-server-name", Insecure: true, CAFile: "testdata/ca.pem", }, }, wantOut: clientauthenticationapi.Cluster{ Server: "some-host", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("a CA bundle lives here"), Config: &runtime.Unknown{ Raw: []byte("stuff"), }, }, }, { name: "bad proxy", in: Config{ ExecProvider: &clientcmdapi.ExecConfig{ ProvideClusterInfo: true, }, Proxy: func(_ *http.Request) (*url.URL, error) { return nil, errors.New("some proxy error") }, }, wantErrorPrefix: "failed to get proxy URL for execProvider: some proxy error", }, { name: "proxy returns nil", in: Config{ ExecProvider: &clientcmdapi.ExecConfig{ ProvideClusterInfo: true, }, Proxy: func(_ *http.Request) (*url.URL, error) { return nil, nil }, Host: "some-host", TLSClientConfig: TLSClientConfig{ ServerName: "some-server-name", Insecure: true, CAFile: "testdata/ca.pem", }, }, wantOut: clientauthenticationapi.Cluster{ Server: "some-host", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("a CA bundle lives here"), }, }, { name: "invalid config host", in: Config{ ExecProvider: &clientcmdapi.ExecConfig{ ProvideClusterInfo: true, }, Proxy: func(_ *http.Request) (*url.URL, error) { return nil, nil }, Host: "invalid-config-host\n", }, wantErrorPrefix: "failed to create proxy URL request for execProvider: ", }, } for _, test := range tests { test := test t.Run(test.name, func(t *testing.T) { out, err := ConfigToExecCluster(&test.in) if test.wantErrorPrefix != "" { if err == nil { t.Error("wanted error") } else if !strings.HasPrefix(err.Error(), test.wantErrorPrefix) { t.Errorf("wanted error prefix %q, got %q", test.wantErrorPrefix, err.Error()) } } else if diff := cmp.Diff(&test.wantOut, out); diff != "" { t.Errorf("unexpected returned cluster: -got, +want:\n %s", diff) } }) } } func TestConfigToExecClusterRoundtrip(t *testing.T) { t.Parallel() f := fuzz.New().NilChance(0.5).NumElements(1, 1) f.Funcs( func(r *runtime.Codec, f fuzz.Continue) { codec := &fakeCodec{} f.Fuzz(codec) *r = codec }, func(r *http.RoundTripper, f fuzz.Continue) { roundTripper := &fakeRoundTripper{} f.Fuzz(roundTripper) *r = roundTripper }, func(fn *func(http.RoundTripper) http.RoundTripper, f fuzz.Continue) { *fn = fakeWrapperFunc }, func(fn *transport.WrapperFunc, f fuzz.Continue) { *fn = fakeWrapperFunc }, func(r *runtime.NegotiatedSerializer, f fuzz.Continue) { serializer := &fakeNegotiatedSerializer{} f.Fuzz(serializer) *r = serializer }, func(r *flowcontrol.RateLimiter, f fuzz.Continue) { limiter := &fakeLimiter{} f.Fuzz(limiter) *r = limiter }, func(h *WarningHandler, f fuzz.Continue) { *h = &fakeWarningHandler{} }, // Authentication does not require fuzzer func(r *AuthProviderConfigPersister, f fuzz.Continue) {}, func(r *clientcmdapi.AuthProviderConfig, f fuzz.Continue) { r.Config = map[string]string{} }, func(r *func(ctx context.Context, network, addr string) (net.Conn, error), f fuzz.Continue) { *r = fakeDialFunc }, func(r *func(*http.Request) (*url.URL, error), f fuzz.Continue) { *r = fakeProxyFunc }, func(r *runtime.Object, f fuzz.Continue) { unknown := &runtime.Unknown{} f.Fuzz(unknown) *r = unknown }, ) for i := 0; i < 100; i++ { expected := &Config{} f.Fuzz(expected) // This is the list of known fields that this roundtrip doesn't care about. We should add new // fields to this list if we don't want to roundtrip them on exec cluster conversion. expected.APIPath = "" expected.ContentConfig = ContentConfig{} expected.Username = "" expected.Password = "" expected.BearerToken = "" expected.BearerTokenFile = "" expected.Impersonate = ImpersonationConfig{} expected.AuthProvider = nil expected.AuthConfigPersister = nil expected.ExecProvider = &clientcmdapi.ExecConfig{} // ConfigToExecCluster assumes != nil. expected.TLSClientConfig.CertFile = "" expected.TLSClientConfig.KeyFile = "" expected.TLSClientConfig.CAFile = "" expected.TLSClientConfig.CertData = nil expected.TLSClientConfig.KeyData = nil expected.TLSClientConfig.NextProtos = nil expected.UserAgent = "" expected.DisableCompression = false expected.Transport = nil expected.WrapTransport = nil expected.QPS = 0.0 expected.Burst = 0 expected.RateLimiter = nil expected.WarningHandler = nil expected.Timeout = 0 expected.Dial = nil // Manually set URLs so we don't get an error when parsing these during the roundtrip. if expected.Host != "" { expected.Host = "https://some-server-url.com/tuna/fish" } if expected.Proxy != nil { expected.Proxy = func(_ *http.Request) (*url.URL, error) { return url.Parse("https://some-proxy-url.com/tuna/fish") } } cluster, err := ConfigToExecCluster(expected) if err != nil { t.Fatal(err) } actual, err := ExecClusterToConfig(cluster) if err != nil { t.Fatal(err) } if actual.Proxy != nil { actualURL, actualErr := actual.Proxy(nil) expectedURL, expectedErr := expected.Proxy(nil) if actualErr != nil { t.Fatalf("failed to get url from actual proxy func: %s", actualErr.Error()) } if expectedErr != nil { t.Fatalf("failed to get url from expected proxy func: %s", actualErr.Error()) } if diff := cmp.Diff(actualURL, expectedURL); diff != "" { t.Fatal("we dropped the Config.Proxy field during conversion") } } actual.Proxy = nil expected.Proxy = nil if actual.ExecProvider != nil { t.Fatal("expected actual Config.ExecProvider field to be set to nil") } actual.ExecProvider = nil expected.ExecProvider = nil if diff := cmp.Diff(actual, expected); diff != "" { t.Fatalf("we dropped some Config fields during roundtrip, -got, +want:\n %s", diff) } } } func TestExecClusterToConfigRoundtrip(t *testing.T) { t.Parallel() f := fuzz.New().NilChance(0.5).NumElements(1, 1) f.Funcs( func(r *runtime.Object, f fuzz.Continue) { // We don't expect the clientauthentication.Cluster.Config to show up in the Config that // comes back from the roundtrip, so just set it to nil. *r = nil }, ) for i := 0; i < 100; i++ { expected := &clientauthenticationapi.Cluster{} f.Fuzz(expected) // Manually set URLs so we don't get an error when parsing these during the roundtrip. if expected.Server != "" { expected.Server = "https://some-server-url.com/tuna/fish" } if expected.ProxyURL != "" { expected.ProxyURL = "https://some-proxy-url.com/tuna/fish" } config, err := ExecClusterToConfig(expected) if err != nil { t.Fatal(err) } // ConfigToExecCluster assumes config.ExecProvider is not nil. config.ExecProvider = &clientcmdapi.ExecConfig{} actual, err := ConfigToExecCluster(config) if err != nil { t.Fatal(err) } if diff := cmp.Diff(actual, expected); diff != "" { t.Fatalf("we dropped some Cluster fields during roundtrip: -got, +want:\n %s", diff) } } } kubernetes-client-go-a2dfcab/rest/fake/000077500000000000000000000000001472614177300202635ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/rest/fake/fake.go000066400000000000000000000067701472614177300215320ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // This is made a separate package and should only be imported by tests, because // it imports testapi package fake import ( "net/http" "net/url" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" restclient "k8s.io/client-go/rest" "k8s.io/client-go/util/flowcontrol" ) // CreateHTTPClient creates an http.Client that will invoke the provided roundTripper func // when a request is made. func CreateHTTPClient(roundTripper func(*http.Request) (*http.Response, error)) *http.Client { return &http.Client{ Transport: roundTripperFunc(roundTripper), } } type roundTripperFunc func(*http.Request) (*http.Response, error) func (f roundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) { return f(req) } // RESTClient provides a fake RESTClient interface. It is used to mock network // interactions via a rest.Request, or to make them via the provided Client to // a specific server. type RESTClient struct { NegotiatedSerializer runtime.NegotiatedSerializer GroupVersion schema.GroupVersion VersionedAPIPath string // Err is returned when any request would be made to the server. If Err is set, // Req will not be recorded, Resp will not be returned, and Client will not be // invoked. Err error // Req is set to the last request that was executed (had the methods Do/DoRaw) invoked. Req *http.Request // If Client is specified, the client will be invoked instead of returning Resp if // Err is not set. Client *http.Client // Resp is returned to the caller after Req is recorded, unless Err or Client are set. Resp *http.Response } func (c *RESTClient) Get() *restclient.Request { return c.Verb("GET") } func (c *RESTClient) Put() *restclient.Request { return c.Verb("PUT") } func (c *RESTClient) Patch(pt types.PatchType) *restclient.Request { return c.Verb("PATCH").SetHeader("Content-Type", string(pt)) } func (c *RESTClient) Post() *restclient.Request { return c.Verb("POST") } func (c *RESTClient) Delete() *restclient.Request { return c.Verb("DELETE") } func (c *RESTClient) Verb(verb string) *restclient.Request { return c.Request().Verb(verb) } func (c *RESTClient) APIVersion() schema.GroupVersion { return c.GroupVersion } func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter { return nil } func (c *RESTClient) Request() *restclient.Request { config := restclient.ClientContentConfig{ ContentType: runtime.ContentTypeJSON, GroupVersion: c.GroupVersion, Negotiator: runtime.NewClientNegotiator(c.NegotiatedSerializer, c.GroupVersion), } return restclient.NewRequestWithClient(&url.URL{Scheme: "https", Host: "localhost"}, c.VersionedAPIPath, config, CreateHTTPClient(c.do)) } // do is invoked when a Request() created by this client is executed. func (c *RESTClient) do(req *http.Request) (*http.Response, error) { if c.Err != nil { return nil, c.Err } c.Req = req if c.Client != nil { return c.Client.Do(req) } return c.Resp, nil } kubernetes-client-go-a2dfcab/rest/plugin.go000066400000000000000000000050051472614177300212020ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "fmt" "net/http" "sync" "k8s.io/klog/v2" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) type AuthProvider interface { // WrapTransport allows the plugin to create a modified RoundTripper that // attaches authorization headers (or other info) to requests. WrapTransport(http.RoundTripper) http.RoundTripper // Login allows the plugin to initialize its configuration. It must not // require direct user interaction. Login() error } // Factory generates an AuthProvider plugin. // // clusterAddress is the address of the current cluster. // config is the initial configuration for this plugin. // persister allows the plugin to save updated configuration. type Factory func(clusterAddress string, config map[string]string, persister AuthProviderConfigPersister) (AuthProvider, error) // AuthProviderConfigPersister allows a plugin to persist configuration info // for just itself. type AuthProviderConfigPersister interface { Persist(map[string]string) error } type noopPersister struct{} func (n *noopPersister) Persist(_ map[string]string) error { // no operation persister return nil } // All registered auth provider plugins. var pluginsLock sync.Mutex var plugins = make(map[string]Factory) func RegisterAuthProviderPlugin(name string, plugin Factory) error { pluginsLock.Lock() defer pluginsLock.Unlock() if _, found := plugins[name]; found { return fmt.Errorf("auth Provider Plugin %q was registered twice", name) } klog.V(4).Infof("Registered Auth Provider Plugin %q", name) plugins[name] = plugin return nil } func GetAuthProvider(clusterAddress string, apc *clientcmdapi.AuthProviderConfig, persister AuthProviderConfigPersister) (AuthProvider, error) { pluginsLock.Lock() defer pluginsLock.Unlock() p, ok := plugins[apc.Name] if !ok { return nil, fmt.Errorf("no Auth Provider found for name %q", apc.Name) } if persister == nil { persister = &noopPersister{} } return p(clusterAddress, apc.Config, persister) } kubernetes-client-go-a2dfcab/rest/plugin_test.go000066400000000000000000000236501472614177300222470ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "fmt" "net/http" "reflect" "strconv" "testing" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) func TestAuthPluginWrapTransport(t *testing.T) { if err := RegisterAuthProviderPlugin("pluginA", pluginAProvider); err != nil { t.Errorf("Unexpected error: failed to register pluginA: %v", err) } if err := RegisterAuthProviderPlugin("pluginB", pluginBProvider); err != nil { t.Errorf("Unexpected error: failed to register pluginB: %v", err) } if err := RegisterAuthProviderPlugin("pluginFail", pluginFailProvider); err != nil { t.Errorf("Unexpected error: failed to register pluginFail: %v", err) } testCases := []struct { useWrapTransport bool plugin string expectErr bool expectPluginA bool expectPluginB bool }{ {false, "", false, false, false}, {false, "pluginA", false, true, false}, {false, "pluginB", false, false, true}, {false, "pluginFail", true, false, false}, {false, "pluginUnknown", true, false, false}, } for i, tc := range testCases { c := Config{} if tc.useWrapTransport { // Specify an existing WrapTransport in the config to make sure that // plugins play nicely. c.WrapTransport = func(rt http.RoundTripper) http.RoundTripper { return &wrapTransport{rt} } } if len(tc.plugin) != 0 { c.AuthProvider = &clientcmdapi.AuthProviderConfig{Name: tc.plugin} } tConfig, err := c.TransportConfig() if err != nil { // Unknown/bad plugins are expected to fail here. if !tc.expectErr { t.Errorf("%d. Did not expect errors loading Auth Plugin: %q. Got: %v", i, tc.plugin, err) } continue } var fullyWrappedTransport http.RoundTripper fullyWrappedTransport = &emptyTransport{} if tConfig.WrapTransport != nil { fullyWrappedTransport = tConfig.WrapTransport(&emptyTransport{}) } res, err := fullyWrappedTransport.RoundTrip(&http.Request{}) if err != nil { t.Errorf("%d. Unexpected error in RoundTrip: %v", i, err) continue } hasWrapTransport := res.Header.Get("wrapTransport") == "Y" hasPluginA := res.Header.Get("pluginA") == "Y" hasPluginB := res.Header.Get("pluginB") == "Y" if hasWrapTransport != tc.useWrapTransport { t.Errorf("%d. Expected Existing config.WrapTransport: %t; Got: %t", i, tc.useWrapTransport, hasWrapTransport) } if hasPluginA != tc.expectPluginA { t.Errorf("%d. Expected Plugin A: %t; Got: %t", i, tc.expectPluginA, hasPluginA) } if hasPluginB != tc.expectPluginB { t.Errorf("%d. Expected Plugin B: %t; Got: %t", i, tc.expectPluginB, hasPluginB) } } } func TestAuthPluginPersist(t *testing.T) { // register pluginA by a different name so we don't collide across tests. if err := RegisterAuthProviderPlugin("pluginA2", pluginAProvider); err != nil { t.Errorf("Unexpected error: failed to register pluginA: %v", err) } if err := RegisterAuthProviderPlugin("pluginPersist", pluginPersistProvider); err != nil { t.Errorf("Unexpected error: failed to register pluginPersist: %v", err) } fooBarConfig := map[string]string{"foo": "bar"} testCases := []struct { plugin string startingConfig map[string]string expectedConfigAfterLogin map[string]string expectedConfigAfterRoundTrip map[string]string }{ // non-persisting plugins should work fine without modifying config. {"pluginA2", map[string]string{}, map[string]string{}, map[string]string{}}, {"pluginA2", fooBarConfig, fooBarConfig, fooBarConfig}, // plugins that persist config should be able to persist when they want. { "pluginPersist", map[string]string{}, map[string]string{ "login": "Y", }, map[string]string{ "login": "Y", "roundTrips": "1", }, }, { "pluginPersist", map[string]string{ "login": "Y", "roundTrips": "123", }, map[string]string{ "login": "Y", "roundTrips": "123", }, map[string]string{ "login": "Y", "roundTrips": "124", }, }, } for i, tc := range testCases { cfg := &clientcmdapi.AuthProviderConfig{ Name: tc.plugin, Config: tc.startingConfig, } persister := &inMemoryPersister{make(map[string]string)} persister.Persist(tc.startingConfig) plugin, err := GetAuthProvider("127.0.0.1", cfg, persister) if err != nil { t.Errorf("%d. Unexpected error: failed to get plugin %q: %v", i, tc.plugin, err) } if err := plugin.Login(); err != nil { t.Errorf("%d. Unexpected error calling Login() w/ plugin %q: %v", i, tc.plugin, err) } // Make sure the plugin persisted what we expect after Login(). if !reflect.DeepEqual(persister.savedConfig, tc.expectedConfigAfterLogin) { t.Errorf("%d. Unexpected persisted config after calling %s.Login(): \nGot:\n%v\nExpected:\n%v", i, tc.plugin, persister.savedConfig, tc.expectedConfigAfterLogin) } if _, err := plugin.WrapTransport(&emptyTransport{}).RoundTrip(&http.Request{}); err != nil { t.Errorf("%d. Unexpected error round-tripping w/ plugin %q: %v", i, tc.plugin, err) } // Make sure the plugin persisted what we expect after RoundTrip(). if !reflect.DeepEqual(persister.savedConfig, tc.expectedConfigAfterRoundTrip) { t.Errorf("%d. Unexpected persisted config after calling %s.WrapTransport.RoundTrip(): \nGot:\n%v\nExpected:\n%v", i, tc.plugin, persister.savedConfig, tc.expectedConfigAfterLogin) } } } func Test_WhenNilPersister_NoOpPersisterIsAssigned(t *testing.T) { if err := RegisterAuthProviderPlugin("anyPlugin", pluginPersistProvider); err != nil { t.Errorf("unexpected error: failed to register 'anyPlugin': %v", err) } cfg := &clientcmdapi.AuthProviderConfig{ Name: "anyPlugin", Config: nil, } plugin, err := GetAuthProvider("127.0.0.1", cfg, nil) if err != nil { t.Errorf("unexpected error: failed to get 'anyPlugin': %v", err) } anyPlugin := plugin.(*pluginPersist) if _, ok := anyPlugin.persister.(*noopPersister); !ok { t.Errorf("expected to be No Operation persister") } } // emptyTransport provides an empty http.Response with an initialized header // to allow wrapping RoundTrippers to set header values. type emptyTransport struct{} func (*emptyTransport) RoundTrip(req *http.Request) (*http.Response, error) { res := &http.Response{ Header: make(map[string][]string), } return res, nil } // wrapTransport sets "wrapTransport" = "Y" on the response. type wrapTransport struct { rt http.RoundTripper } func (w *wrapTransport) RoundTrip(req *http.Request) (*http.Response, error) { res, err := w.rt.RoundTrip(req) if err != nil { return nil, err } res.Header.Add("wrapTransport", "Y") return res, nil } // wrapTransportA sets "pluginA" = "Y" on the response. type wrapTransportA struct { rt http.RoundTripper } func (w *wrapTransportA) RoundTrip(req *http.Request) (*http.Response, error) { res, err := w.rt.RoundTrip(req) if err != nil { return nil, err } res.Header.Add("pluginA", "Y") return res, nil } type pluginA struct{} func (*pluginA) WrapTransport(rt http.RoundTripper) http.RoundTripper { return &wrapTransportA{rt} } func (*pluginA) Login() error { return nil } func pluginAProvider(string, map[string]string, AuthProviderConfigPersister) (AuthProvider, error) { return &pluginA{}, nil } // wrapTransportB sets "pluginB" = "Y" on the response. type wrapTransportB struct { rt http.RoundTripper } func (w *wrapTransportB) RoundTrip(req *http.Request) (*http.Response, error) { res, err := w.rt.RoundTrip(req) if err != nil { return nil, err } res.Header.Add("pluginB", "Y") return res, nil } type pluginB struct{} func (*pluginB) WrapTransport(rt http.RoundTripper) http.RoundTripper { return &wrapTransportB{rt} } func (*pluginB) Login() error { return nil } func pluginBProvider(string, map[string]string, AuthProviderConfigPersister) (AuthProvider, error) { return &pluginB{}, nil } // pluginFailProvider simulates a registered AuthPlugin that fails to load. func pluginFailProvider(string, map[string]string, AuthProviderConfigPersister) (AuthProvider, error) { return nil, fmt.Errorf("Failed to load AuthProvider") } type inMemoryPersister struct { savedConfig map[string]string } func (i *inMemoryPersister) Persist(config map[string]string) error { i.savedConfig = make(map[string]string) for k, v := range config { i.savedConfig[k] = v } return nil } // wrapTransportPersist increments the "roundTrips" entry from the config when // roundTrip is called. type wrapTransportPersist struct { rt http.RoundTripper config map[string]string persister AuthProviderConfigPersister } func (w *wrapTransportPersist) RoundTrip(req *http.Request) (*http.Response, error) { roundTrips := 0 if rtVal, ok := w.config["roundTrips"]; ok { var err error roundTrips, err = strconv.Atoi(rtVal) if err != nil { return nil, err } } roundTrips++ w.config["roundTrips"] = fmt.Sprintf("%d", roundTrips) if err := w.persister.Persist(w.config); err != nil { return nil, err } return w.rt.RoundTrip(req) } type pluginPersist struct { config map[string]string persister AuthProviderConfigPersister } func (p *pluginPersist) WrapTransport(rt http.RoundTripper) http.RoundTripper { return &wrapTransportPersist{rt, p.config, p.persister} } // Login sets the config entry "login" to "Y". func (p *pluginPersist) Login() error { p.config["login"] = "Y" p.persister.Persist(p.config) return nil } func pluginPersistProvider(_ string, config map[string]string, persister AuthProviderConfigPersister) (AuthProvider, error) { return &pluginPersist{config, persister}, nil } kubernetes-client-go-a2dfcab/rest/request.go000066400000000000000000001431431472614177300214020ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "bytes" "context" "encoding/hex" "fmt" "io" "mime" "net/http" "net/http/httptrace" "net/url" "os" "path" "reflect" "strconv" "strings" "sync" "time" "golang.org/x/net/http2" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/watch" clientfeatures "k8s.io/client-go/features" restclientwatch "k8s.io/client-go/rest/watch" "k8s.io/client-go/tools/metrics" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" "k8s.io/utils/clock" ) var ( // longThrottleLatency defines threshold for logging requests. All requests being // throttled (via the provided rateLimiter) for more than longThrottleLatency will // be logged. longThrottleLatency = 50 * time.Millisecond // extraLongThrottleLatency defines the threshold for logging requests at log level 2. extraLongThrottleLatency = 1 * time.Second ) // HTTPClient is an interface for testing a request object. type HTTPClient interface { Do(req *http.Request) (*http.Response, error) } // ResponseWrapper is an interface for getting a response. // The response may be either accessed as a raw data (the whole output is put into memory) or as a stream. type ResponseWrapper interface { DoRaw(context.Context) ([]byte, error) Stream(context.Context) (io.ReadCloser, error) } // RequestConstructionError is returned when there's an error assembling a request. type RequestConstructionError struct { Err error } // Error returns a textual description of 'r'. func (r *RequestConstructionError) Error() string { return fmt.Sprintf("request construction error: '%v'", r.Err) } var noBackoff = &NoBackoff{} type requestRetryFunc func(maxRetries int) WithRetry func defaultRequestRetryFn(maxRetries int) WithRetry { return &withRetry{maxRetries: maxRetries} } // Request allows for building up a request to a server in a chained fashion. // Any errors are stored until the end of your call, so you only have to // check once. type Request struct { c *RESTClient warningHandler WarningHandler rateLimiter flowcontrol.RateLimiter backoff BackoffManager timeout time.Duration maxRetries int // generic components accessible via method setters verb string pathPrefix string subpath string params url.Values headers http.Header // structural elements of the request that are part of the Kubernetes API conventions namespace string namespaceSet bool resource string resourceName string subresource string // output err error // only one of body / bodyBytes may be set. requests using body are not retriable. body io.Reader bodyBytes []byte retryFn requestRetryFunc } // NewRequest creates a new request helper object for accessing runtime.Objects on a server. func NewRequest(c *RESTClient) *Request { var backoff BackoffManager if c.createBackoffMgr != nil { backoff = c.createBackoffMgr() } if backoff == nil { backoff = noBackoff } var pathPrefix string if c.base != nil { pathPrefix = path.Join("/", c.base.Path, c.versionedAPIPath) } else { pathPrefix = path.Join("/", c.versionedAPIPath) } var timeout time.Duration if c.Client != nil { timeout = c.Client.Timeout } r := &Request{ c: c, rateLimiter: c.rateLimiter, backoff: backoff, timeout: timeout, pathPrefix: pathPrefix, maxRetries: 10, retryFn: defaultRequestRetryFn, warningHandler: c.warningHandler, } switch { case len(c.content.AcceptContentTypes) > 0: r.SetHeader("Accept", c.content.AcceptContentTypes) case len(c.content.ContentType) > 0: r.SetHeader("Accept", c.content.ContentType+", */*") } return r } // NewRequestWithClient creates a Request with an embedded RESTClient for use in test scenarios. func NewRequestWithClient(base *url.URL, versionedAPIPath string, content ClientContentConfig, client *http.Client) *Request { return NewRequest(&RESTClient{ base: base, versionedAPIPath: versionedAPIPath, content: content, Client: client, }) } // Verb sets the verb this request will use. func (r *Request) Verb(verb string) *Request { r.verb = verb return r } // Prefix adds segments to the relative beginning to the request path. These // items will be placed before the optional Namespace, Resource, or Name sections. // Setting AbsPath will clear any previously set Prefix segments func (r *Request) Prefix(segments ...string) *Request { if r.err != nil { return r } r.pathPrefix = path.Join(r.pathPrefix, path.Join(segments...)) return r } // Suffix appends segments to the end of the path. These items will be placed after the prefix and optional // Namespace, Resource, or Name sections. func (r *Request) Suffix(segments ...string) *Request { if r.err != nil { return r } r.subpath = path.Join(r.subpath, path.Join(segments...)) return r } // Resource sets the resource to access (/[ns//]) func (r *Request) Resource(resource string) *Request { if r.err != nil { return r } if len(r.resource) != 0 { r.err = fmt.Errorf("resource already set to %q, cannot change to %q", r.resource, resource) return r } if msgs := IsValidPathSegmentName(resource); len(msgs) != 0 { r.err = fmt.Errorf("invalid resource %q: %v", resource, msgs) return r } r.resource = resource return r } // BackOff sets the request's backoff manager to the one specified, // or defaults to the stub implementation if nil is provided func (r *Request) BackOff(manager BackoffManager) *Request { if manager == nil { r.backoff = &NoBackoff{} return r } r.backoff = manager return r } // WarningHandler sets the handler this client uses when warning headers are encountered. // If set to nil, this client will use the default warning handler (see SetDefaultWarningHandler). func (r *Request) WarningHandler(handler WarningHandler) *Request { r.warningHandler = handler return r } // Throttle receives a rate-limiter and sets or replaces an existing request limiter func (r *Request) Throttle(limiter flowcontrol.RateLimiter) *Request { r.rateLimiter = limiter return r } // SubResource sets a sub-resource path which can be multiple segments after the resource // name but before the suffix. func (r *Request) SubResource(subresources ...string) *Request { if r.err != nil { return r } subresource := path.Join(subresources...) if len(r.subresource) != 0 { r.err = fmt.Errorf("subresource already set to %q, cannot change to %q", r.subresource, subresource) return r } for _, s := range subresources { if msgs := IsValidPathSegmentName(s); len(msgs) != 0 { r.err = fmt.Errorf("invalid subresource %q: %v", s, msgs) return r } } r.subresource = subresource return r } // Name sets the name of a resource to access (/[ns//]) func (r *Request) Name(resourceName string) *Request { if r.err != nil { return r } if len(resourceName) == 0 { r.err = fmt.Errorf("resource name may not be empty") return r } if len(r.resourceName) != 0 { r.err = fmt.Errorf("resource name already set to %q, cannot change to %q", r.resourceName, resourceName) return r } if msgs := IsValidPathSegmentName(resourceName); len(msgs) != 0 { r.err = fmt.Errorf("invalid resource name %q: %v", resourceName, msgs) return r } r.resourceName = resourceName return r } // Namespace applies the namespace scope to a request (/[ns//]) func (r *Request) Namespace(namespace string) *Request { if r.err != nil { return r } if r.namespaceSet { r.err = fmt.Errorf("namespace already set to %q, cannot change to %q", r.namespace, namespace) return r } if msgs := IsValidPathSegmentName(namespace); len(msgs) != 0 { r.err = fmt.Errorf("invalid namespace %q: %v", namespace, msgs) return r } r.namespaceSet = true r.namespace = namespace return r } // NamespaceIfScoped is a convenience function to set a namespace if scoped is true func (r *Request) NamespaceIfScoped(namespace string, scoped bool) *Request { if scoped { return r.Namespace(namespace) } return r } // AbsPath overwrites an existing path with the segments provided. Trailing slashes are preserved // when a single segment is passed. func (r *Request) AbsPath(segments ...string) *Request { if r.err != nil { return r } r.pathPrefix = path.Join(r.c.base.Path, path.Join(segments...)) if len(segments) == 1 && (len(r.c.base.Path) > 1 || len(segments[0]) > 1) && strings.HasSuffix(segments[0], "/") { // preserve any trailing slashes for legacy behavior r.pathPrefix += "/" } return r } // RequestURI overwrites existing path and parameters with the value of the provided server relative // URI. func (r *Request) RequestURI(uri string) *Request { if r.err != nil { return r } locator, err := url.Parse(uri) if err != nil { r.err = err return r } r.pathPrefix = locator.Path if len(locator.Query()) > 0 { if r.params == nil { r.params = make(url.Values) } for k, v := range locator.Query() { r.params[k] = v } } return r } // Param creates a query parameter with the given string value. func (r *Request) Param(paramName, s string) *Request { if r.err != nil { return r } return r.setParam(paramName, s) } // VersionedParams will take the provided object, serialize it to a map[string][]string using the // implicit RESTClient API version and the default parameter codec, and then add those as parameters // to the request. Use this to provide versioned query parameters from client libraries. // VersionedParams will not write query parameters that have omitempty set and are empty. If a // parameter has already been set it is appended to (Params and VersionedParams are additive). func (r *Request) VersionedParams(obj runtime.Object, codec runtime.ParameterCodec) *Request { return r.SpecificallyVersionedParams(obj, codec, r.c.content.GroupVersion) } func (r *Request) SpecificallyVersionedParams(obj runtime.Object, codec runtime.ParameterCodec, version schema.GroupVersion) *Request { if r.err != nil { return r } params, err := codec.EncodeParameters(obj, version) if err != nil { r.err = err return r } for k, v := range params { if r.params == nil { r.params = make(url.Values) } r.params[k] = append(r.params[k], v...) } return r } func (r *Request) setParam(paramName, value string) *Request { if r.params == nil { r.params = make(url.Values) } r.params[paramName] = append(r.params[paramName], value) return r } func (r *Request) SetHeader(key string, values ...string) *Request { if r.headers == nil { r.headers = http.Header{} } r.headers.Del(key) for _, value := range values { r.headers.Add(key, value) } return r } // Timeout makes the request use the given duration as an overall timeout for the // request. Additionally, if set passes the value as "timeout" parameter in URL. func (r *Request) Timeout(d time.Duration) *Request { if r.err != nil { return r } r.timeout = d return r } // MaxRetries makes the request use the given integer as a ceiling of retrying upon receiving // "Retry-After" headers and 429 status-code in the response. The default is 10 unless this // function is specifically called with a different value. // A zero maxRetries prevent it from doing retires and return an error immediately. func (r *Request) MaxRetries(maxRetries int) *Request { if maxRetries < 0 { maxRetries = 0 } r.maxRetries = maxRetries return r } // Body makes the request use obj as the body. Optional. // If obj is a string, try to read a file of that name. // If obj is a []byte, send it directly. // If obj is an io.Reader, use it directly. // If obj is a runtime.Object, marshal it correctly, and set Content-Type header. // If obj is a runtime.Object and nil, do nothing. // Otherwise, set an error. func (r *Request) Body(obj interface{}) *Request { if r.err != nil { return r } switch t := obj.(type) { case string: data, err := os.ReadFile(t) if err != nil { r.err = err return r } glogBody("Request Body", data) r.body = nil r.bodyBytes = data case []byte: glogBody("Request Body", t) r.body = nil r.bodyBytes = t case io.Reader: r.body = t r.bodyBytes = nil case runtime.Object: // callers may pass typed interface pointers, therefore we must check nil with reflection if reflect.ValueOf(t).IsNil() { return r } encoder, err := r.c.content.Negotiator.Encoder(r.c.content.ContentType, nil) if err != nil { r.err = err return r } data, err := runtime.Encode(encoder, t) if err != nil { r.err = err return r } glogBody("Request Body", data) r.body = nil r.bodyBytes = data r.SetHeader("Content-Type", r.c.content.ContentType) default: r.err = fmt.Errorf("unknown type used for body: %+v", obj) } return r } // Error returns any error encountered constructing the request, if any. func (r *Request) Error() error { return r.err } // URL returns the current working URL. Check the result of Error() to ensure // that the returned URL is valid. func (r *Request) URL() *url.URL { p := r.pathPrefix if r.namespaceSet && len(r.namespace) > 0 { p = path.Join(p, "namespaces", r.namespace) } if len(r.resource) != 0 { p = path.Join(p, strings.ToLower(r.resource)) } // Join trims trailing slashes, so preserve r.pathPrefix's trailing slash for backwards compatibility if nothing was changed if len(r.resourceName) != 0 || len(r.subpath) != 0 || len(r.subresource) != 0 { p = path.Join(p, r.resourceName, r.subresource, r.subpath) } finalURL := &url.URL{} if r.c.base != nil { *finalURL = *r.c.base } finalURL.Path = p query := url.Values{} for key, values := range r.params { for _, value := range values { query.Add(key, value) } } // timeout is handled specially here. if r.timeout != 0 { query.Set("timeout", r.timeout.String()) } finalURL.RawQuery = query.Encode() return finalURL } // finalURLTemplate is similar to URL(), but will make all specific parameter values equal // - instead of name or namespace, "{name}" and "{namespace}" will be used, and all query // parameters will be reset. This creates a copy of the url so as not to change the // underlying object. func (r Request) finalURLTemplate() url.URL { newParams := url.Values{} v := []string{"{value}"} for k := range r.params { newParams[k] = v } r.params = newParams u := r.URL() if u == nil { return url.URL{} } segments := strings.Split(u.Path, "/") groupIndex := 0 index := 0 trimmedBasePath := "" if r.c.base != nil && strings.Contains(u.Path, r.c.base.Path) { p := strings.TrimPrefix(u.Path, r.c.base.Path) if !strings.HasPrefix(p, "/") { p = "/" + p } // store the base path that we have trimmed so we can append it // before returning the URL trimmedBasePath = r.c.base.Path segments = strings.Split(p, "/") groupIndex = 1 } if len(segments) <= 2 { return *u } const CoreGroupPrefix = "api" const NamedGroupPrefix = "apis" isCoreGroup := segments[groupIndex] == CoreGroupPrefix isNamedGroup := segments[groupIndex] == NamedGroupPrefix if isCoreGroup { // checking the case of core group with /api/v1/... format index = groupIndex + 2 } else if isNamedGroup { // checking the case of named group with /apis/apps/v1/... format index = groupIndex + 3 } else { // this should not happen that the only two possibilities are /api... and /apis..., just want to put an // outlet here in case more API groups are added in future if ever possible: // https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups // if a wrong API groups name is encountered, return the {prefix} for url.Path u.Path = "/{prefix}" u.RawQuery = "" return *u } // switch segLength := len(segments) - index; segLength { switch { // case len(segments) - index == 1: // resource (with no name) do nothing case len(segments)-index == 2: // /$RESOURCE/$NAME: replace $NAME with {name} segments[index+1] = "{name}" case len(segments)-index == 3: if segments[index+2] == "finalize" || segments[index+2] == "status" { // /$RESOURCE/$NAME/$SUBRESOURCE: replace $NAME with {name} segments[index+1] = "{name}" } else { // /namespace/$NAMESPACE/$RESOURCE: replace $NAMESPACE with {namespace} segments[index+1] = "{namespace}" } case len(segments)-index >= 4: segments[index+1] = "{namespace}" // /namespace/$NAMESPACE/$RESOURCE/$NAME: replace $NAMESPACE with {namespace}, $NAME with {name} if segments[index+3] != "finalize" && segments[index+3] != "status" { // /$RESOURCE/$NAME/$SUBRESOURCE: replace $NAME with {name} segments[index+3] = "{name}" } } u.Path = path.Join(trimmedBasePath, path.Join(segments...)) return *u } func (r *Request) tryThrottleWithInfo(ctx context.Context, retryInfo string) error { if r.rateLimiter == nil { return nil } now := time.Now() err := r.rateLimiter.Wait(ctx) if err != nil { err = fmt.Errorf("client rate limiter Wait returned an error: %w", err) } latency := time.Since(now) var message string switch { case len(retryInfo) > 0: message = fmt.Sprintf("Waited for %v, %s - request: %s:%s", latency, retryInfo, r.verb, r.URL().String()) default: message = fmt.Sprintf("Waited for %v due to client-side throttling, not priority and fairness, request: %s:%s", latency, r.verb, r.URL().String()) } if latency > longThrottleLatency { klog.V(3).Info(message) } if latency > extraLongThrottleLatency { // If the rate limiter latency is very high, the log message should be printed at a higher log level, // but we use a throttled logger to prevent spamming. globalThrottledLogger.Infof("%s", message) } metrics.RateLimiterLatency.Observe(ctx, r.verb, r.finalURLTemplate(), latency) return err } func (r *Request) tryThrottle(ctx context.Context) error { return r.tryThrottleWithInfo(ctx, "") } type throttleSettings struct { logLevel klog.Level minLogInterval time.Duration lastLogTime time.Time lock sync.RWMutex } type throttledLogger struct { clock clock.PassiveClock settings []*throttleSettings } var globalThrottledLogger = &throttledLogger{ clock: clock.RealClock{}, settings: []*throttleSettings{ { logLevel: 2, minLogInterval: 1 * time.Second, }, { logLevel: 0, minLogInterval: 10 * time.Second, }, }, } func (b *throttledLogger) attemptToLog() (klog.Level, bool) { for _, setting := range b.settings { if bool(klog.V(setting.logLevel).Enabled()) { // Return early without write locking if possible. if func() bool { setting.lock.RLock() defer setting.lock.RUnlock() return b.clock.Since(setting.lastLogTime) >= setting.minLogInterval }() { setting.lock.Lock() defer setting.lock.Unlock() if b.clock.Since(setting.lastLogTime) >= setting.minLogInterval { setting.lastLogTime = b.clock.Now() return setting.logLevel, true } } return -1, false } } return -1, false } // Infof will write a log message at each logLevel specified by the receiver's throttleSettings // as long as it hasn't written a log message more recently than minLogInterval. func (b *throttledLogger) Infof(message string, args ...interface{}) { if logLevel, ok := b.attemptToLog(); ok { klog.V(logLevel).Infof(message, args...) } } // Watch attempts to begin watching the requested location. // Returns a watch.Interface, or an error. func (r *Request) Watch(ctx context.Context) (watch.Interface, error) { // We specifically don't want to rate limit watches, so we // don't use r.rateLimiter here. if r.err != nil { return nil, r.err } client := r.c.Client if client == nil { client = http.DefaultClient } isErrRetryableFunc := func(request *http.Request, err error) bool { // The watch stream mechanism handles many common partial data errors, so closed // connections can be retried in many cases. if net.IsProbableEOF(err) || net.IsTimeout(err) { return true } return false } retry := r.retryFn(r.maxRetries) url := r.URL().String() for { if err := retry.Before(ctx, r); err != nil { return nil, retry.WrapPreviousError(err) } req, err := r.newHTTPRequest(ctx) if err != nil { return nil, err } resp, err := client.Do(req) retry.After(ctx, r, resp, err) if err == nil && resp.StatusCode == http.StatusOK { return r.newStreamWatcher(resp) } done, transformErr := func() (bool, error) { defer readAndCloseResponseBody(resp) if retry.IsNextRetry(ctx, r, req, resp, err, isErrRetryableFunc) { return false, nil } if resp == nil { // the server must have sent us an error in 'err' return true, nil } if result := r.transformResponse(resp, req); result.err != nil { return true, result.err } return true, fmt.Errorf("for request %s, got status: %v", url, resp.StatusCode) }() if done { if isErrRetryableFunc(req, err) { return watch.NewEmptyWatch(), nil } if err == nil { // if the server sent us an HTTP Response object, // we need to return the error object from that. err = transformErr } return nil, retry.WrapPreviousError(err) } } } type WatchListResult struct { // err holds any errors we might have received // during streaming. err error // items hold the collected data items []runtime.Object // initialEventsEndBookmarkRV holds the resource version // extracted from the bookmark event that marks // the end of the stream. initialEventsEndBookmarkRV string // gv represents the API version // it is used to construct the final list response // normally this information is filled by the server gv schema.GroupVersion } func (r WatchListResult) Into(obj runtime.Object) error { if r.err != nil { return r.err } listPtr, err := meta.GetItemsPtr(obj) if err != nil { return err } listVal, err := conversion.EnforcePtr(listPtr) if err != nil { return err } if listVal.Kind() != reflect.Slice { return fmt.Errorf("need a pointer to slice, got %v", listVal.Kind()) } if len(r.items) == 0 { listVal.Set(reflect.MakeSlice(listVal.Type(), 0, 0)) } else { listVal.Set(reflect.MakeSlice(listVal.Type(), len(r.items), len(r.items))) for i, o := range r.items { if listVal.Type().Elem() != reflect.TypeOf(o).Elem() { return fmt.Errorf("received object type = %v at index = %d, doesn't match the list item type = %v", reflect.TypeOf(o).Elem(), i, listVal.Type().Elem()) } listVal.Index(i).Set(reflect.ValueOf(o).Elem()) } } listMeta, err := meta.ListAccessor(obj) if err != nil { return err } listMeta.SetResourceVersion(r.initialEventsEndBookmarkRV) typeMeta, err := meta.TypeAccessor(obj) if err != nil { return err } version := r.gv.String() typeMeta.SetAPIVersion(version) typeMeta.SetKind(reflect.TypeOf(obj).Elem().Name()) return nil } // WatchList establishes a stream to get a consistent snapshot of data // from the server as described in https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/3157-watch-list#proposal // // Note that the watchlist requires properly setting the ListOptions // otherwise it just establishes a regular watch with the server. // Check the documentation https://kubernetes.io/docs/reference/using-api/api-concepts/#streaming-lists // to see what parameters are currently required. func (r *Request) WatchList(ctx context.Context) WatchListResult { if !clientfeatures.FeatureGates().Enabled(clientfeatures.WatchListClient) { return WatchListResult{err: fmt.Errorf("%q feature gate is not enabled", clientfeatures.WatchListClient)} } // TODO(#115478): consider validating request parameters (i.e sendInitialEvents). // Most users use the generated client, which handles the proper setting of parameters. // We don't have validation for other methods (e.g., the Watch) // thus, for symmetry, we haven't added additional checks for the WatchList method. w, err := r.Watch(ctx) if err != nil { return WatchListResult{err: err} } return r.handleWatchList(ctx, w) } // handleWatchList holds the actual logic for easier unit testing. // Note that this function will close the passed watch. func (r *Request) handleWatchList(ctx context.Context, w watch.Interface) WatchListResult { defer w.Stop() var lastKey string var items []runtime.Object for { select { case <-ctx.Done(): return WatchListResult{err: ctx.Err()} case event, ok := <-w.ResultChan(): if !ok { return WatchListResult{err: fmt.Errorf("unexpected watch close")} } if event.Type == watch.Error { return WatchListResult{err: errors.FromObject(event.Object)} } meta, err := meta.Accessor(event.Object) if err != nil { return WatchListResult{err: fmt.Errorf("failed to parse watch event: %#v", event)} } switch event.Type { case watch.Added: // the following check ensures that the response is ordered. // earlier servers had a bug that caused them to not sort the output. // in such cases, return an error which can trigger fallback logic. key := objectKeyFromMeta(meta) if len(lastKey) > 0 && lastKey > key { return WatchListResult{err: fmt.Errorf("cannot add the obj (%#v) with the key = %s, as it violates the ordering guarantees provided by the watchlist feature in beta phase, lastInsertedKey was = %s", event.Object, key, lastKey)} } items = append(items, event.Object) lastKey = key case watch.Bookmark: if meta.GetAnnotations()[metav1.InitialEventsAnnotationKey] == "true" { return WatchListResult{ items: items, initialEventsEndBookmarkRV: meta.GetResourceVersion(), gv: r.c.content.GroupVersion, } } default: return WatchListResult{err: fmt.Errorf("unexpected watch event %#v, expected to only receive watch.Added and watch.Bookmark events", event)} } } } } func (r *Request) newStreamWatcher(resp *http.Response) (watch.Interface, error) { contentType := resp.Header.Get("Content-Type") mediaType, params, err := mime.ParseMediaType(contentType) if err != nil { klog.V(4).Infof("Unexpected content type from the server: %q: %v", contentType, err) } objectDecoder, streamingSerializer, framer, err := r.c.content.Negotiator.StreamDecoder(mediaType, params) if err != nil { return nil, err } handleWarnings(resp.Header, r.warningHandler) frameReader := framer.NewFrameReader(resp.Body) watchEventDecoder := streaming.NewDecoder(frameReader, streamingSerializer) return watch.NewStreamWatcher( restclientwatch.NewDecoder(watchEventDecoder, objectDecoder), // use 500 to indicate that the cause of the error is unknown - other error codes // are more specific to HTTP interactions, and set a reason errors.NewClientErrorReporter(http.StatusInternalServerError, r.verb, "ClientWatchDecoding"), ), nil } // updateRequestResultMetric increments the RequestResult metric counter, // it should be called with the (response, err) tuple from the final // reply from the server. func updateRequestResultMetric(ctx context.Context, req *Request, resp *http.Response, err error) { code, host := sanitize(req, resp, err) metrics.RequestResult.Increment(ctx, code, req.verb, host) } // updateRequestRetryMetric increments the RequestRetry metric counter, // it should be called with the (response, err) tuple for each retry // except for the final attempt. func updateRequestRetryMetric(ctx context.Context, req *Request, resp *http.Response, err error) { code, host := sanitize(req, resp, err) metrics.RequestRetry.IncrementRetry(ctx, code, req.verb, host) } func sanitize(req *Request, resp *http.Response, err error) (string, string) { host := "none" if req.c.base != nil { host = req.c.base.Host } // Errors can be arbitrary strings. Unbound label cardinality is not suitable for a metric // system so we just report them as ``. code := "" if resp != nil { code = strconv.Itoa(resp.StatusCode) } return code, host } // Stream formats and executes the request, and offers streaming of the response. // Returns io.ReadCloser which could be used for streaming of the response, or an error // Any non-2xx http status code causes an error. If we get a non-2xx code, we try to convert the body into an APIStatus object. // If we can, we return that as an error. Otherwise, we create an error that lists the http status and the content of the response. func (r *Request) Stream(ctx context.Context) (io.ReadCloser, error) { if r.err != nil { return nil, r.err } if err := r.tryThrottle(ctx); err != nil { return nil, err } client := r.c.Client if client == nil { client = http.DefaultClient } retry := r.retryFn(r.maxRetries) url := r.URL().String() for { if err := retry.Before(ctx, r); err != nil { return nil, err } req, err := r.newHTTPRequest(ctx) if err != nil { return nil, err } resp, err := client.Do(req) retry.After(ctx, r, resp, err) if err != nil { // we only retry on an HTTP response with 'Retry-After' header return nil, err } switch { case (resp.StatusCode >= 200) && (resp.StatusCode < 300): handleWarnings(resp.Header, r.warningHandler) return resp.Body, nil default: done, transformErr := func() (bool, error) { defer resp.Body.Close() if retry.IsNextRetry(ctx, r, req, resp, err, neverRetryError) { return false, nil } result := r.transformResponse(resp, req) if err := result.Error(); err != nil { return true, err } return true, fmt.Errorf("%d while accessing %v: %s", result.statusCode, url, string(result.body)) }() if done { return nil, transformErr } } } } // requestPreflightCheck looks for common programmer errors on Request. // // We tackle here two programmer mistakes. The first one is to try to create // something(POST) using an empty string as namespace with namespaceSet as // true. If namespaceSet is true then namespace should also be defined. The // second mistake is, when under the same circumstances, the programmer tries // to GET, PUT or DELETE a named resource(resourceName != ""), again, if // namespaceSet is true then namespace must not be empty. func (r *Request) requestPreflightCheck() error { if !r.namespaceSet { return nil } if len(r.namespace) > 0 { return nil } switch r.verb { case "POST": return fmt.Errorf("an empty namespace may not be set during creation") case "GET", "PUT", "DELETE": if len(r.resourceName) > 0 { return fmt.Errorf("an empty namespace may not be set when a resource name is provided") } } return nil } func (r *Request) newHTTPRequest(ctx context.Context) (*http.Request, error) { var body io.Reader switch { case r.body != nil && r.bodyBytes != nil: return nil, fmt.Errorf("cannot set both body and bodyBytes") case r.body != nil: body = r.body case r.bodyBytes != nil: // Create a new reader specifically for this request. // Giving each request a dedicated reader allows retries to avoid races resetting the request body. body = bytes.NewReader(r.bodyBytes) } url := r.URL().String() req, err := http.NewRequestWithContext(httptrace.WithClientTrace(ctx, newDNSMetricsTrace(ctx)), r.verb, url, body) if err != nil { return nil, err } req.Header = r.headers return req, nil } // newDNSMetricsTrace returns an HTTP trace that tracks time spent on DNS lookups per host. // This metric is available in client as "rest_client_dns_resolution_duration_seconds". func newDNSMetricsTrace(ctx context.Context) *httptrace.ClientTrace { type dnsMetric struct { start time.Time host string sync.Mutex } dns := &dnsMetric{} return &httptrace.ClientTrace{ DNSStart: func(info httptrace.DNSStartInfo) { dns.Lock() defer dns.Unlock() dns.start = time.Now() dns.host = info.Host }, DNSDone: func(info httptrace.DNSDoneInfo) { dns.Lock() defer dns.Unlock() metrics.ResolverLatency.Observe(ctx, dns.host, time.Since(dns.start)) }, } } // request connects to the server and invokes the provided function when a server response is // received. It handles retry behavior and up front validation of requests. It will invoke // fn at most once. It will return an error if a problem occurred prior to connecting to the // server - the provided function is responsible for handling server errors. func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Response)) error { // Metrics for total request latency start := time.Now() defer func() { metrics.RequestLatency.Observe(ctx, r.verb, r.finalURLTemplate(), time.Since(start)) }() if r.err != nil { klog.V(4).Infof("Error in request: %v", r.err) return r.err } if err := r.requestPreflightCheck(); err != nil { return err } client := r.c.Client if client == nil { client = http.DefaultClient } // Throttle the first try before setting up the timeout configured on the // client. We don't want a throttled client to return timeouts to callers // before it makes a single request. if err := r.tryThrottle(ctx); err != nil { return err } if r.timeout > 0 { var cancel context.CancelFunc ctx, cancel = context.WithTimeout(ctx, r.timeout) defer cancel() } isErrRetryableFunc := func(req *http.Request, err error) bool { // "Connection reset by peer" or "apiserver is shutting down" are usually a transient errors. // Thus in case of "GET" operations, we simply retry it. // We are not automatically retrying "write" operations, as they are not idempotent. if req.Method != "GET" { return false } // For connection errors and apiserver shutdown errors retry. if net.IsConnectionReset(err) || net.IsProbableEOF(err) { return true } return false } // Right now we make about ten retry attempts if we get a Retry-After response. retry := r.retryFn(r.maxRetries) for { if err := retry.Before(ctx, r); err != nil { return retry.WrapPreviousError(err) } req, err := r.newHTTPRequest(ctx) if err != nil { return err } resp, err := client.Do(req) // The value -1 or a value of 0 with a non-nil Body indicates that the length is unknown. // https://pkg.go.dev/net/http#Request if req.ContentLength >= 0 && !(req.Body != nil && req.ContentLength == 0) { metrics.RequestSize.Observe(ctx, r.verb, r.URL().Host, float64(req.ContentLength)) } retry.After(ctx, r, resp, err) done := func() bool { defer readAndCloseResponseBody(resp) // if the server returns an error in err, the response will be nil. f := func(req *http.Request, resp *http.Response) { if resp == nil { return } fn(req, resp) } if retry.IsNextRetry(ctx, r, req, resp, err, isErrRetryableFunc) { return false } f(req, resp) return true }() if done { return retry.WrapPreviousError(err) } } } // Do formats and executes the request. Returns a Result object for easy response // processing. // // Error type: // - If the server responds with a status: *errors.StatusError or *errors.UnexpectedObjectError // - http.Client.Do errors are returned directly. func (r *Request) Do(ctx context.Context) Result { var result Result err := r.request(ctx, func(req *http.Request, resp *http.Response) { result = r.transformResponse(resp, req) }) if err != nil { return Result{err: err} } if result.err == nil || len(result.body) > 0 { metrics.ResponseSize.Observe(ctx, r.verb, r.URL().Host, float64(len(result.body))) } return result } // DoRaw executes the request but does not process the response body. func (r *Request) DoRaw(ctx context.Context) ([]byte, error) { var result Result err := r.request(ctx, func(req *http.Request, resp *http.Response) { result.body, result.err = io.ReadAll(resp.Body) glogBody("Response Body", result.body) if resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent { result.err = r.transformUnstructuredResponseError(resp, req, result.body) } }) if err != nil { return nil, err } if result.err == nil || len(result.body) > 0 { metrics.ResponseSize.Observe(ctx, r.verb, r.URL().Host, float64(len(result.body))) } return result.body, result.err } // transformResponse converts an API response into a structured API object func (r *Request) transformResponse(resp *http.Response, req *http.Request) Result { var body []byte if resp.Body != nil { data, err := io.ReadAll(resp.Body) switch err.(type) { case nil: body = data case http2.StreamError: // This is trying to catch the scenario that the server may close the connection when sending the // response body. This can be caused by server timeout due to a slow network connection. // TODO: Add test for this. Steps may be: // 1. client-go (or kubectl) sends a GET request. // 2. Apiserver sends back the headers and then part of the body // 3. Apiserver closes connection. // 4. client-go should catch this and return an error. klog.V(2).Infof("Stream error %#v when reading response body, may be caused by closed connection.", err) streamErr := fmt.Errorf("stream error when reading response body, may be caused by closed connection. Please retry. Original error: %w", err) return Result{ err: streamErr, } default: klog.Errorf("Unexpected error when reading response body: %v", err) unexpectedErr := fmt.Errorf("unexpected error when reading response body. Please retry. Original error: %w", err) return Result{ err: unexpectedErr, } } } glogBody("Response Body", body) // verify the content type is accurate var decoder runtime.Decoder contentType := resp.Header.Get("Content-Type") if len(contentType) == 0 { contentType = r.c.content.ContentType } if len(contentType) > 0 { var err error mediaType, params, err := mime.ParseMediaType(contentType) if err != nil { return Result{err: errors.NewInternalError(err)} } decoder, err = r.c.content.Negotiator.Decoder(mediaType, params) if err != nil { // if we fail to negotiate a decoder, treat this as an unstructured error switch { case resp.StatusCode == http.StatusSwitchingProtocols: // no-op, we've been upgraded case resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent: return Result{err: r.transformUnstructuredResponseError(resp, req, body)} } return Result{ body: body, contentType: contentType, statusCode: resp.StatusCode, warnings: handleWarnings(resp.Header, r.warningHandler), } } } switch { case resp.StatusCode == http.StatusSwitchingProtocols: // no-op, we've been upgraded case resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent: // calculate an unstructured error from the response which the Result object may use if the caller // did not return a structured error. retryAfter, _ := retryAfterSeconds(resp) err := r.newUnstructuredResponseError(body, isTextResponse(resp), resp.StatusCode, req.Method, retryAfter) return Result{ body: body, contentType: contentType, statusCode: resp.StatusCode, decoder: decoder, err: err, warnings: handleWarnings(resp.Header, r.warningHandler), } } return Result{ body: body, contentType: contentType, statusCode: resp.StatusCode, decoder: decoder, warnings: handleWarnings(resp.Header, r.warningHandler), } } // truncateBody decides if the body should be truncated, based on the glog Verbosity. func truncateBody(body string) string { max := 0 switch { case bool(klog.V(10).Enabled()): return body case bool(klog.V(9).Enabled()): max = 10240 case bool(klog.V(8).Enabled()): max = 1024 } if len(body) <= max { return body } return body[:max] + fmt.Sprintf(" [truncated %d chars]", len(body)-max) } // glogBody logs a body output that could be either JSON or protobuf. It explicitly guards against // allocating a new string for the body output unless necessary. Uses a simple heuristic to determine // whether the body is printable. func glogBody(prefix string, body []byte) { if klogV := klog.V(8); klogV.Enabled() { if bytes.IndexFunc(body, func(r rune) bool { return r < 0x0a }) != -1 { klogV.Infof("%s:\n%s", prefix, truncateBody(hex.Dump(body))) } else { klogV.Infof("%s: %s", prefix, truncateBody(string(body))) } } } // maxUnstructuredResponseTextBytes is an upper bound on how much output to include in the unstructured error. const maxUnstructuredResponseTextBytes = 2048 // transformUnstructuredResponseError handles an error from the server that is not in a structured form. // It is expected to transform any response that is not recognizable as a clear server sent error from the // K8S API using the information provided with the request. In practice, HTTP proxies and client libraries // introduce a level of uncertainty to the responses returned by servers that in common use result in // unexpected responses. The rough structure is: // // 1. Assume the server sends you something sane - JSON + well defined error objects + proper codes // - this is the happy path // - when you get this output, trust what the server sends // 2. Guard against empty fields / bodies in received JSON and attempt to cull sufficient info from them to // generate a reasonable facsimile of the original failure. // - Be sure to use a distinct error type or flag that allows a client to distinguish between this and error 1 above // 3. Handle true disconnect failures / completely malformed data by moving up to a more generic client error // 4. Distinguish between various connection failures like SSL certificates, timeouts, proxy errors, unexpected // initial contact, the presence of mismatched body contents from posted content types // - Give these a separate distinct error type and capture as much as possible of the original message // // TODO: introduce transformation of generic http.Client.Do() errors that separates 4. func (r *Request) transformUnstructuredResponseError(resp *http.Response, req *http.Request, body []byte) error { if body == nil && resp.Body != nil { if data, err := io.ReadAll(&io.LimitedReader{R: resp.Body, N: maxUnstructuredResponseTextBytes}); err == nil { body = data } } retryAfter, _ := retryAfterSeconds(resp) return r.newUnstructuredResponseError(body, isTextResponse(resp), resp.StatusCode, req.Method, retryAfter) } // newUnstructuredResponseError instantiates the appropriate generic error for the provided input. It also logs the body. func (r *Request) newUnstructuredResponseError(body []byte, isTextResponse bool, statusCode int, method string, retryAfter int) error { // cap the amount of output we create if len(body) > maxUnstructuredResponseTextBytes { body = body[:maxUnstructuredResponseTextBytes] } message := "unknown" if isTextResponse { message = strings.TrimSpace(string(body)) } var groupResource schema.GroupResource if len(r.resource) > 0 { groupResource.Group = r.c.content.GroupVersion.Group groupResource.Resource = r.resource } return errors.NewGenericServerResponse( statusCode, method, groupResource, r.resourceName, message, retryAfter, true, ) } // isTextResponse returns true if the response appears to be a textual media type. func isTextResponse(resp *http.Response) bool { contentType := resp.Header.Get("Content-Type") if len(contentType) == 0 { return true } media, _, err := mime.ParseMediaType(contentType) if err != nil { return false } return strings.HasPrefix(media, "text/") } // retryAfterSeconds returns the value of the Retry-After header and true, or 0 and false if // the header was missing or not a valid number. func retryAfterSeconds(resp *http.Response) (int, bool) { if h := resp.Header.Get("Retry-After"); len(h) > 0 { if i, err := strconv.Atoi(h); err == nil { return i, true } } return 0, false } // Result contains the result of calling Request.Do(). type Result struct { body []byte warnings []net.WarningHeader contentType string err error statusCode int decoder runtime.Decoder } // Raw returns the raw result. func (r Result) Raw() ([]byte, error) { return r.body, r.err } // Get returns the result as an object, which means it passes through the decoder. // If the returned object is of type Status and has .Status != StatusSuccess, the // additional information in Status will be used to enrich the error. func (r Result) Get() (runtime.Object, error) { if r.err != nil { // Check whether the result has a Status object in the body and prefer that. return nil, r.Error() } if r.decoder == nil { return nil, fmt.Errorf("serializer for %s doesn't exist", r.contentType) } // decode, but if the result is Status return that as an error instead. out, _, err := r.decoder.Decode(r.body, nil, nil) if err != nil { return nil, err } switch t := out.(type) { case *metav1.Status: // any status besides StatusSuccess is considered an error. if t.Status != metav1.StatusSuccess { return nil, errors.FromObject(t) } } return out, nil } // StatusCode returns the HTTP status code of the request. (Only valid if no // error was returned.) func (r Result) StatusCode(statusCode *int) Result { *statusCode = r.statusCode return r } // ContentType returns the "Content-Type" response header into the passed // string, returning the Result for possible chaining. (Only valid if no // error code was returned.) func (r Result) ContentType(contentType *string) Result { *contentType = r.contentType return r } // Into stores the result into obj, if possible. If obj is nil it is ignored. // If the returned object is of type Status and has .Status != StatusSuccess, the // additional information in Status will be used to enrich the error. func (r Result) Into(obj runtime.Object) error { if r.err != nil { // Check whether the result has a Status object in the body and prefer that. return r.Error() } if r.decoder == nil { return fmt.Errorf("serializer for %s doesn't exist", r.contentType) } if len(r.body) == 0 { return fmt.Errorf("0-length response with status code: %d and content type: %s", r.statusCode, r.contentType) } out, _, err := r.decoder.Decode(r.body, nil, obj) if err != nil || out == obj { return err } // if a different object is returned, see if it is Status and avoid double decoding // the object. switch t := out.(type) { case *metav1.Status: // any status besides StatusSuccess is considered an error. if t.Status != metav1.StatusSuccess { return errors.FromObject(t) } } return nil } // WasCreated updates the provided bool pointer to whether the server returned // 201 created or a different response. func (r Result) WasCreated(wasCreated *bool) Result { *wasCreated = r.statusCode == http.StatusCreated return r } // Error returns the error executing the request, nil if no error occurred. // If the returned object is of type Status and has Status != StatusSuccess, the // additional information in Status will be used to enrich the error. // See the Request.Do() comment for what errors you might get. func (r Result) Error() error { // if we have received an unexpected server error, and we have a body and decoder, we can try to extract // a Status object. if r.err == nil || !errors.IsUnexpectedServerError(r.err) || len(r.body) == 0 || r.decoder == nil { return r.err } // attempt to convert the body into a Status object // to be backwards compatible with old servers that do not return a version, default to "v1" out, _, err := r.decoder.Decode(r.body, &schema.GroupVersionKind{Version: "v1"}, nil) if err != nil { klog.V(5).Infof("body was not decodable (unable to check for Status): %v", err) return r.err } switch t := out.(type) { case *metav1.Status: // because we default the kind, we *must* check for StatusFailure if t.Status == metav1.StatusFailure { return errors.FromObject(t) } } return r.err } // Warnings returns any warning headers received in the response func (r Result) Warnings() []net.WarningHeader { return r.warnings } // NameMayNotBe specifies strings that cannot be used as names specified as path segments (like the REST API or etcd store) var NameMayNotBe = []string{".", ".."} // NameMayNotContain specifies substrings that cannot be used in names specified as path segments (like the REST API or etcd store) var NameMayNotContain = []string{"/", "%"} // IsValidPathSegmentName validates the name can be safely encoded as a path segment func IsValidPathSegmentName(name string) []string { for _, illegalName := range NameMayNotBe { if name == illegalName { return []string{fmt.Sprintf(`may not be '%s'`, illegalName)} } } var errors []string for _, illegalContent := range NameMayNotContain { if strings.Contains(name, illegalContent) { errors = append(errors, fmt.Sprintf(`may not contain '%s'`, illegalContent)) } } return errors } // IsValidPathSegmentPrefix validates the name can be used as a prefix for a name which will be encoded as a path segment // It does not check for exact matches with disallowed names, since an arbitrary suffix might make the name valid func IsValidPathSegmentPrefix(name string) []string { var errors []string for _, illegalContent := range NameMayNotContain { if strings.Contains(name, illegalContent) { errors = append(errors, fmt.Sprintf(`may not contain '%s'`, illegalContent)) } } return errors } // ValidatePathSegmentName validates the name can be safely encoded as a path segment func ValidatePathSegmentName(name string, prefix bool) []string { if prefix { return IsValidPathSegmentPrefix(name) } return IsValidPathSegmentName(name) } func objectKeyFromMeta(objMeta metav1.Object) string { if len(objMeta.GetNamespace()) > 0 { return fmt.Sprintf("%s/%s", objMeta.GetNamespace(), objMeta.GetName()) } return objMeta.GetName() } kubernetes-client-go-a2dfcab/rest/request_test.go000066400000000000000000003702451472614177300224460ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "bytes" "context" "errors" "flag" "fmt" "io" "net" "net/http" "net/http/httptest" "net/url" "os" "reflect" "strings" "sync" "sync/atomic" "syscall" "testing" "time" "github.com/google/go-cmp/cmp" v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/util/intstr" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes/scheme" restclientwatch "k8s.io/client-go/rest/watch" "k8s.io/client-go/tools/metrics" "k8s.io/client-go/util/flowcontrol" utiltesting "k8s.io/client-go/util/testing" "k8s.io/klog/v2" testingclock "k8s.io/utils/clock/testing" ) func TestNewRequestSetsAccept(t *testing.T) { r := NewRequestWithClient(&url.URL{Path: "/path/"}, "", ClientContentConfig{}, nil).Verb("get") if r.headers.Get("Accept") != "" { t.Errorf("unexpected headers: %#v", r.headers) } r = NewRequestWithClient(&url.URL{Path: "/path/"}, "", ClientContentConfig{ContentType: "application/other"}, nil).Verb("get") if r.headers.Get("Accept") != "application/other, */*" { t.Errorf("unexpected headers: %#v", r.headers) } } func clientForFunc(fn clientFunc) *http.Client { return &http.Client{ Transport: fn, } } type clientFunc func(req *http.Request) (*http.Response, error) func (f clientFunc) RoundTrip(req *http.Request) (*http.Response, error) { return f(req) } func TestRequestSetsHeaders(t *testing.T) { server := clientForFunc(func(req *http.Request) (*http.Response, error) { if req.Header.Get("Accept") != "application/other, */*" { t.Errorf("unexpected headers: %#v", req.Header) } return &http.Response{ StatusCode: http.StatusForbidden, Body: io.NopCloser(bytes.NewReader([]byte{})), }, nil }) config := defaultContentConfig() config.ContentType = "application/other" r := NewRequestWithClient(&url.URL{Path: "/path"}, "", config, nil).Verb("get") r.c.Client = server // Check if all "issue" methods are setting headers. _ = r.Do(context.Background()) _, _ = r.Watch(context.Background()) _, _ = r.Stream(context.Background()) } func TestRequestWithErrorWontChange(t *testing.T) { gvCopy := v1.SchemeGroupVersion original := Request{ err: errors.New("test"), c: &RESTClient{ content: ClientContentConfig{GroupVersion: gvCopy}, }, } r := original changed := r.Param("foo", "bar"). AbsPath("/abs"). Prefix("test"). Suffix("testing"). Namespace("new"). Resource("foos"). Name("bars"). Body("foo"). Timeout(time.Millisecond) if changed != &r { t.Errorf("returned request should point to the same object") } if !reflect.DeepEqual(changed, &original) { t.Errorf("expected %#v, got %#v", &original, changed) } } func TestRequestPreservesBaseTrailingSlash(t *testing.T) { r := &Request{c: &RESTClient{base: &url.URL{}}, pathPrefix: "/path/"} if s := r.URL().String(); s != "/path/" { t.Errorf("trailing slash should be preserved: %s", s) } } func TestRequestAbsPathPreservesTrailingSlash(t *testing.T) { r := (&Request{c: &RESTClient{base: &url.URL{}}}).AbsPath("/foo/") if s := r.URL().String(); s != "/foo/" { t.Errorf("trailing slash should be preserved: %s", s) } } func TestRequestAbsPathJoins(t *testing.T) { r := (&Request{c: &RESTClient{base: &url.URL{}}}).AbsPath("foo/bar", "baz") if s := r.URL().String(); s != "foo/bar/baz" { t.Errorf("trailing slash should be preserved: %s", s) } } func TestRequestSetsNamespace(t *testing.T) { r := (&Request{ c: &RESTClient{base: &url.URL{Path: "/"}}, }).Namespace("foo") if r.namespace == "" { t.Errorf("namespace should be set: %#v", r) } if s := r.URL().String(); s != "namespaces/foo" { t.Errorf("namespace should be in path: %s", s) } } func TestRequestOrdersNamespaceInPath(t *testing.T) { r := (&Request{ c: &RESTClient{base: &url.URL{}}, pathPrefix: "/test/", }).Name("bar").Resource("baz").Namespace("foo") if s := r.URL().String(); s != "/test/namespaces/foo/baz/bar" { t.Errorf("namespace should be in order in path: %s", s) } } func TestRequestOrdersSubResource(t *testing.T) { r := (&Request{ c: &RESTClient{base: &url.URL{}}, pathPrefix: "/test/", }).Name("bar").Resource("baz").Namespace("foo").Suffix("test").SubResource("a", "b") if s := r.URL().String(); s != "/test/namespaces/foo/baz/bar/a/b/test" { t.Errorf("namespace should be in order in path: %s", s) } } func TestRequestSetTwiceError(t *testing.T) { if (&Request{}).Name("bar").Name("baz").err == nil { t.Errorf("setting name twice should result in error") } if (&Request{}).Namespace("bar").Namespace("baz").err == nil { t.Errorf("setting namespace twice should result in error") } if (&Request{}).Resource("bar").Resource("baz").err == nil { t.Errorf("setting resource twice should result in error") } if (&Request{}).SubResource("bar").SubResource("baz").err == nil { t.Errorf("setting subresource twice should result in error") } } func TestInvalidSegments(t *testing.T) { invalidSegments := []string{".", "..", "test/segment", "test%2bsegment"} setters := map[string]func(string, *Request){ "namespace": func(s string, r *Request) { r.Namespace(s) }, "resource": func(s string, r *Request) { r.Resource(s) }, "name": func(s string, r *Request) { r.Name(s) }, "subresource": func(s string, r *Request) { r.SubResource(s) }, } for _, invalidSegment := range invalidSegments { for setterName, setter := range setters { r := &Request{} setter(invalidSegment, r) if r.err == nil { t.Errorf("%s: %s: expected error, got none", setterName, invalidSegment) } } } } func TestRequestParam(t *testing.T) { r := (&Request{}).Param("foo", "a") if !reflect.DeepEqual(r.params, url.Values{"foo": []string{"a"}}) { t.Errorf("should have set a param: %#v", r) } r.Param("bar", "1") r.Param("bar", "2") if !reflect.DeepEqual(r.params, url.Values{"foo": []string{"a"}, "bar": []string{"1", "2"}}) { t.Errorf("should have set a param: %#v", r) } } func TestRequestVersionedParams(t *testing.T) { r := (&Request{c: &RESTClient{content: ClientContentConfig{GroupVersion: v1.SchemeGroupVersion}}}).Param("foo", "a") if !reflect.DeepEqual(r.params, url.Values{"foo": []string{"a"}}) { t.Errorf("should have set a param: %#v", r) } r.VersionedParams(&v1.PodLogOptions{Follow: true, Container: "bar"}, scheme.ParameterCodec) if !reflect.DeepEqual(r.params, url.Values{ "foo": []string{"a"}, "container": []string{"bar"}, "follow": []string{"true"}, }) { t.Errorf("should have set a param: %#v", r) } } func TestRequestVersionedParamsFromListOptions(t *testing.T) { r := &Request{c: &RESTClient{content: ClientContentConfig{GroupVersion: v1.SchemeGroupVersion}}} r.VersionedParams(&metav1.ListOptions{ResourceVersion: "1"}, scheme.ParameterCodec) if !reflect.DeepEqual(r.params, url.Values{ "resourceVersion": []string{"1"}, }) { t.Errorf("should have set a param: %#v", r) } var timeout int64 = 10 r.VersionedParams(&metav1.ListOptions{ResourceVersion: "2", TimeoutSeconds: &timeout}, scheme.ParameterCodec) if !reflect.DeepEqual(r.params, url.Values{ "resourceVersion": []string{"1", "2"}, "timeoutSeconds": []string{"10"}, }) { t.Errorf("should have set a param: %#v %v", r.params, r.err) } } func TestRequestVersionedParamsWithInvalidScheme(t *testing.T) { parameterCodec := runtime.NewParameterCodec(runtime.NewScheme()) r := (&Request{c: &RESTClient{content: ClientContentConfig{GroupVersion: v1.SchemeGroupVersion}}}) r.VersionedParams(&v1.PodExecOptions{Stdin: false, Stdout: true}, parameterCodec) if r.Error() == nil { t.Errorf("should have recorded an error: %#v", r.params) } } func TestRequestError(t *testing.T) { // Invalid body, see TestRequestBody() r := (&Request{}).Body([]string{"test"}) if r.Error() != r.err { t.Errorf("getter should be identical to reference: %#v %#v", r.Error(), r.err) } } func TestRequestURI(t *testing.T) { r := (&Request{}).Param("foo", "a") r.Prefix("other") r.RequestURI("/test?foo=b&a=b&c=1&c=2") if r.pathPrefix != "/test" { t.Errorf("path is wrong: %#v", r) } if !reflect.DeepEqual(r.params, url.Values{"a": []string{"b"}, "foo": []string{"b"}, "c": []string{"1", "2"}}) { t.Errorf("should have set a param: %#v", r) } } type NotAnAPIObject struct{} func (obj NotAnAPIObject) GroupVersionKind() *schema.GroupVersionKind { return nil } func (obj NotAnAPIObject) SetGroupVersionKind(gvk *schema.GroupVersionKind) {} func defaultContentConfig() ClientContentConfig { gvCopy := v1.SchemeGroupVersion return ClientContentConfig{ ContentType: "application/json", GroupVersion: gvCopy, Negotiator: runtime.NewClientNegotiator(scheme.Codecs.WithoutConversion(), gvCopy), } } func TestRequestBody(t *testing.T) { // test unknown type r := (&Request{}).Body([]string{"test"}) if r.err == nil || r.body != nil { t.Errorf("should have set err and left body nil: %#v", r) } // test error set when failing to read file f, err := os.CreateTemp("", "") if err != nil { t.Fatalf("unable to create temp file") } defer f.Close() os.Remove(f.Name()) r = (&Request{}).Body(f.Name()) if r.err == nil || r.body != nil { t.Errorf("should have set err and left body nil: %#v", r) } // test unencodable api object r = (&Request{c: &RESTClient{content: defaultContentConfig()}}).Body(&NotAnAPIObject{}) if r.err == nil || r.body != nil { t.Errorf("should have set err and left body nil: %#v", r) } } func TestResultIntoWithErrReturnsErr(t *testing.T) { res := Result{err: errors.New("test")} if err := res.Into(&v1.Pod{}); err != res.err { t.Errorf("should have returned exact error from result") } } func TestResultIntoWithNoBodyReturnsErr(t *testing.T) { res := Result{ body: []byte{}, decoder: scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), } if err := res.Into(&v1.Pod{}); err == nil || !strings.Contains(err.Error(), "0-length") { t.Errorf("should have complained about 0 length body") } } func TestURLTemplate(t *testing.T) { uri, _ := url.Parse("http://localhost/some/base/url/path") uriSingleSlash, _ := url.Parse("http://localhost/") testCases := []struct { Request *Request ExpectedFullURL string ExpectedFinalURL string }{ { // non dynamic client Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("POST"). Prefix("api", "v1").Resource("r1").Namespace("ns").Name("nm").Param("p0", "v0"), ExpectedFullURL: "http://localhost/some/base/url/path/api/v1/namespaces/ns/r1/nm?p0=v0", ExpectedFinalURL: "http://localhost/some/base/url/path/api/v1/namespaces/%7Bnamespace%7D/r1/%7Bname%7D?p0=%7Bvalue%7D", }, { // non dynamic client with wrong api group Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("POST"). Prefix("pre1", "v1").Resource("r1").Namespace("ns").Name("nm").Param("p0", "v0"), ExpectedFullURL: "http://localhost/some/base/url/path/pre1/v1/namespaces/ns/r1/nm?p0=v0", ExpectedFinalURL: "http://localhost/%7Bprefix%7D", }, { // dynamic client with core group + namespace + resourceResource (with name) // /api/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/api/v1/namespaces/ns/r1/name1"), ExpectedFullURL: "http://localhost/some/base/url/path/api/v1/namespaces/ns/r1/name1", ExpectedFinalURL: "http://localhost/some/base/url/path/api/v1/namespaces/%7Bnamespace%7D/r1/%7Bname%7D", }, { // dynamic client with named group + namespace + resourceResource (with name) // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/g1/v1/namespaces/ns/r1/name1"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/g1/v1/namespaces/ns/r1/name1", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/g1/v1/namespaces/%7Bnamespace%7D/r1/%7Bname%7D", }, { // dynamic client with core group + namespace + resourceResource (with NO name) // /api/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/api/v1/namespaces/ns/r1"), ExpectedFullURL: "http://localhost/some/base/url/path/api/v1/namespaces/ns/r1", ExpectedFinalURL: "http://localhost/some/base/url/path/api/v1/namespaces/%7Bnamespace%7D/r1", }, { // dynamic client with named group + namespace + resourceResource (with NO name) // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/g1/v1/namespaces/ns/r1"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/g1/v1/namespaces/ns/r1", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/g1/v1/namespaces/%7Bnamespace%7D/r1", }, { // dynamic client with core group + resourceResource (with name) // /api/$RESOURCEVERSION/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/api/v1/r1/name1"), ExpectedFullURL: "http://localhost/some/base/url/path/api/v1/r1/name1", ExpectedFinalURL: "http://localhost/some/base/url/path/api/v1/r1/%7Bname%7D", }, { // dynamic client with named group + resourceResource (with name) // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/g1/v1/r1/name1"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/g1/v1/r1/name1", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/g1/v1/r1/%7Bname%7D", }, { // dynamic client with named group + namespace + resourceResource (with name) + subresource // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME/$SUBRESOURCE Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces/namespaces/namespaces/namespaces/finalize"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/namespaces/namespaces/namespaces/finalize", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/%7Bnamespace%7D/namespaces/%7Bname%7D/finalize", }, { // dynamic client with named group + namespace + resourceResource (with name) // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces/namespaces/namespaces/namespaces"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/namespaces/namespaces/namespaces", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/%7Bnamespace%7D/namespaces/%7Bname%7D", }, { // dynamic client with named group + namespace + resourceResource (with NO name) + subresource // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%SUBRESOURCE Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces/namespaces/namespaces/finalize"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/namespaces/namespaces/finalize", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/%7Bnamespace%7D/namespaces/finalize", }, { // dynamic client with named group + namespace + resourceResource (with NO name) + subresource // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%SUBRESOURCE Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces/namespaces/namespaces/status"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/namespaces/namespaces/status", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/%7Bnamespace%7D/namespaces/status", }, { // dynamic client with named group + namespace + resourceResource (with no name) // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces/namespaces/namespaces"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/namespaces/namespaces", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/%7Bnamespace%7D/namespaces", }, { // dynamic client with named group + resourceResource (with name) + subresource // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces/namespaces/finalize"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/namespaces/finalize", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/%7Bname%7D/finalize", }, { // dynamic client with named group + resourceResource (with name) + subresource // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces/namespaces/status"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/namespaces/status", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/%7Bname%7D/status", }, { // dynamic client with named group + resourceResource (with name) // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces/namespaces"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/namespaces", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces/%7Bname%7D", }, { // dynamic client with named group + resourceResource (with no name) // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/apis/namespaces/namespaces/namespaces"), ExpectedFullURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces", ExpectedFinalURL: "http://localhost/some/base/url/path/apis/namespaces/namespaces/namespaces", }, { // dynamic client with wrong api group + namespace + resourceResource (with name) + subresource // /apis/$NAMEDGROUPNAME/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME/$SUBRESOURCE Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/pre1/namespaces/namespaces/namespaces/namespaces/namespaces/namespaces/finalize"), ExpectedFullURL: "http://localhost/some/base/url/path/pre1/namespaces/namespaces/namespaces/namespaces/namespaces/namespaces/finalize", ExpectedFinalURL: "http://localhost/%7Bprefix%7D", }, { // dynamic client with core group + namespace + resourceResource (with name) where baseURL is a single / // /api/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME Request: NewRequestWithClient(uriSingleSlash, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/api/v1/namespaces/ns/r2/name1"), ExpectedFullURL: "http://localhost/api/v1/namespaces/ns/r2/name1", ExpectedFinalURL: "http://localhost/api/v1/namespaces/%7Bnamespace%7D/r2/%7Bname%7D", }, { // dynamic client with core group + namespace + resourceResource (with name) where baseURL is 'some/base/url/path' // /api/$RESOURCEVERSION/namespaces/$NAMESPACE/$RESOURCE/%NAME Request: NewRequestWithClient(uri, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/api/v1/namespaces/ns/r3/name1"), ExpectedFullURL: "http://localhost/some/base/url/path/api/v1/namespaces/ns/r3/name1", ExpectedFinalURL: "http://localhost/some/base/url/path/api/v1/namespaces/%7Bnamespace%7D/r3/%7Bname%7D", }, { // dynamic client where baseURL is a single / // / Request: NewRequestWithClient(uriSingleSlash, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/"), ExpectedFullURL: "http://localhost/", ExpectedFinalURL: "http://localhost/", }, { // dynamic client where baseURL is a single / // /version Request: NewRequestWithClient(uriSingleSlash, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("DELETE"). Prefix("/version"), ExpectedFullURL: "http://localhost/version", ExpectedFinalURL: "http://localhost/version", }, } for i, testCase := range testCases { r := testCase.Request full := r.URL() if full.String() != testCase.ExpectedFullURL { t.Errorf("%d: unexpected initial URL: %s %s", i, full, testCase.ExpectedFullURL) } actualURL := r.finalURLTemplate() actual := actualURL.String() if actual != testCase.ExpectedFinalURL { t.Errorf("%d: unexpected URL template: %s %s", i, actual, testCase.ExpectedFinalURL) } if r.URL().String() != full.String() { t.Errorf("%d, creating URL template changed request: %s -> %s", i, full.String(), r.URL().String()) } } } func TestTransformResponse(t *testing.T) { invalid := []byte("aaaaa") uri, _ := url.Parse("http://localhost") testCases := []struct { Response *http.Response Data []byte Created bool Error bool ErrFn func(err error) bool }{ {Response: &http.Response{StatusCode: http.StatusOK}, Data: []byte{}}, {Response: &http.Response{StatusCode: http.StatusCreated}, Data: []byte{}, Created: true}, {Response: &http.Response{StatusCode: 199}, Error: true}, {Response: &http.Response{StatusCode: http.StatusInternalServerError}, Error: true}, {Response: &http.Response{StatusCode: http.StatusUnprocessableEntity}, Error: true}, {Response: &http.Response{StatusCode: http.StatusConflict}, Error: true}, {Response: &http.Response{StatusCode: http.StatusNotFound}, Error: true}, {Response: &http.Response{StatusCode: http.StatusUnauthorized}, Error: true}, { Response: &http.Response{ StatusCode: http.StatusUnauthorized, Header: http.Header{"Content-Type": []string{"application/json"}}, Body: io.NopCloser(bytes.NewReader(invalid)), }, Error: true, ErrFn: func(err error) bool { return err.Error() != "aaaaa" && apierrors.IsUnauthorized(err) }, }, { Response: &http.Response{ StatusCode: http.StatusUnauthorized, Header: http.Header{"Content-Type": []string{"text/any"}}, Body: io.NopCloser(bytes.NewReader(invalid)), }, Error: true, ErrFn: func(err error) bool { return strings.Contains(err.Error(), "server has asked for the client to provide") && apierrors.IsUnauthorized(err) }, }, {Response: &http.Response{StatusCode: http.StatusForbidden}, Error: true}, {Response: &http.Response{StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewReader(invalid))}, Data: invalid}, {Response: &http.Response{StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewReader(invalid))}, Data: invalid}, } for i, test := range testCases { r := NewRequestWithClient(uri, "", defaultContentConfig(), nil) if test.Response.Body == nil { test.Response.Body = io.NopCloser(bytes.NewReader([]byte{})) } result := r.transformResponse(test.Response, &http.Request{}) response, created, err := result.body, result.statusCode == http.StatusCreated, result.err hasErr := err != nil if hasErr != test.Error { t.Errorf("%d: unexpected error: %t %v", i, test.Error, err) } else if hasErr && test.Response.StatusCode > 399 { status, ok := err.(apierrors.APIStatus) if !ok { t.Errorf("%d: response should have been transformable into APIStatus: %v", i, err) continue } if int(status.Status().Code) != test.Response.StatusCode { t.Errorf("%d: status code did not match response: %#v", i, status.Status()) } } if test.ErrFn != nil && !test.ErrFn(err) { t.Errorf("%d: error function did not match: %v", i, err) } if !(test.Data == nil && response == nil) && !apiequality.Semantic.DeepDerivative(test.Data, response) { t.Errorf("%d: unexpected response: %#v %#v", i, test.Data, response) } if test.Created != created { t.Errorf("%d: expected created %t, got %t", i, test.Created, created) } } } type renegotiator struct { called bool contentType string params map[string]string decoder runtime.Decoder err error } func (r *renegotiator) Decoder(contentType string, params map[string]string) (runtime.Decoder, error) { r.called = true r.contentType = contentType r.params = params return r.decoder, r.err } func (r *renegotiator) Encoder(contentType string, params map[string]string) (runtime.Encoder, error) { return nil, fmt.Errorf("UNIMPLEMENTED") } func (r *renegotiator) StreamDecoder(contentType string, params map[string]string) (runtime.Decoder, runtime.Serializer, runtime.Framer, error) { return nil, nil, nil, fmt.Errorf("UNIMPLEMENTED") } func TestTransformResponseNegotiate(t *testing.T) { invalid := []byte("aaaaa") uri, _ := url.Parse("http://localhost") testCases := []struct { Response *http.Response Data []byte Created bool Error bool ErrFn func(err error) bool ContentType string Called bool ExpectContentType string Decoder runtime.Decoder NegotiateErr error }{ { ContentType: "application/json", Response: &http.Response{ StatusCode: http.StatusUnauthorized, Header: http.Header{"Content-Type": []string{"application/json"}}, Body: io.NopCloser(bytes.NewReader(invalid)), }, Called: true, ExpectContentType: "application/json", Error: true, ErrFn: func(err error) bool { return err.Error() != "aaaaa" && apierrors.IsUnauthorized(err) }, }, { ContentType: "application/json", Response: &http.Response{ StatusCode: http.StatusUnauthorized, Header: http.Header{"Content-Type": []string{"application/protobuf"}}, Body: io.NopCloser(bytes.NewReader(invalid)), }, Decoder: scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), Called: true, ExpectContentType: "application/protobuf", Error: true, ErrFn: func(err error) bool { return err.Error() != "aaaaa" && apierrors.IsUnauthorized(err) }, }, { ContentType: "application/json", Response: &http.Response{ StatusCode: http.StatusInternalServerError, Header: http.Header{"Content-Type": []string{"application/,others"}}, }, Decoder: scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), Error: true, ErrFn: func(err error) bool { return err.Error() == "Internal error occurred: mime: expected token after slash" && err.(apierrors.APIStatus).Status().Code == 500 }, }, { // negotiate when no content type specified Response: &http.Response{ StatusCode: http.StatusOK, Header: http.Header{"Content-Type": []string{"text/any"}}, Body: io.NopCloser(bytes.NewReader(invalid)), }, Decoder: scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), Called: true, ExpectContentType: "text/any", }, { // negotiate when no response content type specified ContentType: "text/any", Response: &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewReader(invalid)), }, Decoder: scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), Called: true, ExpectContentType: "text/any", }, { // unrecognized content type is not handled ContentType: "application/json", Response: &http.Response{ StatusCode: http.StatusNotFound, Header: http.Header{"Content-Type": []string{"application/unrecognized"}}, Body: io.NopCloser(bytes.NewReader(invalid)), }, Decoder: scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), NegotiateErr: fmt.Errorf("aaaa"), Called: true, ExpectContentType: "application/unrecognized", Error: true, ErrFn: func(err error) bool { return err.Error() != "aaaaa" && apierrors.IsNotFound(err) }, }, } for i, test := range testCases { contentConfig := defaultContentConfig() contentConfig.ContentType = test.ContentType negotiator := &renegotiator{ decoder: test.Decoder, err: test.NegotiateErr, } contentConfig.Negotiator = negotiator r := NewRequestWithClient(uri, "", contentConfig, nil) if test.Response.Body == nil { test.Response.Body = io.NopCloser(bytes.NewReader([]byte{})) } result := r.transformResponse(test.Response, &http.Request{}) _, err := result.body, result.err hasErr := err != nil if hasErr != test.Error { t.Errorf("%d: unexpected error: %t %v", i, test.Error, err) continue } else if hasErr && test.Response.StatusCode > 399 { status, ok := err.(apierrors.APIStatus) if !ok { t.Errorf("%d: response should have been transformable into APIStatus: %v", i, err) continue } if int(status.Status().Code) != test.Response.StatusCode { t.Errorf("%d: status code did not match response: %#v", i, status.Status()) } } if test.ErrFn != nil && !test.ErrFn(err) { t.Errorf("%d: error function did not match: %v", i, err) } if negotiator.called != test.Called { t.Errorf("%d: negotiator called %t != %t", i, negotiator.called, test.Called) } if !test.Called { continue } if negotiator.contentType != test.ExpectContentType { t.Errorf("%d: unexpected content type: %s", i, negotiator.contentType) } } } func TestTransformUnstructuredError(t *testing.T) { testCases := []struct { Req *http.Request Res *http.Response Resource string Name string ErrFn func(error) bool Transformed error }{ { Resource: "foo", Name: "bar", Req: &http.Request{ Method: "POST", }, Res: &http.Response{ StatusCode: http.StatusConflict, Body: io.NopCloser(bytes.NewReader(nil)), }, ErrFn: apierrors.IsAlreadyExists, }, { Resource: "foo", Name: "bar", Req: &http.Request{ Method: "PUT", }, Res: &http.Response{ StatusCode: http.StatusConflict, Body: io.NopCloser(bytes.NewReader(nil)), }, ErrFn: apierrors.IsConflict, }, { Resource: "foo", Name: "bar", Req: &http.Request{}, Res: &http.Response{ StatusCode: http.StatusNotFound, Body: io.NopCloser(bytes.NewReader(nil)), }, ErrFn: apierrors.IsNotFound, }, { Req: &http.Request{}, Res: &http.Response{ StatusCode: http.StatusBadRequest, Body: io.NopCloser(bytes.NewReader(nil)), }, ErrFn: apierrors.IsBadRequest, }, { // status in response overrides transformed result Req: &http.Request{}, Res: &http.Response{StatusCode: http.StatusBadRequest, Body: io.NopCloser(bytes.NewReader([]byte(`{"kind":"Status","apiVersion":"v1","status":"Failure","code":404}`)))}, ErrFn: apierrors.IsBadRequest, Transformed: &apierrors.StatusError{ ErrStatus: metav1.Status{Status: metav1.StatusFailure, Code: http.StatusNotFound}, }, }, { // successful status is ignored Req: &http.Request{}, Res: &http.Response{StatusCode: http.StatusBadRequest, Body: io.NopCloser(bytes.NewReader([]byte(`{"kind":"Status","apiVersion":"v1","status":"Success","code":404}`)))}, ErrFn: apierrors.IsBadRequest, }, { // empty object does not change result Req: &http.Request{}, Res: &http.Response{StatusCode: http.StatusBadRequest, Body: io.NopCloser(bytes.NewReader([]byte(`{}`)))}, ErrFn: apierrors.IsBadRequest, }, { // we default apiVersion for backwards compatibility with old clients // TODO: potentially remove in 1.7 Req: &http.Request{}, Res: &http.Response{StatusCode: http.StatusBadRequest, Body: io.NopCloser(bytes.NewReader([]byte(`{"kind":"Status","status":"Failure","code":404}`)))}, ErrFn: apierrors.IsBadRequest, Transformed: &apierrors.StatusError{ ErrStatus: metav1.Status{Status: metav1.StatusFailure, Code: http.StatusNotFound}, }, }, { // we do not default kind Req: &http.Request{}, Res: &http.Response{StatusCode: http.StatusBadRequest, Body: io.NopCloser(bytes.NewReader([]byte(`{"status":"Failure","code":404}`)))}, ErrFn: apierrors.IsBadRequest, }, } for _, testCase := range testCases { t.Run("", func(t *testing.T) { r := &Request{ c: &RESTClient{ content: defaultContentConfig(), }, resourceName: testCase.Name, resource: testCase.Resource, } result := r.transformResponse(testCase.Res, testCase.Req) err := result.err if !testCase.ErrFn(err) { t.Fatalf("unexpected error: %v", err) } if !apierrors.IsUnexpectedServerError(err) { t.Errorf("unexpected error type: %v", err) } if len(testCase.Name) != 0 && !strings.Contains(err.Error(), testCase.Name) { t.Errorf("unexpected error string: %s", err) } if len(testCase.Resource) != 0 && !strings.Contains(err.Error(), testCase.Resource) { t.Errorf("unexpected error string: %s", err) } // verify Error() properly transforms the error transformed := result.Error() expect := testCase.Transformed if expect == nil { expect = err } if !reflect.DeepEqual(expect, transformed) { t.Errorf("unexpected Error(): %s", cmp.Diff(expect, transformed)) } // verify result.Get properly transforms the error if _, err := result.Get(); !reflect.DeepEqual(expect, err) { t.Errorf("unexpected error on Get(): %s", cmp.Diff(expect, err)) } // verify result.Into properly handles the error if err := result.Into(&v1.Pod{}); !reflect.DeepEqual(expect, err) { t.Errorf("unexpected error on Into(): %s", cmp.Diff(expect, err)) } // verify result.Raw leaves the error in the untransformed state if _, err := result.Raw(); !reflect.DeepEqual(result.err, err) { t.Errorf("unexpected error on Raw(): %s", cmp.Diff(expect, err)) } }) } } func TestRequestWatch(t *testing.T) { testCases := []struct { name string Request *Request maxRetries int serverReturns []responseErr Expect []watch.Event attemptsExpected int Err bool ErrFn func(error) bool Empty bool }{ { name: "Request has error", Request: &Request{err: errors.New("bail")}, attemptsExpected: 0, Err: true, }, { name: "Client is nil, should use http.DefaultClient", Request: &Request{c: &RESTClient{base: &url.URL{}}, pathPrefix: "%"}, Err: true, }, { name: "error is not retryable", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: nil, err: errors.New("err")}, }, attemptsExpected: 1, Err: true, }, { name: "server returns forbidden", Request: &Request{ c: &RESTClient{ content: defaultContentConfig(), base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: &http.Response{ StatusCode: http.StatusForbidden, Body: io.NopCloser(bytes.NewReader([]byte{})), }, err: nil}, }, attemptsExpected: 1, Expect: []watch.Event{ { Type: watch.Error, Object: &metav1.Status{ Status: "Failure", Code: 500, Reason: "InternalError", Message: `an error on the server ("unable to decode an event from the watch stream: test error") has prevented the request from succeeding`, Details: &metav1.StatusDetails{ Causes: []metav1.StatusCause{ { Type: "UnexpectedServerResponse", Message: "unable to decode an event from the watch stream: test error", }, { Type: "ClientWatchDecoding", Message: "unable to decode an event from the watch stream: test error", }, }, }, }, }, }, Err: true, ErrFn: func(err error) bool { return apierrors.IsForbidden(err) }, }, { name: "server returns forbidden", Request: &Request{ c: &RESTClient{ content: defaultContentConfig(), base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: &http.Response{ StatusCode: http.StatusForbidden, Body: io.NopCloser(bytes.NewReader([]byte{})), }, err: nil}, }, attemptsExpected: 1, Err: true, ErrFn: func(err error) bool { return apierrors.IsForbidden(err) }, }, { name: "server returns unauthorized", Request: &Request{ c: &RESTClient{ content: defaultContentConfig(), base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: &http.Response{ StatusCode: http.StatusUnauthorized, Body: io.NopCloser(bytes.NewReader([]byte{})), }, err: nil}, }, attemptsExpected: 1, Err: true, ErrFn: func(err error) bool { return apierrors.IsUnauthorized(err) }, }, { name: "server returns unauthorized", Request: &Request{ c: &RESTClient{ content: defaultContentConfig(), base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: &http.Response{ StatusCode: http.StatusUnauthorized, Body: io.NopCloser(bytes.NewReader([]byte(runtime.EncodeOrDie(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), &metav1.Status{ Status: metav1.StatusFailure, Reason: metav1.StatusReasonUnauthorized, })))), }, err: nil}, }, attemptsExpected: 1, Err: true, ErrFn: func(err error) bool { return apierrors.IsUnauthorized(err) }, }, { name: "server returns EOF error", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: nil, err: io.EOF}, }, attemptsExpected: 1, Empty: true, }, { name: "server returns can't write HTTP request on broken connection error", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: nil, err: errors.New("http: can't write HTTP request on broken connection")}, }, attemptsExpected: 1, Empty: true, }, { name: "server returns connection reset by peer", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: nil, err: errors.New("foo: connection reset by peer")}, }, attemptsExpected: 1, Empty: true, }, { name: "max retries 2, server always returns EOF error", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, maxRetries: 2, attemptsExpected: 3, serverReturns: []responseErr{ {response: nil, err: io.EOF}, {response: nil, err: io.EOF}, {response: nil, err: io.EOF}, }, Empty: true, }, { name: "max retries 2, server always returns a response with Retry-After header", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, maxRetries: 2, attemptsExpected: 3, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, }, Err: true, ErrFn: func(err error) bool { return apierrors.IsInternalError(err) }, }, } for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { var attemptsGot int client := clientForFunc(func(req *http.Request) (*http.Response, error) { defer func() { attemptsGot++ }() if attemptsGot >= len(testCase.serverReturns) { t.Fatalf("Wrong test setup, the server does not know what to return") } re := testCase.serverReturns[attemptsGot] return re.response, re.err }) if c := testCase.Request.c; c != nil && len(testCase.serverReturns) > 0 { c.Client = client } testCase.Request.backoff = &noSleepBackOff{} testCase.Request.maxRetries = testCase.maxRetries testCase.Request.retryFn = defaultRequestRetryFn watch, err := testCase.Request.Watch(context.Background()) if watch == nil && err == nil { t.Fatal("Both watch.Interface and err returned by Watch are nil") } if testCase.attemptsExpected != attemptsGot { t.Errorf("Expected RoundTrip to be invoked %d times, but got: %d", testCase.attemptsExpected, attemptsGot) } hasErr := err != nil if hasErr != testCase.Err { t.Fatalf("expected %t, got %t: %v", testCase.Err, hasErr, err) } if testCase.ErrFn != nil && !testCase.ErrFn(err) { t.Errorf("error not valid: %v", err) } if hasErr && watch != nil { t.Fatalf("watch should be nil when error is returned") } if hasErr { return } defer watch.Stop() if testCase.Empty { evt, ok := <-watch.ResultChan() if ok { t.Errorf("expected the watch to be empty: %#v", evt) } } if testCase.Expect != nil { for i, evt := range testCase.Expect { out, ok := <-watch.ResultChan() if !ok { t.Fatalf("Watch closed early, %d/%d read", i, len(testCase.Expect)) } if !reflect.DeepEqual(evt, out) { t.Fatalf("Event %d does not match: %s", i, cmp.Diff(evt, out)) } } } }) } } func TestRequestStream(t *testing.T) { testCases := []struct { name string Request *Request maxRetries int serverReturns []responseErr attemptsExpected int Err bool ErrFn func(error) bool }{ { name: "request has error", Request: &Request{err: errors.New("bail")}, attemptsExpected: 0, Err: true, }, { name: "Client is nil, should use http.DefaultClient", Request: &Request{c: &RESTClient{base: &url.URL{}}, pathPrefix: "%"}, Err: true, }, { name: "server returns an error", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: nil, err: errors.New("err")}, }, attemptsExpected: 1, Err: true, }, { Request: &Request{ c: &RESTClient{ content: defaultContentConfig(), base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: &http.Response{ StatusCode: http.StatusUnauthorized, Body: io.NopCloser(bytes.NewReader([]byte(runtime.EncodeOrDie(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), &metav1.Status{ Status: metav1.StatusFailure, Reason: metav1.StatusReasonUnauthorized, })))), }, err: nil}, }, attemptsExpected: 1, Err: true, }, { Request: &Request{ c: &RESTClient{ content: defaultContentConfig(), base: &url.URL{}, }, }, serverReturns: []responseErr{ {response: &http.Response{ StatusCode: http.StatusBadRequest, Body: io.NopCloser(bytes.NewReader([]byte(`{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"a container name must be specified for pod kube-dns-v20-mz5cv, choose one of: [kubedns dnsmasq healthz]","reason":"BadRequest","code":400}`))), }, err: nil}, }, attemptsExpected: 1, Err: true, ErrFn: func(err error) bool { if err.Error() == "a container name must be specified for pod kube-dns-v20-mz5cv, choose one of: [kubedns dnsmasq healthz]" { return true } return false }, }, { name: "max retries 1, server returns a retry-after response, non-bytes request, no retry", Request: &Request{ body: &readSeeker{err: io.EOF}, c: &RESTClient{ base: &url.URL{}, }, }, maxRetries: 1, attemptsExpected: 1, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, }, Err: true, }, { name: "max retries 2, server always returns a response with Retry-After header", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, maxRetries: 2, attemptsExpected: 3, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, }, Err: true, ErrFn: func(err error) bool { return apierrors.IsInternalError(err) }, }, { name: "server returns EOF after attempt 1, retry aborted", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, maxRetries: 2, attemptsExpected: 2, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: nil, err: io.EOF}, }, Err: true, ErrFn: func(err error) bool { return unWrap(err) == io.EOF }, }, { name: "max retries 2, server returns success on the final attempt", Request: &Request{ c: &RESTClient{ base: &url.URL{}, }, }, maxRetries: 2, attemptsExpected: 3, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewReader([]byte{})), }, err: nil}, }, }, } for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { var attemptsGot int client := clientForFunc(func(req *http.Request) (*http.Response, error) { defer func() { attemptsGot++ }() if attemptsGot >= len(testCase.serverReturns) { t.Fatalf("Wrong test setup, the server does not know what to return") } re := testCase.serverReturns[attemptsGot] return re.response, re.err }) if c := testCase.Request.c; c != nil && len(testCase.serverReturns) > 0 { c.Client = client } testCase.Request.backoff = &noSleepBackOff{} testCase.Request.maxRetries = testCase.maxRetries testCase.Request.retryFn = defaultRequestRetryFn body, err := testCase.Request.Stream(context.Background()) if body == nil && err == nil { t.Fatal("Both body and err returned by Stream are nil") } if testCase.attemptsExpected != attemptsGot { t.Errorf("Expected RoundTrip to be invoked %d times, but got: %d", testCase.attemptsExpected, attemptsGot) } hasErr := err != nil if hasErr != testCase.Err { t.Errorf("expected %t, got %t: %v", testCase.Err, hasErr, err) } if hasErr && body != nil { t.Error("body should be nil when error is returned") } if hasErr { if testCase.ErrFn != nil && !testCase.ErrFn(err) { t.Errorf("unexpected error: %#v", err) } } }) } } func TestRequestDo(t *testing.T) { testCases := []struct { Request *Request Err bool }{ { Request: &Request{c: &RESTClient{}, err: errors.New("bail")}, Err: true, }, { Request: &Request{c: &RESTClient{base: &url.URL{}}, pathPrefix: "%"}, Err: true, }, { Request: &Request{ c: &RESTClient{ Client: clientForFunc(func(req *http.Request) (*http.Response, error) { return nil, errors.New("err") }), base: &url.URL{}, }, }, Err: true, }, } for i, testCase := range testCases { testCase.Request.backoff = &NoBackoff{} testCase.Request.retryFn = defaultRequestRetryFn body, err := testCase.Request.Do(context.Background()).Raw() hasErr := err != nil if hasErr != testCase.Err { t.Errorf("%d: expected %t, got %t: %v", i, testCase.Err, hasErr, err) } if hasErr && body != nil { t.Errorf("%d: body should be nil when error is returned", i) } } } func TestDoRequestNewWay(t *testing.T) { reqBody := "request body" expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{ Protocol: "TCP", Port: 12345, TargetPort: intstr.FromInt32(12345), }}}} expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj) fakeHandler := utiltesting.FakeHandler{ StatusCode: 200, ResponseBody: string(expectedBody), T: t, } testServer := httptest.NewServer(&fakeHandler) defer testServer.Close() c := testRESTClient(t, testServer) obj, err := c.Verb("POST"). Prefix("foo", "bar"). Suffix("baz"). Timeout(time.Second). Body([]byte(reqBody)). Do(context.Background()).Get() if err != nil { t.Errorf("Unexpected error: %v %#v", err, err) return } if obj == nil { t.Error("nil obj") } else if !apiequality.Semantic.DeepDerivative(expectedObj, obj) { t.Errorf("Expected: %#v, got %#v", expectedObj, obj) } requestURL := defaultResourcePathWithPrefix("foo/bar", "", "", "baz") requestURL += "?timeout=1s" fakeHandler.ValidateRequest(t, requestURL, "POST", &reqBody) } // This test assumes that the client implementation backs off exponentially, for an individual request. func TestBackoffLifecycle(t *testing.T) { count := 0 testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { count++ t.Logf("Attempt %d", count) if count == 5 || count == 9 { w.WriteHeader(http.StatusOK) return } w.WriteHeader(http.StatusGatewayTimeout) return })) defer testServer.Close() c := testRESTClient(t, testServer) // Test backoff recovery and increase. This correlates to the constants // which are used in the server implementation returning StatusOK above. seconds := []int{0, 1, 2, 4, 8, 0, 1, 2, 4, 0} request := c.Verb("POST").Prefix("backofftest").Suffix("abc") clock := testingclock.FakeClock{} request.backoff = &URLBackoff{ // Use a fake backoff here to avoid flakes and speed the test up. Backoff: flowcontrol.NewFakeBackOff( time.Duration(1)*time.Second, time.Duration(200)*time.Second, &clock, )} for _, sec := range seconds { thisBackoff := request.backoff.CalculateBackoff(request.URL()) t.Logf("Current backoff %v", thisBackoff) if thisBackoff != time.Duration(sec)*time.Second { t.Errorf("Backoff is %v instead of %v", thisBackoff, sec) } now := clock.Now() request.DoRaw(context.Background()) elapsed := clock.Since(now) if clock.Since(now) != thisBackoff { t.Errorf("CalculatedBackoff not honored by clock: Expected time of %v, but got %v ", thisBackoff, elapsed) } } } type testBackoffManager struct { sleeps []time.Duration } func (b *testBackoffManager) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) { } func (b *testBackoffManager) CalculateBackoff(actualUrl *url.URL) time.Duration { return time.Duration(0) } func (b *testBackoffManager) Sleep(d time.Duration) { b.sleeps = append(b.sleeps, d) } func TestCheckRetryClosesBody(t *testing.T) { count := 0 ch := make(chan struct{}) testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { count++ t.Logf("attempt %d", count) if count >= 5 { w.WriteHeader(http.StatusOK) close(ch) return } w.Header().Set("Retry-After", "1") http.Error(w, "Too many requests, please try again later.", http.StatusTooManyRequests) })) defer testServer.Close() backoff := &testBackoffManager{} // testBackoffManager.CalculateBackoff always returns 0 expectedSleeps := []time.Duration{0, time.Second, time.Second, time.Second, time.Second} c := testRESTClient(t, testServer) c.createBackoffMgr = func() BackoffManager { return backoff } _, err := c.Verb("POST"). Prefix("foo", "bar"). Suffix("baz"). Timeout(time.Second). Body([]byte(strings.Repeat("abcd", 1000))). DoRaw(context.Background()) if err != nil { t.Fatalf("Unexpected error: %v %#v", err, err) } <-ch if count != 5 { t.Errorf("unexpected retries: %d", count) } if !reflect.DeepEqual(backoff.sleeps, expectedSleeps) { t.Errorf("unexpected sleeps, expected: %v, got: %v", expectedSleeps, backoff.sleeps) } } func TestConnectionResetByPeerIsRetried(t *testing.T) { count := 0 backoff := &testBackoffManager{} req := &Request{ verb: "GET", c: &RESTClient{ Client: clientForFunc(func(req *http.Request) (*http.Response, error) { count++ if count >= 3 { return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewReader([]byte{})), }, nil } return nil, &net.OpError{Err: syscall.ECONNRESET} }), }, backoff: backoff, maxRetries: 10, retryFn: defaultRequestRetryFn, } // We expect two retries of "connection reset by peer" and the success. _, err := req.Do(context.Background()).Raw() if err != nil { t.Errorf("Unexpected error: %v", err) } if count != 3 { t.Errorf("Expected 3 attempts, got: %d", count) } // We have a sleep before each retry (including the initial one) thus 3 together. if len(backoff.sleeps) != 3 { t.Errorf("Expected 3 backoff.Sleep, got: %d", len(backoff.sleeps)) } } func TestCheckRetryHandles429And5xx(t *testing.T) { count := 0 ch := make(chan struct{}) testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { data, err := io.ReadAll(req.Body) if err != nil { t.Fatalf("unable to read request body: %v", err) } if !bytes.Equal(data, []byte(strings.Repeat("abcd", 1000))) { t.Fatalf("retry did not send a complete body: %s", data) } t.Logf("attempt %d", count) if count >= 4 { w.WriteHeader(http.StatusOK) close(ch) return } w.Header().Set("Retry-After", "0") w.WriteHeader([]int{http.StatusTooManyRequests, 500, 501, 504}[count]) count++ })) defer testServer.Close() c := testRESTClient(t, testServer) _, err := c.Verb("POST"). Prefix("foo", "bar"). Suffix("baz"). Timeout(time.Second). Body([]byte(strings.Repeat("abcd", 1000))). DoRaw(context.Background()) if err != nil { t.Fatalf("Unexpected error: %v %#v", err, err) } <-ch if count != 4 { t.Errorf("unexpected retries: %d", count) } } func BenchmarkCheckRetryClosesBody(b *testing.B) { count := 0 testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { count++ if count%3 == 0 { w.WriteHeader(http.StatusOK) return } w.Header().Set("Retry-After", "0") w.WriteHeader(http.StatusTooManyRequests) })) defer testServer.Close() c := testRESTClient(b, testServer) requests := make([]*Request, 0, b.N) for i := 0; i < b.N; i++ { requests = append(requests, c.Verb("POST"). Prefix("foo", "bar"). Suffix("baz"). Timeout(time.Second). Body([]byte(strings.Repeat("abcd", 1000)))) } b.ResetTimer() for i := 0; i < b.N; i++ { if _, err := requests[i].DoRaw(context.Background()); err != nil { b.Fatalf("Unexpected error (%d/%d): %v", i, b.N, err) } } } func TestDoRequestNewWayReader(t *testing.T) { reqObj := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}} reqBodyExpected, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), reqObj) expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{ Protocol: "TCP", Port: 12345, TargetPort: intstr.FromInt32(12345), }}}} expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj) fakeHandler := utiltesting.FakeHandler{ StatusCode: 200, ResponseBody: string(expectedBody), T: t, } testServer := httptest.NewServer(&fakeHandler) defer testServer.Close() c := testRESTClient(t, testServer) obj, err := c.Verb("POST"). Resource("bar"). Name("baz"). Prefix("foo"). Timeout(time.Second). Body(bytes.NewBuffer(reqBodyExpected)). Do(context.Background()).Get() if err != nil { t.Errorf("Unexpected error: %v %#v", err, err) return } if obj == nil { t.Error("nil obj") } else if !apiequality.Semantic.DeepDerivative(expectedObj, obj) { t.Errorf("Expected: %#v, got %#v", expectedObj, obj) } tmpStr := string(reqBodyExpected) requestURL := defaultResourcePathWithPrefix("foo", "bar", "", "baz") requestURL += "?timeout=1s" fakeHandler.ValidateRequest(t, requestURL, "POST", &tmpStr) } func TestDoRequestNewWayObj(t *testing.T) { reqObj := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}} reqBodyExpected, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), reqObj) expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{ Protocol: "TCP", Port: 12345, TargetPort: intstr.FromInt32(12345), }}}} expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj) fakeHandler := utiltesting.FakeHandler{ StatusCode: 200, ResponseBody: string(expectedBody), T: t, } testServer := httptest.NewServer(&fakeHandler) defer testServer.Close() c := testRESTClient(t, testServer) obj, err := c.Verb("POST"). Suffix("baz"). Name("bar"). Resource("foo"). Timeout(time.Second). Body(reqObj). Do(context.Background()).Get() if err != nil { t.Errorf("Unexpected error: %v %#v", err, err) return } if obj == nil { t.Error("nil obj") } else if !apiequality.Semantic.DeepDerivative(expectedObj, obj) { t.Errorf("Expected: %#v, got %#v", expectedObj, obj) } tmpStr := string(reqBodyExpected) requestURL := defaultResourcePathWithPrefix("", "foo", "", "bar/baz") requestURL += "?timeout=1s" fakeHandler.ValidateRequest(t, requestURL, "POST", &tmpStr) } func TestDoRequestNewWayFile(t *testing.T) { reqObj := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}} reqBodyExpected, err := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), reqObj) if err != nil { t.Errorf("unexpected error: %v", err) } file, err := os.CreateTemp("", "foo") if err != nil { t.Errorf("unexpected error: %v", err) } defer file.Close() defer os.Remove(file.Name()) _, err = file.Write(reqBodyExpected) if err != nil { t.Errorf("unexpected error: %v", err) } expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{ Protocol: "TCP", Port: 12345, TargetPort: intstr.FromInt32(12345), }}}} expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj) fakeHandler := utiltesting.FakeHandler{ StatusCode: 200, ResponseBody: string(expectedBody), T: t, } testServer := httptest.NewServer(&fakeHandler) defer testServer.Close() c := testRESTClient(t, testServer) wasCreated := true obj, err := c.Verb("POST"). Prefix("foo/bar", "baz"). Timeout(time.Second). Body(file.Name()). Do(context.Background()).WasCreated(&wasCreated).Get() if err != nil { t.Errorf("Unexpected error: %v %#v", err, err) return } if obj == nil { t.Error("nil obj") } else if !apiequality.Semantic.DeepDerivative(expectedObj, obj) { t.Errorf("Expected: %#v, got %#v", expectedObj, obj) } if wasCreated { t.Errorf("expected object was created") } tmpStr := string(reqBodyExpected) requestURL := defaultResourcePathWithPrefix("foo/bar/baz", "", "", "") requestURL += "?timeout=1s" fakeHandler.ValidateRequest(t, requestURL, "POST", &tmpStr) } func TestWasCreated(t *testing.T) { reqObj := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}} reqBodyExpected, err := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), reqObj) if err != nil { t.Errorf("unexpected error: %v", err) } expectedObj := &v1.Service{Spec: v1.ServiceSpec{Ports: []v1.ServicePort{{ Protocol: "TCP", Port: 12345, TargetPort: intstr.FromInt32(12345), }}}} expectedBody, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expectedObj) fakeHandler := utiltesting.FakeHandler{ StatusCode: 201, ResponseBody: string(expectedBody), T: t, } testServer := httptest.NewServer(&fakeHandler) defer testServer.Close() c := testRESTClient(t, testServer) wasCreated := false obj, err := c.Verb("PUT"). Prefix("foo/bar", "baz"). Timeout(time.Second). Body(reqBodyExpected). Do(context.Background()).WasCreated(&wasCreated).Get() if err != nil { t.Errorf("Unexpected error: %v %#v", err, err) return } if obj == nil { t.Error("nil obj") } else if !apiequality.Semantic.DeepDerivative(expectedObj, obj) { t.Errorf("Expected: %#v, got %#v", expectedObj, obj) } if !wasCreated { t.Errorf("Expected object was created") } tmpStr := string(reqBodyExpected) requestURL := defaultResourcePathWithPrefix("foo/bar/baz", "", "", "") requestURL += "?timeout=1s" fakeHandler.ValidateRequest(t, requestURL, "PUT", &tmpStr) } func TestVerbs(t *testing.T) { c := testRESTClient(t, nil) if r := c.Post(); r.verb != "POST" { t.Errorf("Post verb is wrong") } if r := c.Put(); r.verb != "PUT" { t.Errorf("Put verb is wrong") } if r := c.Get(); r.verb != "GET" { t.Errorf("Get verb is wrong") } if r := c.Delete(); r.verb != "DELETE" { t.Errorf("Delete verb is wrong") } } func TestAbsPath(t *testing.T) { for i, tc := range []struct { configPrefix string resourcePrefix string absPath string wantsAbsPath string }{ {"/", "", "", "/"}, {"", "", "/", "/"}, {"", "", "/api", "/api"}, {"", "", "/api/", "/api/"}, {"", "", "/apis", "/apis"}, {"", "/foo", "/bar/foo", "/bar/foo"}, {"", "/api/foo/123", "/bar/foo", "/bar/foo"}, {"/p1", "", "", "/p1"}, {"/p1", "", "/", "/p1/"}, {"/p1", "", "/api", "/p1/api"}, {"/p1", "", "/apis", "/p1/apis"}, {"/p1", "/r1", "/apis", "/p1/apis"}, {"/p1", "/api/r1", "/apis", "/p1/apis"}, {"/p1/api/p2", "", "", "/p1/api/p2"}, {"/p1/api/p2", "", "/", "/p1/api/p2/"}, {"/p1/api/p2", "", "/api", "/p1/api/p2/api"}, {"/p1/api/p2", "", "/api/", "/p1/api/p2/api/"}, {"/p1/api/p2", "/r1", "/api/", "/p1/api/p2/api/"}, {"/p1/api/p2", "/api/r1", "/api/", "/p1/api/p2/api/"}, } { u, _ := url.Parse("http://localhost:123" + tc.configPrefix) r := NewRequestWithClient(u, "", ClientContentConfig{GroupVersion: schema.GroupVersion{Group: "test"}}, nil).Verb("POST").Prefix(tc.resourcePrefix).AbsPath(tc.absPath) if r.pathPrefix != tc.wantsAbsPath { t.Errorf("test case %d failed, unexpected path: %q, expected %q", i, r.pathPrefix, tc.wantsAbsPath) } } } func TestUnacceptableParamNames(t *testing.T) { table := []struct { name string testVal string expectSuccess bool }{ // timeout is no longer "protected" {"timeout", "42", true}, } for _, item := range table { c := testRESTClient(t, nil) r := c.Get().setParam(item.name, item.testVal) if e, a := item.expectSuccess, r.err == nil; e != a { t.Errorf("expected %v, got %v (%v)", e, a, r.err) } } } func TestBody(t *testing.T) { const data = "test payload" obj := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}} bodyExpected, _ := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), obj) f, err := os.CreateTemp("", "test_body") if err != nil { t.Fatalf("TempFile error: %v", err) } if _, err := f.WriteString(data); err != nil { t.Fatalf("TempFile.WriteString error: %v", err) } f.Close() defer os.Remove(f.Name()) var nilObject *metav1.DeleteOptions typedObject := interface{}(nilObject) c := testRESTClient(t, nil) tests := []struct { input interface{} expected string headers map[string]string }{ {[]byte(data), data, nil}, {f.Name(), data, nil}, {strings.NewReader(data), data, nil}, {obj, string(bodyExpected), map[string]string{"Content-Type": "application/json"}}, {typedObject, "", nil}, } for i, tt := range tests { r := c.Post().Body(tt.input) if r.err != nil { t.Errorf("%d: r.Body(%#v) error: %v", i, tt, r.err) continue } if tt.headers != nil { for k, v := range tt.headers { if r.headers.Get(k) != v { t.Errorf("%d: r.headers[%q] = %q; want %q", i, k, v, v) } } } req, err := r.newHTTPRequest(context.Background()) if err != nil { t.Fatal(err) } if req.Body == nil { if len(tt.expected) != 0 { t.Errorf("%d: req.Body = %q; want %q", i, req.Body, tt.expected) } continue } buf := make([]byte, len(tt.expected)) if _, err := req.Body.Read(buf); err != nil { t.Errorf("%d: req.Body.Read error: %v", i, err) continue } body := string(buf) if body != tt.expected { t.Errorf("%d: req.Body = %q; want %q", i, body, tt.expected) } } } func TestWatch(t *testing.T) { tests := []struct { name string maxRetries int }{ { name: "no retry", maxRetries: 0, }, { name: "with retries", maxRetries: 3, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { var table = []struct { t watch.EventType obj runtime.Object }{ {watch.Added, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "first"}}}, {watch.Modified, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "second"}}}, {watch.Deleted, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "last"}}}, } var attempts int testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { defer func() { attempts++ }() flusher, ok := w.(http.Flusher) if !ok { panic("need flusher!") } if attempts < test.maxRetries { w.Header().Set("Retry-After", "1") w.WriteHeader(http.StatusTooManyRequests) return } w.Header().Set("Transfer-Encoding", "chunked") w.WriteHeader(http.StatusOK) flusher.Flush() encoder := restclientwatch.NewEncoder(streaming.NewEncoder(w, scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)), scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)) for _, item := range table { if err := encoder.Encode(&watch.Event{Type: item.t, Object: item.obj}); err != nil { panic(err) } flusher.Flush() } })) defer testServer.Close() s := testRESTClient(t, testServer) watching, err := s.Get().Prefix("path/to/watch/thing"). MaxRetries(test.maxRetries).Watch(context.Background()) if err != nil { t.Fatalf("Unexpected error: %v", err) } for _, item := range table { got, ok := <-watching.ResultChan() if !ok { t.Fatalf("Unexpected early close") } if e, a := item.t, got.Type; e != a { t.Errorf("Expected %v, got %v", e, a) } if e, a := item.obj, got.Object; !apiequality.Semantic.DeepDerivative(e, a) { t.Errorf("Expected %v, got %v", e, a) } } _, ok := <-watching.ResultChan() if ok { t.Fatal("Unexpected non-close") } }) } } func TestWatchNonDefaultContentType(t *testing.T) { var table = []struct { t watch.EventType obj runtime.Object }{ {watch.Added, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "first"}}}, {watch.Modified, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "second"}}}, {watch.Deleted, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "last"}}}, } testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { flusher, ok := w.(http.Flusher) if !ok { panic("need flusher!") } w.Header().Set("Transfer-Encoding", "chunked") // manually set the content type here so we get the renegotiation behavior w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) flusher.Flush() encoder := restclientwatch.NewEncoder(streaming.NewEncoder(w, scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)), scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)) for _, item := range table { if err := encoder.Encode(&watch.Event{Type: item.t, Object: item.obj}); err != nil { panic(err) } flusher.Flush() } })) defer testServer.Close() // set the default content type to protobuf so that we test falling back to JSON serialization contentConfig := defaultContentConfig() contentConfig.ContentType = "application/vnd.kubernetes.protobuf" s := testRESTClientWithConfig(t, testServer, contentConfig) watching, err := s.Get().Prefix("path/to/watch/thing").Watch(context.Background()) if err != nil { t.Fatalf("Unexpected error") } for _, item := range table { got, ok := <-watching.ResultChan() if !ok { t.Fatalf("Unexpected early close") } if e, a := item.t, got.Type; e != a { t.Errorf("Expected %v, got %v", e, a) } if e, a := item.obj, got.Object; !apiequality.Semantic.DeepDerivative(e, a) { t.Errorf("Expected %v, got %v", e, a) } } _, ok := <-watching.ResultChan() if ok { t.Fatal("Unexpected non-close") } } func TestWatchUnknownContentType(t *testing.T) { var table = []struct { t watch.EventType obj runtime.Object }{ {watch.Added, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "first"}}}, {watch.Modified, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "second"}}}, {watch.Deleted, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "last"}}}, } testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { flusher, ok := w.(http.Flusher) if !ok { panic("need flusher!") } w.Header().Set("Transfer-Encoding", "chunked") // manually set the content type here so we get the renegotiation behavior w.Header().Set("Content-Type", "foobar") w.WriteHeader(http.StatusOK) flusher.Flush() encoder := restclientwatch.NewEncoder(streaming.NewEncoder(w, scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)), scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)) for _, item := range table { if err := encoder.Encode(&watch.Event{Type: item.t, Object: item.obj}); err != nil { panic(err) } flusher.Flush() } })) defer testServer.Close() s := testRESTClient(t, testServer) _, err := s.Get().Prefix("path/to/watch/thing").Watch(context.Background()) if err == nil { t.Fatalf("Expected to fail due to lack of known stream serialization for content type") } } func TestStream(t *testing.T) { expectedBody := "expected body" testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { flusher, ok := w.(http.Flusher) if !ok { panic("need flusher!") } w.Header().Set("Transfer-Encoding", "chunked") w.WriteHeader(http.StatusOK) w.Write([]byte(expectedBody)) flusher.Flush() })) defer testServer.Close() s := testRESTClient(t, testServer) readCloser, err := s.Get().Prefix("path/to/stream/thing").Stream(context.Background()) if err != nil { t.Fatalf("unexpected error: %v", err) } defer readCloser.Close() buf := new(bytes.Buffer) buf.ReadFrom(readCloser) resultBody := buf.String() if expectedBody != resultBody { t.Errorf("Expected %s, got %s", expectedBody, resultBody) } } func testRESTClientWithConfig(t testing.TB, srv *httptest.Server, contentConfig ClientContentConfig) *RESTClient { base, _ := url.Parse("http://localhost") var c *http.Client if srv != nil { var err error base, err = url.Parse(srv.URL) if err != nil { t.Fatalf("failed to parse test URL: %v", err) } c = srv.Client() } versionedAPIPath := defaultResourcePathWithPrefix("", "", "", "") client, err := NewRESTClient(base, versionedAPIPath, contentConfig, nil, c) if err != nil { t.Fatalf("failed to create a client: %v", err) } return client } func testRESTClient(t testing.TB, srv *httptest.Server) *RESTClient { contentConfig := defaultContentConfig() return testRESTClientWithConfig(t, srv, contentConfig) } func TestDoContext(t *testing.T) { receivedCh := make(chan struct{}) block := make(chan struct{}) testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { close(receivedCh) <-block w.WriteHeader(http.StatusOK) })) defer testServer.Close() defer close(block) ctx, cancel := context.WithCancel(context.Background()) defer cancel() go func() { <-receivedCh cancel() }() c := testRESTClient(t, testServer) _, err := c.Verb("GET"). Prefix("foo"). DoRaw(ctx) if err == nil { t.Fatal("Expected context cancellation error") } } func buildString(length int) string { s := make([]byte, length) for i := range s { s[i] = 'a' } return string(s) } func init() { klog.InitFlags(nil) } func TestTruncateBody(t *testing.T) { tests := []struct { body string want string level string }{ // Anything below 8 is completely truncated { body: "Completely truncated below 8", want: " [truncated 28 chars]", level: "0", }, // Small strings are not truncated by high levels { body: "Small body never gets truncated", want: "Small body never gets truncated", level: "10", }, { body: "Small body never gets truncated", want: "Small body never gets truncated", level: "8", }, // Strings are truncated to 1024 if level is less than 9. { body: buildString(2000), level: "8", want: fmt.Sprintf("%s [truncated 976 chars]", buildString(1024)), }, // Strings are truncated to 10240 if level is 9. { body: buildString(20000), level: "9", want: fmt.Sprintf("%s [truncated 9760 chars]", buildString(10240)), }, // Strings are not truncated if level is 10 or higher { body: buildString(20000), level: "10", want: buildString(20000), }, // Strings are not truncated if level is 10 or higher { body: buildString(20000), level: "11", want: buildString(20000), }, } l := flag.Lookup("v").Value.(flag.Getter).Get().(klog.Level) for _, test := range tests { flag.Set("v", test.level) got := truncateBody(test.body) if got != test.want { t.Errorf("truncateBody(%v) = %v, want %v", test.body, got, test.want) } } flag.Set("v", l.String()) } func defaultResourcePathWithPrefix(prefix, resource, namespace, name string) string { var path string path = "/api/" + v1.SchemeGroupVersion.Version if prefix != "" { path = path + "/" + prefix } if namespace != "" { path = path + "/namespaces/" + namespace } // Resource names are lower case. resource = strings.ToLower(resource) if resource != "" { path = path + "/" + resource } if name != "" { path = path + "/" + name } return path } func TestRequestPreflightCheck(t *testing.T) { for _, tt := range []struct { name string verbs []string namespace string resourceName string namespaceSet bool expectsErr bool }{ { name: "no namespace set", verbs: []string{"GET", "PUT", "DELETE", "POST"}, namespaceSet: false, expectsErr: false, }, { name: "empty resource name and namespace", verbs: []string{"GET", "PUT", "DELETE"}, namespaceSet: true, expectsErr: false, }, { name: "resource name with empty namespace", verbs: []string{"GET", "PUT", "DELETE"}, namespaceSet: true, resourceName: "ResourceName", expectsErr: true, }, { name: "post empty resource name and namespace", verbs: []string{"POST"}, namespaceSet: true, expectsErr: true, }, { name: "working requests", verbs: []string{"GET", "PUT", "DELETE", "POST"}, namespaceSet: true, resourceName: "ResourceName", namespace: "Namespace", expectsErr: false, }, } { t.Run(tt.name, func(t *testing.T) { for _, verb := range tt.verbs { r := &Request{ verb: verb, namespace: tt.namespace, resourceName: tt.resourceName, namespaceSet: tt.namespaceSet, } err := r.requestPreflightCheck() hasErr := err != nil if hasErr == tt.expectsErr { return } t.Errorf("%s: expects error: %v, has error: %v", verb, tt.expectsErr, hasErr) } }) } } func TestThrottledLogger(t *testing.T) { now := time.Now() oldClock := globalThrottledLogger.clock defer func() { globalThrottledLogger.clock = oldClock }() clock := testingclock.NewFakeClock(now) globalThrottledLogger.clock = clock logMessages := 0 for i := 0; i < 1000; i++ { var wg sync.WaitGroup wg.Add(10) for j := 0; j < 10; j++ { go func() { if _, ok := globalThrottledLogger.attemptToLog(); ok { logMessages++ } wg.Done() }() } wg.Wait() now = now.Add(1 * time.Second) clock.SetTime(now) } if a, e := logMessages, 100; a != e { t.Fatalf("expected %v log messages, but got %v", e, a) } } func TestRequestMaxRetries(t *testing.T) { successAtNthCalls := 1 actualCalls := 0 retryOneTimeHandler := func(w http.ResponseWriter, req *http.Request) { defer func() { actualCalls++ }() if actualCalls >= successAtNthCalls { w.WriteHeader(http.StatusOK) return } w.Header().Set("Retry-After", "1") w.WriteHeader(http.StatusTooManyRequests) actualCalls++ } testServer := httptest.NewServer(http.HandlerFunc(retryOneTimeHandler)) defer testServer.Close() u, err := url.Parse(testServer.URL) if err != nil { t.Error(err) } testCases := []struct { name string maxRetries int expectError bool }{ { name: "no retrying should fail", maxRetries: 0, expectError: true, }, { name: "1 max-retry should exactly work", maxRetries: 1, expectError: false, }, { name: "5 max-retry should work", maxRetries: 5, expectError: false, }, } for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { defer func() { actualCalls = 0 }() _, err := NewRequestWithClient(u, "", defaultContentConfig(), testServer.Client()). Verb("get"). MaxRetries(testCase.maxRetries). AbsPath("/foo"). DoRaw(context.TODO()) hasError := err != nil if testCase.expectError != hasError { t.Error(" failed checking error") } }) } } type responseErr struct { response *http.Response err error } type seek struct { offset int64 whence int } type count struct { // keeps track of the number of Seek(offset, whence) calls. seeks []seek // how many times {Request|Response}.Body.Close() has been invoked lock sync.Mutex closes int } func (c *count) close() { c.lock.Lock() defer c.lock.Unlock() c.closes++ } func (c *count) getCloseCount() int { c.lock.Lock() defer c.lock.Unlock() return c.closes } // used to track {Request|Response}.Body type readTracker struct { delegated io.Reader count *count } func (r *readTracker) Seek(offset int64, whence int) (int64, error) { if seeker, ok := r.delegated.(io.Seeker); ok { r.count.seeks = append(r.count.seeks, seek{offset: offset, whence: whence}) return seeker.Seek(offset, whence) } return 0, io.EOF } func (r *readTracker) Read(p []byte) (n int, err error) { return r.delegated.Read(p) } func (r *readTracker) Close() error { if closer, ok := r.delegated.(io.Closer); ok { r.count.close() return closer.Close() } return nil } func newReadTracker(count *count) *readTracker { return &readTracker{ count: count, } } func newCount() *count { return &count{ closes: 0, seeks: make([]seek, 0), } } type readSeeker struct{ err error } func (rs readSeeker) Read([]byte) (int, error) { return 0, rs.err } func (rs readSeeker) Seek(int64, int) (int64, error) { return 0, rs.err } func unWrap(err error) error { if uerr, ok := err.(*url.Error); ok { return uerr.Err } return err } // noSleepBackOff is a NoBackoff except it does not sleep, // used for faster execution of the unit tests. type noSleepBackOff struct { *NoBackoff } func (n *noSleepBackOff) Sleep(d time.Duration) {} func TestRequestWithRetry(t *testing.T) { tests := []struct { name string body io.Reader bodyBytes []byte serverReturns responseErr errExpected error errContains string transformFuncInvokedExpected int roundTripInvokedExpected int }{ { name: "server returns retry-after response, no request body, retry goes ahead", bodyBytes: nil, serverReturns: responseErr{response: retryAfterResponse(), err: nil}, errExpected: nil, transformFuncInvokedExpected: 1, roundTripInvokedExpected: 2, }, { name: "server returns retry-after response, bytes request body, retry goes ahead", bodyBytes: []byte{}, serverReturns: responseErr{response: retryAfterResponse(), err: nil}, errExpected: nil, transformFuncInvokedExpected: 1, roundTripInvokedExpected: 2, }, { name: "server returns retry-after response, opaque request body, retry aborted", body: &readSeeker{}, serverReturns: responseErr{response: retryAfterResponse(), err: nil}, errExpected: nil, transformFuncInvokedExpected: 1, roundTripInvokedExpected: 1, }, { name: "server returns retryable err, no request body, retry goes ahead", bodyBytes: nil, serverReturns: responseErr{response: nil, err: io.ErrUnexpectedEOF}, errExpected: io.ErrUnexpectedEOF, transformFuncInvokedExpected: 0, roundTripInvokedExpected: 2, }, { name: "server returns retryable err, bytes request body, retry goes ahead", bodyBytes: []byte{}, serverReturns: responseErr{response: nil, err: io.ErrUnexpectedEOF}, errExpected: io.ErrUnexpectedEOF, transformFuncInvokedExpected: 0, roundTripInvokedExpected: 2, }, { name: "server returns retryable err, opaque request body, retry aborted", body: &readSeeker{}, serverReturns: responseErr{response: nil, err: io.ErrUnexpectedEOF}, errExpected: io.ErrUnexpectedEOF, transformFuncInvokedExpected: 0, roundTripInvokedExpected: 1, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { var roundTripInvoked int client := clientForFunc(func(req *http.Request) (*http.Response, error) { roundTripInvoked++ return test.serverReturns.response, test.serverReturns.err }) req := &Request{ verb: "GET", body: test.body, c: &RESTClient{ Client: client, }, backoff: &noSleepBackOff{}, maxRetries: 1, retryFn: defaultRequestRetryFn, } var transformFuncInvoked int err := req.request(context.Background(), func(request *http.Request, response *http.Response) { transformFuncInvoked++ }) if test.roundTripInvokedExpected != roundTripInvoked { t.Errorf("Expected RoundTrip to be invoked %d times, but got: %d", test.roundTripInvokedExpected, roundTripInvoked) } if test.transformFuncInvokedExpected != transformFuncInvoked { t.Errorf("Expected transform func to be invoked %d times, but got: %d", test.transformFuncInvokedExpected, transformFuncInvoked) } switch { case test.errExpected != nil: if test.errExpected != unWrap(err) { t.Errorf("Expected error: %v, but got: %v", test.errExpected, unWrap(err)) } case len(test.errContains) > 0: if !strings.Contains(err.Error(), test.errContains) { t.Errorf("Expected error message to caontain: %q, but got: %q", test.errContains, err.Error()) } } }) } } func TestRequestDoWithRetry(t *testing.T) { testRequestWithRetry(t, "Do", func(ctx context.Context, r *Request) { r.Do(ctx) }) } func TestRequestDoRawWithRetry(t *testing.T) { // both request.Do and request.DoRaw have the same behavior and expectations testRequestWithRetry(t, "Do", func(ctx context.Context, r *Request) { r.DoRaw(ctx) }) } func TestRequestStreamWithRetry(t *testing.T) { testRequestWithRetry(t, "Stream", func(ctx context.Context, r *Request) { r.Stream(ctx) }) } func TestRequestWatchWithRetry(t *testing.T) { testRequestWithRetry(t, "Watch", func(ctx context.Context, r *Request) { w, err := r.Watch(ctx) if err == nil { // in this test the response body returned by the server is always empty, // this will cause StreamWatcher.receive() to: // - return an io.EOF to indicate that the watch closed normally and // - then close the io.Reader // since we assert on the number of times 'Close' has been called on the // body of the response object, we need to wait here to avoid race condition. <-w.ResultChan() } }) } func TestRequestDoRetryWithRateLimiterBackoffAndMetrics(t *testing.T) { // both request.Do and request.DoRaw have the same behavior and expectations testRetryWithRateLimiterBackoffAndMetrics(t, "Do", func(ctx context.Context, r *Request) { r.DoRaw(ctx) }) } func TestRequestStreamRetryWithRateLimiterBackoffAndMetrics(t *testing.T) { testRetryWithRateLimiterBackoffAndMetrics(t, "Stream", func(ctx context.Context, r *Request) { r.Stream(ctx) }) } func TestRequestWatchRetryWithRateLimiterBackoffAndMetrics(t *testing.T) { testRetryWithRateLimiterBackoffAndMetrics(t, "Watch", func(ctx context.Context, r *Request) { w, err := r.Watch(ctx) if err == nil { // in this test the response body returned by the server is always empty, // this will cause StreamWatcher.receive() to: // - return an io.EOF to indicate that the watch closed normally and // - then close the io.Reader // since we assert on the number of times 'Close' has been called on the // body of the response object, we need to wait here to avoid race condition. <-w.ResultChan() } }) } func TestRequestDoWithRetryInvokeOrder(t *testing.T) { // both request.Do and request.DoRaw have the same behavior and expectations testWithRetryInvokeOrder(t, "Do", func(ctx context.Context, r *Request) { r.DoRaw(ctx) }) } func TestRequestStreamWithRetryInvokeOrder(t *testing.T) { testWithRetryInvokeOrder(t, "Stream", func(ctx context.Context, r *Request) { r.Stream(ctx) }) } func TestRequestWatchWithRetryInvokeOrder(t *testing.T) { testWithRetryInvokeOrder(t, "Watch", func(ctx context.Context, r *Request) { w, err := r.Watch(ctx) if err == nil { // in this test the response body returned by the server is always empty, // this will cause StreamWatcher.receive() to: // - return an io.EOF to indicate that the watch closed normally and // - then close the io.Reader // since we assert on the number of times 'Close' has been called on the // body of the response object, we need to wait here to avoid race condition. <-w.ResultChan() } }) } func TestRequestWatchWithWrapPreviousError(t *testing.T) { testWithWrapPreviousError(t, func(ctx context.Context, r *Request) error { w, err := r.Watch(ctx) if err == nil { // in this test the response body returned by the server is always empty, // this will cause StreamWatcher.receive() to: // - return an io.EOF to indicate that the watch closed normally and // - then close the io.Reader // since we assert on the number of times 'Close' has been called on the // body of the response object, we need to wait here to avoid race condition. <-w.ResultChan() } return err }) } func TestRequestDoWithWrapPreviousError(t *testing.T) { // both request.Do and request.DoRaw have the same behavior and expectations testWithWrapPreviousError(t, func(ctx context.Context, r *Request) error { result := r.Do(ctx) return result.err }) } func testRequestWithRetry(t *testing.T, key string, doFunc func(ctx context.Context, r *Request)) { type expected struct { attempts int reqCount *count respCount *count } tests := []struct { name string verb string body io.Reader bodyBytes []byte maxRetries int serverReturns []responseErr // expectations differ based on whether it is 'Watch', 'Stream' or 'Do' expectations map[string]expected }{ { name: "server always returns retry-after response", verb: "GET", bodyBytes: []byte{}, maxRetries: 2, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, }, expectations: map[string]expected{ "Do": { attempts: 3, reqCount: &count{closes: 0, seeks: make([]seek, 2)}, respCount: &count{closes: 3, seeks: []seek{}}, }, "Watch": { attempts: 3, reqCount: &count{closes: 0, seeks: make([]seek, 2)}, respCount: &count{closes: 3, seeks: []seek{}}, }, "Stream": { attempts: 3, reqCount: &count{closes: 0, seeks: make([]seek, 2)}, respCount: &count{closes: 3, seeks: []seek{}}, }, }, }, { name: "server always returns retryable error", verb: "GET", bodyBytes: []byte{}, maxRetries: 2, serverReturns: []responseErr{ {response: nil, err: io.EOF}, {response: nil, err: io.EOF}, {response: nil, err: io.EOF}, }, expectations: map[string]expected{ "Do": { attempts: 3, reqCount: &count{closes: 0, seeks: make([]seek, 2)}, respCount: &count{closes: 0, seeks: []seek{}}, }, "Watch": { attempts: 3, reqCount: &count{closes: 0, seeks: make([]seek, 2)}, respCount: &count{closes: 0, seeks: []seek{}}, }, // for Stream, we never retry on any error "Stream": { attempts: 1, // only the first attempt is expected reqCount: &count{closes: 0, seeks: []seek{}}, respCount: &count{closes: 0, seeks: []seek{}}, }, }, }, { name: "server returns success on the final retry", verb: "GET", bodyBytes: []byte{}, maxRetries: 2, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: nil, err: io.EOF}, {response: &http.Response{StatusCode: http.StatusOK}, err: nil}, }, expectations: map[string]expected{ "Do": { attempts: 3, reqCount: &count{closes: 0, seeks: make([]seek, 2)}, respCount: &count{closes: 2, seeks: []seek{}}, }, "Watch": { attempts: 3, reqCount: &count{closes: 0, seeks: make([]seek, 2)}, // the Body of the successful response object will get closed by // StreamWatcher, so we need to take that into account. respCount: &count{closes: 2, seeks: []seek{}}, }, "Stream": { attempts: 2, reqCount: &count{closes: 0, seeks: make([]seek, 1)}, respCount: &count{closes: 1, seeks: []seek{}}, }, }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { respCountGot := newCount() responseRecorder := newReadTracker(respCountGot) var attempts int client := clientForFunc(func(req *http.Request) (*http.Response, error) { defer func() { attempts++ }() resp := test.serverReturns[attempts].response if resp != nil { responseRecorder.delegated = io.NopCloser(bytes.NewReader([]byte{})) resp.Body = responseRecorder } return resp, test.serverReturns[attempts].err }) req := &Request{ verb: test.verb, body: test.body, bodyBytes: test.bodyBytes, c: &RESTClient{ content: defaultContentConfig(), Client: client, }, backoff: &noSleepBackOff{}, maxRetries: test.maxRetries, retryFn: defaultRequestRetryFn, } doFunc(context.Background(), req) expected, ok := test.expectations[key] if !ok { t.Fatalf("Wrong test setup - did not find expected for: %s", key) } if expected.attempts != attempts { t.Errorf("Expected retries: %d, but got: %d", expected.attempts, attempts) } if expected.respCount.closes != respCountGot.getCloseCount() { t.Errorf("Expected response body Close to be invoked %d times, but got: %d", expected.respCount.closes, respCountGot.getCloseCount()) } }) } } type retryTestKeyType int const retryTestKey retryTestKeyType = iota // fake flowcontrol.RateLimiter so we can tap into the Wait method of the rate limiter. // fake BackoffManager so we can tap into backoff calls // fake metrics.ResultMetric to tap into the metric calls // we use it to verify that RateLimiter, BackoffManager, and // metric calls are invoked appropriately in right order. type withRateLimiterBackoffManagerAndMetrics struct { flowcontrol.RateLimiter *NoBackoff metrics.ResultMetric calculateBackoffSeq int64 calculateBackoffFn func(i int64) time.Duration metrics.RetryMetric invokeOrderGot []string sleepsGot []string statusCodesGot []string } func (lb *withRateLimiterBackoffManagerAndMetrics) Wait(ctx context.Context) error { lb.invokeOrderGot = append(lb.invokeOrderGot, "RateLimiter.Wait") return nil } func (lb *withRateLimiterBackoffManagerAndMetrics) CalculateBackoff(actualUrl *url.URL) time.Duration { lb.invokeOrderGot = append(lb.invokeOrderGot, "BackoffManager.CalculateBackoff") waitFor := lb.calculateBackoffFn(lb.calculateBackoffSeq) lb.calculateBackoffSeq++ return waitFor } func (lb *withRateLimiterBackoffManagerAndMetrics) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) { lb.invokeOrderGot = append(lb.invokeOrderGot, "BackoffManager.UpdateBackoff") } func (lb *withRateLimiterBackoffManagerAndMetrics) Sleep(d time.Duration) { lb.invokeOrderGot = append(lb.invokeOrderGot, "BackoffManager.Sleep") lb.sleepsGot = append(lb.sleepsGot, d.String()) } func (lb *withRateLimiterBackoffManagerAndMetrics) Increment(ctx context.Context, code, _, _ string) { // we are interested in the request context that is marked by this test if marked, ok := ctx.Value(retryTestKey).(bool); ok && marked { lb.invokeOrderGot = append(lb.invokeOrderGot, "RequestResult.Increment") lb.statusCodesGot = append(lb.statusCodesGot, code) } } func (lb *withRateLimiterBackoffManagerAndMetrics) IncrementRetry(ctx context.Context, code, _, _ string) { // we are interested in the request context that is marked by this test if marked, ok := ctx.Value(retryTestKey).(bool); ok && marked { lb.invokeOrderGot = append(lb.invokeOrderGot, "RequestRetry.IncrementRetry") lb.statusCodesGot = append(lb.statusCodesGot, code) } } func (lb *withRateLimiterBackoffManagerAndMetrics) Do() { lb.invokeOrderGot = append(lb.invokeOrderGot, "Client.Do") } func testRetryWithRateLimiterBackoffAndMetrics(t *testing.T, key string, doFunc func(ctx context.Context, r *Request)) { type expected struct { attempts int order []string sleeps []string statusCodes []string } // we define the expected order of how the client invokes the // rate limiter, backoff, and metrics methods. // scenario: // - A: original request fails with a retryable response: (500, 'Retry-After: N') // - B: retry 1: successful with a status code 200 // so we have a total of 2 attempts invokeOrderWant := []string{ // before we send the request to the server: // - we wait as dictated by the client rate lmiter // - we wait, as dictated by the backoff manager "RateLimiter.Wait", "BackoffManager.CalculateBackoff", "BackoffManager.Sleep", // A: first attempt for which the server sends a retryable response // status code: 500, Retry-Afer: N "Client.Do", // we got a response object, status code: 500, Retry-Afer: N // - call metrics method with appropriate status code // - update backoff parameters with the status code returned "RequestResult.Increment", "BackoffManager.UpdateBackoff", "BackoffManager.CalculateBackoff", // sleep for delay=max(BackoffManager.CalculateBackoff, Retry-After: N) "BackoffManager.Sleep", // wait as dictated by the client rate lmiter "RateLimiter.Wait", // B: 2nd attempt: retry, and this should return a status code=200 "Client.Do", // it's a success, so do the following: // count the result metric, and since it's a retry, // count the retry metric, and then update backoff parameters. "RequestResult.Increment", "RequestRetry.IncrementRetry", "BackoffManager.UpdateBackoff", } statusCodesWant := []string{ // first attempt (A): we count the result metric only "500", // final attempt (B): we count the result metric, and the retry metric "200", "200", } tests := []struct { name string maxRetries int serverReturns []responseErr calculateBackoffFn func(i int64) time.Duration // expectations differ based on whether it is 'Watch', 'Stream' or 'Do' expectations map[string]expected }{ { name: "success after one retry, Retry-After: N > BackoffManager.CalculateBackoff", maxRetries: 1, serverReturns: []responseErr{ {response: retryAfterResponseWithDelay("5"), err: nil}, {response: &http.Response{StatusCode: http.StatusOK}, err: nil}, }, // we simulate a sleep sequence of 0s, 1s, 2s, 3s, ... calculateBackoffFn: func(i int64) time.Duration { return time.Duration(i * int64(time.Second)) }, expectations: map[string]expected{ "Do": { attempts: 2, order: invokeOrderWant, statusCodes: statusCodesWant, sleeps: []string{ // initial backoff.Sleep before we send the request to the server for the first time "0s", // maximum of: // - 'Retry-After: 5' response header from (A) // - BackoffManager.CalculateBackoff (will return 1s) (5 * time.Second).String(), }, }, "Watch": { attempts: 2, // Watch does not do 'RateLimiter.Wait' before initially sending the request to the server order: invokeOrderWant[1:], statusCodes: statusCodesWant, sleeps: []string{ "0s", (5 * time.Second).String(), }, }, "Stream": { attempts: 2, order: invokeOrderWant, statusCodes: statusCodesWant, sleeps: []string{ "0s", (5 * time.Second).String(), }, }, }, }, { name: "success after one retry, Retry-After: N < BackoffManager.CalculateBackoff", maxRetries: 1, serverReturns: []responseErr{ {response: retryAfterResponseWithDelay("2"), err: nil}, {response: &http.Response{StatusCode: http.StatusOK}, err: nil}, }, // we simulate a sleep sequence of 0s, 4s, 8s, 16s, ... calculateBackoffFn: func(i int64) time.Duration { return time.Duration(i * int64(4*time.Second)) }, expectations: map[string]expected{ "Do": { attempts: 2, order: invokeOrderWant, statusCodes: statusCodesWant, sleeps: []string{ // initial backoff.Sleep before we send the request to the server for the first time "0s", // maximum of: // - 'Retry-After: 2' response header from (A) // - BackoffManager.CalculateBackoff (will return 4s) (4 * time.Second).String(), }, }, "Watch": { attempts: 2, // Watch does not do 'RateLimiter.Wait' before initially sending the request to the server order: invokeOrderWant[1:], statusCodes: statusCodesWant, sleeps: []string{ "0s", (4 * time.Second).String(), }, }, "Stream": { attempts: 2, order: invokeOrderWant, statusCodes: statusCodesWant, sleeps: []string{ "0s", (4 * time.Second).String(), }, }, }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { interceptor := &withRateLimiterBackoffManagerAndMetrics{ RateLimiter: flowcontrol.NewFakeAlwaysRateLimiter(), NoBackoff: &NoBackoff{}, calculateBackoffFn: test.calculateBackoffFn, } // TODO: today this is the only site where a test overrides the // default metric interfaces, in future if we other tests want // to override as well, and we want tests to be able to run in // parallel then we will need to provide a way for tests to // register/deregister their own metric inerfaces. oldRequestResult := metrics.RequestResult oldRequestRetry := metrics.RequestRetry metrics.RequestResult = interceptor metrics.RequestRetry = interceptor defer func() { metrics.RequestResult = oldRequestResult metrics.RequestRetry = oldRequestRetry }() ctx, cancel := context.WithCancel(context.Background()) defer cancel() // we are changing metrics.RequestResult (a global state) in // this test, to avoid interference from other tests running in // parallel we need to associate a key to the context so we // can identify the metric calls associated with this test. ctx = context.WithValue(ctx, retryTestKey, true) var attempts int client := clientForFunc(func(req *http.Request) (*http.Response, error) { defer func() { attempts++ }() interceptor.Do() resp := test.serverReturns[attempts].response if resp != nil { resp.Body = io.NopCloser(bytes.NewReader([]byte{})) } return resp, test.serverReturns[attempts].err }) base, err := url.Parse("http://foo.bar") if err != nil { t.Fatalf("Wrong test setup - did not find expected for: %s", key) } req := &Request{ verb: "GET", bodyBytes: []byte{}, c: &RESTClient{ base: base, content: defaultContentConfig(), Client: client, rateLimiter: interceptor, }, pathPrefix: "/api/v1", rateLimiter: interceptor, backoff: interceptor, maxRetries: test.maxRetries, retryFn: defaultRequestRetryFn, } doFunc(ctx, req) want, ok := test.expectations[key] if !ok { t.Fatalf("Wrong test setup - did not find expected for: %s", key) } if want.attempts != attempts { t.Errorf("%s: Expected retries: %d, but got: %d", key, want.attempts, attempts) } if !cmp.Equal(want.order, interceptor.invokeOrderGot) { t.Errorf("%s: Expected invoke order to match, diff: %s", key, cmp.Diff(want.order, interceptor.invokeOrderGot)) } if !cmp.Equal(want.sleeps, interceptor.sleepsGot) { t.Errorf("%s: Expected sleep sequence to match, diff: %s", key, cmp.Diff(want.sleeps, interceptor.sleepsGot)) } if !cmp.Equal(want.statusCodes, interceptor.statusCodesGot) { t.Errorf("%s: Expected status codes to match, diff: %s", key, cmp.Diff(want.statusCodes, interceptor.statusCodesGot)) } }) } } type retryInterceptor struct { WithRetry invokeOrderGot []string } func (ri *retryInterceptor) IsNextRetry(ctx context.Context, restReq *Request, httpReq *http.Request, resp *http.Response, err error, f IsRetryableErrorFunc) bool { ri.invokeOrderGot = append(ri.invokeOrderGot, "WithRetry.IsNextRetry") return ri.WithRetry.IsNextRetry(ctx, restReq, httpReq, resp, err, f) } func (ri *retryInterceptor) Before(ctx context.Context, request *Request) error { ri.invokeOrderGot = append(ri.invokeOrderGot, "WithRetry.Before") return ri.WithRetry.Before(ctx, request) } func (ri *retryInterceptor) After(ctx context.Context, request *Request, resp *http.Response, err error) { ri.invokeOrderGot = append(ri.invokeOrderGot, "WithRetry.After") ri.WithRetry.After(ctx, request, resp, err) } func (ri *retryInterceptor) Do() { ri.invokeOrderGot = append(ri.invokeOrderGot, "Client.Do") } func testWithRetryInvokeOrder(t *testing.T, key string, doFunc func(ctx context.Context, r *Request)) { // we define the expected order of how the client // should invoke the retry interface // scenario: // - A: original request fails with a retryable response: (500, 'Retry-After: 1') // - B: retry 1: successful with a status code 200 // so we have a total of 2 attempts defaultInvokeOrderWant := []string{ // first attempt (A) "WithRetry.Before", "Client.Do", "WithRetry.After", // server returns a retryable response: (500, 'Retry-After: 1') // IsNextRetry is expected to return true "WithRetry.IsNextRetry", // second attempt (B) - retry 1: successful with a status code 200 "WithRetry.Before", "Client.Do", "WithRetry.After", // success: IsNextRetry is expected to return false // Watch and Stream are an exception, they return as soon as the // server sends a status code of success. "WithRetry.IsNextRetry", } tests := []struct { name string maxRetries int serverReturns []responseErr // expectations differ based on whether it is 'Watch', 'Stream' or 'Do' expectations map[string][]string }{ { name: "success after one retry", maxRetries: 1, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: &http.Response{StatusCode: http.StatusOK}, err: nil}, }, expectations: map[string][]string{ "Do": defaultInvokeOrderWant, // Watch and Stream skip the final 'IsNextRetry' by returning // as soon as they see a success from the server. "Watch": defaultInvokeOrderWant[0 : len(defaultInvokeOrderWant)-1], "Stream": defaultInvokeOrderWant[0 : len(defaultInvokeOrderWant)-1], }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { interceptor := &retryInterceptor{ WithRetry: &withRetry{maxRetries: test.maxRetries}, } var attempts int client := clientForFunc(func(req *http.Request) (*http.Response, error) { defer func() { attempts++ }() interceptor.Do() resp := test.serverReturns[attempts].response if resp != nil { resp.Body = io.NopCloser(bytes.NewReader([]byte{})) } return resp, test.serverReturns[attempts].err }) base, err := url.Parse("http://foo.bar") if err != nil { t.Fatalf("Wrong test setup - did not find expected for: %s", key) } req := &Request{ verb: "GET", bodyBytes: []byte{}, c: &RESTClient{ base: base, content: defaultContentConfig(), Client: client, }, pathPrefix: "/api/v1", rateLimiter: flowcontrol.NewFakeAlwaysRateLimiter(), backoff: &NoBackoff{}, retryFn: func(_ int) WithRetry { return interceptor }, } doFunc(context.Background(), req) if attempts != 2 { t.Errorf("%s: Expected attempts: %d, but got: %d", key, 2, attempts) } invokeOrderWant, ok := test.expectations[key] if !ok { t.Fatalf("Wrong test setup - did not find expected for: %s", key) } if !cmp.Equal(invokeOrderWant, interceptor.invokeOrderGot) { t.Errorf("%s: Expected invoke order to match, diff: %s", key, cmp.Diff(invokeOrderWant, interceptor.invokeOrderGot)) } }) } } func testWithWrapPreviousError(t *testing.T, doFunc func(ctx context.Context, r *Request) error) { var ( containsFormatExpected = "- error from a previous attempt: %s" nonRetryableErr = errors.New("non retryable error") ) tests := []struct { name string maxRetries int serverReturns []responseErr expectedErr error wrapped bool attemptsExpected int contains string }{ { name: "success at first attempt", maxRetries: 2, serverReturns: []responseErr{ {response: &http.Response{StatusCode: http.StatusOK}, err: nil}, }, attemptsExpected: 1, expectedErr: nil, }, { name: "success after a series of retry-after from the server", maxRetries: 2, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: &http.Response{StatusCode: http.StatusOK}, err: nil}, }, attemptsExpected: 3, expectedErr: nil, }, { name: "success after a series of retryable errors", maxRetries: 2, serverReturns: []responseErr{ {response: nil, err: io.EOF}, {response: nil, err: io.EOF}, {response: &http.Response{StatusCode: http.StatusOK}, err: nil}, }, attemptsExpected: 3, expectedErr: nil, }, { name: "request errors out with a non retryable error", maxRetries: 2, serverReturns: []responseErr{ {response: nil, err: nonRetryableErr}, }, attemptsExpected: 1, expectedErr: nonRetryableErr, }, { name: "request times out after retries, but no previous error", maxRetries: 2, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: nil, err: context.Canceled}, }, attemptsExpected: 3, expectedErr: context.Canceled, }, { name: "request times out after retries, and we have a relevant previous error", maxRetries: 3, serverReturns: []responseErr{ {response: nil, err: io.EOF}, {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: nil, err: context.Canceled}, }, attemptsExpected: 4, wrapped: true, expectedErr: context.Canceled, contains: fmt.Sprintf(containsFormatExpected, io.EOF), }, { name: "interleaved retry-after responses with retryable errors", maxRetries: 8, serverReturns: []responseErr{ {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: nil, err: io.ErrUnexpectedEOF}, {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: nil, err: io.EOF}, {response: retryAfterResponse(), err: nil}, {response: retryAfterResponse(), err: nil}, {response: nil, err: context.Canceled}, }, attemptsExpected: 9, wrapped: true, expectedErr: context.Canceled, contains: fmt.Sprintf(containsFormatExpected, io.EOF), }, { name: "request errors out with a retryable error, followed by a non-retryable one", maxRetries: 3, serverReturns: []responseErr{ {response: nil, err: io.EOF}, {response: nil, err: nonRetryableErr}, }, attemptsExpected: 2, wrapped: true, expectedErr: nonRetryableErr, contains: fmt.Sprintf(containsFormatExpected, io.EOF), }, { name: "use the most recent error", maxRetries: 2, serverReturns: []responseErr{ {response: nil, err: io.ErrUnexpectedEOF}, {response: nil, err: io.EOF}, {response: nil, err: context.Canceled}, }, attemptsExpected: 3, wrapped: true, expectedErr: context.Canceled, contains: fmt.Sprintf(containsFormatExpected, io.EOF), }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { var attempts int client := clientForFunc(func(req *http.Request) (*http.Response, error) { defer func() { attempts++ }() resp := test.serverReturns[attempts].response if resp != nil { resp.Body = io.NopCloser(bytes.NewReader([]byte{})) } return resp, test.serverReturns[attempts].err }) base, err := url.Parse("http://foo.bar") if err != nil { t.Fatalf("Failed to create new HTTP request - %v", err) } req := &Request{ verb: "GET", bodyBytes: []byte{}, c: &RESTClient{ base: base, content: defaultContentConfig(), Client: client, }, pathPrefix: "/api/v1", rateLimiter: flowcontrol.NewFakeAlwaysRateLimiter(), backoff: &noSleepBackOff{}, maxRetries: test.maxRetries, retryFn: defaultRequestRetryFn, } err = doFunc(context.Background(), req) if test.attemptsExpected != attempts { t.Errorf("Expected attempts: %d, but got: %d", test.attemptsExpected, attempts) } switch { case test.expectedErr == nil: if err != nil { t.Errorf("Expected a nil error, but got: %v", err) return } case test.expectedErr != nil: if !strings.Contains(err.Error(), test.contains) { t.Errorf("Expected error message to contain %q, but got: %v", test.contains, err) } urlErrGot, _ := err.(*url.Error) if test.wrapped { // we expect the url.Error from net/http to be wrapped by WrapPreviousError unwrapper, ok := err.(interface { Unwrap() error }) if !ok { t.Errorf("Expected error to implement Unwrap method, but got: %v", err) return } urlErrGot, _ = unwrapper.Unwrap().(*url.Error) } // we always get a url.Error from net/http if urlErrGot == nil { t.Errorf("Expected error to be url.Error, but got: %v", err) return } errGot := urlErrGot.Unwrap() if test.expectedErr != errGot { t.Errorf("Expected error %v, but got: %v", test.expectedErr, errGot) } } }) } } func TestReuseRequest(t *testing.T) { var tests = []struct { name string enableHTTP2 bool }{ {"HTTP1", false}, {"HTTP2", true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(r.RemoteAddr)) })) ts.EnableHTTP2 = tt.enableHTTP2 ts.StartTLS() defer ts.Close() ctx, cancel := context.WithCancel(context.Background()) defer cancel() c := testRESTClient(t, ts) req1, err := c.Verb("GET"). Prefix("foo"). DoRaw(ctx) if err != nil { t.Fatalf("Unexpected error: %v", err) } req2, err := c.Verb("GET"). Prefix("foo"). DoRaw(ctx) if err != nil { t.Fatalf("Unexpected error: %v", err) } if string(req1) != string(req2) { t.Fatalf("Expected %v to be equal to %v", string(req1), string(req2)) } }) } } func TestHTTP1DoNotReuseRequestAfterTimeout(t *testing.T) { var tests = []struct { name string enableHTTP2 bool }{ {"HTTP1", false}, {"HTTP2", true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { done := make(chan struct{}) ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { t.Logf("TEST Connected from %v on %v\n", r.RemoteAddr, r.URL.Path) if r.URL.Path == "/hang" { t.Logf("TEST hanging %v\n", r.RemoteAddr) <-done } w.Write([]byte(r.RemoteAddr)) })) ts.EnableHTTP2 = tt.enableHTTP2 ts.StartTLS() defer ts.Close() // close hanging connection before shutting down the http server defer close(done) ctx, cancel := context.WithCancel(context.Background()) defer cancel() transport, ok := ts.Client().Transport.(*http.Transport) if !ok { t.Fatalf("failed to assert *http.Transport") } config := &Config{ Host: ts.URL, Transport: utilnet.SetTransportDefaults(transport), Timeout: 1 * time.Second, // These fields are required to create a REST client. ContentConfig: ContentConfig{ GroupVersion: &schema.GroupVersion{}, NegotiatedSerializer: &serializer.CodecFactory{}, }, } if !tt.enableHTTP2 { config.TLSClientConfig.NextProtos = []string{"http/1.1"} } c, err := RESTClientFor(config) if err != nil { t.Fatalf("failed to create REST client: %v", err) } req1, err := c.Verb("GET"). Prefix("foo"). DoRaw(ctx) if err != nil { t.Fatalf("Unexpected error: %v", err) } _, err = c.Verb("GET"). Prefix("/hang"). DoRaw(ctx) if err == nil { t.Fatalf("Expected error") } req2, err := c.Verb("GET"). Prefix("foo"). DoRaw(ctx) if err != nil { t.Fatalf("Unexpected error: %v", err) } // http1 doesn't reuse the connection after it times if tt.enableHTTP2 != (string(req1) == string(req2)) { if tt.enableHTTP2 { t.Fatalf("Expected %v to be the same as %v", string(req1), string(req2)) } else { t.Fatalf("Expected %v to be different to %v", string(req1), string(req2)) } } }) } } func TestTransportConcurrency(t *testing.T) { const numReqs = 10 var tests = []struct { name string enableHTTP2 bool }{ {"HTTP1", false}, {"HTTP2", true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { t.Logf("Connected from %v %v", r.RemoteAddr, r.URL) fmt.Fprintf(w, "%v", r.FormValue("echo")) })) ts.EnableHTTP2 = tt.enableHTTP2 ts.StartTLS() defer ts.Close() var wg sync.WaitGroup wg.Add(numReqs) c := testRESTClient(t, ts) reqs := make(chan string) defer close(reqs) for i := 0; i < 4; i++ { go func() { for req := range reqs { res, err := c.Get().Param("echo", req).DoRaw(context.Background()) if err != nil { t.Errorf("error on req %s: %v", req, err) wg.Done() continue } if string(res) != req { t.Errorf("body of req %s = %q; want %q", req, res, req) } wg.Done() } }() } for i := 0; i < numReqs; i++ { reqs <- fmt.Sprintf("request-%d", i) } wg.Wait() }) } } func TestRetryableConditions(t *testing.T) { var ( methods = map[string]func(ctx context.Context, r *Request){ "Do": func(ctx context.Context, r *Request) { r.Do(ctx) }, "DoRaw": func(ctx context.Context, r *Request) { r.DoRaw(ctx) }, "Stream": func(ctx context.Context, r *Request) { r.Stream(ctx) }, "Watch": func(ctx context.Context, r *Request) { w, err := r.Watch(ctx) if err == nil { // we need to wait here to avoid race condition. <-w.ResultChan() } }, } alwaysRetry = map[string]bool{ "Do": true, "DoRaw": true, "Watch": true, "Stream": true, } neverRetry = map[string]bool{ "Do": false, "DoRaw": false, "Watch": false, "Stream": false, } alwaysRetryExceptStream = map[string]bool{ "Do": true, "DoRaw": true, "Watch": true, "Stream": false, } ) tests := []struct { name string verbs []string serverReturns responseErr retryExpectation map[string]bool }{ // {429, Retry-After: N} - we expect retry { name: "server returns {429, Retry-After}", verbs: []string{"GET", "POST", "PUT", "DELETE", "PATCH"}, serverReturns: responseErr{response: retryAfterResponseWithCodeAndDelay(http.StatusTooManyRequests, "0"), err: nil}, retryExpectation: alwaysRetry, }, // {5xx, Retry-After: N} - we expect retry { name: "server returns {503, Retry-After}", verbs: []string{"GET", "POST", "PUT", "DELETE", "PATCH"}, serverReturns: responseErr{response: retryAfterResponseWithCodeAndDelay(http.StatusServiceUnavailable, "0"), err: nil}, retryExpectation: alwaysRetry, }, // 5xx, but Retry-After: N is missing - no retry is expected { name: "server returns 5xx, but no Retry-After", verbs: []string{"GET", "POST", "PUT", "DELETE", "PATCH"}, serverReturns: responseErr{response: &http.Response{StatusCode: http.StatusInternalServerError}, err: nil}, retryExpectation: neverRetry, }, // 429, but Retry-After: N is missing - no retry is expected { name: "server returns 429 but no Retry-After", verbs: []string{"GET", "POST", "PUT", "DELETE", "PATCH"}, serverReturns: responseErr{response: &http.Response{StatusCode: http.StatusTooManyRequests}, err: nil}, retryExpectation: neverRetry, }, // response is nil, but error is set { name: "server returns connection reset error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: syscall.ECONNRESET}, retryExpectation: alwaysRetryExceptStream, }, { name: "server returns EOF error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: io.EOF}, retryExpectation: alwaysRetryExceptStream, }, { name: "server returns unexpected EOF error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: io.ErrUnexpectedEOF}, retryExpectation: alwaysRetryExceptStream, }, { name: "server returns broken connection error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: errors.New("http: can't write HTTP request on broken connection")}, retryExpectation: alwaysRetryExceptStream, }, { name: "server returns GOAWAY error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: errors.New("http2: server sent GOAWAY and closed the connection")}, retryExpectation: alwaysRetryExceptStream, }, { name: "server returns connection reset by peer error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: errors.New("connection reset by peer")}, retryExpectation: alwaysRetryExceptStream, }, { name: "server returns use of closed network connection error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: errors.New("use of closed network connection")}, retryExpectation: alwaysRetryExceptStream, }, // connection refused error never gets retried { name: "server returns connection refused error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: syscall.ECONNREFUSED}, retryExpectation: neverRetry, }, { name: "server returns connection refused error", verbs: []string{"POST"}, serverReturns: responseErr{response: nil, err: syscall.ECONNREFUSED}, retryExpectation: neverRetry, }, { name: "server returns EOF error", verbs: []string{"POST"}, serverReturns: responseErr{response: nil, err: io.EOF}, retryExpectation: map[string]bool{ "Do": false, "DoRaw": false, "Watch": true, // not applicable, Watch should always be GET only "Stream": false, }, }, // Timeout error gets retries by watch only { name: "server returns net.Timeout() == true error", verbs: []string{"GET"}, serverReturns: responseErr{response: nil, err: &net.DNSError{IsTimeout: true}}, retryExpectation: map[string]bool{ "Do": false, "DoRaw": false, "Watch": true, "Stream": false, }, }, { name: "server returns OK, never retry", verbs: []string{"GET", "POST", "PUT", "DELETE", "PATCH"}, serverReturns: responseErr{response: &http.Response{StatusCode: http.StatusOK}, err: nil}, retryExpectation: neverRetry, }, { name: "server returns {3xx, Retry-After}", verbs: []string{"GET", "POST", "PUT", "DELETE", "PATCH"}, serverReturns: responseErr{response: &http.Response{StatusCode: http.StatusMovedPermanently, Header: http.Header{"Retry-After": []string{"0"}}}, err: nil}, retryExpectation: neverRetry, }, } for _, test := range tests { for method, retryExpected := range test.retryExpectation { fn, ok := methods[method] if !ok { t.Fatalf("Wrong test setup, unknown method: %s", method) } for _, verb := range test.verbs { t.Run(fmt.Sprintf("%s/%s/%s", test.name, method, verb), func(t *testing.T) { var attemptsGot int client := clientForFunc(func(req *http.Request) (*http.Response, error) { attemptsGot++ return test.serverReturns.response, test.serverReturns.err }) u, _ := url.Parse("http://localhost:123" + "/apis") req := &Request{ verb: verb, c: &RESTClient{ base: u, content: defaultContentConfig(), Client: client, }, backoff: &noSleepBackOff{}, maxRetries: 2, retryFn: defaultRequestRetryFn, } fn(context.Background(), req) if retryExpected { if attemptsGot != 3 { t.Errorf("Expected attempt count: %d, but got: %d", 3, attemptsGot) } return } // we don't expect retry, so we should see the first attempt only. if attemptsGot > 1 { t.Errorf("Expected no retry, but got %d attempts", attemptsGot) } }) } } } } func TestRequestConcurrencyWithRetry(t *testing.T) { var attempts int32 client := clientForFunc(func(req *http.Request) (*http.Response, error) { defer func() { atomic.AddInt32(&attempts, 1) }() // always send a retry-after response return &http.Response{ StatusCode: http.StatusInternalServerError, Header: http.Header{"Retry-After": []string{"1"}}, }, nil }) req := &Request{ verb: "POST", c: &RESTClient{ content: defaultContentConfig(), Client: client, }, backoff: &noSleepBackOff{}, maxRetries: 9, // 10 attempts in total, including the first retryFn: defaultRequestRetryFn, } concurrency := 20 wg := sync.WaitGroup{} wg.Add(concurrency) startCh := make(chan struct{}) for i := 0; i < concurrency; i++ { go func() { defer wg.Done() <-startCh req.Do(context.Background()) }() } close(startCh) wg.Wait() // we expect (concurrency*req.maxRetries+1) attempts to be recorded expected := concurrency * (req.maxRetries + 1) if atomic.LoadInt32(&attempts) != int32(expected) { t.Errorf("Expected attempts: %d, but got: %d", expected, attempts) } } kubernetes-client-go-a2dfcab/rest/request_watchlist_test.go000066400000000000000000000254351472614177300245260ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "fmt" "regexp" "testing" "github.com/google/go-cmp/cmp" v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/watch" clientfeatures "k8s.io/client-go/features" clientfeaturestesting "k8s.io/client-go/features/testing" ) func TestWatchListResult(t *testing.T) { scenarios := []struct { name string target WatchListResult result runtime.Object expectedResult *v1.PodList expectedErr error }{ { name: "not a pointer", result: fakeObj{}, expectedErr: fmt.Errorf("rest.fakeObj is not a list: expected pointer, but got rest.fakeObj type"), }, { name: "nil input won't panic", result: nil, expectedErr: fmt.Errorf(" is not a list: expected pointer, but got invalid kind"), }, { name: "not a list", result: &v1.Pod{}, expectedErr: fmt.Errorf("*v1.Pod is not a list: no Items field in this object"), }, { name: "an err is always returned", result: nil, target: WatchListResult{err: fmt.Errorf("dummy err")}, expectedErr: fmt.Errorf("dummy err"), }, { name: "empty list", result: &v1.PodList{}, expectedResult: &v1.PodList{ TypeMeta: metav1.TypeMeta{Kind: "PodList"}, Items: []v1.Pod{}, }, }, { name: "gv is applied", result: &v1.PodList{}, target: WatchListResult{gv: schema.GroupVersion{Group: "g", Version: "v"}}, expectedResult: &v1.PodList{ TypeMeta: metav1.TypeMeta{Kind: "PodList", APIVersion: "g/v"}, Items: []v1.Pod{}, }, }, { name: "gv is applied, empty group", result: &v1.PodList{}, target: WatchListResult{gv: schema.GroupVersion{Version: "v"}}, expectedResult: &v1.PodList{ TypeMeta: metav1.TypeMeta{Kind: "PodList", APIVersion: "v"}, Items: []v1.Pod{}, }, }, { name: "rv is applied", result: &v1.PodList{}, target: WatchListResult{initialEventsEndBookmarkRV: "100"}, expectedResult: &v1.PodList{ TypeMeta: metav1.TypeMeta{Kind: "PodList"}, ListMeta: metav1.ListMeta{ResourceVersion: "100"}, Items: []v1.Pod{}, }, }, { name: "items are applied", result: &v1.PodList{}, target: WatchListResult{items: []runtime.Object{makePod(1), makePod(2)}}, expectedResult: &v1.PodList{ TypeMeta: metav1.TypeMeta{Kind: "PodList"}, Items: []v1.Pod{*makePod(1), *makePod(2)}, }, }, { name: "type mismatch", result: &v1.PodList{}, target: WatchListResult{items: []runtime.Object{makeNamespace("1")}}, expectedErr: fmt.Errorf("received object type = v1.Namespace at index = 0, doesn't match the list item type = v1.Pod"), }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { err := scenario.target.Into(scenario.result) if scenario.expectedErr != nil && err == nil { t.Fatalf("expected an error = %v, got nil", scenario.expectedErr) } if scenario.expectedErr == nil && err != nil { t.Fatalf("didn't expect an error, got = %v", err) } if err != nil { if scenario.expectedErr.Error() != err.Error() { t.Fatalf("unexpected err = %v, expected = %v", err, scenario.expectedErr) } return } if !apiequality.Semantic.DeepEqual(scenario.expectedResult, scenario.result) { t.Errorf("diff: %v", cmp.Diff(scenario.expectedResult, scenario.result)) } }) } } func TestWatchListSuccess(t *testing.T) { scenarios := []struct { name string gv schema.GroupVersion watchEvents []watch.Event expectedResult *v1.PodList }{ { name: "happy path", // Note that the APIVersion for the core API group is "v1" (not "core/v1"). // We fake "core/v1" here to test if the Group part is properly // recognized and set on the resulting object. gv: schema.GroupVersion{Group: "core", Version: "v1"}, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod(1)}, {Type: watch.Added, Object: makePod(2)}, {Type: watch.Bookmark, Object: makeBookmarkEvent(5)}, }, expectedResult: &v1.PodList{ TypeMeta: metav1.TypeMeta{ APIVersion: "core/v1", Kind: "PodList", }, ListMeta: metav1.ListMeta{ResourceVersion: "5"}, Items: []v1.Pod{*makePod(1), *makePod(2)}, }, }, { name: "APIVersion with only version provided is properly set", gv: schema.GroupVersion{Version: "v1"}, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod(1)}, {Type: watch.Bookmark, Object: makeBookmarkEvent(5)}, }, expectedResult: &v1.PodList{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "PodList", }, ListMeta: metav1.ListMeta{ResourceVersion: "5"}, Items: []v1.Pod{*makePod(1)}, }, }, { name: "only the bookmark", gv: schema.GroupVersion{Version: "v1"}, watchEvents: []watch.Event{ {Type: watch.Bookmark, Object: makeBookmarkEvent(5)}, }, expectedResult: &v1.PodList{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "PodList", }, ListMeta: metav1.ListMeta{ResourceVersion: "5"}, Items: []v1.Pod{}, }, }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { ctx := context.Background() fakeWatcher := watch.NewFake() target := &Request{ c: &RESTClient{ content: ClientContentConfig{ GroupVersion: scenario.gv, }, }, } go func(watchEvents []watch.Event) { for _, watchEvent := range watchEvents { fakeWatcher.Action(watchEvent.Type, watchEvent.Object) } }(scenario.watchEvents) res := target.handleWatchList(ctx, fakeWatcher) if res.err != nil { t.Fatal(res.err) } result := &v1.PodList{} if err := res.Into(result); err != nil { t.Fatal(err) } if !apiequality.Semantic.DeepEqual(scenario.expectedResult, result) { t.Errorf("diff: %v", cmp.Diff(scenario.expectedResult, result)) } if !fakeWatcher.IsStopped() { t.Fatalf("the watcher wasn't stopped") } }) } } func TestWatchListFailure(t *testing.T) { scenarios := []struct { name string ctx context.Context watcher *watch.FakeWatcher watchEvents []watch.Event expectedError error }{ { name: "request stop", ctx: func() context.Context { ctx, ctxCancel := context.WithCancel(context.TODO()) ctxCancel() return ctx }(), watcher: watch.NewFake(), expectedError: fmt.Errorf("context canceled"), }, { name: "stop watcher", ctx: context.TODO(), watcher: func() *watch.FakeWatcher { w := watch.NewFake() w.Stop() return w }(), expectedError: fmt.Errorf("unexpected watch close"), }, { name: "stop on watch.Error", ctx: context.TODO(), watcher: watch.NewFake(), watchEvents: []watch.Event{{Type: watch.Error, Object: &apierrors.NewInternalError(fmt.Errorf("dummy errror")).ErrStatus}}, expectedError: fmt.Errorf("Internal error occurred: dummy errror"), }, { name: "incorrect watch type (Deleted)", ctx: context.TODO(), watcher: watch.NewFake(), watchEvents: []watch.Event{{Type: watch.Deleted, Object: makePod(1)}}, expectedError: fmt.Errorf("unexpected watch event .*, expected to only receive watch.Added and watch.Bookmark events"), }, { name: "incorrect watch type (Modified)", ctx: context.TODO(), watcher: watch.NewFake(), watchEvents: []watch.Event{{Type: watch.Modified, Object: makePod(1)}}, expectedError: fmt.Errorf("unexpected watch event .*, expected to only receive watch.Added and watch.Bookmark events"), }, { name: "unordered input returns an error", ctx: context.TODO(), watcher: watch.NewFake(), watchEvents: []watch.Event{{Type: watch.Added, Object: makePod(3)}, {Type: watch.Added, Object: makePod(1)}}, expectedError: fmt.Errorf("cannot add the obj .* with the key = ns/pod-1, as it violates the ordering guarantees provided by the watchlist feature in beta phase, lastInsertedKey was = ns/pod-3"), }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { target := &Request{} go func(w *watch.FakeWatcher, watchEvents []watch.Event) { for _, event := range watchEvents { w.Action(event.Type, event.Object) } }(scenario.watcher, scenario.watchEvents) res := target.handleWatchList(scenario.ctx, scenario.watcher) resErr := res.Into(nil) if resErr == nil { t.Fatal("expected to get an error, got nil") } matched, err := regexp.MatchString(scenario.expectedError.Error(), resErr.Error()) if err != nil { t.Fatal(err) } if !matched { t.Fatalf("unexpected err = %v, expected = %v", resErr, scenario.expectedError) } if !scenario.watcher.IsStopped() { t.Fatalf("the watcher wasn't stopped") } }) } } func TestWatchListWhenFeatureGateDisabled(t *testing.T) { clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, false) expectedError := fmt.Errorf("%q feature gate is not enabled", clientfeatures.WatchListClient) target := &Request{} res := target.WatchList(context.TODO()) resErr := res.Into(nil) if resErr == nil { t.Fatal("expected to get an error, got nil") } if resErr.Error() != expectedError.Error() { t.Fatalf("unexpected error: %v, expected: %v", resErr, expectedError) } } func makePod(rv uint64) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("pod-%d", rv), Namespace: "ns", ResourceVersion: fmt.Sprintf("%d", rv), Annotations: map[string]string{}, }, } } func makeNamespace(name string) *v1.Namespace { return &v1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: name}} } func makeBookmarkEvent(rv uint64) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: fmt.Sprintf("%d", rv), Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, } } type fakeObj struct { } func (f fakeObj) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } func (f fakeObj) DeepCopyObject() runtime.Object { return fakeObj{} } kubernetes-client-go-a2dfcab/rest/testdata/000077500000000000000000000000001472614177300211665ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/rest/testdata/ca.pem000066400000000000000000000000261472614177300222520ustar00rootroot00000000000000a CA bundle lives herekubernetes-client-go-a2dfcab/rest/transport.go000066400000000000000000000113671472614177300217500ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "crypto/tls" "errors" "net/http" "k8s.io/client-go/pkg/apis/clientauthentication" "k8s.io/client-go/plugin/pkg/client/auth/exec" "k8s.io/client-go/transport" ) // HTTPClientFor returns an http.Client that will provide the authentication // or transport level security defined by the provided Config. Will return the // default http.DefaultClient if no special case behavior is needed. func HTTPClientFor(config *Config) (*http.Client, error) { transport, err := TransportFor(config) if err != nil { return nil, err } var httpClient *http.Client if transport != http.DefaultTransport || config.Timeout > 0 { httpClient = &http.Client{ Transport: transport, Timeout: config.Timeout, } } else { httpClient = http.DefaultClient } return httpClient, nil } // TLSConfigFor returns a tls.Config that will provide the transport level security defined // by the provided Config. Will return nil if no transport level security is requested. func TLSConfigFor(config *Config) (*tls.Config, error) { cfg, err := config.TransportConfig() if err != nil { return nil, err } return transport.TLSConfigFor(cfg) } // TransportFor returns an http.RoundTripper that will provide the authentication // or transport level security defined by the provided Config. Will return the // default http.DefaultTransport if no special case behavior is needed. func TransportFor(config *Config) (http.RoundTripper, error) { cfg, err := config.TransportConfig() if err != nil { return nil, err } return transport.New(cfg) } // HTTPWrappersForConfig wraps a round tripper with any relevant layered behavior from the // config. Exposed to allow more clients that need HTTP-like behavior but then must hijack // the underlying connection (like WebSocket or HTTP2 clients). Pure HTTP clients should use // the higher level TransportFor or RESTClientFor methods. func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTripper, error) { cfg, err := config.TransportConfig() if err != nil { return nil, err } return transport.HTTPWrappersForConfig(cfg, rt) } // TransportConfig converts a client config to an appropriate transport config. func (c *Config) TransportConfig() (*transport.Config, error) { conf := &transport.Config{ UserAgent: c.UserAgent, Transport: c.Transport, WrapTransport: c.WrapTransport, DisableCompression: c.DisableCompression, TLS: transport.TLSConfig{ Insecure: c.Insecure, ServerName: c.ServerName, CAFile: c.CAFile, CAData: c.CAData, CertFile: c.CertFile, CertData: c.CertData, KeyFile: c.KeyFile, KeyData: c.KeyData, NextProtos: c.NextProtos, }, Username: c.Username, Password: c.Password, BearerToken: c.BearerToken, BearerTokenFile: c.BearerTokenFile, Impersonate: transport.ImpersonationConfig{ UserName: c.Impersonate.UserName, UID: c.Impersonate.UID, Groups: c.Impersonate.Groups, Extra: c.Impersonate.Extra, }, Proxy: c.Proxy, } if c.Dial != nil { conf.DialHolder = &transport.DialHolder{Dial: c.Dial} } if c.ExecProvider != nil && c.AuthProvider != nil { return nil, errors.New("execProvider and authProvider cannot be used in combination") } if c.ExecProvider != nil { var cluster *clientauthentication.Cluster if c.ExecProvider.ProvideClusterInfo { var err error cluster, err = ConfigToExecCluster(c) if err != nil { return nil, err } } provider, err := exec.GetAuthenticator(c.ExecProvider, cluster) if err != nil { return nil, err } if err := provider.UpdateTransportConfig(conf); err != nil { return nil, err } } if c.AuthProvider != nil { provider, err := GetAuthProvider(c.Host, c.AuthProvider, c.AuthConfigPersister) if err != nil { return nil, err } conf.Wrap(provider.WrapTransport) } return conf, nil } // Wrap adds a transport middleware function that will give the caller // an opportunity to wrap the underlying http.RoundTripper prior to the // first API call being made. The provided function is invoked after any // existing transport wrappers are invoked. func (c *Config) Wrap(fn transport.WrapperFunc) { c.WrapTransport = transport.Wrappers(c.WrapTransport, fn) } kubernetes-client-go-a2dfcab/rest/transport_test.go000066400000000000000000000102261472614177300230000ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "net" "strings" "sync" "testing" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) // TestTransportForThreadSafe is meant to be run with the race detector // to detect that the Transport generation for client-go is safe to // call from multiple goroutines. func TestTransportForThreadSafe(t *testing.T) { const ( rootCACert = `-----BEGIN CERTIFICATE----- MIIC4DCCAcqgAwIBAgIBATALBgkqhkiG9w0BAQswIzEhMB8GA1UEAwwYMTAuMTMu MTI5LjEwNkAxNDIxMzU5MDU4MB4XDTE1MDExNTIxNTczN1oXDTE2MDExNTIxNTcz OFowIzEhMB8GA1UEAwwYMTAuMTMuMTI5LjEwNkAxNDIxMzU5MDU4MIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAunDRXGwsiYWGFDlWH6kjGun+PshDGeZX xtx9lUnL8pIRWH3wX6f13PO9sktaOWW0T0mlo6k2bMlSLlSZgG9H6og0W6gLS3vq s4VavZ6DbXIwemZG2vbRwsvR+t4G6Nbwelm6F8RFnA1Fwt428pavmNQ/wgYzo+T1 1eS+HiN4ACnSoDSx3QRWcgBkB1g6VReofVjx63i0J+w8Q/41L9GUuLqquFxu6ZnH 60vTB55lHgFiDLjA1FkEz2dGvGh/wtnFlRvjaPC54JH2K1mPYAUXTreoeJtLJKX0 ycoiyB24+zGCniUmgIsmQWRPaOPircexCp1BOeze82BT1LCZNTVaxQIDAQABoyMw ITAOBgNVHQ8BAf8EBAMCAKQwDwYDVR0TAQH/BAUwAwEB/zALBgkqhkiG9w0BAQsD ggEBADMxsUuAFlsYDpF4fRCzXXwrhbtj4oQwcHpbu+rnOPHCZupiafzZpDu+rw4x YGPnCb594bRTQn4pAu3Ac18NbLD5pV3uioAkv8oPkgr8aUhXqiv7KdDiaWm6sbAL EHiXVBBAFvQws10HMqMoKtO8f1XDNAUkWduakR/U6yMgvOPwS7xl0eUTqyRB6zGb K55q2dejiFWaFqB/y78txzvz6UlOZKE44g2JAVoJVM6kGaxh33q8/FmrL4kuN3ut W+MmJCVDvd4eEqPwbp7146ZWTqpIJ8lvA6wuChtqV8lhAPka2hD/LMqY8iXNmfXD uml0obOEy+ON91k+SWTJ3ggmF/U= -----END CERTIFICATE-----` authPluginName = "auth-plugin-tr" ) err := RegisterAuthProviderPlugin(authPluginName, pluginAProvider) // the plugins are stored in a global variable that fails if the test // runs with the flag -count N, with N > 1 if err != nil && !strings.Contains(err.Error(), "was registered twice") { t.Errorf("Unexpected error: failed to register pluginA: %v", err) } configurations := []struct { name string config *Config }{ { name: "simple config", config: &Config{ Host: "localhost:8080", Username: "gopher", Password: "g0ph3r", }, }, { name: "not cacheable config", config: &Config{ Host: "localhost:8080", Username: "gopher", Password: "g0ph3r", Dial: func(ctx context.Context, network, address string) (net.Conn, error) { return nil, nil }, }, }, { name: "with TLS config", config: &Config{ Host: "localhost:8080", Username: "gopher", Password: "g0ph3r", TLSClientConfig: TLSClientConfig{ CAData: []byte(rootCACert), }, }, }, { name: "with auth provider", config: &Config{ Host: "localhost:8080", Username: "gopher", Password: "g0ph3r", TLSClientConfig: TLSClientConfig{ CAData: []byte(rootCACert), }, AuthProvider: &clientcmdapi.AuthProviderConfig{ Name: authPluginName, Config: map[string]string{"secret": "s3cr3t"}, }, }, }, { name: "with exec provider", config: &Config{ Host: "localhost:8080", Username: "gopher", Password: "g0ph3r", TLSClientConfig: TLSClientConfig{ CAData: []byte(rootCACert), }, ExecProvider: &clientcmdapi.ExecConfig{ Args: []string{"secret"}, Env: []clientcmdapi.ExecEnvVar{{Name: "secret", Value: "s3cr3t"}}, APIVersion: "client.authentication.k8s.io/v1beta1", }, }, }, } var wg sync.WaitGroup for _, tt := range configurations { tt := tt wg.Add(1) go func() { defer wg.Done() for i := 1; i <= 50; i++ { wg.Add(1) go func() { defer wg.Done() _, err := TransportFor(tt.config) if err != nil { t.Errorf("Config: %s TransportFor() error = %v", tt.name, err) } }() } }() } wg.Wait() } kubernetes-client-go-a2dfcab/rest/url_utils.go000066400000000000000000000070271472614177300217340ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "fmt" "net/url" "path" "k8s.io/apimachinery/pkg/runtime/schema" ) // DefaultServerURL converts a host, host:port, or URL string to the default base server API path // to use with a Client at a given API version following the standard conventions for a // Kubernetes API. func DefaultServerURL(host, apiPath string, groupVersion schema.GroupVersion, defaultTLS bool) (*url.URL, string, error) { if host == "" { return nil, "", fmt.Errorf("host must be a URL or a host:port pair") } base := host hostURL, err := url.Parse(base) if err != nil || hostURL.Scheme == "" || hostURL.Host == "" { scheme := "http://" if defaultTLS { scheme = "https://" } hostURL, err = url.Parse(scheme + base) if err != nil { return nil, "", err } if hostURL.Path != "" && hostURL.Path != "/" { return nil, "", fmt.Errorf("host must be a URL or a host:port pair: %q", base) } } // hostURL.Path is optional; a non-empty Path is treated as a prefix that is to be applied to // all URIs used to access the host. this is useful when there's a proxy in front of the // apiserver that has relocated the apiserver endpoints, forwarding all requests from, for // example, /a/b/c to the apiserver. in this case the Path should be /a/b/c. // // if running without a frontend proxy (that changes the location of the apiserver), then // hostURL.Path should be blank. // // versionedAPIPath, a path relative to baseURL.Path, points to a versioned API base versionedAPIPath := DefaultVersionedAPIPath(apiPath, groupVersion) return hostURL, versionedAPIPath, nil } // DefaultVersionedAPIPathFor constructs the default path for the given group version, assuming the given // API path, following the standard conventions of the Kubernetes API. func DefaultVersionedAPIPath(apiPath string, groupVersion schema.GroupVersion) string { versionedAPIPath := path.Join("/", apiPath) // Add the version to the end of the path if len(groupVersion.Group) > 0 { versionedAPIPath = path.Join(versionedAPIPath, groupVersion.Group, groupVersion.Version) } else { versionedAPIPath = path.Join(versionedAPIPath, groupVersion.Version) } return versionedAPIPath } // DefaultServerUrlFor is shared between IsConfigTransportTLS and RESTClientFor. It // requires Host and Version to be set prior to being called. func DefaultServerUrlFor(config *Config) (*url.URL, string, error) { // TODO: move the default to secure when the apiserver supports TLS by default // config.Insecure is taken to mean "I want HTTPS but don't bother checking the certs against a CA." hasCA := len(config.CAFile) != 0 || len(config.CAData) != 0 hasCert := len(config.CertFile) != 0 || len(config.CertData) != 0 defaultTLS := hasCA || hasCert || config.Insecure host := config.Host if host == "" { host = "localhost" } if config.GroupVersion != nil { return DefaultServerURL(host, config.APIPath, *config.GroupVersion, defaultTLS) } return DefaultServerURL(host, config.APIPath, schema.GroupVersion{}, defaultTLS) } kubernetes-client-go-a2dfcab/rest/url_utils_test.go000066400000000000000000000036331472614177300227720ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "path" "testing" "k8s.io/api/core/v1" ) func TestValidatesHostParameter(t *testing.T) { testCases := []struct { Host string APIPath string URL string Err bool }{ {"127.0.0.1", "", "http://127.0.0.1/" + v1.SchemeGroupVersion.Version, false}, {"127.0.0.1:8080", "", "http://127.0.0.1:8080/" + v1.SchemeGroupVersion.Version, false}, {"foo.bar.com", "", "http://foo.bar.com/" + v1.SchemeGroupVersion.Version, false}, {"http://host/prefix", "", "http://host/prefix/" + v1.SchemeGroupVersion.Version, false}, {"http://host", "", "http://host/" + v1.SchemeGroupVersion.Version, false}, {"http://host", "/", "http://host/" + v1.SchemeGroupVersion.Version, false}, {"http://host", "/other", "http://host/other/" + v1.SchemeGroupVersion.Version, false}, {"host/server", "", "", true}, } for i, testCase := range testCases { u, versionedAPIPath, err := DefaultServerURL(testCase.Host, testCase.APIPath, v1.SchemeGroupVersion, false) switch { case err == nil && testCase.Err: t.Errorf("expected error but was nil") continue case err != nil && !testCase.Err: t.Errorf("unexpected error %v", err) continue case err != nil: continue } u.Path = path.Join(u.Path, versionedAPIPath) if e, a := testCase.URL, u.String(); e != a { t.Errorf("%d: expected host %s, got %s", i, e, a) continue } } } kubernetes-client-go-a2dfcab/rest/urlbackoff.go000066400000000000000000000065631472614177300220340ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "net/url" "time" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" ) // Set of resp. Codes that we backoff for. // In general these should be errors that indicate a server is overloaded. // These shouldn't be configured by any user, we set them based on conventions // described in var serverIsOverloadedSet = sets.NewInt(429) var maxResponseCode = 499 type BackoffManager interface { UpdateBackoff(actualUrl *url.URL, err error, responseCode int) CalculateBackoff(actualUrl *url.URL) time.Duration Sleep(d time.Duration) } // URLBackoff struct implements the semantics on top of Backoff which // we need for URL specific exponential backoff. type URLBackoff struct { // Uses backoff as underlying implementation. Backoff *flowcontrol.Backoff } // NoBackoff is a stub implementation, can be used for mocking or else as a default. type NoBackoff struct { } func (n *NoBackoff) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) { // do nothing. } func (n *NoBackoff) CalculateBackoff(actualUrl *url.URL) time.Duration { return 0 * time.Second } func (n *NoBackoff) Sleep(d time.Duration) { time.Sleep(d) } // Disable makes the backoff trivial, i.e., sets it to zero. This might be used // by tests which want to run 1000s of mock requests without slowing down. func (b *URLBackoff) Disable() { klog.V(4).Infof("Disabling backoff strategy") b.Backoff = flowcontrol.NewBackOff(0*time.Second, 0*time.Second) } // baseUrlKey returns the key which urls will be mapped to. // For example, 127.0.0.1:8080/api/v2/abcde -> 127.0.0.1:8080. func (b *URLBackoff) baseUrlKey(rawurl *url.URL) string { // Simple implementation for now, just the host. // We may backoff specific paths (i.e. "pods") differentially // in the future. host, err := url.Parse(rawurl.String()) if err != nil { klog.V(4).Infof("Error extracting url: %v", rawurl) panic("bad url!") } return host.Host } // UpdateBackoff updates backoff metadata func (b *URLBackoff) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) { // range for retry counts that we store is [0,13] if responseCode > maxResponseCode || serverIsOverloadedSet.Has(responseCode) { b.Backoff.Next(b.baseUrlKey(actualUrl), b.Backoff.Clock.Now()) return } else if responseCode >= 300 || err != nil { klog.V(4).Infof("Client is returning errors: code %v, error %v", responseCode, err) } //If we got this far, there is no backoff required for this URL anymore. b.Backoff.Reset(b.baseUrlKey(actualUrl)) } // CalculateBackoff takes a url and back's off exponentially, // based on its knowledge of existing failures. func (b *URLBackoff) CalculateBackoff(actualUrl *url.URL) time.Duration { return b.Backoff.Get(b.baseUrlKey(actualUrl)) } func (b *URLBackoff) Sleep(d time.Duration) { b.Backoff.Clock.Sleep(d) } kubernetes-client-go-a2dfcab/rest/urlbackoff_test.go000066400000000000000000000046501472614177300230660ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "net/url" "testing" "time" "k8s.io/client-go/util/flowcontrol" ) func parse(raw string) *url.URL { theUrl, _ := url.Parse(raw) return theUrl } func TestURLBackoffFunctionalityCollisions(t *testing.T) { myBackoff := &URLBackoff{ Backoff: flowcontrol.NewBackOff(1*time.Second, 60*time.Second), } // Add some noise and make sure backoff for a clean URL is zero. myBackoff.UpdateBackoff(parse("http://100.200.300.400:8080"), nil, 500) myBackoff.UpdateBackoff(parse("http://1.2.3.4:8080"), nil, 500) if myBackoff.CalculateBackoff(parse("http://1.2.3.4:100")) > 0 { t.Errorf("URLs are colliding in the backoff map!") } } // TestURLBackoffFunctionality generally tests the URLBackoff wrapper. We avoid duplicating tests from backoff and request. func TestURLBackoffFunctionality(t *testing.T) { myBackoff := &URLBackoff{ Backoff: flowcontrol.NewBackOff(1*time.Second, 60*time.Second), } // Now test that backoff increases, then recovers. // 200 and 300 should both result in clearing the backoff. // all others like 429 should result in increased backoff. seconds := []int{0, 1, 2, 4, 8, 0, 1, 2} returnCodes := []int{ 429, 500, 501, 502, 300, 500, 501, 502, } if len(seconds) != len(returnCodes) { t.Fatalf("responseCode to backoff arrays should be the same length... sanity check failed.") } for i, sec := range seconds { backoffSec := myBackoff.CalculateBackoff(parse("http://1.2.3.4:100")) if backoffSec < time.Duration(sec)*time.Second || backoffSec > time.Duration(sec+5)*time.Second { t.Errorf("Backoff out of range %v: %v %v", i, sec, backoffSec) } myBackoff.UpdateBackoff(parse("http://1.2.3.4:100/responseCodeForFuncTest"), nil, returnCodes[i]) } if myBackoff.CalculateBackoff(parse("http://1.2.3.4:100")) == 0 { t.Errorf("The final return code %v should have resulted in a backoff ! ", returnCodes[7]) } } kubernetes-client-go-a2dfcab/rest/warnings.go000066400000000000000000000103521472614177300215350ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "fmt" "io" "net/http" "sync" "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/util/net" ) // WarningHandler is an interface for handling warning headers type WarningHandler interface { // HandleWarningHeader is called with the warn code, agent, and text when a warning header is countered. HandleWarningHeader(code int, agent string, text string) } var ( defaultWarningHandler WarningHandler = WarningLogger{} defaultWarningHandlerLock sync.RWMutex ) // SetDefaultWarningHandler sets the default handler clients use when warning headers are encountered. // By default, warnings are logged. Several built-in implementations are provided: // - NoWarnings suppresses warnings. // - WarningLogger logs warnings. // - NewWarningWriter() outputs warnings to the provided writer. func SetDefaultWarningHandler(l WarningHandler) { defaultWarningHandlerLock.Lock() defer defaultWarningHandlerLock.Unlock() defaultWarningHandler = l } func getDefaultWarningHandler() WarningHandler { defaultWarningHandlerLock.RLock() defer defaultWarningHandlerLock.RUnlock() l := defaultWarningHandler return l } // NoWarnings is an implementation of WarningHandler that suppresses warnings. type NoWarnings struct{} func (NoWarnings) HandleWarningHeader(code int, agent string, message string) {} // WarningLogger is an implementation of WarningHandler that logs code 299 warnings type WarningLogger struct{} func (WarningLogger) HandleWarningHeader(code int, agent string, message string) { if code != 299 || len(message) == 0 { return } klog.Warning(message) } type warningWriter struct { // out is the writer to output warnings to out io.Writer // opts contains options controlling warning output opts WarningWriterOptions // writtenLock guards written and writtenCount writtenLock sync.Mutex writtenCount int written map[string]struct{} } // WarningWriterOptions controls the behavior of a WarningHandler constructed using NewWarningWriter() type WarningWriterOptions struct { // Deduplicate indicates a given warning message should only be written once. // Setting this to true in a long-running process handling many warnings can result in increased memory use. Deduplicate bool // Color indicates that warning output can include ANSI color codes Color bool } // NewWarningWriter returns an implementation of WarningHandler that outputs code 299 warnings to the specified writer. func NewWarningWriter(out io.Writer, opts WarningWriterOptions) *warningWriter { h := &warningWriter{out: out, opts: opts} if opts.Deduplicate { h.written = map[string]struct{}{} } return h } const ( yellowColor = "\u001b[33;1m" resetColor = "\u001b[0m" ) // HandleWarningHeader prints warnings with code=299 to the configured writer. func (w *warningWriter) HandleWarningHeader(code int, agent string, message string) { if code != 299 || len(message) == 0 { return } w.writtenLock.Lock() defer w.writtenLock.Unlock() if w.opts.Deduplicate { if _, alreadyWritten := w.written[message]; alreadyWritten { return } w.written[message] = struct{}{} } w.writtenCount++ if w.opts.Color { fmt.Fprintf(w.out, "%sWarning:%s %s\n", yellowColor, resetColor, message) } else { fmt.Fprintf(w.out, "Warning: %s\n", message) } } func (w *warningWriter) WarningCount() int { w.writtenLock.Lock() defer w.writtenLock.Unlock() return w.writtenCount } func handleWarnings(headers http.Header, handler WarningHandler) []net.WarningHeader { if handler == nil { handler = getDefaultWarningHandler() } warnings, _ := net.ParseWarningHeaders(headers["Warning"]) for _, warning := range warnings { handler.HandleWarningHeader(warning.Code, warning.Agent, warning.Text) } return warnings } kubernetes-client-go-a2dfcab/rest/watch/000077500000000000000000000000001472614177300204635ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/rest/watch/decoder.go000066400000000000000000000043671472614177300224310ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package versioned import ( "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/watch" ) // Decoder implements the watch.Decoder interface for io.ReadClosers that // have contents which consist of a series of watchEvent objects encoded // with the given streaming decoder. The internal objects will be then // decoded by the embedded decoder. type Decoder struct { decoder streaming.Decoder embeddedDecoder runtime.Decoder } // NewDecoder creates an Decoder for the given writer and codec. func NewDecoder(decoder streaming.Decoder, embeddedDecoder runtime.Decoder) *Decoder { return &Decoder{ decoder: decoder, embeddedDecoder: embeddedDecoder, } } // Decode blocks until it can return the next object in the reader. Returns an error // if the reader is closed or an object can't be decoded. func (d *Decoder) Decode() (watch.EventType, runtime.Object, error) { var got metav1.WatchEvent res, _, err := d.decoder.Decode(nil, &got) if err != nil { return "", nil, err } if res != &got { return "", nil, fmt.Errorf("unable to decode to metav1.WatchEvent") } switch got.Type { case string(watch.Added), string(watch.Modified), string(watch.Deleted), string(watch.Error), string(watch.Bookmark): default: return "", nil, fmt.Errorf("got invalid watch event type: %v", got.Type) } obj, err := runtime.Decode(d.embeddedDecoder, got.Object.Raw) if err != nil { return "", nil, fmt.Errorf("unable to decode watch event: %v", err) } return watch.EventType(got.Type), obj, nil } // Close closes the underlying r. func (d *Decoder) Close() { d.decoder.Close() } kubernetes-client-go-a2dfcab/rest/watch/decoder_test.go000066400000000000000000000065611472614177300234660ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package versioned_test import ( "encoding/json" "fmt" "io" "testing" "time" "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" runtimejson "k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes/scheme" restclientwatch "k8s.io/client-go/rest/watch" ) // getDecoder mimics how k8s.io/client-go/rest.createSerializers creates a decoder func getDecoder() runtime.Decoder { jsonSerializer := runtimejson.NewSerializer(runtimejson.DefaultMetaFactory, scheme.Scheme, scheme.Scheme, false) directCodecFactory := scheme.Codecs.WithoutConversion() return directCodecFactory.DecoderToVersion(jsonSerializer, v1.SchemeGroupVersion) } func TestDecoder(t *testing.T) { table := []watch.EventType{watch.Added, watch.Deleted, watch.Modified, watch.Error, watch.Bookmark} for _, eventType := range table { out, in := io.Pipe() decoder := restclientwatch.NewDecoder(streaming.NewDecoder(out, getDecoder()), getDecoder()) expect := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}} encoder := json.NewEncoder(in) eType := eventType errc := make(chan error) go func() { data, err := runtime.Encode(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), expect) if err != nil { errc <- fmt.Errorf("Unexpected error %v", err) return } event := metav1.WatchEvent{ Type: string(eType), Object: runtime.RawExtension{Raw: json.RawMessage(data)}, } if err := encoder.Encode(&event); err != nil { t.Errorf("Unexpected error %v", err) } in.Close() }() done := make(chan struct{}) go func() { action, got, err := decoder.Decode() if err != nil { errc <- fmt.Errorf("Unexpected error %v", err) return } if e, a := eType, action; e != a { t.Errorf("Expected %v, got %v", e, a) } if e, a := expect, got; !apiequality.Semantic.DeepDerivative(e, a) { t.Errorf("Expected %v, got %v", e, a) } t.Logf("Exited read") close(done) }() select { case err := <-errc: t.Fatal(err) case <-done: } done = make(chan struct{}) go func() { _, _, err := decoder.Decode() if err == nil { t.Errorf("Unexpected nil error") } close(done) }() <-done decoder.Close() } } func TestDecoder_SourceClose(t *testing.T) { out, in := io.Pipe() decoder := restclientwatch.NewDecoder(streaming.NewDecoder(out, getDecoder()), getDecoder()) done := make(chan struct{}) go func() { _, _, err := decoder.Decode() if err == nil { t.Errorf("Unexpected nil error") } close(done) }() in.Close() select { case <-done: break case <-time.After(wait.ForeverTestTimeout): t.Error("Timeout") } } kubernetes-client-go-a2dfcab/rest/watch/encoder.go000066400000000000000000000032531472614177300224340ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package versioned import ( "encoding/json" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/watch" ) // Encoder serializes watch.Events into io.Writer. The internal objects // are encoded using embedded encoder, and the outer Event is serialized // using encoder. // TODO: this type is only used by tests type Encoder struct { encoder streaming.Encoder embeddedEncoder runtime.Encoder } func NewEncoder(encoder streaming.Encoder, embeddedEncoder runtime.Encoder) *Encoder { return &Encoder{ encoder: encoder, embeddedEncoder: embeddedEncoder, } } // Encode writes an event to the writer. Returns an error // if the writer is closed or an object can't be encoded. func (e *Encoder) Encode(event *watch.Event) error { data, err := runtime.Encode(e.embeddedEncoder, event.Object) if err != nil { return err } // FIXME: get rid of json.RawMessage. return e.encoder.Encode(&metav1.WatchEvent{ Type: string(event.Type), Object: runtime.RawExtension{Raw: json.RawMessage(data)}, }) } kubernetes-client-go-a2dfcab/rest/watch/encoder_test.go000066400000000000000000000051361472614177300234750ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package versioned_test import ( "bytes" "io" "testing" "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" runtimejson "k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes/scheme" restclientwatch "k8s.io/client-go/rest/watch" ) // getEncoder mimics how k8s.io/client-go/rest.createSerializers creates a encoder func getEncoder() runtime.Encoder { jsonSerializer := runtimejson.NewSerializer(runtimejson.DefaultMetaFactory, scheme.Scheme, scheme.Scheme, false) directCodecFactory := scheme.Codecs.WithoutConversion() return directCodecFactory.EncoderForVersion(jsonSerializer, v1.SchemeGroupVersion) } func TestEncodeDecodeRoundTrip(t *testing.T) { testCases := []struct { Type watch.EventType Object runtime.Object }{ { watch.Added, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}, }, { watch.Modified, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}, }, { watch.Deleted, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}, }, { watch.Bookmark, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}, }, } for i, testCase := range testCases { buf := &bytes.Buffer{} encoder := restclientwatch.NewEncoder(streaming.NewEncoder(buf, getEncoder()), getEncoder()) if err := encoder.Encode(&watch.Event{Type: testCase.Type, Object: testCase.Object}); err != nil { t.Errorf("%d: unexpected error: %v", i, err) continue } rc := io.NopCloser(buf) decoder := restclientwatch.NewDecoder(streaming.NewDecoder(rc, getDecoder()), getDecoder()) event, obj, err := decoder.Decode() if err != nil { t.Errorf("%d: unexpected error: %v", i, err) continue } if !apiequality.Semantic.DeepDerivative(testCase.Object, obj) { t.Errorf("%d: expected %#v, got %#v", i, testCase.Object, obj) } if event != testCase.Type { t.Errorf("%d: unexpected type: %#v", i, event) } } } kubernetes-client-go-a2dfcab/rest/with_retry.go000066400000000000000000000313121472614177300221040ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "fmt" "io" "net/http" "net/url" "time" "k8s.io/klog/v2" ) // IsRetryableErrorFunc allows the client to provide its own function // that determines whether the specified err from the server is retryable. // // request: the original request sent to the server // err: the server sent this error to us // // The function returns true if the error is retryable and the request // can be retried, otherwise it returns false. // We have four mode of communications - 'Stream', 'Watch', 'Do' and 'DoRaw', this // function allows us to customize the retryability aspect of each. type IsRetryableErrorFunc func(request *http.Request, err error) bool func (r IsRetryableErrorFunc) IsErrorRetryable(request *http.Request, err error) bool { return r(request, err) } var neverRetryError = IsRetryableErrorFunc(func(_ *http.Request, _ error) bool { return false }) // WithRetry allows the client to retry a request up to a certain number of times // Note that WithRetry is not safe for concurrent use by multiple // goroutines without additional locking or coordination. type WithRetry interface { // IsNextRetry advances the retry counter appropriately // and returns true if the request should be retried, // otherwise it returns false, if: // - we have already reached the maximum retry threshold. // - the error does not fall into the retryable category. // - the server has not sent us a 429, or 5xx status code and the // 'Retry-After' response header is not set with a value. // - we need to seek to the beginning of the request body before we // initiate the next retry, the function should log an error and // return false if it fails to do so. // // restReq: the associated rest.Request // httpReq: the HTTP Request sent to the server // resp: the response sent from the server, it is set if err is nil // err: the server sent this error to us, if err is set then resp is nil. // f: a IsRetryableErrorFunc function provided by the client that determines // if the err sent by the server is retryable. IsNextRetry(ctx context.Context, restReq *Request, httpReq *http.Request, resp *http.Response, err error, f IsRetryableErrorFunc) bool // Before should be invoked prior to each attempt, including // the first one. If an error is returned, the request should // be aborted immediately. // // Before may also be additionally responsible for preparing // the request for the next retry, namely in terms of resetting // the request body in case it has been read. Before(ctx context.Context, r *Request) error // After should be invoked immediately after an attempt is made. After(ctx context.Context, r *Request, resp *http.Response, err error) // WrapPreviousError wraps the error from any previous attempt into // the final error specified in 'finalErr', so the user has more // context why the request failed. // For example, if a request times out after multiple retries then // we see a generic context.Canceled or context.DeadlineExceeded // error which is not very useful in debugging. This function can // wrap any error from previous attempt(s) to provide more context to // the user. The error returned in 'err' must satisfy the // following conditions: // a: errors.Unwrap(err) = errors.Unwrap(finalErr) if finalErr // implements Unwrap // b: errors.Unwrap(err) = finalErr if finalErr does not // implements Unwrap // c: errors.Is(err, otherErr) = errors.Is(finalErr, otherErr) WrapPreviousError(finalErr error) (err error) } // RetryAfter holds information associated with the next retry. type RetryAfter struct { // Wait is the duration the server has asked us to wait before // the next retry is initiated. // This is the value of the 'Retry-After' response header in seconds. Wait time.Duration // Attempt is the Nth attempt after which we have received a retryable // error or a 'Retry-After' response header from the server. Attempt int // Reason describes why we are retrying the request Reason string } type withRetry struct { maxRetries int attempts int // retry after parameters that pertain to the attempt that is to // be made soon, so as to enable 'Before' and 'After' to refer // to the retry parameters. // - for the first attempt, it will always be nil // - for consecutive attempts, it is non nil and holds the // retry after parameters for the next attempt to be made. retryAfter *RetryAfter // we keep track of two most recent errors, if the most // recent attempt is labeled as 'N' then: // - currentErr represents the error returned by attempt N, it // can be nil if attempt N did not return an error. // - previousErr represents an error from an attempt 'M' which // precedes attempt 'N' (N - M >= 1), it is non nil only when: // - for a sequence of attempt(s) 1..n (n>1), there // is an attempt k (k r.maxRetries { return false } // if the server returned an error, it takes precedence over the http response. var errIsRetryable bool if f != nil && err != nil && f.IsErrorRetryable(httpReq, err) { errIsRetryable = true // we have a retryable error, for which we will create an // artificial "Retry-After" response. resp = retryAfterResponse() } if err != nil && !errIsRetryable { return false } // if we are here, we have either a or b: // a: we have a retryable error, for which we already // have an artificial "Retry-After" response. // b: we have a response from the server for which we // need to check if it is retryable seconds, wait := checkWait(resp) if !wait { return false } r.retryAfter.Wait = time.Duration(seconds) * time.Second r.retryAfter.Reason = getRetryReason(r.attempts, seconds, resp, err) return true } func (r *withRetry) Before(ctx context.Context, request *Request) error { // If the request context is already canceled there // is no need to retry. if ctx.Err() != nil { r.trackPreviousError(ctx.Err()) return ctx.Err() } url := request.URL() // r.retryAfter represents the retry after parameters calculated // from the (response, err) tuple from the last attempt, so 'Before' // can apply these retry after parameters prior to the next attempt. // 'r.retryAfter == nil' indicates that this is the very first attempt. if r.retryAfter == nil { // we do a backoff sleep before the first attempt is made, // (preserving current behavior). if request.backoff != nil { request.backoff.Sleep(request.backoff.CalculateBackoff(url)) } return nil } // if we are here, we have made attempt(s) at least once before. if request.backoff != nil { delay := request.backoff.CalculateBackoff(url) if r.retryAfter.Wait > delay { delay = r.retryAfter.Wait } request.backoff.Sleep(delay) } // We are retrying the request that we already send to // apiserver at least once before. This request should // also be throttled with the client-internal rate limiter. if err := request.tryThrottleWithInfo(ctx, r.retryAfter.Reason); err != nil { r.trackPreviousError(ctx.Err()) return err } klog.V(4).Infof("Got a Retry-After %s response for attempt %d to %v", r.retryAfter.Wait, r.retryAfter.Attempt, request.URL().String()) return nil } func (r *withRetry) After(ctx context.Context, request *Request, resp *http.Response, err error) { // 'After' is invoked immediately after an attempt is made, let's label // the attempt we have just made as attempt 'N'. // the current value of r.retryAfter represents the retry after // parameters calculated from the (response, err) tuple from // attempt N-1, so r.retryAfter is outdated and should not be // referred to here. isRetry := r.retryAfter != nil r.retryAfter = nil // the client finishes a single request after N attempts (1..N) // - all attempts (1..N) are counted to the rest_client_requests_total // metric (current behavior). // - every attempt after the first (2..N) are counted to the // rest_client_request_retries_total metric. updateRequestResultMetric(ctx, request, resp, err) if isRetry { // this is attempt 2 or later updateRequestRetryMetric(ctx, request, resp, err) } if request.c.base != nil { if err != nil { request.backoff.UpdateBackoff(request.URL(), err, 0) } else { request.backoff.UpdateBackoff(request.URL(), err, resp.StatusCode) } } } func (r *withRetry) WrapPreviousError(currentErr error) error { if currentErr == nil || r.previousErr == nil { return currentErr } // if both previous and current error objects represent the error, // then there is no need to wrap the previous error. if currentErr.Error() == r.previousErr.Error() { return currentErr } previousErr := r.previousErr // net/http wraps the underlying error with an url.Error, if the // previous err object is an instance of url.Error, then we can // unwrap it to get to the inner error object, this is so we can // avoid error message like: // Error: Get "http://foo.bar/api/v1": context deadline exceeded - error \ // from a previous attempt: Error: Get "http://foo.bar/api/v1": EOF if urlErr, ok := r.previousErr.(*url.Error); ok && urlErr != nil { if urlErr.Unwrap() != nil { previousErr = urlErr.Unwrap() } } return &wrapPreviousError{ currentErr: currentErr, previousError: previousErr, } } type wrapPreviousError struct { currentErr, previousError error } func (w *wrapPreviousError) Unwrap() error { return w.currentErr } func (w *wrapPreviousError) Error() string { return fmt.Sprintf("%s - error from a previous attempt: %s", w.currentErr.Error(), w.previousError.Error()) } // checkWait returns true along with a number of seconds if // the server instructed us to wait before retrying. func checkWait(resp *http.Response) (int, bool) { switch r := resp.StatusCode; { // any 500 error code and 429 can trigger a wait case r == http.StatusTooManyRequests, r >= 500: default: return 0, false } i, ok := retryAfterSeconds(resp) return i, ok } func getRetryReason(retries, seconds int, resp *http.Response, err error) string { // priority and fairness sets the UID of the FlowSchema // associated with a request in the following response Header. const responseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchema-UID" message := fmt.Sprintf("retries: %d, retry-after: %ds", retries, seconds) switch { case resp.StatusCode == http.StatusTooManyRequests: // it is server-side throttling from priority and fairness flowSchemaUID := resp.Header.Get(responseHeaderMatchedFlowSchemaUID) return fmt.Sprintf("%s - retry-reason: due to server-side throttling, FlowSchema UID: %q", message, flowSchemaUID) case err != nil: // it's a retryable error return fmt.Sprintf("%s - retry-reason: due to retryable error, error: %v", message, err) default: return fmt.Sprintf("%s - retry-reason: %d", message, resp.StatusCode) } } func readAndCloseResponseBody(resp *http.Response) { if resp == nil { return } // Ensure the response body is fully read and closed // before we reconnect, so that we reuse the same TCP // connection. const maxBodySlurpSize = 2 << 10 defer resp.Body.Close() if resp.ContentLength <= maxBodySlurpSize { io.Copy(io.Discard, &io.LimitedReader{R: resp.Body, N: maxBodySlurpSize}) } } func retryAfterResponse() *http.Response { return retryAfterResponseWithDelay("1") } func retryAfterResponseWithDelay(delay string) *http.Response { return retryAfterResponseWithCodeAndDelay(http.StatusInternalServerError, delay) } func retryAfterResponseWithCodeAndDelay(code int, delay string) *http.Response { return &http.Response{ StatusCode: code, Header: http.Header{"Retry-After": []string{delay}}, } } kubernetes-client-go-a2dfcab/rest/with_retry_test.go000066400000000000000000000253201472614177300231450ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package rest import ( "context" "errors" "fmt" "io" "net/http" "net/url" "reflect" "strings" "testing" "time" "github.com/google/go-cmp/cmp" ) var alwaysRetryError = IsRetryableErrorFunc(func(_ *http.Request, _ error) bool { return true }) func TestIsNextRetry(t *testing.T) { fakeError := errors.New("fake error") tests := []struct { name string attempts int maxRetries int request *http.Request response *http.Response err error retryableErrFunc IsRetryableErrorFunc retryExpected []bool retryAfterExpected []*RetryAfter }{ { name: "bad input, response and err are nil", maxRetries: 2, attempts: 1, request: &http.Request{}, response: nil, err: nil, retryExpected: []bool{false}, retryAfterExpected: []*RetryAfter{nil}, }, { name: "zero maximum retry", maxRetries: 0, attempts: 1, request: &http.Request{}, response: retryAfterResponse(), err: nil, retryExpected: []bool{false}, retryAfterExpected: []*RetryAfter{ { Attempt: 1, }, }, }, { name: "server returned a retryable error", maxRetries: 3, attempts: 1, request: &http.Request{}, response: nil, err: fakeError, retryableErrFunc: func(_ *http.Request, err error) bool { if err == fakeError { return true } return false }, retryExpected: []bool{true}, retryAfterExpected: []*RetryAfter{ { Attempt: 1, Wait: time.Second, Reason: "retries: 1, retry-after: 1s - retry-reason: due to retryable error, error: fake error", }, }, }, { name: "server returned a retryable HTTP 429 response", maxRetries: 3, attempts: 1, request: &http.Request{}, response: &http.Response{ StatusCode: http.StatusTooManyRequests, Header: http.Header{ "Retry-After": []string{"2"}, "X-Kubernetes-Pf-Flowschema-Uid": []string{"fs-1"}, }, }, err: nil, retryExpected: []bool{true}, retryAfterExpected: []*RetryAfter{ { Attempt: 1, Wait: 2 * time.Second, Reason: `retries: 1, retry-after: 2s - retry-reason: due to server-side throttling, FlowSchema UID: "fs-1"`, }, }, }, { name: "server returned a retryable HTTP 5xx response", maxRetries: 3, attempts: 1, request: &http.Request{}, response: &http.Response{ StatusCode: http.StatusServiceUnavailable, Header: http.Header{ "Retry-After": []string{"3"}, }, }, err: nil, retryExpected: []bool{true}, retryAfterExpected: []*RetryAfter{ { Attempt: 1, Wait: 3 * time.Second, Reason: "retries: 1, retry-after: 3s - retry-reason: 503", }, }, }, { name: "server returned a non response without without a Retry-After header", maxRetries: 1, attempts: 1, request: &http.Request{}, response: &http.Response{ StatusCode: http.StatusTooManyRequests, Header: http.Header{}, }, err: nil, retryExpected: []bool{false}, retryAfterExpected: []*RetryAfter{ { Attempt: 1, }, }, }, { name: "both response and err are set, err takes precedence", maxRetries: 1, attempts: 1, request: &http.Request{}, response: retryAfterResponse(), err: fakeError, retryableErrFunc: func(_ *http.Request, err error) bool { if err == fakeError { return true } return false }, retryExpected: []bool{true}, retryAfterExpected: []*RetryAfter{ { Attempt: 1, Wait: time.Second, Reason: "retries: 1, retry-after: 1s - retry-reason: due to retryable error, error: fake error", }, }, }, { name: "all retries are exhausted", maxRetries: 3, attempts: 4, request: &http.Request{}, response: nil, err: fakeError, retryableErrFunc: alwaysRetryError, retryExpected: []bool{true, true, true, false}, retryAfterExpected: []*RetryAfter{ { Attempt: 1, Wait: time.Second, Reason: "retries: 1, retry-after: 1s - retry-reason: due to retryable error, error: fake error", }, { Attempt: 2, Wait: time.Second, Reason: "retries: 2, retry-after: 1s - retry-reason: due to retryable error, error: fake error", }, { Attempt: 3, Wait: time.Second, Reason: "retries: 3, retry-after: 1s - retry-reason: due to retryable error, error: fake error", }, { Attempt: 4, }, }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { restReq := &Request{ bodyBytes: []byte{}, c: &RESTClient{ base: &url.URL{}, }, } r := &withRetry{maxRetries: test.maxRetries} retryGot := make([]bool, 0) retryAfterGot := make([]*RetryAfter, 0) for i := 0; i < test.attempts; i++ { retry := r.IsNextRetry(context.TODO(), restReq, test.request, test.response, test.err, test.retryableErrFunc) retryGot = append(retryGot, retry) retryAfterGot = append(retryAfterGot, r.retryAfter) } if !reflect.DeepEqual(test.retryExpected, retryGot) { t.Errorf("Expected retry: %t, but got: %t", test.retryExpected, retryGot) } if !reflect.DeepEqual(test.retryAfterExpected, retryAfterGot) { t.Errorf("Expected retry-after parameters to match, but got: %s", cmp.Diff(test.retryAfterExpected, retryAfterGot)) } }) } } func TestWrapPreviousError(t *testing.T) { const ( attempt = 2 previousAttempt = 1 containsFormatExpected = "- error from a previous attempt: %s" ) var ( wrappedCtxDeadlineExceededErr = &url.Error{ Op: "GET", URL: "http://foo.bar", Err: context.DeadlineExceeded, } wrappedCtxCanceledErr = &url.Error{ Op: "GET", URL: "http://foo.bar", Err: context.Canceled, } urlEOFErr = &url.Error{ Op: "GET", URL: "http://foo.bar", Err: io.EOF, } ) tests := []struct { name string previousErr error currentErr error expectedErr error wrapped bool contains string }{ { name: "current error is nil, previous error is nil", }, { name: "current error is nil", previousErr: errors.New("error from a previous attempt"), }, { name: "previous error is nil", currentErr: urlEOFErr, expectedErr: urlEOFErr, wrapped: false, }, { name: "both current and previous errors represent the same error", currentErr: urlEOFErr, previousErr: &url.Error{Op: "GET", URL: "http://foo.bar", Err: io.EOF}, expectedErr: urlEOFErr, }, { name: "current and previous errors are not same", currentErr: urlEOFErr, previousErr: errors.New("unknown error"), expectedErr: urlEOFErr, wrapped: true, contains: fmt.Sprintf(containsFormatExpected, "unknown error"), }, { name: "current error is context.Canceled", currentErr: context.Canceled, previousErr: io.EOF, expectedErr: context.Canceled, wrapped: true, contains: fmt.Sprintf(containsFormatExpected, io.EOF.Error()), }, { name: "current error is context.DeadlineExceeded", currentErr: context.DeadlineExceeded, previousErr: io.EOF, expectedErr: context.DeadlineExceeded, wrapped: true, contains: fmt.Sprintf(containsFormatExpected, io.EOF.Error()), }, { name: "current error is a wrapped context.DeadlineExceeded", currentErr: wrappedCtxDeadlineExceededErr, previousErr: io.EOF, expectedErr: wrappedCtxDeadlineExceededErr, wrapped: true, contains: fmt.Sprintf(containsFormatExpected, io.EOF.Error()), }, { name: "current error is a wrapped context.Canceled", currentErr: wrappedCtxCanceledErr, previousErr: io.EOF, expectedErr: wrappedCtxCanceledErr, wrapped: true, contains: fmt.Sprintf(containsFormatExpected, io.EOF.Error()), }, { name: "previous error should be unwrapped if it is url.Error", currentErr: urlEOFErr, previousErr: &url.Error{Err: io.ErrUnexpectedEOF}, expectedErr: urlEOFErr, wrapped: true, contains: fmt.Sprintf(containsFormatExpected, io.ErrUnexpectedEOF.Error()), }, { name: "previous error should not be unwrapped if it is not url.Error", currentErr: urlEOFErr, previousErr: fmt.Errorf("should be included in error message - %w", io.EOF), expectedErr: urlEOFErr, wrapped: true, contains: fmt.Sprintf(containsFormatExpected, "should be included in error message - EOF"), }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { retry := &withRetry{ previousErr: test.previousErr, } err := retry.WrapPreviousError(test.currentErr) switch { case test.expectedErr == nil: if err != nil { t.Errorf("Expected a nil error, but got: %v", err) return } case test.expectedErr != nil: // make sure the message from the returned error contains // message from the "previous" error from retries. if !strings.Contains(err.Error(), test.contains) { t.Errorf("Expected error message to contain %q, but got: %v", test.contains, err) } currentErrGot := err if test.wrapped { currentErrGot = errors.Unwrap(err) } if test.expectedErr != currentErrGot { t.Errorf("Expected current error %v, but got: %v", test.expectedErr, currentErrGot) } } }) } t.Run("Before should track previous error", func(t *testing.T) { retry := &withRetry{ currentErr: io.EOF, } ctx, cancel := context.WithCancel(context.Background()) cancel() // we pass zero Request object since we expect 'Before' // to check the context for error at the very beginning. err := retry.Before(ctx, &Request{}) if err != context.Canceled { t.Errorf("Expected error: %v, but got: %v", context.Canceled, err) } if retry.currentErr != context.Canceled { t.Errorf("Expected current error: %v, but got: %v", context.Canceled, retry.currentErr) } if retry.previousErr != io.EOF { t.Errorf("Expected previous error: %v, but got: %v", io.EOF, retry.previousErr) } }) } kubernetes-client-go-a2dfcab/rest/zz_generated.deepcopy.go000066400000000000000000000031371472614177300242000ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by deepcopy-gen. DO NOT EDIT. package rest // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSClientConfig) DeepCopyInto(out *TLSClientConfig) { *out = *in if in.CertData != nil { in, out := &in.CertData, &out.CertData *out = make([]byte, len(*in)) copy(*out, *in) } if in.KeyData != nil { in, out := &in.KeyData, &out.KeyData *out = make([]byte, len(*in)) copy(*out, *in) } if in.CAData != nil { in, out := &in.CAData, &out.CAData *out = make([]byte, len(*in)) copy(*out, *in) } if in.NextProtos != nil { in, out := &in.NextProtos, &out.NextProtos *out = make([]string, len(*in)) copy(*out, *in) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSClientConfig. func (in *TLSClientConfig) DeepCopy() *TLSClientConfig { if in == nil { return nil } out := new(TLSClientConfig) in.DeepCopyInto(out) return out } kubernetes-client-go-a2dfcab/restmapper/000077500000000000000000000000001472614177300205625ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/restmapper/category_expansion.go000066400000000000000000000075711472614177300250240ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package restmapper import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" ) // CategoryExpander maps category strings to GroupResources. // Categories are classification or 'tag' of a group of resources. type CategoryExpander interface { Expand(category string) ([]schema.GroupResource, bool) } // SimpleCategoryExpander implements CategoryExpander interface // using a static mapping of categories to GroupResource mapping. type SimpleCategoryExpander struct { Expansions map[string][]schema.GroupResource } // Expand fulfills CategoryExpander func (e SimpleCategoryExpander) Expand(category string) ([]schema.GroupResource, bool) { ret, ok := e.Expansions[category] return ret, ok } // discoveryCategoryExpander struct lets a REST Client wrapper (discoveryClient) to retrieve list of APIResourceList, // and then convert to fallbackExpander type discoveryCategoryExpander struct { discoveryClient discovery.DiscoveryInterface } // NewDiscoveryCategoryExpander returns a category expander that makes use of the "categories" fields from // the API, found through the discovery client. In case of any error or no category found (which likely // means we're at a cluster prior to categories support, fallback to the expander provided. func NewDiscoveryCategoryExpander(client discovery.DiscoveryInterface) CategoryExpander { if client == nil { panic("Please provide discovery client to shortcut expander") } return discoveryCategoryExpander{discoveryClient: client} } // Expand fulfills CategoryExpander func (e discoveryCategoryExpander) Expand(category string) ([]schema.GroupResource, bool) { // Get all supported resources for groups and versions from server, if no resource found, fallback anyway. _, apiResourceLists, _ := e.discoveryClient.ServerGroupsAndResources() if len(apiResourceLists) == 0 { return nil, false } discoveredExpansions := map[string][]schema.GroupResource{} for _, apiResourceList := range apiResourceLists { gv, err := schema.ParseGroupVersion(apiResourceList.GroupVersion) if err != nil { continue } // Collect GroupVersions by categories for _, apiResource := range apiResourceList.APIResources { if categories := apiResource.Categories; len(categories) > 0 { for _, category := range categories { groupResource := schema.GroupResource{ Group: gv.Group, Resource: apiResource.Name, } discoveredExpansions[category] = append(discoveredExpansions[category], groupResource) } } } } ret, ok := discoveredExpansions[category] return ret, ok } // UnionCategoryExpander implements CategoryExpander interface. // It maps given category string to union of expansions returned by all the CategoryExpanders in the list. type UnionCategoryExpander []CategoryExpander // Expand fulfills CategoryExpander func (u UnionCategoryExpander) Expand(category string) ([]schema.GroupResource, bool) { ret := []schema.GroupResource{} ok := false // Expand the category for each CategoryExpander in the list and merge/combine the results. for _, expansion := range u { curr, currOk := expansion.Expand(category) for _, currGR := range curr { found := false for _, existing := range ret { if existing == currGR { found = true break } } if !found { ret = append(ret, currGR) } } ok = ok || currOk } return ret, ok } kubernetes-client-go-a2dfcab/restmapper/category_expansion_test.go000066400000000000000000000064031472614177300260540ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package restmapper import ( "reflect" "testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) func TestCategoryExpansion(t *testing.T) { tests := []struct { name string arg string expected []schema.GroupResource expectedOk bool }{ { name: "no-replacement", arg: "service", expected: nil, }, { name: "all-replacement", arg: "all", expected: []schema.GroupResource{ {Resource: "one"}, {Resource: "two"}, {Resource: "three", Group: "alpha"}, {Resource: "four", Group: "bravo"}, }, expectedOk: true, }, } for _, test := range tests { simpleCategoryExpander := SimpleCategoryExpander{ Expansions: map[string][]schema.GroupResource{ "all": { {Group: "", Resource: "one"}, {Group: "", Resource: "two"}, {Group: "alpha", Resource: "three"}, {Group: "bravo", Resource: "four"}, }, }, } actual, actualOk := simpleCategoryExpander.Expand(test.arg) if e, a := test.expected, actual; !reflect.DeepEqual(e, a) { t.Errorf("%s: expected %s, got %s", test.name, e, a) } if e, a := test.expectedOk, actualOk; e != a { t.Errorf("%s: expected %v, got %v", test.name, e, a) } } } func TestDiscoveryCategoryExpander(t *testing.T) { tests := []struct { category string serverResponse []*metav1.APIResourceList expected []schema.GroupResource }{ { category: "all", serverResponse: []*metav1.APIResourceList{ { GroupVersion: "batch/v1", APIResources: []metav1.APIResource{ { Name: "jobs", ShortNames: []string{"jz"}, Categories: []string{"all"}, }, }, }, }, expected: []schema.GroupResource{ { Group: "batch", Resource: "jobs", }, }, }, { category: "all", serverResponse: []*metav1.APIResourceList{ { GroupVersion: "batch/v1", APIResources: []metav1.APIResource{ { Name: "jobs", ShortNames: []string{"jz"}, }, }, }, }, }, { category: "targaryens", serverResponse: []*metav1.APIResourceList{ { GroupVersion: "batch/v1", APIResources: []metav1.APIResource{ { Name: "jobs", ShortNames: []string{"jz"}, Categories: []string{"all"}, }, }, }, }, }, } dc := &fakeDiscoveryClient{} for _, test := range tests { dc.serverResourcesHandler = func() ([]*metav1.APIResourceList, error) { return test.serverResponse, nil } expander := NewDiscoveryCategoryExpander(dc) expanded, _ := expander.Expand(test.category) if !reflect.DeepEqual(expanded, test.expected) { t.Errorf("expected %v, got %v", test.expected, expanded) } } } kubernetes-client-go-a2dfcab/restmapper/discovery.go000066400000000000000000000246421472614177300231300ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package restmapper import ( "fmt" "strings" "sync" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" "k8s.io/klog/v2" ) // APIGroupResources is an API group with a mapping of versions to // resources. type APIGroupResources struct { Group metav1.APIGroup // A mapping of version string to a slice of APIResources for // that version. VersionedResources map[string][]metav1.APIResource } // NewDiscoveryRESTMapper returns a PriorityRESTMapper based on the discovered // groups and resources passed in. func NewDiscoveryRESTMapper(groupResources []*APIGroupResources) meta.RESTMapper { unionMapper := meta.MultiRESTMapper{} var groupPriority []string // /v1 is special. It should always come first resourcePriority := []schema.GroupVersionResource{{Group: "", Version: "v1", Resource: meta.AnyResource}} kindPriority := []schema.GroupVersionKind{{Group: "", Version: "v1", Kind: meta.AnyKind}} for _, group := range groupResources { groupPriority = append(groupPriority, group.Group.Name) // Make sure the preferred version comes first if len(group.Group.PreferredVersion.Version) != 0 { preferred := group.Group.PreferredVersion.Version if _, ok := group.VersionedResources[preferred]; ok { resourcePriority = append(resourcePriority, schema.GroupVersionResource{ Group: group.Group.Name, Version: group.Group.PreferredVersion.Version, Resource: meta.AnyResource, }) kindPriority = append(kindPriority, schema.GroupVersionKind{ Group: group.Group.Name, Version: group.Group.PreferredVersion.Version, Kind: meta.AnyKind, }) } } for _, discoveryVersion := range group.Group.Versions { resources, ok := group.VersionedResources[discoveryVersion.Version] if !ok { continue } // Add non-preferred versions after the preferred version, in case there are resources that only exist in those versions if discoveryVersion.Version != group.Group.PreferredVersion.Version { resourcePriority = append(resourcePriority, schema.GroupVersionResource{ Group: group.Group.Name, Version: discoveryVersion.Version, Resource: meta.AnyResource, }) kindPriority = append(kindPriority, schema.GroupVersionKind{ Group: group.Group.Name, Version: discoveryVersion.Version, Kind: meta.AnyKind, }) } gv := schema.GroupVersion{Group: group.Group.Name, Version: discoveryVersion.Version} versionMapper := meta.NewDefaultRESTMapper([]schema.GroupVersion{gv}) for _, resource := range resources { scope := meta.RESTScopeNamespace if !resource.Namespaced { scope = meta.RESTScopeRoot } // if we have a slash, then this is a subresource and we shouldn't create mappings for those. if strings.Contains(resource.Name, "/") { continue } plural := gv.WithResource(resource.Name) singular := gv.WithResource(resource.SingularName) // this is for legacy resources and servers which don't list singular forms. For those we must still guess. if len(resource.SingularName) == 0 { _, singular = meta.UnsafeGuessKindToResource(gv.WithKind(resource.Kind)) } versionMapper.AddSpecific(gv.WithKind(strings.ToLower(resource.Kind)), plural, singular, scope) versionMapper.AddSpecific(gv.WithKind(resource.Kind), plural, singular, scope) // TODO this is producing unsafe guesses that don't actually work, but it matches previous behavior versionMapper.Add(gv.WithKind(resource.Kind+"List"), scope) } // TODO why is this type not in discovery (at least for "v1") versionMapper.Add(gv.WithKind("List"), meta.RESTScopeRoot) unionMapper = append(unionMapper, versionMapper) } } for _, group := range groupPriority { resourcePriority = append(resourcePriority, schema.GroupVersionResource{ Group: group, Version: meta.AnyVersion, Resource: meta.AnyResource, }) kindPriority = append(kindPriority, schema.GroupVersionKind{ Group: group, Version: meta.AnyVersion, Kind: meta.AnyKind, }) } return meta.PriorityRESTMapper{ Delegate: unionMapper, ResourcePriority: resourcePriority, KindPriority: kindPriority, } } // GetAPIGroupResources uses the provided discovery client to gather // discovery information and populate a slice of APIGroupResources. func GetAPIGroupResources(cl discovery.DiscoveryInterface) ([]*APIGroupResources, error) { gs, rs, err := cl.ServerGroupsAndResources() if rs == nil || gs == nil { return nil, err // TODO track the errors and update callers to handle partial errors. } rsm := map[string]*metav1.APIResourceList{} for _, r := range rs { rsm[r.GroupVersion] = r } var result []*APIGroupResources for _, group := range gs { groupResources := &APIGroupResources{ Group: *group, VersionedResources: make(map[string][]metav1.APIResource), } for _, version := range group.Versions { resources, ok := rsm[version.GroupVersion] if !ok { continue } groupResources.VersionedResources[version.Version] = resources.APIResources } result = append(result, groupResources) } return result, nil } // DeferredDiscoveryRESTMapper is a RESTMapper that will defer // initialization of the RESTMapper until the first mapping is // requested. type DeferredDiscoveryRESTMapper struct { initMu sync.Mutex delegate meta.RESTMapper cl discovery.CachedDiscoveryInterface } // NewDeferredDiscoveryRESTMapper returns a // DeferredDiscoveryRESTMapper that will lazily query the provided // client for discovery information to do REST mappings. func NewDeferredDiscoveryRESTMapper(cl discovery.CachedDiscoveryInterface) *DeferredDiscoveryRESTMapper { return &DeferredDiscoveryRESTMapper{ cl: cl, } } func (d *DeferredDiscoveryRESTMapper) getDelegate() (meta.RESTMapper, error) { d.initMu.Lock() defer d.initMu.Unlock() if d.delegate != nil { return d.delegate, nil } groupResources, err := GetAPIGroupResources(d.cl) if err != nil { return nil, err } d.delegate = NewDiscoveryRESTMapper(groupResources) return d.delegate, nil } // Reset resets the internally cached Discovery information and will // cause the next mapping request to re-discover. func (d *DeferredDiscoveryRESTMapper) Reset() { klog.V(5).Info("Invalidating discovery information") d.initMu.Lock() defer d.initMu.Unlock() d.cl.Invalidate() d.delegate = nil } // KindFor takes a partial resource and returns back the single match. // It returns an error if there are multiple matches. func (d *DeferredDiscoveryRESTMapper) KindFor(resource schema.GroupVersionResource) (gvk schema.GroupVersionKind, err error) { del, err := d.getDelegate() if err != nil { return schema.GroupVersionKind{}, err } gvk, err = del.KindFor(resource) if err != nil && !d.cl.Fresh() { d.Reset() gvk, err = d.KindFor(resource) } return } // KindsFor takes a partial resource and returns back the list of // potential kinds in priority order. func (d *DeferredDiscoveryRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvks []schema.GroupVersionKind, err error) { del, err := d.getDelegate() if err != nil { return nil, err } gvks, err = del.KindsFor(resource) if len(gvks) == 0 && !d.cl.Fresh() { d.Reset() gvks, err = d.KindsFor(resource) } return } // ResourceFor takes a partial resource and returns back the single // match. It returns an error if there are multiple matches. func (d *DeferredDiscoveryRESTMapper) ResourceFor(input schema.GroupVersionResource) (gvr schema.GroupVersionResource, err error) { del, err := d.getDelegate() if err != nil { return schema.GroupVersionResource{}, err } gvr, err = del.ResourceFor(input) if err != nil && !d.cl.Fresh() { d.Reset() gvr, err = d.ResourceFor(input) } return } // ResourcesFor takes a partial resource and returns back the list of // potential resource in priority order. func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input schema.GroupVersionResource) (gvrs []schema.GroupVersionResource, err error) { del, err := d.getDelegate() if err != nil { return nil, err } gvrs, err = del.ResourcesFor(input) if len(gvrs) == 0 && !d.cl.Fresh() { d.Reset() gvrs, err = d.ResourcesFor(input) } return } // RESTMapping identifies a preferred resource mapping for the // provided group kind. func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (m *meta.RESTMapping, err error) { del, err := d.getDelegate() if err != nil { return nil, err } m, err = del.RESTMapping(gk, versions...) if err != nil && !d.cl.Fresh() { d.Reset() m, err = d.RESTMapping(gk, versions...) } return } // RESTMappings returns the RESTMappings for the provided group kind // in a rough internal preferred order. If no kind is found, it will // return a NoResourceMatchError. func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) (ms []*meta.RESTMapping, err error) { del, err := d.getDelegate() if err != nil { return nil, err } ms, err = del.RESTMappings(gk, versions...) if len(ms) == 0 && !d.cl.Fresh() { d.Reset() ms, err = d.RESTMappings(gk, versions...) } return } // ResourceSingularizer converts a resource name from plural to // singular (e.g., from pods to pod). func (d *DeferredDiscoveryRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { del, err := d.getDelegate() if err != nil { return resource, err } singular, err = del.ResourceSingularizer(resource) if err != nil && !d.cl.Fresh() { d.Reset() singular, err = d.ResourceSingularizer(resource) } return } func (d *DeferredDiscoveryRESTMapper) String() string { del, err := d.getDelegate() if err != nil { return fmt.Sprintf("DeferredDiscoveryRESTMapper{%v}", err) } return fmt.Sprintf("DeferredDiscoveryRESTMapper{\n\t%v\n}", del) } // Make sure it satisfies the interface var _ meta.ResettableRESTMapper = &DeferredDiscoveryRESTMapper{} kubernetes-client-go-a2dfcab/restmapper/discovery_test.go000066400000000000000000000343601472614177300241650ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package restmapper import ( "fmt" "reflect" "testing" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/dump" "k8s.io/apimachinery/pkg/version" . "k8s.io/client-go/discovery" "k8s.io/client-go/openapi" restclient "k8s.io/client-go/rest" "k8s.io/client-go/rest/fake" openapi_v2 "github.com/google/gnostic-models/openapiv2" "github.com/stretchr/testify/assert" ) func TestRESTMapper(t *testing.T) { resources := []*APIGroupResources{ { Group: metav1.APIGroup{ Name: "extensions", Versions: []metav1.GroupVersionForDiscovery{ {Version: "v1beta"}, }, PreferredVersion: metav1.GroupVersionForDiscovery{Version: "v1beta"}, }, VersionedResources: map[string][]metav1.APIResource{ "v1beta": { {Name: "jobs", Namespaced: true, Kind: "Job"}, {Name: "pods", Namespaced: true, Kind: "Pod"}, }, }, }, { Group: metav1.APIGroup{ Versions: []metav1.GroupVersionForDiscovery{ {Version: "v1"}, {Version: "v2"}, }, PreferredVersion: metav1.GroupVersionForDiscovery{Version: "v1"}, }, VersionedResources: map[string][]metav1.APIResource{ "v1": { {Name: "pods", Namespaced: true, Kind: "Pod"}, }, "v2": { {Name: "pods", Namespaced: true, Kind: "Pod"}, }, }, }, // This group tests finding and prioritizing resources that only exist in non-preferred versions { Group: metav1.APIGroup{ Name: "unpreferred", Versions: []metav1.GroupVersionForDiscovery{ {Version: "v1"}, {Version: "v2beta1"}, {Version: "v2alpha1"}, }, PreferredVersion: metav1.GroupVersionForDiscovery{Version: "v1"}, }, VersionedResources: map[string][]metav1.APIResource{ "v1": { {Name: "broccoli", Namespaced: true, Kind: "Broccoli"}, }, "v2beta1": { {Name: "broccoli", Namespaced: true, Kind: "Broccoli"}, {Name: "peas", Namespaced: true, Kind: "Pea"}, }, "v2alpha1": { {Name: "broccoli", Namespaced: true, Kind: "Broccoli"}, {Name: "peas", Namespaced: true, Kind: "Pea"}, }, }, }, } restMapper := NewDiscoveryRESTMapper(resources) kindTCs := []struct { input schema.GroupVersionResource want schema.GroupVersionKind }{ { input: schema.GroupVersionResource{ Resource: "pods", }, want: schema.GroupVersionKind{ Version: "v1", Kind: "Pod", }, }, { input: schema.GroupVersionResource{ Version: "v1", Resource: "pods", }, want: schema.GroupVersionKind{ Version: "v1", Kind: "Pod", }, }, { input: schema.GroupVersionResource{ Version: "v2", Resource: "pods", }, want: schema.GroupVersionKind{ Version: "v2", Kind: "Pod", }, }, { input: schema.GroupVersionResource{ Resource: "pods", }, want: schema.GroupVersionKind{ Version: "v1", Kind: "Pod", }, }, { input: schema.GroupVersionResource{ Resource: "jobs", }, want: schema.GroupVersionKind{ Group: "extensions", Version: "v1beta", Kind: "Job", }, }, { input: schema.GroupVersionResource{ Resource: "peas", }, want: schema.GroupVersionKind{ Group: "unpreferred", Version: "v2beta1", Kind: "Pea", }, }, } for _, tc := range kindTCs { got, err := restMapper.KindFor(tc.input) if err != nil { t.Errorf("KindFor(%#v) unexpected error: %v", tc.input, err) continue } if !reflect.DeepEqual(got, tc.want) { t.Errorf("KindFor(%#v) = %#v, want %#v", tc.input, got, tc.want) } } resourceTCs := []struct { input schema.GroupVersionResource want schema.GroupVersionResource }{ { input: schema.GroupVersionResource{ Resource: "pods", }, want: schema.GroupVersionResource{ Version: "v1", Resource: "pods", }, }, { input: schema.GroupVersionResource{ Version: "v1", Resource: "pods", }, want: schema.GroupVersionResource{ Version: "v1", Resource: "pods", }, }, { input: schema.GroupVersionResource{ Version: "v2", Resource: "pods", }, want: schema.GroupVersionResource{ Version: "v2", Resource: "pods", }, }, { input: schema.GroupVersionResource{ Resource: "pods", }, want: schema.GroupVersionResource{ Version: "v1", Resource: "pods", }, }, { input: schema.GroupVersionResource{ Resource: "jobs", }, want: schema.GroupVersionResource{ Group: "extensions", Version: "v1beta", Resource: "jobs", }, }, } for _, tc := range resourceTCs { got, err := restMapper.ResourceFor(tc.input) if err != nil { t.Errorf("ResourceFor(%#v) unexpected error: %v", tc.input, err) continue } if !reflect.DeepEqual(got, tc.want) { t.Errorf("ResourceFor(%#v) = %#v, want %#v", tc.input, got, tc.want) } } } func TestDeferredDiscoveryRESTMapper_CacheMiss(t *testing.T) { assert := assert.New(t) cdc := fakeCachedDiscoveryInterface{fresh: false} m := NewDeferredDiscoveryRESTMapper(&cdc) assert.False(cdc.fresh, "should NOT be fresh after instantiation") assert.Zero(cdc.invalidateCalls, "should not have called Invalidate()") gvk, err := m.KindFor(schema.GroupVersionResource{ Group: "a", Version: "v1", Resource: "foo", }) assert.NoError(err) assert.True(cdc.fresh, "should be fresh after a cache-miss") assert.Equal(cdc.invalidateCalls, 1, "should have called Invalidate() once") assert.Equal(gvk.Kind, "Foo") gvk, err = m.KindFor(schema.GroupVersionResource{ Group: "a", Version: "v1", Resource: "foo", }) assert.NoError(err) assert.Equal(cdc.invalidateCalls, 1, "should NOT have called Invalidate() again") gvk, err = m.KindFor(schema.GroupVersionResource{ Group: "a", Version: "v1", Resource: "bar", }) assert.Error(err) assert.Equal(cdc.invalidateCalls, 1, "should NOT have called Invalidate() again after another cache-miss, but with fresh==true") cdc.fresh = false gvk, err = m.KindFor(schema.GroupVersionResource{ Group: "a", Version: "v1", Resource: "bar", }) assert.Error(err) assert.Equal(cdc.invalidateCalls, 2, "should HAVE called Invalidate() again after another cache-miss, but with fresh==false") } func TestGetAPIGroupResources(t *testing.T) { type Test struct { name string discovery DiscoveryInterface expected []*APIGroupResources expectedError error } for _, test := range []Test{ {"nil", &fakeFailingDiscovery{nil, nil, nil, nil}, nil, nil}, {"normal", &fakeFailingDiscovery{ []metav1.APIGroup{aGroup, bGroup}, nil, map[string]*metav1.APIResourceList{"a/v1": &aResources, "b/v1": &bResources}, nil, }, []*APIGroupResources{ {aGroup, map[string][]metav1.APIResource{"v1": {aFoo}}}, {bGroup, map[string][]metav1.APIResource{"v1": {bBar}}}, }, nil, }, {"groups failed, but has fallback with a only", &fakeFailingDiscovery{ []metav1.APIGroup{aGroup}, fmt.Errorf("error fetching groups"), map[string]*metav1.APIResourceList{"a/v1": &aResources, "b/v1": &bResources}, nil, }, []*APIGroupResources{ {aGroup, map[string][]metav1.APIResource{"v1": {aFoo}}}, }, nil, }, {"groups failed, but has no fallback", &fakeFailingDiscovery{ nil, fmt.Errorf("error fetching groups"), map[string]*metav1.APIResourceList{"a/v1": &aResources, "b/v1": &bResources}, nil, }, nil, fmt.Errorf("error fetching groups"), }, {"a failed, but has fallback", &fakeFailingDiscovery{ []metav1.APIGroup{aGroup, bGroup}, nil, map[string]*metav1.APIResourceList{"a/v1": &aResources, "b/v1": &bResources}, map[string]error{"a/v1": fmt.Errorf("a failed")}, }, []*APIGroupResources{ {aGroup, map[string][]metav1.APIResource{"v1": {aFoo}}}, {bGroup, map[string][]metav1.APIResource{"v1": {bBar}}}, }, nil, // TODO: do we want this? }, {"a failed, but has no fallback", &fakeFailingDiscovery{ []metav1.APIGroup{aGroup, bGroup}, nil, map[string]*metav1.APIResourceList{"b/v1": &bResources}, map[string]error{"a/v1": fmt.Errorf("a failed")}, }, []*APIGroupResources{ {aGroup, map[string][]metav1.APIResource{}}, {bGroup, map[string][]metav1.APIResource{"v1": {bBar}}}, }, nil, // TODO: do we want this? }, {"a and b failed, but have fallbacks", &fakeFailingDiscovery{ []metav1.APIGroup{aGroup, bGroup}, nil, map[string]*metav1.APIResourceList{"a/v1": &aResources, "b/v1": &bResources}, // TODO: both fallbacks are ignored map[string]error{"a/v1": fmt.Errorf("a failed"), "b/v1": fmt.Errorf("b failed")}, }, []*APIGroupResources{ {aGroup, map[string][]metav1.APIResource{"v1": {aFoo}}}, {bGroup, map[string][]metav1.APIResource{"v1": {bBar}}}, }, nil, // TODO: do we want this? }, } { t.Run(test.name, func(t *testing.T) { got, err := GetAPIGroupResources(test.discovery) if err == nil && test.expectedError != nil { t.Fatalf("expected error %q, but got none", test.expectedError) } else if err != nil && test.expectedError == nil { t.Fatalf("unexpected error: %v", err) } if !reflect.DeepEqual(test.expected, got) { t.Errorf("unexpected result:\nexpected = %s\ngot = %s", dump.Pretty(test.expected), dump.Pretty(got)) } }) } } var _ DiscoveryInterface = &fakeFailingDiscovery{} type fakeFailingDiscovery struct { groups []metav1.APIGroup groupsErr error resourcesForGroupVersion map[string]*metav1.APIResourceList resourcesForGroupVersionErr map[string]error } func (*fakeFailingDiscovery) RESTClient() restclient.Interface { return nil } func (d *fakeFailingDiscovery) ServerGroups() (*metav1.APIGroupList, error) { if d.groups == nil && d.groupsErr != nil { return nil, d.groupsErr } return &metav1.APIGroupList{Groups: d.groups}, d.groupsErr } func (d *fakeFailingDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { return ServerGroupsAndResources(d) } func (d *fakeFailingDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { if rs, found := d.resourcesForGroupVersion[groupVersion]; found { return rs, d.resourcesForGroupVersionErr[groupVersion] } return nil, fmt.Errorf("not found") } func (d *fakeFailingDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error) { return ServerPreferredResources(d) } func (d *fakeFailingDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { return ServerPreferredNamespacedResources(d) } func (*fakeFailingDiscovery) ServerVersion() (*version.Info, error) { return &version.Info{}, nil } func (*fakeFailingDiscovery) OpenAPISchema() (*openapi_v2.Document, error) { panic("implement me") } func (c *fakeFailingDiscovery) OpenAPIV3() openapi.Client { panic("implement me") } func (c *fakeFailingDiscovery) WithLegacy() DiscoveryInterface { panic("implement me") } type fakeCachedDiscoveryInterface struct { invalidateCalls int fresh bool enabledGroupA bool } var _ CachedDiscoveryInterface = &fakeCachedDiscoveryInterface{} func (c *fakeCachedDiscoveryInterface) Fresh() bool { return c.fresh } func (c *fakeCachedDiscoveryInterface) Invalidate() { c.invalidateCalls = c.invalidateCalls + 1 c.fresh = true c.enabledGroupA = true } func (c *fakeCachedDiscoveryInterface) RESTClient() restclient.Interface { return &fake.RESTClient{} } func (c *fakeCachedDiscoveryInterface) ServerGroups() (*metav1.APIGroupList, error) { if c.enabledGroupA { return &metav1.APIGroupList{ Groups: []metav1.APIGroup{aGroup}, }, nil } return &metav1.APIGroupList{}, nil } func (c *fakeCachedDiscoveryInterface) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { return ServerGroupsAndResources(c) } func (c *fakeCachedDiscoveryInterface) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { if c.enabledGroupA && groupVersion == "a/v1" { return &aResources, nil } return nil, errors.NewNotFound(schema.GroupResource{}, "") } func (c *fakeCachedDiscoveryInterface) ServerPreferredResources() ([]*metav1.APIResourceList, error) { if c.enabledGroupA { return []*metav1.APIResourceList{ { GroupVersion: "a/v1", APIResources: []metav1.APIResource{ { Name: "foo", Kind: "Foo", Verbs: []string{}, }, }, }, }, nil } return nil, nil } func (c *fakeCachedDiscoveryInterface) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { return nil, nil } func (c *fakeCachedDiscoveryInterface) ServerVersion() (*version.Info, error) { return &version.Info{}, nil } func (c *fakeCachedDiscoveryInterface) OpenAPISchema() (*openapi_v2.Document, error) { return &openapi_v2.Document{}, nil } func (c *fakeCachedDiscoveryInterface) OpenAPIV3() openapi.Client { panic("implement me") } func (c *fakeCachedDiscoveryInterface) WithLegacy() DiscoveryInterface { panic("implement me") } var ( aGroup = metav1.APIGroup{ Name: "a", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "a/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "a/v1", Version: "v1", }, } bGroup = metav1.APIGroup{ Name: "b", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "b/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "b/v1", Version: "v1", }, } aResources = metav1.APIResourceList{ GroupVersion: "a/v1", APIResources: []metav1.APIResource{aFoo}, } aFoo = metav1.APIResource{ Name: "foo", Kind: "Foo", Namespaced: false, } bResources = metav1.APIResourceList{ GroupVersion: "b/v1", APIResources: []metav1.APIResource{bBar}, } bBar = metav1.APIResource{ Name: "bar", Kind: "Bar", Namespaced: true, } ) kubernetes-client-go-a2dfcab/restmapper/shortcut.go000066400000000000000000000174441472614177300227760ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package restmapper import ( "fmt" "strings" "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" ) // shortcutExpander is a RESTMapper that can be used for Kubernetes resources. It expands the resource first, then invokes the wrapped type shortcutExpander struct { RESTMapper meta.RESTMapper discoveryClient discovery.DiscoveryInterface warningHandler func(string) } var _ meta.ResettableRESTMapper = shortcutExpander{} // NewShortcutExpander wraps a restmapper in a layer that expands shortcuts found via discovery func NewShortcutExpander(delegate meta.RESTMapper, client discovery.DiscoveryInterface, warningHandler func(string)) meta.RESTMapper { return shortcutExpander{RESTMapper: delegate, discoveryClient: client, warningHandler: warningHandler} } // KindFor fulfills meta.RESTMapper func (e shortcutExpander) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { // expandResourceShortcut works with current API resources as read from discovery cache. // In case of new CRDs this means we potentially don't have current state of discovery. // In the current wiring in k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go#toRESTMapper, // we are using DeferredDiscoveryRESTMapper which on KindFor failure will clear the // cache and fetch all data from a cluster (see k8s.io/client-go/restmapper/discovery.go#KindFor). // Thus another call to expandResourceShortcut, after a NoMatchError should successfully // read Kind to the user or an error. gvk, err := e.RESTMapper.KindFor(e.expandResourceShortcut(resource)) if meta.IsNoMatchError(err) { return e.RESTMapper.KindFor(e.expandResourceShortcut(resource)) } return gvk, err } // KindsFor fulfills meta.RESTMapper func (e shortcutExpander) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { return e.RESTMapper.KindsFor(e.expandResourceShortcut(resource)) } // ResourcesFor fulfills meta.RESTMapper func (e shortcutExpander) ResourcesFor(resource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { return e.RESTMapper.ResourcesFor(e.expandResourceShortcut(resource)) } // ResourceFor fulfills meta.RESTMapper func (e shortcutExpander) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { return e.RESTMapper.ResourceFor(e.expandResourceShortcut(resource)) } // ResourceSingularizer fulfills meta.RESTMapper func (e shortcutExpander) ResourceSingularizer(resource string) (string, error) { return e.RESTMapper.ResourceSingularizer(e.expandResourceShortcut(schema.GroupVersionResource{Resource: resource}).Resource) } // RESTMapping fulfills meta.RESTMapper func (e shortcutExpander) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error) { return e.RESTMapper.RESTMapping(gk, versions...) } // RESTMappings fulfills meta.RESTMapper func (e shortcutExpander) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error) { return e.RESTMapper.RESTMappings(gk, versions...) } // getShortcutMappings returns a set of tuples which holds short names for resources. // First the list of potential resources will be taken from the API server. // Next we will append the hardcoded list of resources - to be backward compatible with old servers. // NOTE that the list is ordered by group priority. func (e shortcutExpander) getShortcutMappings() ([]*metav1.APIResourceList, []resourceShortcuts, error) { res := []resourceShortcuts{} // get server resources // This can return an error *and* the results it was able to find. We don't need to fail on the error. _, apiResList, err := e.discoveryClient.ServerGroupsAndResources() if err != nil { klog.V(1).Infof("Error loading discovery information: %v", err) } for _, apiResources := range apiResList { gv, err := schema.ParseGroupVersion(apiResources.GroupVersion) if err != nil { klog.V(1).Infof("Unable to parse groupversion = %s due to = %s", apiResources.GroupVersion, err.Error()) continue } for _, apiRes := range apiResources.APIResources { for _, shortName := range apiRes.ShortNames { rs := resourceShortcuts{ ShortForm: schema.GroupResource{Group: gv.Group, Resource: shortName}, LongForm: schema.GroupResource{Group: gv.Group, Resource: apiRes.Name}, } res = append(res, rs) } } } return apiResList, res, nil } // expandResourceShortcut will return the expanded version of resource // (something that a pkg/api/meta.RESTMapper can understand), if it is // indeed a shortcut. If no match has been found, we will match on group prefixing. // Lastly we will return resource unmodified. func (e shortcutExpander) expandResourceShortcut(resource schema.GroupVersionResource) schema.GroupVersionResource { // get the shortcut mappings and return on first match. if allResources, shortcutResources, err := e.getShortcutMappings(); err == nil { // avoid expanding if there's an exact match to a full resource name for _, apiResources := range allResources { gv, err := schema.ParseGroupVersion(apiResources.GroupVersion) if err != nil { continue } if len(resource.Group) != 0 && resource.Group != gv.Group { continue } for _, apiRes := range apiResources.APIResources { if resource.Resource == apiRes.Name { return resource } if resource.Resource == apiRes.SingularName { return resource } } } found := false var rsc schema.GroupVersionResource warnedAmbiguousShortcut := make(map[schema.GroupResource]bool) for _, item := range shortcutResources { if len(resource.Group) != 0 && resource.Group != item.ShortForm.Group { continue } if resource.Resource == item.ShortForm.Resource { if found { if item.LongForm.Group == rsc.Group && item.LongForm.Resource == rsc.Resource { // It is common and acceptable that group/resource has multiple // versions registered in cluster. This does not introduce ambiguity // in terms of shortname usage. continue } if !warnedAmbiguousShortcut[item.LongForm] { if e.warningHandler != nil { e.warningHandler(fmt.Sprintf("short name %q could also match lower priority resource %s", resource.Resource, item.LongForm.String())) } warnedAmbiguousShortcut[item.LongForm] = true } continue } rsc.Resource = item.LongForm.Resource rsc.Group = item.LongForm.Group found = true } } if found { return rsc } // we didn't find exact match so match on group prefixing. This allows autoscal to match autoscaling if len(resource.Group) == 0 { return resource } for _, item := range shortcutResources { if !strings.HasPrefix(item.ShortForm.Group, resource.Group) { continue } if resource.Resource == item.ShortForm.Resource { resource.Resource = item.LongForm.Resource resource.Group = item.LongForm.Group return resource } } } return resource } func (e shortcutExpander) Reset() { meta.MaybeResetRESTMapper(e.RESTMapper) } // ResourceShortcuts represents a structure that holds the information how to // transition from resource's shortcut to its full name. type resourceShortcuts struct { ShortForm schema.GroupResource LongForm schema.GroupResource } kubernetes-client-go-a2dfcab/restmapper/shortcut_test.go000066400000000000000000000405251472614177300240310ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package restmapper import ( "testing" openapi_v2 "github.com/google/gnostic-models/openapiv2" "github.com/google/go-cmp/cmp" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/discovery" "k8s.io/client-go/openapi" restclient "k8s.io/client-go/rest" "k8s.io/client-go/rest/fake" ) func TestReplaceAliases(t *testing.T) { tests := []struct { name string arg string expected schema.GroupVersionResource srvRes []*metav1.APIResourceList }{ { name: "storageclasses-no-replacement", arg: "storageclasses", expected: schema.GroupVersionResource{Resource: "storageclasses"}, srvRes: []*metav1.APIResourceList{}, }, { name: "hpa-priority", arg: "hpa", expected: schema.GroupVersionResource{Resource: "superhorizontalpodautoscalers", Group: "autoscaling"}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "autoscaling/v1", APIResources: []metav1.APIResource{ { Name: "superhorizontalpodautoscalers", ShortNames: []string{"hpa"}, }, }, }, { GroupVersion: "autoscaling/v1", APIResources: []metav1.APIResource{ { Name: "horizontalpodautoscalers", ShortNames: []string{"hpa"}, }, }, }, }, }, { name: "resource-override", arg: "dpl", expected: schema.GroupVersionResource{Resource: "deployments", Group: "foo"}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "foo/v1", APIResources: []metav1.APIResource{ { Name: "deployments", ShortNames: []string{"dpl"}, }, }, }, { GroupVersion: "extension/v1beta1", APIResources: []metav1.APIResource{ { Name: "deployments", ShortNames: []string{"deploy"}, }, }, }, }, }, { name: "resource-match-preferred", arg: "pods", expected: schema.GroupVersionResource{Resource: "pods", Group: ""}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "v1", APIResources: []metav1.APIResource{{Name: "pods", SingularName: "pod"}}, }, { GroupVersion: "acme.com/v1", APIResources: []metav1.APIResource{{Name: "poddlers", ShortNames: []string{"pods", "pod"}}}, }, }, }, { name: "resource-match-singular-preferred", arg: "pod", expected: schema.GroupVersionResource{Resource: "pod", Group: ""}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "v1", APIResources: []metav1.APIResource{{Name: "pods", SingularName: "pod"}}, }, { GroupVersion: "acme.com/v1", APIResources: []metav1.APIResource{{Name: "poddlers", ShortNames: []string{"pods", "pod"}}}, }, }, }, } for _, test := range tests { ds := &fakeDiscoveryClient{} ds.serverResourcesHandler = func() ([]*metav1.APIResourceList, error) { return test.srvRes, nil } mapper := NewShortcutExpander(&fakeRESTMapper{}, ds, nil).(shortcutExpander) actual := mapper.expandResourceShortcut(schema.GroupVersionResource{Resource: test.arg}) if actual != test.expected { t.Errorf("%s: unexpected argument: expected %s, got %s", test.name, test.expected, actual) } } } func TestKindFor(t *testing.T) { tests := []struct { in schema.GroupVersionResource expected schema.GroupVersionResource srvRes []*metav1.APIResourceList }{ { in: schema.GroupVersionResource{Group: "storage.k8s.io", Version: "", Resource: "sc"}, expected: schema.GroupVersionResource{Group: "storage.k8s.io", Version: "", Resource: "storageclasses"}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "storage.k8s.io/v1", APIResources: []metav1.APIResource{ { Name: "storageclasses", ShortNames: []string{"sc"}, }, }, }, }, }, { in: schema.GroupVersionResource{Group: "", Version: "", Resource: "sc"}, expected: schema.GroupVersionResource{Group: "storage.k8s.io", Version: "", Resource: "storageclasses"}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "storage.k8s.io/v1", APIResources: []metav1.APIResource{ { Name: "storageclasses", ShortNames: []string{"sc"}, }, }, }, }, }, } for i, test := range tests { ds := &fakeDiscoveryClient{} ds.serverResourcesHandler = func() ([]*metav1.APIResourceList, error) { return test.srvRes, nil } delegate := &fakeRESTMapper{} mapper := NewShortcutExpander(delegate, ds, func(a string) { t.Fatalf("unexpected warning message %s", a) }) mapper.KindFor(test.in) if delegate.kindForInput != test.expected { t.Errorf("%d: unexpected data returned %#v, expected %#v", i, delegate.kindForInput, test.expected) } } } func TestKindForWithNewCRDs(t *testing.T) { tests := map[string]struct { in schema.GroupVersionResource expected schema.GroupVersionKind srvRes []*metav1.APIResourceList }{ "": { in: schema.GroupVersionResource{Group: "a", Version: "", Resource: "sc"}, expected: schema.GroupVersionKind{Group: "a", Version: "v1", Kind: "StorageClass"}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "a/v1", APIResources: []metav1.APIResource{ { Name: "storageclasses", ShortNames: []string{"sc"}, Kind: "StorageClass", }, }, }, }, }, } for name, test := range tests { t.Run(name, func(t *testing.T) { invalidateCalled := false fakeDiscovery := &fakeDiscoveryClient{} fakeDiscovery.serverResourcesHandler = func() ([]*metav1.APIResourceList, error) { if invalidateCalled { return test.srvRes, nil } return []*metav1.APIResourceList{}, nil } fakeCachedDiscovery := &fakeCachedDiscoveryClient{DiscoveryInterface: fakeDiscovery} fakeCachedDiscovery.invalidateHandler = func() { invalidateCalled = true } fakeCachedDiscovery.freshHandler = func() bool { return invalidateCalled } // in real world the discovery client is fronted with a cache which // will answer the initial request, only failure to match will trigger // the cache invalidation and live discovery call delegate := NewDeferredDiscoveryRESTMapper(fakeCachedDiscovery) mapper := NewShortcutExpander(delegate, fakeCachedDiscovery, func(a string) { t.Fatalf("unexpected warning message %s", a) }) gvk, err := mapper.KindFor(test.in) if err != nil { t.Errorf("unexpected error: %v", err) } if diff := cmp.Equal(gvk, test.expected); !diff { t.Errorf("unexpected data returned %#v, expected %#v", gvk, test.expected) } }) } } func TestWarnAmbigious(t *testing.T) { tests := []struct { name string arg string expected schema.GroupVersionResource expectedWarningLogs []string srvRes []*metav1.APIResourceList }{ { name: "warn ambiguity", arg: "hpa", expected: schema.GroupVersionResource{Resource: "superhorizontalpodautoscalers", Group: "autoscaling"}, expectedWarningLogs: []string{`short name "hpa" could also match lower priority resource horizontalpodautoscalers.autoscaling`}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "autoscaling/v1", APIResources: []metav1.APIResource{ { Name: "superhorizontalpodautoscalers", ShortNames: []string{"hpa"}, }, }, }, { GroupVersion: "autoscaling/v1", APIResources: []metav1.APIResource{ { Name: "horizontalpodautoscalers", ShortNames: []string{"hpa"}, }, }, }, }, }, { name: "warn-builtin-shortname-ambugity", arg: "po", expected: schema.GroupVersionResource{Resource: "pods", Group: ""}, expectedWarningLogs: []string{`short name "po" could also match lower priority resource poddlers.acme.com`}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "v1", APIResources: []metav1.APIResource{{Name: "pods", SingularName: "pod", ShortNames: []string{"po"}}}, }, { GroupVersion: "acme.com/v1", APIResources: []metav1.APIResource{{Name: "poddlers", ShortNames: []string{"po"}}}, }, }, }, { name: "warn-builtin-shortname-ambugity-multi-version", arg: "po", expected: schema.GroupVersionResource{Resource: "pods", Group: ""}, expectedWarningLogs: []string{`short name "po" could also match lower priority resource poddlers.acme.com`}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "v1", APIResources: []metav1.APIResource{{Name: "pods", SingularName: "pod", ShortNames: []string{"po"}}}, }, { GroupVersion: "acme.com/v1", APIResources: []metav1.APIResource{{Name: "poddlers", ShortNames: []string{"po"}}}, }, { GroupVersion: "acme.com/v1beta1", APIResources: []metav1.APIResource{{Name: "poddlers", ShortNames: []string{"po"}}}, }, }, }, { name: "resource-match-singular-preferred", arg: "pod", expected: schema.GroupVersionResource{Resource: "pod", Group: ""}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "v1", APIResources: []metav1.APIResource{{Name: "pods", SingularName: "pod"}}, }, { GroupVersion: "acme.com/v1", APIResources: []metav1.APIResource{{Name: "poddlers", ShortNames: []string{"pods", "pod"}}}, }, }, }, { name: "resource-multiple-versions-shortform", arg: "hpa", expected: schema.GroupVersionResource{Resource: "horizontalpodautoscalers", Group: "autoscaling"}, expectedWarningLogs: []string{}, srvRes: []*metav1.APIResourceList{ { GroupVersion: "autoscaling/v1alphav1", APIResources: []metav1.APIResource{ { Name: "horizontalpodautoscalers", ShortNames: []string{"hpa"}, }, }, }, { GroupVersion: "autoscaling/v1", APIResources: []metav1.APIResource{ { Name: "horizontalpodautoscalers", ShortNames: []string{"hpa"}, }, }, }, }, }, { name: "multi-resource-multiple-versions-shortform", arg: "hpa", expected: schema.GroupVersionResource{Resource: "horizontalpodautoscalers", Group: "autoscaling"}, expectedWarningLogs: []string{ `short name "hpa" could also match lower priority resource foo.foo`, `short name "hpa" could also match lower priority resource bar.bar`, }, srvRes: []*metav1.APIResourceList{ { GroupVersion: "autoscaling/v1alphav1", APIResources: []metav1.APIResource{ { Name: "horizontalpodautoscalers", ShortNames: []string{"hpa"}, }, }, }, { GroupVersion: "autoscaling/v1", APIResources: []metav1.APIResource{ { Name: "horizontalpodautoscalers", ShortNames: []string{"hpa"}, }, }, }, { GroupVersion: "foo/v1", APIResources: []metav1.APIResource{ { Name: "foo", ShortNames: []string{"hpa"}, }, }, }, { GroupVersion: "foo/v1beta1", APIResources: []metav1.APIResource{ { Name: "foo", ShortNames: []string{"hpa"}, }, }, }, { GroupVersion: "bar/v1", APIResources: []metav1.APIResource{ { Name: "bar", ShortNames: []string{"hpa"}, }, }, }, }, }, } for _, test := range tests { ds := &fakeDiscoveryClient{} ds.serverResourcesHandler = func() ([]*metav1.APIResourceList, error) { return test.srvRes, nil } var actualWarnings []string mapper := NewShortcutExpander(&fakeRESTMapper{}, ds, func(a string) { actualWarnings = append(actualWarnings, a) }).(shortcutExpander) actual := mapper.expandResourceShortcut(schema.GroupVersionResource{Resource: test.arg}) if actual != test.expected { t.Errorf("%s: unexpected argument: expected %s, got %s", test.name, test.expected, actual) } if len(actualWarnings) == 0 && len(test.expectedWarningLogs) == 0 { continue } if !cmp.Equal(test.expectedWarningLogs, actualWarnings) { t.Fatalf("expected warning message %s but got %s", test.expectedWarningLogs, actualWarnings) } } } type fakeRESTMapper struct { kindForInput schema.GroupVersionResource } func (f *fakeRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { f.kindForInput = resource return schema.GroupVersionKind{}, nil } func (f *fakeRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { return nil, nil } func (f *fakeRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error) { return schema.GroupVersionResource{}, nil } func (f *fakeRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { return nil, nil } func (f *fakeRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error) { return nil, nil } func (f *fakeRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error) { return nil, nil } func (f *fakeRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { return "", nil } type fakeDiscoveryClient struct { serverResourcesHandler func() ([]*metav1.APIResourceList, error) } var _ discovery.DiscoveryInterface = &fakeDiscoveryClient{} func (c *fakeDiscoveryClient) RESTClient() restclient.Interface { return &fake.RESTClient{} } func (c *fakeDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { return &metav1.APIGroupList{ Groups: []metav1.APIGroup{ { Name: "a", Versions: []metav1.GroupVersionForDiscovery{ { GroupVersion: "a/v1", Version: "v1", }, }, PreferredVersion: metav1.GroupVersionForDiscovery{ GroupVersion: "a/v1", Version: "v1", }, }, }, }, nil } func (c *fakeDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { if groupVersion == "a/v1" { return &metav1.APIResourceList{APIResources: []metav1.APIResource{{Name: "widgets", Kind: "Widget"}}}, nil } return nil, errors.NewNotFound(schema.GroupResource{}, "") } func (c *fakeDiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { sgs, err := c.ServerGroups() if err != nil { return nil, nil, err } resultGroups := []*metav1.APIGroup{} for i := range sgs.Groups { resultGroups = append(resultGroups, &sgs.Groups[i]) } if c.serverResourcesHandler != nil { rs, err := c.serverResourcesHandler() return resultGroups, rs, err } return resultGroups, []*metav1.APIResourceList{}, nil } func (c *fakeDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { return nil, nil } func (c *fakeDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { return nil, nil } func (c *fakeDiscoveryClient) ServerVersion() (*version.Info, error) { return &version.Info{}, nil } func (c *fakeDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { return &openapi_v2.Document{}, nil } func (c *fakeDiscoveryClient) OpenAPIV3() openapi.Client { panic("implement me") } func (c *fakeDiscoveryClient) WithLegacy() discovery.DiscoveryInterface { panic("implement me") } type fakeCachedDiscoveryClient struct { discovery.DiscoveryInterface freshHandler func() bool invalidateHandler func() } var _ discovery.CachedDiscoveryInterface = &fakeCachedDiscoveryClient{} func (c *fakeCachedDiscoveryClient) Fresh() bool { if c.freshHandler != nil { return c.freshHandler() } return true } func (c *fakeCachedDiscoveryClient) Invalidate() { if c.invalidateHandler != nil { c.invalidateHandler() } } kubernetes-client-go-a2dfcab/scale/000077500000000000000000000000001472614177300174675ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/client.go000066400000000000000000000204021472614177300212720ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package scale import ( "context" "fmt" autoscaling "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/dynamic" restclient "k8s.io/client-go/rest" ) var scaleConverter = NewScaleConverter() var codecs = serializer.NewCodecFactory(scaleConverter.Scheme()) var parameterScheme = runtime.NewScheme() var dynamicParameterCodec = runtime.NewParameterCodec(parameterScheme) var versionV1 = schema.GroupVersion{Version: "v1"} func init() { metav1.AddToGroupVersion(parameterScheme, versionV1) } // scaleClient is an implementation of ScalesGetter // which makes use of a RESTMapper and a generic REST // client to support an discoverable resource. // It behaves somewhat similarly to the dynamic ClientPool, // but is more specifically scoped to Scale. type scaleClient struct { mapper PreferredResourceMapper apiPathResolverFunc dynamic.APIPathResolverFunc scaleKindResolver ScaleKindResolver clientBase restclient.Interface } // NewForConfig creates a new ScalesGetter which resolves kinds // to resources using the given RESTMapper, and API paths using // the given dynamic.APIPathResolverFunc. func NewForConfig(cfg *restclient.Config, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) (ScalesGetter, error) { // so that the RESTClientFor doesn't complain cfg.GroupVersion = &schema.GroupVersion{} cfg.NegotiatedSerializer = codecs.WithoutConversion() if len(cfg.UserAgent) == 0 { cfg.UserAgent = restclient.DefaultKubernetesUserAgent() } client, err := restclient.RESTClientFor(cfg) if err != nil { return nil, err } return New(client, mapper, resolver, scaleKindResolver), nil } // New creates a new ScalesGetter using the given client to make requests. // The GroupVersion on the client is ignored. func New(baseClient restclient.Interface, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) ScalesGetter { return &scaleClient{ mapper: mapper, apiPathResolverFunc: resolver, scaleKindResolver: scaleKindResolver, clientBase: baseClient, } } // apiPathFor returns the absolute api path for the given GroupVersion func (c *scaleClient) apiPathFor(groupVer schema.GroupVersion) string { // we need to set the API path based on GroupVersion (defaulting to the legacy path if none is set) // TODO: we "cheat" here since the API path really only depends on group ATM, but this should // *probably* take GroupVersionResource and not GroupVersionKind. apiPath := c.apiPathResolverFunc(groupVer.WithKind("")) if apiPath == "" { apiPath = "/api" } return restclient.DefaultVersionedAPIPath(apiPath, groupVer) } // pathAndVersionFor returns the appropriate base path and the associated full GroupVersionResource // for the given GroupResource func (c *scaleClient) pathAndVersionFor(resource schema.GroupResource) (string, schema.GroupVersionResource, error) { gvr, err := c.mapper.ResourceFor(resource.WithVersion("")) if err != nil { return "", gvr, fmt.Errorf("unable to get full preferred group-version-resource for %s: %v", resource.String(), err) } groupVer := gvr.GroupVersion() return c.apiPathFor(groupVer), gvr, nil } // namespacedScaleClient is an ScaleInterface for fetching // Scales in a given namespace. type namespacedScaleClient struct { client *scaleClient namespace string } // convertToScale converts the response body to autoscaling/v1.Scale func convertToScale(result *restclient.Result) (*autoscaling.Scale, error) { scaleBytes, err := result.Raw() if err != nil { return nil, err } decoder := scaleConverter.codecs.UniversalDecoder(scaleConverter.ScaleVersions()...) rawScaleObj, err := runtime.Decode(decoder, scaleBytes) if err != nil { return nil, err } // convert whatever this is to autoscaling/v1.Scale scaleObj, err := scaleConverter.ConvertToVersion(rawScaleObj, autoscaling.SchemeGroupVersion) if err != nil { return nil, fmt.Errorf("received an object from a /scale endpoint which was not convertible to autoscaling Scale: %v", err) } return scaleObj.(*autoscaling.Scale), nil } func (c *scaleClient) Scales(namespace string) ScaleInterface { return &namespacedScaleClient{ client: c, namespace: namespace, } } func (c *namespacedScaleClient) Get(ctx context.Context, resource schema.GroupResource, name string, opts metav1.GetOptions) (*autoscaling.Scale, error) { // Currently, a /scale endpoint can return different scale types. // Until we have support for the alternative API representations proposal, // we need to deal with accepting different API versions. // In practice, this is autoscaling/v1.Scale and extensions/v1beta1.Scale path, gvr, err := c.client.pathAndVersionFor(resource) if err != nil { return nil, fmt.Errorf("unable to get client for %s: %v", resource.String(), err) } result := c.client.clientBase.Get(). AbsPath(path). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(gvr.Resource). Name(name). SubResource("scale"). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Do(ctx) if err := result.Error(); err != nil { return nil, err } return convertToScale(&result) } func (c *namespacedScaleClient) Update(ctx context.Context, resource schema.GroupResource, scale *autoscaling.Scale, opts metav1.UpdateOptions) (*autoscaling.Scale, error) { path, gvr, err := c.client.pathAndVersionFor(resource) if err != nil { return nil, fmt.Errorf("unable to get client for %s: %v", resource.String(), err) } // Currently, a /scale endpoint can receive and return different scale types. // Until we have support for the alternative API representations proposal, // we need to deal with sending and accepting different API versions. // figure out what scale we actually need here desiredGVK, err := c.client.scaleKindResolver.ScaleForResource(gvr) if err != nil { return nil, fmt.Errorf("could not find proper group-version for scale subresource of %s: %v", gvr.String(), err) } // convert this to whatever this endpoint wants scaleUpdate, err := scaleConverter.ConvertToVersion(scale, desiredGVK.GroupVersion()) if err != nil { return nil, fmt.Errorf("could not convert scale update to external Scale: %v", err) } encoder := scaleConverter.codecs.LegacyCodec(desiredGVK.GroupVersion()) scaleUpdateBytes, err := runtime.Encode(encoder, scaleUpdate) if err != nil { return nil, fmt.Errorf("could not encode scale update to external Scale: %v", err) } result := c.client.clientBase.Put(). AbsPath(path). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(gvr.Resource). Name(scale.Name). SubResource("scale"). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Body(scaleUpdateBytes). Do(ctx) if err := result.Error(); err != nil { // propagate "raw" error from the API // this allows callers to interpret underlying Reason field // for example: errors.IsConflict(err) return nil, err } return convertToScale(&result) } func (c *namespacedScaleClient) Patch(ctx context.Context, gvr schema.GroupVersionResource, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions) (*autoscaling.Scale, error) { groupVersion := gvr.GroupVersion() result := c.client.clientBase.Patch(pt). AbsPath(c.client.apiPathFor(groupVersion)). NamespaceIfScoped(c.namespace, c.namespace != ""). Resource(gvr.Resource). Name(name). SubResource("scale"). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). Body(data). Do(ctx) if err := result.Error(); err != nil { return nil, err } return convertToScale(&result) } kubernetes-client-go-a2dfcab/scale/client_test.go000066400000000000000000000276411472614177300223450ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package scale import ( "bytes" "context" "encoding/json" "fmt" "io" "net/http" "testing" jsonpatch "gopkg.in/evanphx/json-patch.v4" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" fakedisco "k8s.io/client-go/discovery/fake" "k8s.io/client-go/dynamic" fakerest "k8s.io/client-go/rest/fake" "github.com/stretchr/testify/assert" appsv1beta1 "k8s.io/api/apps/v1beta1" appsv1beta2 "k8s.io/api/apps/v1beta2" autoscalingv1 "k8s.io/api/autoscaling/v1" corev1 "k8s.io/api/core/v1" extv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/client-go/restmapper" coretesting "k8s.io/client-go/testing" ) func bytesBody(bodyBytes []byte) io.ReadCloser { return io.NopCloser(bytes.NewReader(bodyBytes)) } func defaultHeaders() http.Header { header := http.Header{} header.Set("Content-Type", runtime.ContentTypeJSON) return header } func fakeScaleClient(t *testing.T) (ScalesGetter, []schema.GroupResource) { fakeDiscoveryClient := &fakedisco.FakeDiscovery{Fake: &coretesting.Fake{}} fakeDiscoveryClient.Resources = []*metav1.APIResourceList{ { GroupVersion: corev1.SchemeGroupVersion.String(), APIResources: []metav1.APIResource{ {Name: "pods", Namespaced: true, Kind: "Pod"}, {Name: "replicationcontrollers", Namespaced: true, Kind: "ReplicationController"}, {Name: "replicationcontrollers/scale", Namespaced: true, Kind: "Scale", Group: "autoscaling", Version: "v1"}, }, }, { GroupVersion: extv1beta1.SchemeGroupVersion.String(), APIResources: []metav1.APIResource{ {Name: "replicasets", Namespaced: true, Kind: "ReplicaSet"}, {Name: "replicasets/scale", Namespaced: true, Kind: "Scale"}, }, }, { GroupVersion: appsv1beta2.SchemeGroupVersion.String(), APIResources: []metav1.APIResource{ {Name: "deployments", Namespaced: true, Kind: "Deployment"}, {Name: "deployments/scale", Namespaced: true, Kind: "Scale", Group: "apps", Version: "v1beta2"}, }, }, { GroupVersion: appsv1beta1.SchemeGroupVersion.String(), APIResources: []metav1.APIResource{ {Name: "statefulsets", Namespaced: true, Kind: "StatefulSet"}, {Name: "statefulsets/scale", Namespaced: true, Kind: "Scale", Group: "apps", Version: "v1beta1"}, }, }, // test a resource that doesn't exist anywere to make sure we're not accidentally depending // on a static RESTMapper anywhere. { GroupVersion: "cheese.testing.k8s.io/v27alpha15", APIResources: []metav1.APIResource{ {Name: "cheddars", Namespaced: true, Kind: "Cheddar"}, {Name: "cheddars/scale", Namespaced: true, Kind: "Scale", Group: "extensions", Version: "v1beta1"}, }, }, } restMapperRes, err := restmapper.GetAPIGroupResources(fakeDiscoveryClient) if err != nil { t.Fatalf("unexpected error while constructing resource list from fake discovery client: %v", err) } restMapper := restmapper.NewDiscoveryRESTMapper(restMapperRes) autoscalingScale := &autoscalingv1.Scale{ TypeMeta: metav1.TypeMeta{ Kind: "Scale", APIVersion: autoscalingv1.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "foo", }, Spec: autoscalingv1.ScaleSpec{Replicas: 10}, Status: autoscalingv1.ScaleStatus{ Replicas: 10, Selector: "foo=bar", }, } extScale := &extv1beta1.Scale{ TypeMeta: metav1.TypeMeta{ Kind: "Scale", APIVersion: extv1beta1.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "foo", }, Spec: extv1beta1.ScaleSpec{Replicas: 10}, Status: extv1beta1.ScaleStatus{ Replicas: 10, TargetSelector: "foo=bar", }, } appsV1beta2Scale := &appsv1beta2.Scale{ TypeMeta: metav1.TypeMeta{ Kind: "Scale", APIVersion: appsv1beta2.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "foo", }, Spec: appsv1beta2.ScaleSpec{Replicas: 10}, Status: appsv1beta2.ScaleStatus{ Replicas: 10, TargetSelector: "foo=bar", }, } appsV1beta1Scale := &appsv1beta1.Scale{ TypeMeta: metav1.TypeMeta{ Kind: "Scale", APIVersion: appsv1beta1.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "foo", }, Spec: appsv1beta1.ScaleSpec{Replicas: 10}, Status: appsv1beta1.ScaleStatus{ Replicas: 10, TargetSelector: "foo=bar", }, } resourcePaths := map[string]runtime.Object{ "/api/v1/namespaces/default/replicationcontrollers/foo/scale": autoscalingScale, "/apis/extensions/v1beta1/namespaces/default/replicasets/foo/scale": extScale, "/apis/apps/v1beta1/namespaces/default/statefulsets/foo/scale": appsV1beta1Scale, "/apis/apps/v1beta2/namespaces/default/deployments/foo/scale": appsV1beta2Scale, "/apis/cheese.testing.k8s.io/v27alpha15/namespaces/default/cheddars/foo/scale": extScale, } fakeReqHandler := func(req *http.Request) (*http.Response, error) { scale, isScalePath := resourcePaths[req.URL.Path] if !isScalePath { return nil, fmt.Errorf("unexpected request for URL %q with method %q", req.URL.String(), req.Method) } switch req.Method { case "GET": res, err := json.Marshal(scale) if err != nil { return nil, err } return &http.Response{StatusCode: http.StatusOK, Header: defaultHeaders(), Body: bytesBody(res)}, nil case "PUT": decoder := codecs.UniversalDeserializer() body, err := io.ReadAll(req.Body) if err != nil { return nil, err } newScale, newScaleGVK, err := decoder.Decode(body, nil, nil) if err != nil { return nil, fmt.Errorf("unexpected request body: %v", err) } if *newScaleGVK != scale.GetObjectKind().GroupVersionKind() { return nil, fmt.Errorf("unexpected scale API version %s (expected %s)", newScaleGVK.String(), scale.GetObjectKind().GroupVersionKind().String()) } res, err := json.Marshal(newScale) if err != nil { return nil, err } return &http.Response{StatusCode: http.StatusOK, Header: defaultHeaders(), Body: bytesBody(res)}, nil case "PATCH": body, err := io.ReadAll(req.Body) if err != nil { return nil, err } originScale, err := json.Marshal(scale) if err != nil { return nil, err } var res []byte contentType := req.Header.Get("Content-Type") pt := types.PatchType(contentType) switch pt { case types.MergePatchType: res, err = jsonpatch.MergePatch(originScale, body) if err != nil { return nil, err } case types.JSONPatchType: patch, err := jsonpatch.DecodePatch(body) if err != nil { return nil, err } res, err = patch.Apply(originScale) if err != nil { return nil, err } default: return nil, fmt.Errorf("invalid patch type") } return &http.Response{StatusCode: http.StatusOK, Header: defaultHeaders(), Body: bytesBody(res)}, nil default: return nil, fmt.Errorf("unexpected request for URL %q with method %q", req.URL.String(), req.Method) } } fakeClient := &fakerest.RESTClient{ Client: fakerest.CreateHTTPClient(fakeReqHandler), NegotiatedSerializer: codecs.WithoutConversion(), GroupVersion: schema.GroupVersion{}, VersionedAPIPath: "/not/a/real/path", } resolver := NewDiscoveryScaleKindResolver(fakeDiscoveryClient) client := New(fakeClient, restMapper, dynamic.LegacyAPIPathResolverFunc, resolver) groupResources := []schema.GroupResource{ {Group: corev1.GroupName, Resource: "replicationcontrollers"}, {Group: extv1beta1.GroupName, Resource: "replicasets"}, {Group: appsv1beta2.GroupName, Resource: "deployments"}, {Group: "cheese.testing.k8s.io", Resource: "cheddars"}, } return client, groupResources } func TestGetScale(t *testing.T) { scaleClient, groupResources := fakeScaleClient(t) expectedScale := &autoscalingv1.Scale{ TypeMeta: metav1.TypeMeta{ Kind: "Scale", APIVersion: autoscalingv1.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "foo", }, Spec: autoscalingv1.ScaleSpec{Replicas: 10}, Status: autoscalingv1.ScaleStatus{ Replicas: 10, Selector: "foo=bar", }, } for _, groupResource := range groupResources { scale, err := scaleClient.Scales("default").Get(context.TODO(), groupResource, "foo", metav1.GetOptions{}) if !assert.NoError(t, err, "should have been able to fetch a scale for %s", groupResource.String()) { continue } assert.NotNil(t, scale, "should have returned a non-nil scale for %s", groupResource.String()) assert.Equal(t, expectedScale, scale, "should have returned the expected scale for %s", groupResource.String()) } } func TestUpdateScale(t *testing.T) { scaleClient, groupResources := fakeScaleClient(t) expectedScale := &autoscalingv1.Scale{ TypeMeta: metav1.TypeMeta{ Kind: "Scale", APIVersion: autoscalingv1.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "foo", }, Spec: autoscalingv1.ScaleSpec{Replicas: 10}, Status: autoscalingv1.ScaleStatus{ Replicas: 10, Selector: "foo=bar", }, } for _, groupResource := range groupResources { scale, err := scaleClient.Scales("default").Update(context.TODO(), groupResource, expectedScale, metav1.UpdateOptions{}) if !assert.NoError(t, err, "should have been able to fetch a scale for %s", groupResource.String()) { continue } assert.NotNil(t, scale, "should have returned a non-nil scale for %s", groupResource.String()) assert.Equal(t, expectedScale, scale, "should have returned the expected scale for %s", groupResource.String()) } } func TestPatchScale(t *testing.T) { scaleClient, groupResources := fakeScaleClient(t) expectedScale := &autoscalingv1.Scale{ TypeMeta: metav1.TypeMeta{ Kind: "Scale", APIVersion: autoscalingv1.SchemeGroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: "foo", }, Spec: autoscalingv1.ScaleSpec{Replicas: 5}, Status: autoscalingv1.ScaleStatus{ Replicas: 10, Selector: "foo=bar", }, } gvrs := make([]schema.GroupVersionResource, 0, len(groupResources)) for _, gr := range groupResources { switch gr.Group { case corev1.GroupName: gvrs = append(gvrs, gr.WithVersion(corev1.SchemeGroupVersion.Version)) case extv1beta1.GroupName: gvrs = append(gvrs, gr.WithVersion(extv1beta1.SchemeGroupVersion.Version)) case appsv1beta2.GroupName: gvrs = append(gvrs, gr.WithVersion(appsv1beta2.SchemeGroupVersion.Version)) default: // Group cheese.testing.k8s.io gvrs = append(gvrs, gr.WithVersion("v27alpha15")) } } patch := []byte(`{"spec":{"replicas":5}}`) for _, gvr := range gvrs { scale, err := scaleClient.Scales("default").Patch(context.TODO(), gvr, "foo", types.MergePatchType, patch, metav1.PatchOptions{}) if !assert.NoError(t, err, "should have been able to fetch a scale for %s", gvr.String()) { continue } assert.NotNil(t, scale, "should have returned a non-nil scale for %s", gvr.String()) assert.Equal(t, expectedScale, scale, "should have returned the expected scale for %s", gvr.String()) } patch = []byte(`[{"op":"replace","path":"/spec/replicas","value":5}]`) for _, gvr := range gvrs { scale, err := scaleClient.Scales("default").Patch(context.TODO(), gvr, "foo", types.JSONPatchType, patch, metav1.PatchOptions{}) if !assert.NoError(t, err, "should have been able to fetch a scale for %s", gvr.String()) { continue } assert.NotNil(t, scale, "should have returned a non-nil scale for %s", gvr.String()) assert.Equal(t, expectedScale, scale, "should have returned the expected scale for %s", gvr.String()) } } kubernetes-client-go-a2dfcab/scale/doc.go000066400000000000000000000015511472614177300205650ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package scale provides a polymorphic scale client capable of fetching // and updating Scale for any resource which implements the `scale` subresource, // as long as that subresource operates on a version of scale convertable to // autoscaling.Scale. package scale // import "k8s.io/client-go/scale" kubernetes-client-go-a2dfcab/scale/fake/000077500000000000000000000000001472614177300203755ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/fake/client.go000066400000000000000000000050201472614177300221770ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package fake provides a fake client interface to arbitrary Kubernetes // APIs that exposes common high level operations and exposes common // metadata. package fake import ( "context" autoscalingapi "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/scale" "k8s.io/client-go/testing" ) // FakeScaleClient provides a fake implementation of scale.ScalesGetter. type FakeScaleClient struct { testing.Fake } func (f *FakeScaleClient) Scales(namespace string) scale.ScaleInterface { return &fakeNamespacedScaleClient{ namespace: namespace, fake: &f.Fake, } } type fakeNamespacedScaleClient struct { namespace string fake *testing.Fake } func (f *fakeNamespacedScaleClient) Get(ctx context.Context, resource schema.GroupResource, name string, opts metav1.GetOptions) (*autoscalingapi.Scale, error) { obj, err := f.fake. Invokes(testing.NewGetSubresourceAction(resource.WithVersion(""), f.namespace, "scale", name), &autoscalingapi.Scale{}) if err != nil { return nil, err } return obj.(*autoscalingapi.Scale), err } func (f *fakeNamespacedScaleClient) Update(ctx context.Context, resource schema.GroupResource, scale *autoscalingapi.Scale, opts metav1.UpdateOptions) (*autoscalingapi.Scale, error) { obj, err := f.fake. Invokes(testing.NewUpdateSubresourceAction(resource.WithVersion(""), "scale", f.namespace, scale), &autoscalingapi.Scale{}) if err != nil { return nil, err } return obj.(*autoscalingapi.Scale), err } func (f *fakeNamespacedScaleClient) Patch(ctx context.Context, gvr schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions) (*autoscalingapi.Scale, error) { obj, err := f.fake. Invokes(testing.NewPatchSubresourceAction(gvr, f.namespace, name, pt, patch, "scale"), &autoscalingapi.Scale{}) if err != nil { return nil, err } return obj.(*autoscalingapi.Scale), err } kubernetes-client-go-a2dfcab/scale/interfaces.go000066400000000000000000000034221472614177300221420ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package scale import ( "context" autoscalingapi "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" ) // ScalesGetter can produce a ScaleInterface type ScalesGetter interface { // Scales produces a ScaleInterface for a particular namespace. // Set namespace to the empty string for non-namespaced resources. Scales(namespace string) ScaleInterface } // ScaleInterface can fetch and update scales for // resources in a particular namespace which implement // the scale subresource. type ScaleInterface interface { // Get fetches the scale of the given scalable resource. Get(ctx context.Context, resource schema.GroupResource, name string, opts metav1.GetOptions) (*autoscalingapi.Scale, error) // Update updates the scale of the given scalable resource. Update(ctx context.Context, resource schema.GroupResource, scale *autoscalingapi.Scale, opts metav1.UpdateOptions) (*autoscalingapi.Scale, error) // Patch patches the scale of the given scalable resource. Patch(ctx context.Context, gvr schema.GroupVersionResource, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions) (*autoscalingapi.Scale, error) } kubernetes-client-go-a2dfcab/scale/roundtrip_test.go000066400000000000000000000020031472614177300230760ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package scale import ( "testing" "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" ) // NB: this can't be in the scheme package, because importing' // scheme/autoscalingv1 from scheme causes a dependency loop from // conversions func TestRoundTrip(t *testing.T) { scheme := NewScaleConverter().Scheme() // we don't actually need any custom fuzzer funcs ATM -- the defaults // will do just fine roundtrip.RoundTripTestForScheme(t, scheme, nil) } kubernetes-client-go-a2dfcab/scale/scheme/000077500000000000000000000000001472614177300207335ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/scheme/appsint/000077500000000000000000000000001472614177300224115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/scheme/appsint/doc.go000066400000000000000000000016361472614177300235130ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package appsint contains the necessary scaffolding of the // internal version of extensions as required by conversion logic. // It doesn't have any of its own types -- it's just necessary to // get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. package appsint // import "k8s.io/client-go/scale/scheme/appsint" kubernetes-client-go-a2dfcab/scale/scheme/appsint/register.go000066400000000000000000000034371472614177300245730ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package appsint import ( appsv1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" scalescheme "k8s.io/client-go/scale/scheme" ) // GroupName is the group name use in this package const GroupName = appsv1beta2.GroupName // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) schema.GroupKind { return SchemeGroupVersion.WithKind(kind).GroupKind() } // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( // SchemeBuilder points to a list of functions added to Scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme applies all the stored functions to the scheme. AddToScheme = SchemeBuilder.AddToScheme ) // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &scalescheme.Scale{}, ) return nil } kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta1/000077500000000000000000000000001472614177300230625ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta1/conversion.go000066400000000000000000000045011472614177300255760ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package appsv1beta1 import ( "fmt" v1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/conversion" scheme "k8s.io/client-go/scale/scheme" ) func Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(in *scheme.ScaleStatus, out *v1beta1.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas out.Selector = nil out.TargetSelector = "" if in.Selector != nil { if in.Selector.MatchExpressions == nil || len(in.Selector.MatchExpressions) == 0 { out.Selector = in.Selector.MatchLabels } selector, err := metav1.LabelSelectorAsSelector(in.Selector) if err != nil { return fmt.Errorf("invalid label selector: %v", err) } out.TargetSelector = selector.String() } return nil } func Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(in *v1beta1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // Normally when 2 fields map to the same internal value we favor the old field, since // old clients can't be expected to know about new fields but clients that know about the // new field can be expected to know about the old field (though that's not quite true, due // to kubectl apply). However, these fields are readonly, so any non-nil value should work. if in.TargetSelector != "" { labelSelector, err := metav1.ParseToLabelSelector(in.TargetSelector) if err != nil { out.Selector = nil return fmt.Errorf("failed to parse target selector: %v", err) } out.Selector = labelSelector } else if in.Selector != nil { out.Selector = new(metav1.LabelSelector) selector := make(map[string]string) for key, val := range in.Selector { selector[key] = val } out.Selector.MatchLabels = selector } else { out.Selector = nil } return nil } kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta1/doc.go000066400000000000000000000013711472614177300241600ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta1 package appsv1beta1 // import "k8s.io/client-go/scale/scheme/appsv1beta1" kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta1/register.go000066400000000000000000000027721472614177300252450ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package appsv1beta1 import ( appsapiv1beta1 "k8s.io/api/apps/v1beta1" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = appsapiv1beta1.GroupName // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( localSchemeBuilder = &appsapiv1beta1.SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. localSchemeBuilder.Register() } kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta1/zz_generated.conversion.go000066400000000000000000000132401472614177300302560ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by conversion-gen. DO NOT EDIT. package appsv1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" scheme "k8s.io/client-go/scale/scheme" ) func init() { localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { if err := s.AddGeneratedConversionFunc((*v1beta1.Scale)(nil), (*scheme.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Scale_To_scheme_Scale(a.(*v1beta1.Scale), b.(*scheme.Scale), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*scheme.Scale)(nil), (*v1beta1.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_Scale_To_v1beta1_Scale(a.(*scheme.Scale), b.(*v1beta1.Scale), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*v1beta1.ScaleSpec)(nil), (*scheme.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(a.(*v1beta1.ScaleSpec), b.(*scheme.ScaleSpec), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*scheme.ScaleSpec)(nil), (*v1beta1.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(a.(*scheme.ScaleSpec), b.(*v1beta1.ScaleSpec), scope) }); err != nil { return err } if err := s.AddConversionFunc((*scheme.ScaleStatus)(nil), (*v1beta1.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(a.(*scheme.ScaleStatus), b.(*v1beta1.ScaleStatus), scope) }); err != nil { return err } if err := s.AddConversionFunc((*v1beta1.ScaleStatus)(nil), (*scheme.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(a.(*v1beta1.ScaleStatus), b.(*scheme.ScaleStatus), scope) }); err != nil { return err } return nil } func autoConvert_v1beta1_Scale_To_scheme_Scale(in *v1beta1.Scale, out *scheme.Scale, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { return err } if err := Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } // Convert_v1beta1_Scale_To_scheme_Scale is an autogenerated conversion function. func Convert_v1beta1_Scale_To_scheme_Scale(in *v1beta1.Scale, out *scheme.Scale, s conversion.Scope) error { return autoConvert_v1beta1_Scale_To_scheme_Scale(in, out, s) } func autoConvert_scheme_Scale_To_v1beta1_Scale(in *scheme.Scale, out *v1beta1.Scale, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { return err } if err := Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } // Convert_scheme_Scale_To_v1beta1_Scale is an autogenerated conversion function. func Convert_scheme_Scale_To_v1beta1_Scale(in *scheme.Scale, out *v1beta1.Scale, s conversion.Scope) error { return autoConvert_scheme_Scale_To_v1beta1_Scale(in, out, s) } func autoConvert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in *v1beta1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { out.Replicas = in.Replicas return nil } // Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec is an autogenerated conversion function. func Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in *v1beta1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { return autoConvert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in, out, s) } func autoConvert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(in *scheme.ScaleSpec, out *v1beta1.ScaleSpec, s conversion.Scope) error { out.Replicas = in.Replicas return nil } // Convert_scheme_ScaleSpec_To_v1beta1_ScaleSpec is an autogenerated conversion function. func Convert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(in *scheme.ScaleSpec, out *v1beta1.ScaleSpec, s conversion.Scope) error { return autoConvert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(in, out, s) } func autoConvert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(in *v1beta1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // WARNING: in.Selector requires manual conversion: inconvertible types (map[string]string vs *k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector) // WARNING: in.TargetSelector requires manual conversion: does not exist in peer-type return nil } func autoConvert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(in *scheme.ScaleStatus, out *v1beta1.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // WARNING: in.Selector requires manual conversion: inconvertible types (*k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector vs map[string]string) return nil } kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta2/000077500000000000000000000000001472614177300230635ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta2/conversion.go000066400000000000000000000045011472614177300255770ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package appsv1beta2 import ( "fmt" v1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/conversion" scheme "k8s.io/client-go/scale/scheme" ) func Convert_scheme_ScaleStatus_To_v1beta2_ScaleStatus(in *scheme.ScaleStatus, out *v1beta2.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas out.Selector = nil out.TargetSelector = "" if in.Selector != nil { if in.Selector.MatchExpressions == nil || len(in.Selector.MatchExpressions) == 0 { out.Selector = in.Selector.MatchLabels } selector, err := metav1.LabelSelectorAsSelector(in.Selector) if err != nil { return fmt.Errorf("invalid label selector: %v", err) } out.TargetSelector = selector.String() } return nil } func Convert_v1beta2_ScaleStatus_To_scheme_ScaleStatus(in *v1beta2.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // Normally when 2 fields map to the same internal value we favor the old field, since // old clients can't be expected to know about new fields but clients that know about the // new field can be expected to know about the old field (though that's not quite true, due // to kubectl apply). However, these fields are readonly, so any non-nil value should work. if in.TargetSelector != "" { labelSelector, err := metav1.ParseToLabelSelector(in.TargetSelector) if err != nil { out.Selector = nil return fmt.Errorf("failed to parse target selector: %v", err) } out.Selector = labelSelector } else if in.Selector != nil { out.Selector = new(metav1.LabelSelector) selector := make(map[string]string) for key, val := range in.Selector { selector[key] = val } out.Selector.MatchLabels = selector } else { out.Selector = nil } return nil } kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta2/doc.go000066400000000000000000000013711472614177300241610ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta2 package appsv1beta2 // import "k8s.io/client-go/scale/scheme/appsv1beta2" kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta2/register.go000066400000000000000000000027721472614177300252460ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package appsv1beta2 import ( appsapiv1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = appsapiv1beta2.GroupName // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( localSchemeBuilder = &appsapiv1beta2.SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. localSchemeBuilder.Register() } kubernetes-client-go-a2dfcab/scale/scheme/appsv1beta2/zz_generated.conversion.go000066400000000000000000000132401472614177300302570ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by conversion-gen. DO NOT EDIT. package appsv1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" scheme "k8s.io/client-go/scale/scheme" ) func init() { localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { if err := s.AddGeneratedConversionFunc((*v1beta2.Scale)(nil), (*scheme.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta2_Scale_To_scheme_Scale(a.(*v1beta2.Scale), b.(*scheme.Scale), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*scheme.Scale)(nil), (*v1beta2.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_Scale_To_v1beta2_Scale(a.(*scheme.Scale), b.(*v1beta2.Scale), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*v1beta2.ScaleSpec)(nil), (*scheme.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta2_ScaleSpec_To_scheme_ScaleSpec(a.(*v1beta2.ScaleSpec), b.(*scheme.ScaleSpec), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*scheme.ScaleSpec)(nil), (*v1beta2.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_ScaleSpec_To_v1beta2_ScaleSpec(a.(*scheme.ScaleSpec), b.(*v1beta2.ScaleSpec), scope) }); err != nil { return err } if err := s.AddConversionFunc((*scheme.ScaleStatus)(nil), (*v1beta2.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_ScaleStatus_To_v1beta2_ScaleStatus(a.(*scheme.ScaleStatus), b.(*v1beta2.ScaleStatus), scope) }); err != nil { return err } if err := s.AddConversionFunc((*v1beta2.ScaleStatus)(nil), (*scheme.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta2_ScaleStatus_To_scheme_ScaleStatus(a.(*v1beta2.ScaleStatus), b.(*scheme.ScaleStatus), scope) }); err != nil { return err } return nil } func autoConvert_v1beta2_Scale_To_scheme_Scale(in *v1beta2.Scale, out *scheme.Scale, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1beta2_ScaleSpec_To_scheme_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { return err } if err := Convert_v1beta2_ScaleStatus_To_scheme_ScaleStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } // Convert_v1beta2_Scale_To_scheme_Scale is an autogenerated conversion function. func Convert_v1beta2_Scale_To_scheme_Scale(in *v1beta2.Scale, out *scheme.Scale, s conversion.Scope) error { return autoConvert_v1beta2_Scale_To_scheme_Scale(in, out, s) } func autoConvert_scheme_Scale_To_v1beta2_Scale(in *scheme.Scale, out *v1beta2.Scale, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_scheme_ScaleSpec_To_v1beta2_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { return err } if err := Convert_scheme_ScaleStatus_To_v1beta2_ScaleStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } // Convert_scheme_Scale_To_v1beta2_Scale is an autogenerated conversion function. func Convert_scheme_Scale_To_v1beta2_Scale(in *scheme.Scale, out *v1beta2.Scale, s conversion.Scope) error { return autoConvert_scheme_Scale_To_v1beta2_Scale(in, out, s) } func autoConvert_v1beta2_ScaleSpec_To_scheme_ScaleSpec(in *v1beta2.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { out.Replicas = in.Replicas return nil } // Convert_v1beta2_ScaleSpec_To_scheme_ScaleSpec is an autogenerated conversion function. func Convert_v1beta2_ScaleSpec_To_scheme_ScaleSpec(in *v1beta2.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { return autoConvert_v1beta2_ScaleSpec_To_scheme_ScaleSpec(in, out, s) } func autoConvert_scheme_ScaleSpec_To_v1beta2_ScaleSpec(in *scheme.ScaleSpec, out *v1beta2.ScaleSpec, s conversion.Scope) error { out.Replicas = in.Replicas return nil } // Convert_scheme_ScaleSpec_To_v1beta2_ScaleSpec is an autogenerated conversion function. func Convert_scheme_ScaleSpec_To_v1beta2_ScaleSpec(in *scheme.ScaleSpec, out *v1beta2.ScaleSpec, s conversion.Scope) error { return autoConvert_scheme_ScaleSpec_To_v1beta2_ScaleSpec(in, out, s) } func autoConvert_v1beta2_ScaleStatus_To_scheme_ScaleStatus(in *v1beta2.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // WARNING: in.Selector requires manual conversion: inconvertible types (map[string]string vs *k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector) // WARNING: in.TargetSelector requires manual conversion: does not exist in peer-type return nil } func autoConvert_scheme_ScaleStatus_To_v1beta2_ScaleStatus(in *scheme.ScaleStatus, out *v1beta2.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // WARNING: in.Selector requires manual conversion: inconvertible types (*k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector vs map[string]string) return nil } kubernetes-client-go-a2dfcab/scale/scheme/autoscalingv1/000077500000000000000000000000001472614177300235135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/scheme/autoscalingv1/conversion.go000066400000000000000000000030271472614177300262310ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package autoscalingv1 import ( "fmt" v1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/conversion" scheme "k8s.io/client-go/scale/scheme" ) func Convert_scheme_ScaleStatus_To_v1_ScaleStatus(in *scheme.ScaleStatus, out *v1.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas out.Selector = "" if in.Selector != nil { selector, err := metav1.LabelSelectorAsSelector(in.Selector) if err != nil { return fmt.Errorf("invalid label selector: %v", err) } out.Selector = selector.String() } return nil } func Convert_v1_ScaleStatus_To_scheme_ScaleStatus(in *v1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas if in.Selector != "" { labelSelector, err := metav1.ParseToLabelSelector(in.Selector) if err != nil { out.Selector = nil return fmt.Errorf("failed to parse target selector: %v", err) } out.Selector = labelSelector } return nil } kubernetes-client-go-a2dfcab/scale/scheme/autoscalingv1/doc.go000066400000000000000000000013771472614177300246170ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/autoscaling/v1 package autoscalingv1 // import "k8s.io/client-go/scale/scheme/autoscalingv1" kubernetes-client-go-a2dfcab/scale/scheme/autoscalingv1/register.go000066400000000000000000000027771472614177300257030ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package autoscalingv1 import ( autoscalingapiv1 "k8s.io/api/autoscaling/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = autoscalingapiv1.GroupName // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( localSchemeBuilder = &autoscalingapiv1.SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. localSchemeBuilder.Register() } kubernetes-client-go-a2dfcab/scale/scheme/autoscalingv1/zz_generated.conversion.go000066400000000000000000000124701472614177300307130ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by conversion-gen. DO NOT EDIT. package autoscalingv1 import ( v1 "k8s.io/api/autoscaling/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" scheme "k8s.io/client-go/scale/scheme" ) func init() { localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { if err := s.AddGeneratedConversionFunc((*v1.Scale)(nil), (*scheme.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_Scale_To_scheme_Scale(a.(*v1.Scale), b.(*scheme.Scale), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*scheme.Scale)(nil), (*v1.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_Scale_To_v1_Scale(a.(*scheme.Scale), b.(*v1.Scale), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*v1.ScaleSpec)(nil), (*scheme.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_ScaleSpec_To_scheme_ScaleSpec(a.(*v1.ScaleSpec), b.(*scheme.ScaleSpec), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*scheme.ScaleSpec)(nil), (*v1.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_ScaleSpec_To_v1_ScaleSpec(a.(*scheme.ScaleSpec), b.(*v1.ScaleSpec), scope) }); err != nil { return err } if err := s.AddConversionFunc((*scheme.ScaleStatus)(nil), (*v1.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_ScaleStatus_To_v1_ScaleStatus(a.(*scheme.ScaleStatus), b.(*v1.ScaleStatus), scope) }); err != nil { return err } if err := s.AddConversionFunc((*v1.ScaleStatus)(nil), (*scheme.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_ScaleStatus_To_scheme_ScaleStatus(a.(*v1.ScaleStatus), b.(*scheme.ScaleStatus), scope) }); err != nil { return err } return nil } func autoConvert_v1_Scale_To_scheme_Scale(in *v1.Scale, out *scheme.Scale, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1_ScaleSpec_To_scheme_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { return err } if err := Convert_v1_ScaleStatus_To_scheme_ScaleStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } // Convert_v1_Scale_To_scheme_Scale is an autogenerated conversion function. func Convert_v1_Scale_To_scheme_Scale(in *v1.Scale, out *scheme.Scale, s conversion.Scope) error { return autoConvert_v1_Scale_To_scheme_Scale(in, out, s) } func autoConvert_scheme_Scale_To_v1_Scale(in *scheme.Scale, out *v1.Scale, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_scheme_ScaleSpec_To_v1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { return err } if err := Convert_scheme_ScaleStatus_To_v1_ScaleStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } // Convert_scheme_Scale_To_v1_Scale is an autogenerated conversion function. func Convert_scheme_Scale_To_v1_Scale(in *scheme.Scale, out *v1.Scale, s conversion.Scope) error { return autoConvert_scheme_Scale_To_v1_Scale(in, out, s) } func autoConvert_v1_ScaleSpec_To_scheme_ScaleSpec(in *v1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { out.Replicas = in.Replicas return nil } // Convert_v1_ScaleSpec_To_scheme_ScaleSpec is an autogenerated conversion function. func Convert_v1_ScaleSpec_To_scheme_ScaleSpec(in *v1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { return autoConvert_v1_ScaleSpec_To_scheme_ScaleSpec(in, out, s) } func autoConvert_scheme_ScaleSpec_To_v1_ScaleSpec(in *scheme.ScaleSpec, out *v1.ScaleSpec, s conversion.Scope) error { out.Replicas = in.Replicas return nil } // Convert_scheme_ScaleSpec_To_v1_ScaleSpec is an autogenerated conversion function. func Convert_scheme_ScaleSpec_To_v1_ScaleSpec(in *scheme.ScaleSpec, out *v1.ScaleSpec, s conversion.Scope) error { return autoConvert_scheme_ScaleSpec_To_v1_ScaleSpec(in, out, s) } func autoConvert_v1_ScaleStatus_To_scheme_ScaleStatus(in *v1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // WARNING: in.Selector requires manual conversion: inconvertible types (string vs *k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector) return nil } func autoConvert_scheme_ScaleStatus_To_v1_ScaleStatus(in *scheme.ScaleStatus, out *v1.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // WARNING: in.Selector requires manual conversion: inconvertible types (*k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector vs string) return nil } kubernetes-client-go-a2dfcab/scale/scheme/doc.go000066400000000000000000000014621472614177300220320ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:deepcopy-gen=package // Package scheme contains a runtime.Scheme to be used for serializing // and deserializing different versions of Scale, and for converting // in between them. package scheme // import "k8s.io/client-go/scale/scheme" kubernetes-client-go-a2dfcab/scale/scheme/extensionsint/000077500000000000000000000000001472614177300236455ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/scheme/extensionsint/doc.go000066400000000000000000000016601472614177300247440ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package extensionsint contains the necessary scaffolding of the // internal version of extensions as required by conversion logic. // It doesn't have any of its own types -- it's just necessary to // get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. package extensionsint // import "k8s.io/client-go/scale/scheme/extensionsint" kubernetes-client-go-a2dfcab/scale/scheme/extensionsint/register.go000066400000000000000000000034671472614177300260320ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package extensionsint import ( extensionsv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" scalescheme "k8s.io/client-go/scale/scheme" ) // GroupName is the group name use in this package const GroupName = extensionsv1beta1.GroupName // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) schema.GroupKind { return SchemeGroupVersion.WithKind(kind).GroupKind() } // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( // SchemeBuilder points to a list of functions added to Scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme applies all the stored functions to the scheme. AddToScheme = SchemeBuilder.AddToScheme ) // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &scalescheme.Scale{}, ) return nil } kubernetes-client-go-a2dfcab/scale/scheme/extensionsv1beta1/000077500000000000000000000000001472614177300243165ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/scale/scheme/extensionsv1beta1/conversion.go000066400000000000000000000045151472614177300270370ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package extensionsv1beta1 import ( "fmt" v1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/conversion" scheme "k8s.io/client-go/scale/scheme" ) func Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(in *scheme.ScaleStatus, out *v1beta1.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas out.Selector = nil out.TargetSelector = "" if in.Selector != nil { if in.Selector.MatchExpressions == nil || len(in.Selector.MatchExpressions) == 0 { out.Selector = in.Selector.MatchLabels } selector, err := metav1.LabelSelectorAsSelector(in.Selector) if err != nil { return fmt.Errorf("invalid label selector: %v", err) } out.TargetSelector = selector.String() } return nil } func Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(in *v1beta1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // Normally when 2 fields map to the same internal value we favor the old field, since // old clients can't be expected to know about new fields but clients that know about the // new field can be expected to know about the old field (though that's not quite true, due // to kubectl apply). However, these fields are readonly, so any non-nil value should work. if in.TargetSelector != "" { labelSelector, err := metav1.ParseToLabelSelector(in.TargetSelector) if err != nil { out.Selector = nil return fmt.Errorf("failed to parse target selector: %v", err) } out.Selector = labelSelector } else if in.Selector != nil { out.Selector = new(metav1.LabelSelector) selector := make(map[string]string) for key, val := range in.Selector { selector[key] = val } out.Selector.MatchLabels = selector } else { out.Selector = nil } return nil } kubernetes-client-go-a2dfcab/scale/scheme/extensionsv1beta1/doc.go000066400000000000000000000014131472614177300254110ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/extensions/v1beta1 package extensionsv1beta1 // import "k8s.io/client-go/scale/scheme/extensionsv1beta1" kubernetes-client-go-a2dfcab/scale/scheme/extensionsv1beta1/register.go000066400000000000000000000030301472614177300264650ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package extensionsv1beta1 import ( extensionsapiv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = extensionsapiv1beta1.GroupName // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( localSchemeBuilder = &extensionsapiv1beta1.SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. localSchemeBuilder.Register() } kubernetes-client-go-a2dfcab/scale/scheme/extensionsv1beta1/zz_generated.conversion.go000066400000000000000000000132541472614177300315170ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by conversion-gen. DO NOT EDIT. package extensionsv1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" scheme "k8s.io/client-go/scale/scheme" ) func init() { localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { if err := s.AddGeneratedConversionFunc((*v1beta1.Scale)(nil), (*scheme.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Scale_To_scheme_Scale(a.(*v1beta1.Scale), b.(*scheme.Scale), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*scheme.Scale)(nil), (*v1beta1.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_Scale_To_v1beta1_Scale(a.(*scheme.Scale), b.(*v1beta1.Scale), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*v1beta1.ScaleSpec)(nil), (*scheme.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(a.(*v1beta1.ScaleSpec), b.(*scheme.ScaleSpec), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*scheme.ScaleSpec)(nil), (*v1beta1.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(a.(*scheme.ScaleSpec), b.(*v1beta1.ScaleSpec), scope) }); err != nil { return err } if err := s.AddConversionFunc((*scheme.ScaleStatus)(nil), (*v1beta1.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(a.(*scheme.ScaleStatus), b.(*v1beta1.ScaleStatus), scope) }); err != nil { return err } if err := s.AddConversionFunc((*v1beta1.ScaleStatus)(nil), (*scheme.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(a.(*v1beta1.ScaleStatus), b.(*scheme.ScaleStatus), scope) }); err != nil { return err } return nil } func autoConvert_v1beta1_Scale_To_scheme_Scale(in *v1beta1.Scale, out *scheme.Scale, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { return err } if err := Convert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } // Convert_v1beta1_Scale_To_scheme_Scale is an autogenerated conversion function. func Convert_v1beta1_Scale_To_scheme_Scale(in *v1beta1.Scale, out *scheme.Scale, s conversion.Scope) error { return autoConvert_v1beta1_Scale_To_scheme_Scale(in, out, s) } func autoConvert_scheme_Scale_To_v1beta1_Scale(in *scheme.Scale, out *v1beta1.Scale, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { return err } if err := Convert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } // Convert_scheme_Scale_To_v1beta1_Scale is an autogenerated conversion function. func Convert_scheme_Scale_To_v1beta1_Scale(in *scheme.Scale, out *v1beta1.Scale, s conversion.Scope) error { return autoConvert_scheme_Scale_To_v1beta1_Scale(in, out, s) } func autoConvert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in *v1beta1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { out.Replicas = in.Replicas return nil } // Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec is an autogenerated conversion function. func Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in *v1beta1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { return autoConvert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in, out, s) } func autoConvert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(in *scheme.ScaleSpec, out *v1beta1.ScaleSpec, s conversion.Scope) error { out.Replicas = in.Replicas return nil } // Convert_scheme_ScaleSpec_To_v1beta1_ScaleSpec is an autogenerated conversion function. func Convert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(in *scheme.ScaleSpec, out *v1beta1.ScaleSpec, s conversion.Scope) error { return autoConvert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(in, out, s) } func autoConvert_v1beta1_ScaleStatus_To_scheme_ScaleStatus(in *v1beta1.ScaleStatus, out *scheme.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // WARNING: in.Selector requires manual conversion: inconvertible types (map[string]string vs *k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector) // WARNING: in.TargetSelector requires manual conversion: does not exist in peer-type return nil } func autoConvert_scheme_ScaleStatus_To_v1beta1_ScaleStatus(in *scheme.ScaleStatus, out *v1beta1.ScaleStatus, s conversion.Scope) error { out.Replicas = in.Replicas // WARNING: in.Selector requires manual conversion: inconvertible types (*k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector vs map[string]string) return nil } kubernetes-client-go-a2dfcab/scale/scheme/register.go000066400000000000000000000033531472614177300231120ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package scheme import ( autoscalingv1 "k8s.io/api/autoscaling/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = autoscalingv1.GroupName // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) schema.GroupKind { return SchemeGroupVersion.WithKind(kind).GroupKind() } // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( // SchemeBuilder points to a list of functions added to Scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme applies all the stored functions to the scheme. AddToScheme = SchemeBuilder.AddToScheme ) // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &Scale{}, ) return nil } kubernetes-client-go-a2dfcab/scale/scheme/types.go000066400000000000000000000040231472614177300224250ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package scheme import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // This file contains our own "internal" version of scale that we use for conversions, // since we can't use the main Kubernetes internal versions. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Scale represents a scaling request for a resource. type Scale struct { metav1.TypeMeta // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. // +optional Spec ScaleSpec // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only. // +optional Status ScaleStatus } // ScaleSpec describes the attributes of a scale subresource. type ScaleSpec struct { // desired number of instances for the scaled object. // +optional Replicas int32 } // ScaleStatus represents the current status of a scale subresource. type ScaleStatus struct { // actual number of observed instances of the scaled object. Replicas int32 // label query over pods that should match the replicas count. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors // +optional Selector *metav1.LabelSelector } kubernetes-client-go-a2dfcab/scale/scheme/zz_generated.deepcopy.go000066400000000000000000000047561472614177300255660ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by deepcopy-gen. DO NOT EDIT. package scheme import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Scale) DeepCopyInto(out *Scale) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec in.Status.DeepCopyInto(&out.Status) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scale. func (in *Scale) DeepCopy() *Scale { if in == nil { return nil } out := new(Scale) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *Scale) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ScaleSpec) DeepCopyInto(out *ScaleSpec) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleSpec. func (in *ScaleSpec) DeepCopy() *ScaleSpec { if in == nil { return nil } out := new(ScaleSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ScaleStatus) DeepCopyInto(out *ScaleStatus) { *out = *in if in.Selector != nil { in, out := &in.Selector, &out.Selector *out = new(v1.LabelSelector) (*in).DeepCopyInto(*out) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleStatus. func (in *ScaleStatus) DeepCopy() *ScaleStatus { if in == nil { return nil } out := new(ScaleStatus) in.DeepCopyInto(out) return out } kubernetes-client-go-a2dfcab/scale/util.go000066400000000000000000000156201472614177300207770ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package scale import ( "fmt" "strings" "sync" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/discovery" scalescheme "k8s.io/client-go/scale/scheme" scaleappsint "k8s.io/client-go/scale/scheme/appsint" scaleappsv1beta1 "k8s.io/client-go/scale/scheme/appsv1beta1" scaleappsv1beta2 "k8s.io/client-go/scale/scheme/appsv1beta2" scaleautoscaling "k8s.io/client-go/scale/scheme/autoscalingv1" scaleextint "k8s.io/client-go/scale/scheme/extensionsint" scaleext "k8s.io/client-go/scale/scheme/extensionsv1beta1" ) // PreferredResourceMapper determines the preferred version of a resource to scale type PreferredResourceMapper interface { // ResourceFor takes a partial resource and returns the preferred resource. ResourceFor(resource schema.GroupVersionResource) (preferredResource schema.GroupVersionResource, err error) } // Ensure a RESTMapper satisfies the PreferredResourceMapper interface var _ PreferredResourceMapper = meta.RESTMapper(nil) // ScaleKindResolver knows about the relationship between // resources and the GroupVersionKind of their scale subresources. type ScaleKindResolver interface { // ScaleForResource returns the GroupVersionKind of the // scale subresource for the given GroupVersionResource. ScaleForResource(resource schema.GroupVersionResource) (scaleVersion schema.GroupVersionKind, err error) } // discoveryScaleResolver is a ScaleKindResolver that uses // a DiscoveryInterface to associate resources with their // scale-kinds type discoveryScaleResolver struct { discoveryClient discovery.ServerResourcesInterface } func (r *discoveryScaleResolver) ScaleForResource(inputRes schema.GroupVersionResource) (scaleVersion schema.GroupVersionKind, err error) { groupVerResources, err := r.discoveryClient.ServerResourcesForGroupVersion(inputRes.GroupVersion().String()) if err != nil { return schema.GroupVersionKind{}, fmt.Errorf("unable to fetch discovery information for %s: %v", inputRes.String(), err) } for _, resource := range groupVerResources.APIResources { resourceParts := strings.SplitN(resource.Name, "/", 2) if len(resourceParts) != 2 || resourceParts[0] != inputRes.Resource || resourceParts[1] != "scale" { // skip non-scale resources, or scales for resources that we're not looking for continue } scaleGV := inputRes.GroupVersion() if resource.Group != "" && resource.Version != "" { scaleGV = schema.GroupVersion{ Group: resource.Group, Version: resource.Version, } } return scaleGV.WithKind(resource.Kind), nil } return schema.GroupVersionKind{}, fmt.Errorf("could not find scale subresource for %s in discovery information", inputRes.String()) } // cachedScaleKindResolver is a ScaleKindResolver that caches results // from another ScaleKindResolver, re-fetching on cache misses. type cachedScaleKindResolver struct { base ScaleKindResolver cache map[schema.GroupVersionResource]schema.GroupVersionKind mu sync.RWMutex } func (r *cachedScaleKindResolver) ScaleForResource(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { r.mu.RLock() gvk, isCached := r.cache[resource] r.mu.RUnlock() if isCached { return gvk, nil } // we could have multiple fetches of the same resources, but that's probably // better than limiting to only one reader at once (mu.Mutex), // or blocking checks for other resources while we fetch // (mu.Lock before fetch). gvk, err := r.base.ScaleForResource(resource) if err != nil { return schema.GroupVersionKind{}, err } r.mu.Lock() defer r.mu.Unlock() r.cache[resource] = gvk return gvk, nil } // NewDiscoveryScaleKindResolver creates a new ScaleKindResolver which uses information from the given // disovery client to resolve the correct Scale GroupVersionKind for different resources. func NewDiscoveryScaleKindResolver(client discovery.ServerResourcesInterface) ScaleKindResolver { base := &discoveryScaleResolver{ discoveryClient: client, } return &cachedScaleKindResolver{ base: base, cache: make(map[schema.GroupVersionResource]schema.GroupVersionKind), } } // ScaleConverter knows how to convert between external scale versions. type ScaleConverter struct { scheme *runtime.Scheme codecs serializer.CodecFactory internalVersioner runtime.GroupVersioner } // NewScaleConverter creates a new ScaleConverter for converting between // Scales in autoscaling/v1 and extensions/v1beta1. func NewScaleConverter() *ScaleConverter { scheme := runtime.NewScheme() utilruntime.Must(scaleautoscaling.AddToScheme(scheme)) utilruntime.Must(scalescheme.AddToScheme(scheme)) utilruntime.Must(scaleext.AddToScheme(scheme)) utilruntime.Must(scaleextint.AddToScheme(scheme)) utilruntime.Must(scaleappsint.AddToScheme(scheme)) utilruntime.Must(scaleappsv1beta1.AddToScheme(scheme)) utilruntime.Must(scaleappsv1beta2.AddToScheme(scheme)) return &ScaleConverter{ scheme: scheme, codecs: serializer.NewCodecFactory(scheme), internalVersioner: runtime.NewMultiGroupVersioner( scalescheme.SchemeGroupVersion, schema.GroupKind{Group: scaleext.GroupName, Kind: "Scale"}, schema.GroupKind{Group: scaleautoscaling.GroupName, Kind: "Scale"}, schema.GroupKind{Group: scaleappsv1beta1.GroupName, Kind: "Scale"}, schema.GroupKind{Group: scaleappsv1beta2.GroupName, Kind: "Scale"}, ), } } // Scheme returns the scheme used by this scale converter. func (c *ScaleConverter) Scheme() *runtime.Scheme { return c.scheme } func (c *ScaleConverter) Codecs() serializer.CodecFactory { return c.codecs } func (c *ScaleConverter) ScaleVersions() []schema.GroupVersion { return []schema.GroupVersion{ scaleautoscaling.SchemeGroupVersion, scalescheme.SchemeGroupVersion, scaleext.SchemeGroupVersion, scaleextint.SchemeGroupVersion, scaleappsint.SchemeGroupVersion, scaleappsv1beta1.SchemeGroupVersion, scaleappsv1beta2.SchemeGroupVersion, } } // ConvertToVersion converts the given *external* input object to the given output *external* output group-version. func (c *ScaleConverter) ConvertToVersion(in runtime.Object, outVersion schema.GroupVersion) (runtime.Object, error) { scaleInt, err := c.scheme.ConvertToVersion(in, c.internalVersioner) if err != nil { return nil, err } return c.scheme.ConvertToVersion(scaleInt, outVersion) } kubernetes-client-go-a2dfcab/testing/000077500000000000000000000000001472614177300200555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/testing/actions.go000066400000000000000000000651561472614177300220610ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "fmt" "path" "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" ) func NewRootGetAction(resource schema.GroupVersionResource, name string) GetActionImpl { return NewRootGetActionWithOptions(resource, name, metav1.GetOptions{}) } func NewRootGetActionWithOptions(resource schema.GroupVersionResource, name string, opts metav1.GetOptions) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Name = name action.GetOptions = opts return action } func NewGetAction(resource schema.GroupVersionResource, namespace, name string) GetActionImpl { return NewGetActionWithOptions(resource, namespace, name, metav1.GetOptions{}) } func NewGetActionWithOptions(resource schema.GroupVersionResource, namespace, name string, opts metav1.GetOptions) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Namespace = namespace action.Name = name action.GetOptions = opts return action } func NewGetSubresourceAction(resource schema.GroupVersionResource, namespace, subresource, name string) GetActionImpl { return NewGetSubresourceActionWithOptions(resource, namespace, subresource, name, metav1.GetOptions{}) } func NewGetSubresourceActionWithOptions(resource schema.GroupVersionResource, namespace, subresource, name string, opts metav1.GetOptions) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Subresource = subresource action.Namespace = namespace action.Name = name action.GetOptions = opts return action } func NewRootGetSubresourceAction(resource schema.GroupVersionResource, subresource, name string) GetActionImpl { return NewRootGetSubresourceActionWithOptions(resource, subresource, name, metav1.GetOptions{}) } func NewRootGetSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource, name string, opts metav1.GetOptions) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Subresource = subresource action.Name = name action.GetOptions = opts return action } func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts interface{}) ListActionImpl { action := ListActionImpl{} action.Verb = "list" action.Resource = resource action.Kind = kind labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} return action } func NewRootListActionWithOptions(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts metav1.ListOptions) ListActionImpl { action := ListActionImpl{} action.Verb = "list" action.Resource = resource action.Kind = kind action.ListOptions = opts labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} return action } func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, namespace string, opts interface{}) ListActionImpl { action := ListActionImpl{} action.Verb = "list" action.Resource = resource action.Kind = kind action.Namespace = namespace labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} return action } func NewListActionWithOptions(resource schema.GroupVersionResource, kind schema.GroupVersionKind, namespace string, opts metav1.ListOptions) ListActionImpl { action := ListActionImpl{} action.Verb = "list" action.Resource = resource action.Kind = kind action.Namespace = namespace action.ListOptions = opts labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} return action } func NewRootCreateAction(resource schema.GroupVersionResource, object runtime.Object) CreateActionImpl { return NewRootCreateActionWithOptions(resource, object, metav1.CreateOptions{}) } func NewRootCreateActionWithOptions(resource schema.GroupVersionResource, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Object = object action.CreateOptions = opts return action } func NewCreateAction(resource schema.GroupVersionResource, namespace string, object runtime.Object) CreateActionImpl { return NewCreateActionWithOptions(resource, namespace, object, metav1.CreateOptions{}) } func NewCreateActionWithOptions(resource schema.GroupVersionResource, namespace string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Namespace = namespace action.Object = object action.CreateOptions = opts return action } func NewRootCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource string, object runtime.Object) CreateActionImpl { return NewRootCreateSubresourceActionWithOptions(resource, name, subresource, object, metav1.CreateOptions{}) } func NewRootCreateSubresourceActionWithOptions(resource schema.GroupVersionResource, name, subresource string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Subresource = subresource action.Name = name action.Object = object action.CreateOptions = opts return action } func NewCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource, namespace string, object runtime.Object) CreateActionImpl { return NewCreateSubresourceActionWithOptions(resource, name, subresource, namespace, object, metav1.CreateOptions{}) } func NewCreateSubresourceActionWithOptions(resource schema.GroupVersionResource, name, subresource, namespace string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Namespace = namespace action.Subresource = subresource action.Name = name action.Object = object action.CreateOptions = opts return action } func NewRootUpdateAction(resource schema.GroupVersionResource, object runtime.Object) UpdateActionImpl { return NewRootUpdateActionWithOptions(resource, object, metav1.UpdateOptions{}) } func NewRootUpdateActionWithOptions(resource schema.GroupVersionResource, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource action.Object = object action.UpdateOptions = opts return action } func NewUpdateAction(resource schema.GroupVersionResource, namespace string, object runtime.Object) UpdateActionImpl { return NewUpdateActionWithOptions(resource, namespace, object, metav1.UpdateOptions{}) } func NewUpdateActionWithOptions(resource schema.GroupVersionResource, namespace string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource action.Namespace = namespace action.Object = object action.UpdateOptions = opts return action } func NewRootPatchAction(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte) PatchActionImpl { return NewRootPatchActionWithOptions(resource, name, pt, patch, metav1.PatchOptions{}) } func NewRootPatchActionWithOptions(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Name = name action.PatchType = pt action.Patch = patch action.PatchOptions = opts return action } func NewPatchAction(resource schema.GroupVersionResource, namespace string, name string, pt types.PatchType, patch []byte) PatchActionImpl { return NewPatchActionWithOptions(resource, namespace, name, pt, patch, metav1.PatchOptions{}) } func NewPatchActionWithOptions(resource schema.GroupVersionResource, namespace string, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Namespace = namespace action.Name = name action.PatchType = pt action.Patch = patch action.PatchOptions = opts return action } func NewRootPatchSubresourceAction(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { return NewRootPatchSubresourceActionWithOptions(resource, name, pt, patch, metav1.PatchOptions{}, subresources...) } func NewRootPatchSubresourceActionWithOptions(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions, subresources ...string) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Subresource = path.Join(subresources...) action.Name = name action.PatchType = pt action.Patch = patch action.PatchOptions = opts return action } func NewPatchSubresourceAction(resource schema.GroupVersionResource, namespace, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { return NewPatchSubresourceActionWithOptions(resource, namespace, name, pt, patch, metav1.PatchOptions{}, subresources...) } func NewPatchSubresourceActionWithOptions(resource schema.GroupVersionResource, namespace, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions, subresources ...string) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Subresource = path.Join(subresources...) action.Namespace = namespace action.Name = name action.PatchType = pt action.Patch = patch action.PatchOptions = opts return action } func NewRootUpdateSubresourceAction(resource schema.GroupVersionResource, subresource string, object runtime.Object) UpdateActionImpl { return NewRootUpdateSubresourceActionWithOptions(resource, subresource, object, metav1.UpdateOptions{}) } func NewRootUpdateSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource action.Subresource = subresource action.Object = object action.UpdateOptions = opts return action } func NewUpdateSubresourceAction(resource schema.GroupVersionResource, subresource string, namespace string, object runtime.Object) UpdateActionImpl { return NewUpdateSubresourceActionWithOptions(resource, subresource, namespace, object, metav1.UpdateOptions{}) } func NewUpdateSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, namespace string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource action.Subresource = subresource action.Namespace = namespace action.Object = object action.UpdateOptions = opts return action } func NewRootDeleteAction(resource schema.GroupVersionResource, name string) DeleteActionImpl { return NewRootDeleteActionWithOptions(resource, name, metav1.DeleteOptions{}) } func NewRootDeleteActionWithOptions(resource schema.GroupVersionResource, name string, opts metav1.DeleteOptions) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Name = name action.DeleteOptions = opts return action } func NewRootDeleteSubresourceAction(resource schema.GroupVersionResource, subresource string, name string) DeleteActionImpl { return NewRootDeleteSubresourceActionWithOptions(resource, subresource, name, metav1.DeleteOptions{}) } func NewRootDeleteSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, name string, opts metav1.DeleteOptions) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Subresource = subresource action.Name = name action.DeleteOptions = opts return action } func NewDeleteAction(resource schema.GroupVersionResource, namespace, name string) DeleteActionImpl { return NewDeleteActionWithOptions(resource, namespace, name, metav1.DeleteOptions{}) } func NewDeleteActionWithOptions(resource schema.GroupVersionResource, namespace, name string, opts metav1.DeleteOptions) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Namespace = namespace action.Name = name action.DeleteOptions = opts return action } func NewDeleteSubresourceAction(resource schema.GroupVersionResource, subresource, namespace, name string) DeleteActionImpl { return NewDeleteSubresourceActionWithOptions(resource, subresource, namespace, name, metav1.DeleteOptions{}) } func NewDeleteSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource, namespace, name string, opts metav1.DeleteOptions) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Subresource = subresource action.Namespace = namespace action.Name = name action.DeleteOptions = opts return action } func NewRootDeleteCollectionAction(resource schema.GroupVersionResource, opts interface{}) DeleteCollectionActionImpl { listOpts, _ := opts.(metav1.ListOptions) return NewRootDeleteCollectionActionWithOptions(resource, metav1.DeleteOptions{}, listOpts) } func NewRootDeleteCollectionActionWithOptions(resource schema.GroupVersionResource, deleteOpts metav1.DeleteOptions, listOpts metav1.ListOptions) DeleteCollectionActionImpl { action := DeleteCollectionActionImpl{} action.Verb = "delete-collection" action.Resource = resource action.DeleteOptions = deleteOpts action.ListOptions = listOpts labelSelector, fieldSelector, _ := ExtractFromListOptions(listOpts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} return action } func NewDeleteCollectionAction(resource schema.GroupVersionResource, namespace string, opts interface{}) DeleteCollectionActionImpl { listOpts, _ := opts.(metav1.ListOptions) return NewDeleteCollectionActionWithOptions(resource, namespace, metav1.DeleteOptions{}, listOpts) } func NewDeleteCollectionActionWithOptions(resource schema.GroupVersionResource, namespace string, deleteOpts metav1.DeleteOptions, listOpts metav1.ListOptions) DeleteCollectionActionImpl { action := DeleteCollectionActionImpl{} action.Verb = "delete-collection" action.Resource = resource action.Namespace = namespace action.DeleteOptions = deleteOpts action.ListOptions = listOpts labelSelector, fieldSelector, _ := ExtractFromListOptions(listOpts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} return action } func NewRootWatchAction(resource schema.GroupVersionResource, opts interface{}) WatchActionImpl { listOpts, _ := opts.(metav1.ListOptions) return NewRootWatchActionWithOptions(resource, listOpts) } func NewRootWatchActionWithOptions(resource schema.GroupVersionResource, opts metav1.ListOptions) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource action.ListOptions = opts labelSelector, fieldSelector, resourceVersion := ExtractFromListOptions(opts) action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, resourceVersion} return action } func ExtractFromListOptions(opts interface{}) (labelSelector labels.Selector, fieldSelector fields.Selector, resourceVersion string) { var err error switch t := opts.(type) { case metav1.ListOptions: labelSelector, err = labels.Parse(t.LabelSelector) if err != nil { panic(fmt.Errorf("invalid selector %q: %v", t.LabelSelector, err)) } fieldSelector, err = fields.ParseSelector(t.FieldSelector) if err != nil { panic(fmt.Errorf("invalid selector %q: %v", t.FieldSelector, err)) } resourceVersion = t.ResourceVersion default: panic(fmt.Errorf("expect a ListOptions %T", opts)) } if labelSelector == nil { labelSelector = labels.Everything() } if fieldSelector == nil { fieldSelector = fields.Everything() } return labelSelector, fieldSelector, resourceVersion } func NewWatchAction(resource schema.GroupVersionResource, namespace string, opts interface{}) WatchActionImpl { listOpts, _ := opts.(metav1.ListOptions) return NewWatchActionWithOptions(resource, namespace, listOpts) } func NewWatchActionWithOptions(resource schema.GroupVersionResource, namespace string, opts metav1.ListOptions) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource action.Namespace = namespace action.ListOptions = opts labelSelector, fieldSelector, resourceVersion := ExtractFromListOptions(opts) action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, resourceVersion} return action } func NewProxyGetAction(resource schema.GroupVersionResource, namespace, scheme, name, port, path string, params map[string]string) ProxyGetActionImpl { action := ProxyGetActionImpl{} action.Verb = "get" action.Resource = resource action.Namespace = namespace action.Scheme = scheme action.Name = name action.Port = port action.Path = path action.Params = params return action } type ListRestrictions struct { Labels labels.Selector Fields fields.Selector } type WatchRestrictions struct { Labels labels.Selector Fields fields.Selector ResourceVersion string } type Action interface { GetNamespace() string GetVerb() string GetResource() schema.GroupVersionResource GetSubresource() string Matches(verb, resource string) bool // DeepCopy is used to copy an action to avoid any risk of accidental mutation. Most people never need to call this // because the invocation logic deep copies before calls to storage and reactors. DeepCopy() Action } type GenericAction interface { Action GetValue() interface{} } type GetAction interface { Action GetName() string } type ListAction interface { Action GetListRestrictions() ListRestrictions } type CreateAction interface { Action GetObject() runtime.Object } type UpdateAction interface { Action GetObject() runtime.Object } type DeleteAction interface { Action GetName() string GetDeleteOptions() metav1.DeleteOptions } type DeleteCollectionAction interface { Action GetListRestrictions() ListRestrictions } type PatchAction interface { Action GetName() string GetPatchType() types.PatchType GetPatch() []byte } type WatchAction interface { Action GetWatchRestrictions() WatchRestrictions } type ProxyGetAction interface { Action GetScheme() string GetName() string GetPort() string GetPath() string GetParams() map[string]string } type ActionImpl struct { Namespace string Verb string Resource schema.GroupVersionResource Subresource string } func (a ActionImpl) GetNamespace() string { return a.Namespace } func (a ActionImpl) GetVerb() string { return a.Verb } func (a ActionImpl) GetResource() schema.GroupVersionResource { return a.Resource } func (a ActionImpl) GetSubresource() string { return a.Subresource } func (a ActionImpl) Matches(verb, resource string) bool { // Stay backwards compatible. if !strings.Contains(resource, "/") { return strings.EqualFold(verb, a.Verb) && strings.EqualFold(resource, a.Resource.Resource) } parts := strings.SplitN(resource, "/", 2) topresource, subresource := parts[0], parts[1] return strings.EqualFold(verb, a.Verb) && strings.EqualFold(topresource, a.Resource.Resource) && strings.EqualFold(subresource, a.Subresource) } func (a ActionImpl) DeepCopy() Action { ret := a return ret } type GenericActionImpl struct { ActionImpl Value interface{} } func (a GenericActionImpl) GetValue() interface{} { return a.Value } func (a GenericActionImpl) DeepCopy() Action { return GenericActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), // TODO this is wrong, but no worse than before Value: a.Value, } } type GetActionImpl struct { ActionImpl Name string GetOptions metav1.GetOptions } func (a GetActionImpl) GetName() string { return a.Name } func (a GetActionImpl) GetGetOptions() metav1.GetOptions { return a.GetOptions } func (a GetActionImpl) DeepCopy() Action { return GetActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), Name: a.Name, GetOptions: *a.GetOptions.DeepCopy(), } } type ListActionImpl struct { ActionImpl Kind schema.GroupVersionKind Name string ListRestrictions ListRestrictions ListOptions metav1.ListOptions } func (a ListActionImpl) GetKind() schema.GroupVersionKind { return a.Kind } func (a ListActionImpl) GetListRestrictions() ListRestrictions { return a.ListRestrictions } func (a ListActionImpl) GetListOptions() metav1.ListOptions { return a.ListOptions } func (a ListActionImpl) DeepCopy() Action { return ListActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), Kind: a.Kind, Name: a.Name, ListRestrictions: ListRestrictions{ Labels: a.ListRestrictions.Labels.DeepCopySelector(), Fields: a.ListRestrictions.Fields.DeepCopySelector(), }, ListOptions: *a.ListOptions.DeepCopy(), } } type CreateActionImpl struct { ActionImpl Name string Object runtime.Object CreateOptions metav1.CreateOptions } func (a CreateActionImpl) GetObject() runtime.Object { return a.Object } func (a CreateActionImpl) GetCreateOptions() metav1.CreateOptions { return a.CreateOptions } func (a CreateActionImpl) DeepCopy() Action { return CreateActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), Name: a.Name, Object: a.Object.DeepCopyObject(), CreateOptions: *a.CreateOptions.DeepCopy(), } } type UpdateActionImpl struct { ActionImpl Object runtime.Object UpdateOptions metav1.UpdateOptions } func (a UpdateActionImpl) GetObject() runtime.Object { return a.Object } func (a UpdateActionImpl) GetUpdateOptions() metav1.UpdateOptions { return a.UpdateOptions } func (a UpdateActionImpl) DeepCopy() Action { return UpdateActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), Object: a.Object.DeepCopyObject(), UpdateOptions: *a.UpdateOptions.DeepCopy(), } } type PatchActionImpl struct { ActionImpl Name string PatchType types.PatchType Patch []byte PatchOptions metav1.PatchOptions } func (a PatchActionImpl) GetName() string { return a.Name } func (a PatchActionImpl) GetPatch() []byte { return a.Patch } func (a PatchActionImpl) GetPatchType() types.PatchType { return a.PatchType } func (a PatchActionImpl) GetPatchOptions() metav1.PatchOptions { return a.PatchOptions } func (a PatchActionImpl) DeepCopy() Action { patch := make([]byte, len(a.Patch)) copy(patch, a.Patch) return PatchActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), Name: a.Name, PatchType: a.PatchType, Patch: patch, PatchOptions: *a.PatchOptions.DeepCopy(), } } type DeleteActionImpl struct { ActionImpl Name string DeleteOptions metav1.DeleteOptions } func (a DeleteActionImpl) GetName() string { return a.Name } func (a DeleteActionImpl) GetDeleteOptions() metav1.DeleteOptions { return a.DeleteOptions } func (a DeleteActionImpl) DeepCopy() Action { return DeleteActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), Name: a.Name, DeleteOptions: *a.DeleteOptions.DeepCopy(), } } type DeleteCollectionActionImpl struct { ActionImpl ListRestrictions ListRestrictions DeleteOptions metav1.DeleteOptions ListOptions metav1.ListOptions } func (a DeleteCollectionActionImpl) GetListRestrictions() ListRestrictions { return a.ListRestrictions } func (a DeleteCollectionActionImpl) GetDeleteOptions() metav1.DeleteOptions { return a.DeleteOptions } func (a DeleteCollectionActionImpl) GetListOptions() metav1.ListOptions { return a.ListOptions } func (a DeleteCollectionActionImpl) DeepCopy() Action { return DeleteCollectionActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), ListRestrictions: ListRestrictions{ Labels: a.ListRestrictions.Labels.DeepCopySelector(), Fields: a.ListRestrictions.Fields.DeepCopySelector(), }, DeleteOptions: *a.DeleteOptions.DeepCopy(), ListOptions: *a.ListOptions.DeepCopy(), } } type WatchActionImpl struct { ActionImpl WatchRestrictions WatchRestrictions ListOptions metav1.ListOptions } func (a WatchActionImpl) GetWatchRestrictions() WatchRestrictions { return a.WatchRestrictions } func (a WatchActionImpl) GetListOptions() metav1.ListOptions { return a.ListOptions } func (a WatchActionImpl) DeepCopy() Action { return WatchActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), WatchRestrictions: WatchRestrictions{ Labels: a.WatchRestrictions.Labels.DeepCopySelector(), Fields: a.WatchRestrictions.Fields.DeepCopySelector(), ResourceVersion: a.WatchRestrictions.ResourceVersion, }, ListOptions: *a.ListOptions.DeepCopy(), } } type ProxyGetActionImpl struct { ActionImpl Scheme string Name string Port string Path string Params map[string]string } func (a ProxyGetActionImpl) GetScheme() string { return a.Scheme } func (a ProxyGetActionImpl) GetName() string { return a.Name } func (a ProxyGetActionImpl) GetPort() string { return a.Port } func (a ProxyGetActionImpl) GetPath() string { return a.Path } func (a ProxyGetActionImpl) GetParams() map[string]string { return a.Params } func (a ProxyGetActionImpl) DeepCopy() Action { params := map[string]string{} for k, v := range a.Params { params[k] = v } return ProxyGetActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), Scheme: a.Scheme, Name: a.Name, Port: a.Port, Path: a.Path, Params: params, } } kubernetes-client-go-a2dfcab/testing/fake.go000066400000000000000000000164221472614177300213170ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "fmt" "sync" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" restclient "k8s.io/client-go/rest" ) // Fake implements client.Interface. Meant to be embedded into a struct to get // a default implementation. This makes faking out just the method you want to // test easier. type Fake struct { sync.RWMutex actions []Action // these may be castable to other types, but "Action" is the minimum // ReactionChain is the list of reactors that will be attempted for every // request in the order they are tried. ReactionChain []Reactor // WatchReactionChain is the list of watch reactors that will be attempted // for every request in the order they are tried. WatchReactionChain []WatchReactor // ProxyReactionChain is the list of proxy reactors that will be attempted // for every request in the order they are tried. ProxyReactionChain []ProxyReactor Resources []*metav1.APIResourceList } // Reactor is an interface to allow the composition of reaction functions. type Reactor interface { // Handles indicates whether or not this Reactor deals with a given // action. Handles(action Action) bool // React handles the action and returns results. It may choose to // delegate by indicated handled=false. React(action Action) (handled bool, ret runtime.Object, err error) } // WatchReactor is an interface to allow the composition of watch functions. type WatchReactor interface { // Handles indicates whether or not this Reactor deals with a given // action. Handles(action Action) bool // React handles a watch action and returns results. It may choose to // delegate by indicating handled=false. React(action Action) (handled bool, ret watch.Interface, err error) } // ProxyReactor is an interface to allow the composition of proxy get // functions. type ProxyReactor interface { // Handles indicates whether or not this Reactor deals with a given // action. Handles(action Action) bool // React handles a watch action and returns results. It may choose to // delegate by indicating handled=false. React(action Action) (handled bool, ret restclient.ResponseWrapper, err error) } // ReactionFunc is a function that returns an object or error for a given // Action. If "handled" is false, then the test client will ignore the // results and continue to the next ReactionFunc. A ReactionFunc can describe // reactions on subresources by testing the result of the action's // GetSubresource() method. type ReactionFunc func(action Action) (handled bool, ret runtime.Object, err error) // WatchReactionFunc is a function that returns a watch interface. If // "handled" is false, then the test client will ignore the results and // continue to the next ReactionFunc. type WatchReactionFunc func(action Action) (handled bool, ret watch.Interface, err error) // ProxyReactionFunc is a function that returns a ResponseWrapper interface // for a given Action. If "handled" is false, then the test client will // ignore the results and continue to the next ProxyReactionFunc. type ProxyReactionFunc func(action Action) (handled bool, ret restclient.ResponseWrapper, err error) // AddReactor appends a reactor to the end of the chain. func (c *Fake) AddReactor(verb, resource string, reaction ReactionFunc) { c.ReactionChain = append(c.ReactionChain, &SimpleReactor{verb, resource, reaction}) } // PrependReactor adds a reactor to the beginning of the chain. func (c *Fake) PrependReactor(verb, resource string, reaction ReactionFunc) { c.ReactionChain = append([]Reactor{&SimpleReactor{verb, resource, reaction}}, c.ReactionChain...) } // AddWatchReactor appends a reactor to the end of the chain. func (c *Fake) AddWatchReactor(resource string, reaction WatchReactionFunc) { c.Lock() defer c.Unlock() c.WatchReactionChain = append(c.WatchReactionChain, &SimpleWatchReactor{resource, reaction}) } // PrependWatchReactor adds a reactor to the beginning of the chain. func (c *Fake) PrependWatchReactor(resource string, reaction WatchReactionFunc) { c.Lock() defer c.Unlock() c.WatchReactionChain = append([]WatchReactor{&SimpleWatchReactor{resource, reaction}}, c.WatchReactionChain...) } // AddProxyReactor appends a reactor to the end of the chain. func (c *Fake) AddProxyReactor(resource string, reaction ProxyReactionFunc) { c.ProxyReactionChain = append(c.ProxyReactionChain, &SimpleProxyReactor{resource, reaction}) } // PrependProxyReactor adds a reactor to the beginning of the chain. func (c *Fake) PrependProxyReactor(resource string, reaction ProxyReactionFunc) { c.ProxyReactionChain = append([]ProxyReactor{&SimpleProxyReactor{resource, reaction}}, c.ProxyReactionChain...) } // Invokes records the provided Action and then invokes the ReactionFunc that // handles the action if one exists. defaultReturnObj is expected to be of the // same type a normal call would return. func (c *Fake) Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error) { c.Lock() defer c.Unlock() actionCopy := action.DeepCopy() c.actions = append(c.actions, action.DeepCopy()) for _, reactor := range c.ReactionChain { if !reactor.Handles(actionCopy) { continue } handled, ret, err := reactor.React(actionCopy) if !handled { continue } return ret, err } return defaultReturnObj, nil } // InvokesWatch records the provided Action and then invokes the ReactionFunc // that handles the action if one exists. func (c *Fake) InvokesWatch(action Action) (watch.Interface, error) { c.Lock() defer c.Unlock() actionCopy := action.DeepCopy() c.actions = append(c.actions, action.DeepCopy()) for _, reactor := range c.WatchReactionChain { if !reactor.Handles(actionCopy) { continue } handled, ret, err := reactor.React(actionCopy) if !handled { continue } return ret, err } return nil, fmt.Errorf("unhandled watch: %#v", action) } // InvokesProxy records the provided Action and then invokes the ReactionFunc // that handles the action if one exists. func (c *Fake) InvokesProxy(action Action) restclient.ResponseWrapper { c.Lock() defer c.Unlock() actionCopy := action.DeepCopy() c.actions = append(c.actions, action.DeepCopy()) for _, reactor := range c.ProxyReactionChain { if !reactor.Handles(actionCopy) { continue } handled, ret, err := reactor.React(actionCopy) if !handled || err != nil { continue } return ret } return nil } // ClearActions clears the history of actions called on the fake client. func (c *Fake) ClearActions() { c.Lock() defer c.Unlock() c.actions = make([]Action, 0) } // Actions returns a chronologically ordered slice fake actions called on the // fake client. func (c *Fake) Actions() []Action { c.RLock() defer c.RUnlock() fa := make([]Action, len(c.actions)) copy(fa, c.actions) return fa } kubernetes-client-go-a2dfcab/testing/fake_test.go000066400000000000000000000115531472614177300223560ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "testing" "github.com/stretchr/testify/assert" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) func TestOriginalObjectCaptured(t *testing.T) { // this ReactionFunc sets the resources SelfLink const testSelfLink = "some-value" reactors := []ReactionFunc{ func(action Action) (bool, runtime.Object, error) { createAction := action.(CreateActionImpl) accessor, err := meta.Accessor(createAction.Object) if err != nil { return false, nil, err } // set any field on the resource accessor.SetSelfLink(testSelfLink) return true, createAction.Object, nil }, } // create a new Fake with the test reactors f := &Fake{} for _, r := range reactors { f.AddReactor("", "", r) } // construct a test resource testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} testObj := getArbitraryResource(testResource, "test_name", "test_namespace") // create a fake CreateAction action := CreateActionImpl{ Object: testObj, } // execute the reaction chain ret, err := f.Invokes(action, nil) assert.NoError(t, err, "running Invokes failed") // obtain a metadata accessor for the returned resource accessor, err := meta.Accessor(ret) if err != nil { t.Fatalf("unexpected error: %v", err) } // validate that the returned resource was modified by the ReactionFunc if accessor.GetSelfLink() != testSelfLink { t.Errorf("expected resource returned by Invokes to be modified by the ReactionFunc") } // verify one action was performed if len(f.actions) != 1 { t.Errorf("expected 1 action to be executed") t.FailNow() } // check to ensure the recorded action has not been modified by the chain createAction := f.actions[0].(CreateActionImpl) accessor, err = meta.Accessor(createAction.Object) if err != nil { t.Fatalf("unexpected error: %v", err) } if accessor.GetSelfLink() != "" { t.Errorf("expected Action recorded to not be modified by ReactionFunc but it was") } } func TestReactorChangesPersisted(t *testing.T) { // this ReactionFunc sets the resources SelfLink const testSelfLink = "some-value" reactors := []ReactionFunc{ func(action Action) (bool, runtime.Object, error) { createAction := action.(CreateActionImpl) accessor, err := meta.Accessor(createAction.Object) if err != nil { return false, nil, err } // set any field on the resource accessor.SetSelfLink(testSelfLink) return false, createAction.Object, nil }, func(action Action) (bool, runtime.Object, error) { createAction := action.(CreateActionImpl) accessor, err := meta.Accessor(createAction.Object) if err != nil { return false, nil, err } // ensure the selfLink is set to testSelfLink already if accessor.GetSelfLink() != testSelfLink { t.Errorf("expected resource passed to second reactor to be modified by first reactor") } return true, createAction.Object, nil }, } // create a new Fake with the test reactors f := &Fake{} for _, r := range reactors { f.AddReactor("", "", r) } // construct a test resource testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} testObj := getArbitraryResource(testResource, "test_name", "test_namespace") // create a fake CreateAction action := CreateActionImpl{ Object: testObj, } // execute the reaction chain ret, err := f.Invokes(action, nil) assert.NoError(t, err, "running Invokes failed") // obtain a metadata accessor for the returned resource accessor, err := meta.Accessor(ret) if err != nil { t.Fatalf("unexpected error: %v", err) } // validate that the returned resource was modified by the ReactionFunc if accessor.GetSelfLink() != testSelfLink { t.Errorf("expected resource returned by Invokes to be modified by the ReactionFunc") } // verify one action was performed if len(f.actions) != 1 { t.Errorf("expected 1 action to be executed") t.FailNow() } // check to ensure the recorded action has not been modified by the chain createAction := f.actions[0].(CreateActionImpl) accessor, err = meta.Accessor(createAction.Object) if err != nil { t.Fatalf("unexpected error: %v", err) } if accessor.GetSelfLink() != "" { t.Errorf("expected Action recorded to not be modified by ReactionFunc but it was") } } kubernetes-client-go-a2dfcab/testing/fixture.go000066400000000000000000000735601472614177300221050ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "fmt" "reflect" "sigs.k8s.io/structured-merge-diff/v4/typed" "sigs.k8s.io/yaml" "sort" "strings" "sync" jsonpatch "gopkg.in/evanphx/json-patch.v4" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/meta/testrestmapper" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/managedfields" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apimachinery/pkg/watch" restclient "k8s.io/client-go/rest" ) // ObjectTracker keeps track of objects. It is intended to be used to // fake calls to a server by returning objects based on their kind, // namespace and name. type ObjectTracker interface { // Add adds an object to the tracker. If object being added // is a list, its items are added separately. Add(obj runtime.Object) error // Get retrieves the object by its kind, namespace and name. Get(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.GetOptions) (runtime.Object, error) // Create adds an object to the tracker in the specified namespace. Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.CreateOptions) error // Update updates an existing object in the tracker in the specified namespace. Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.UpdateOptions) error // Patch patches an existing object in the tracker in the specified namespace. Patch(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.PatchOptions) error // Apply applies an object in the tracker in the specified namespace. Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, opts ...metav1.PatchOptions) error // List retrieves all objects of a given kind in the given // namespace. Only non-List kinds are accepted. List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string, opts ...metav1.ListOptions) (runtime.Object, error) // Delete deletes an existing object from the tracker. If object // didn't exist in the tracker prior to deletion, Delete returns // no error. Delete(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.DeleteOptions) error // Watch watches objects from the tracker. Watch returns a channel // which will push added / modified / deleted object. Watch(gvr schema.GroupVersionResource, ns string, opts ...metav1.ListOptions) (watch.Interface, error) } // ObjectScheme abstracts the implementation of common operations on objects. type ObjectScheme interface { runtime.ObjectCreater runtime.ObjectTyper } // ObjectReaction returns a ReactionFunc that applies core.Action to // the given tracker. // // If tracker also implements ManagedFieldObjectTracker, then managed fields // will be handled by the tracker and apply patch actions will be evaluated // using the field manager and will take field ownership into consideration. // Without a ManagedFieldObjectTracker, apply patch actions do not consider // field ownership. // // WARNING: There is no server side defaulting, validation, or conversion handled // by the fake client and subresources are not handled accurately (fields in the // root resource are not automatically updated when a scale resource is updated, for example). func ObjectReaction(tracker ObjectTracker) ReactionFunc { reactor := objectTrackerReact{tracker: tracker} return func(action Action) (bool, runtime.Object, error) { // Here and below we need to switch on implementation types, // not on interfaces, as some interfaces are identical // (e.g. UpdateAction and CreateAction), so if we use them, // updates and creates end up matching the same case branch. switch action := action.(type) { case ListActionImpl: obj, err := reactor.List(action) return true, obj, err case GetActionImpl: obj, err := reactor.Get(action) return true, obj, err case CreateActionImpl: obj, err := reactor.Create(action) return true, obj, err case UpdateActionImpl: obj, err := reactor.Update(action) return true, obj, err case DeleteActionImpl: obj, err := reactor.Delete(action) return true, obj, err case PatchActionImpl: if action.GetPatchType() == types.ApplyPatchType { obj, err := reactor.Apply(action) return true, obj, err } obj, err := reactor.Patch(action) return true, obj, err default: return false, nil, fmt.Errorf("no reaction implemented for %s", action) } } } type objectTrackerReact struct { tracker ObjectTracker } func (o objectTrackerReact) List(action ListActionImpl) (runtime.Object, error) { return o.tracker.List(action.GetResource(), action.GetKind(), action.GetNamespace(), action.ListOptions) } func (o objectTrackerReact) Get(action GetActionImpl) (runtime.Object, error) { return o.tracker.Get(action.GetResource(), action.GetNamespace(), action.GetName(), action.GetOptions) } func (o objectTrackerReact) Create(action CreateActionImpl) (runtime.Object, error) { ns := action.GetNamespace() gvr := action.GetResource() objMeta, err := meta.Accessor(action.GetObject()) if err != nil { return nil, err } if action.GetSubresource() == "" { err = o.tracker.Create(gvr, action.GetObject(), ns, action.CreateOptions) if err != nil { return nil, err } } else { oldObj, getOldObjErr := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) if getOldObjErr != nil { return nil, getOldObjErr } // Check whether the existing historical object type is the same as the current operation object type that needs to be updated, and if it is the same, perform the update operation. if reflect.TypeOf(oldObj) == reflect.TypeOf(action.GetObject()) { // TODO: Currently we're handling subresource creation as an update // on the enclosing resource. This works for some subresources but // might not be generic enough. err = o.tracker.Update(gvr, action.GetObject(), ns, metav1.UpdateOptions{ DryRun: action.CreateOptions.DryRun, FieldManager: action.CreateOptions.FieldManager, FieldValidation: action.CreateOptions.FieldValidation, }) } else { // If the historical object type is different from the current object type, need to make sure we return the object submitted,don't persist the submitted object in the tracker. return action.GetObject(), nil } } if err != nil { return nil, err } obj, err := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) return obj, err } func (o objectTrackerReact) Update(action UpdateActionImpl) (runtime.Object, error) { ns := action.GetNamespace() gvr := action.GetResource() objMeta, err := meta.Accessor(action.GetObject()) if err != nil { return nil, err } err = o.tracker.Update(gvr, action.GetObject(), ns, action.UpdateOptions) if err != nil { return nil, err } obj, err := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) return obj, err } func (o objectTrackerReact) Delete(action DeleteActionImpl) (runtime.Object, error) { err := o.tracker.Delete(action.GetResource(), action.GetNamespace(), action.GetName(), action.DeleteOptions) return nil, err } func (o objectTrackerReact) Apply(action PatchActionImpl) (runtime.Object, error) { ns := action.GetNamespace() gvr := action.GetResource() patchObj := &unstructured.Unstructured{Object: map[string]interface{}{}} if err := yaml.Unmarshal(action.GetPatch(), &patchObj.Object); err != nil { return nil, err } err := o.tracker.Apply(gvr, patchObj, ns, action.PatchOptions) if err != nil { return nil, err } obj, err := o.tracker.Get(gvr, ns, action.GetName(), metav1.GetOptions{}) return obj, err } func (o objectTrackerReact) Patch(action PatchActionImpl) (runtime.Object, error) { ns := action.GetNamespace() gvr := action.GetResource() obj, err := o.tracker.Get(gvr, ns, action.GetName(), metav1.GetOptions{}) if err != nil { return nil, err } old, err := json.Marshal(obj) if err != nil { return nil, err } // reset the object in preparation to unmarshal, since unmarshal does not guarantee that fields // in obj that are removed by patch are cleared value := reflect.ValueOf(obj) value.Elem().Set(reflect.New(value.Type().Elem()).Elem()) switch action.GetPatchType() { case types.JSONPatchType: patch, err := jsonpatch.DecodePatch(action.GetPatch()) if err != nil { return nil, err } modified, err := patch.Apply(old) if err != nil { return nil, err } if err = json.Unmarshal(modified, obj); err != nil { return nil, err } case types.MergePatchType: modified, err := jsonpatch.MergePatch(old, action.GetPatch()) if err != nil { return nil, err } if err := json.Unmarshal(modified, obj); err != nil { return nil, err } case types.StrategicMergePatchType: mergedByte, err := strategicpatch.StrategicMergePatch(old, action.GetPatch(), obj) if err != nil { return nil, err } if err = json.Unmarshal(mergedByte, obj); err != nil { return nil, err } default: return nil, fmt.Errorf("PatchType %s is not supported", action.GetPatchType()) } if err = o.tracker.Patch(gvr, obj, ns, action.PatchOptions); err != nil { return nil, err } return obj, nil } type tracker struct { scheme ObjectScheme decoder runtime.Decoder lock sync.RWMutex objects map[schema.GroupVersionResource]map[types.NamespacedName]runtime.Object // The value type of watchers is a map of which the key is either a namespace or // all/non namespace aka "" and its value is list of fake watchers. // Manipulations on resources will broadcast the notification events into the // watchers' channel. Note that too many unhandled events (currently 100, // see apimachinery/pkg/watch.DefaultChanSize) will cause a panic. watchers map[schema.GroupVersionResource]map[string][]*watch.RaceFreeFakeWatcher } var _ ObjectTracker = &tracker{} // NewObjectTracker returns an ObjectTracker that can be used to keep track // of objects for the fake clientset. Mostly useful for unit tests. func NewObjectTracker(scheme ObjectScheme, decoder runtime.Decoder) ObjectTracker { return &tracker{ scheme: scheme, decoder: decoder, objects: make(map[schema.GroupVersionResource]map[types.NamespacedName]runtime.Object), watchers: make(map[schema.GroupVersionResource]map[string][]*watch.RaceFreeFakeWatcher), } } func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string, opts ...metav1.ListOptions) (runtime.Object, error) { _, err := assertOptionalSingleArgument(opts) if err != nil { return nil, err } // Heuristic for list kind: original kind + List suffix. Might // not always be true but this tracker has a pretty limited // understanding of the actual API model. listGVK := gvk listGVK.Kind = listGVK.Kind + "List" // GVK does have the concept of "internal version". The scheme recognizes // the runtime.APIVersionInternal, but not the empty string. if listGVK.Version == "" { listGVK.Version = runtime.APIVersionInternal } list, err := t.scheme.New(listGVK) if err != nil { return nil, err } if !meta.IsListType(list) { return nil, fmt.Errorf("%q is not a list type", listGVK.Kind) } t.lock.RLock() defer t.lock.RUnlock() objs, ok := t.objects[gvr] if !ok { return list, nil } matchingObjs, err := filterByNamespace(objs, ns) if err != nil { return nil, err } if err := meta.SetList(list, matchingObjs); err != nil { return nil, err } return list.DeepCopyObject(), nil } func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string, opts ...metav1.ListOptions) (watch.Interface, error) { _, err := assertOptionalSingleArgument(opts) if err != nil { return nil, err } t.lock.Lock() defer t.lock.Unlock() fakewatcher := watch.NewRaceFreeFake() if _, exists := t.watchers[gvr]; !exists { t.watchers[gvr] = make(map[string][]*watch.RaceFreeFakeWatcher) } t.watchers[gvr][ns] = append(t.watchers[gvr][ns], fakewatcher) return fakewatcher, nil } func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.GetOptions) (runtime.Object, error) { _, err := assertOptionalSingleArgument(opts) if err != nil { return nil, err } errNotFound := apierrors.NewNotFound(gvr.GroupResource(), name) t.lock.RLock() defer t.lock.RUnlock() objs, ok := t.objects[gvr] if !ok { return nil, errNotFound } matchingObj, ok := objs[types.NamespacedName{Namespace: ns, Name: name}] if !ok { return nil, errNotFound } // Only one object should match in the tracker if it works // correctly, as Add/Update methods enforce kind/namespace/name // uniqueness. obj := matchingObj.DeepCopyObject() if status, ok := obj.(*metav1.Status); ok { if status.Status != metav1.StatusSuccess { return nil, &apierrors.StatusError{ErrStatus: *status} } } return obj, nil } func (t *tracker) Add(obj runtime.Object) error { if meta.IsListType(obj) { return t.addList(obj, false) } objMeta, err := meta.Accessor(obj) if err != nil { return err } gvks, _, err := t.scheme.ObjectKinds(obj) if err != nil { return err } if partial, ok := obj.(*metav1.PartialObjectMetadata); ok && len(partial.TypeMeta.APIVersion) > 0 { gvks = []schema.GroupVersionKind{partial.TypeMeta.GroupVersionKind()} } if len(gvks) == 0 { return fmt.Errorf("no registered kinds for %v", obj) } for _, gvk := range gvks { // NOTE: UnsafeGuessKindToResource is a heuristic and default match. The // actual registration in apiserver can specify arbitrary route for a // gvk. If a test uses such objects, it cannot preset the tracker with // objects via Add(). Instead, it should trigger the Create() function // of the tracker, where an arbitrary gvr can be specified. gvr, _ := meta.UnsafeGuessKindToResource(gvk) // Resource doesn't have the concept of "__internal" version, just set it to "". if gvr.Version == runtime.APIVersionInternal { gvr.Version = "" } err := t.add(gvr, obj, objMeta.GetNamespace(), false) if err != nil { return err } } return nil } func (t *tracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.CreateOptions) error { _, err := assertOptionalSingleArgument(opts) if err != nil { return err } return t.add(gvr, obj, ns, false) } func (t *tracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.UpdateOptions) error { _, err := assertOptionalSingleArgument(opts) if err != nil { return err } return t.add(gvr, obj, ns, true) } func (t *tracker) Patch(gvr schema.GroupVersionResource, patchedObject runtime.Object, ns string, opts ...metav1.PatchOptions) error { _, err := assertOptionalSingleArgument(opts) if err != nil { return err } return t.add(gvr, patchedObject, ns, true) } func (t *tracker) Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, opts ...metav1.PatchOptions) error { _, err := assertOptionalSingleArgument(opts) if err != nil { return err } applyConfigurationMeta, err := meta.Accessor(applyConfiguration) if err != nil { return err } obj, err := t.Get(gvr, ns, applyConfigurationMeta.GetName(), metav1.GetOptions{}) if err != nil { return err } old, err := json.Marshal(obj) if err != nil { return err } // reset the object in preparation to unmarshal, since unmarshal does not guarantee that fields // in obj that are removed by patch are cleared value := reflect.ValueOf(obj) value.Elem().Set(reflect.New(value.Type().Elem()).Elem()) // For backward compatibility with behavior 1.30 and earlier, continue to handle apply // via strategic merge patch (clients may use fake.NewClientset and ManagedFieldObjectTracker // for full field manager support). patch, err := json.Marshal(applyConfiguration) if err != nil { return err } mergedByte, err := strategicpatch.StrategicMergePatch(old, patch, obj) if err != nil { return err } if err = json.Unmarshal(mergedByte, obj); err != nil { return err } return t.add(gvr, obj, ns, true) } func (t *tracker) getWatches(gvr schema.GroupVersionResource, ns string) []*watch.RaceFreeFakeWatcher { watches := []*watch.RaceFreeFakeWatcher{} if t.watchers[gvr] != nil { if w := t.watchers[gvr][ns]; w != nil { watches = append(watches, w...) } if ns != metav1.NamespaceAll { if w := t.watchers[gvr][metav1.NamespaceAll]; w != nil { watches = append(watches, w...) } } } return watches } func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns string, replaceExisting bool) error { t.lock.Lock() defer t.lock.Unlock() gr := gvr.GroupResource() // To avoid the object from being accidentally modified by caller // after it's been added to the tracker, we always store the deep // copy. obj = obj.DeepCopyObject() newMeta, err := meta.Accessor(obj) if err != nil { return err } // Propagate namespace to the new object if hasn't already been set. if len(newMeta.GetNamespace()) == 0 { newMeta.SetNamespace(ns) } if ns != newMeta.GetNamespace() { msg := fmt.Sprintf("request namespace does not match object namespace, request: %q object: %q", ns, newMeta.GetNamespace()) return apierrors.NewBadRequest(msg) } _, ok := t.objects[gvr] if !ok { t.objects[gvr] = make(map[types.NamespacedName]runtime.Object) } namespacedName := types.NamespacedName{Namespace: newMeta.GetNamespace(), Name: newMeta.GetName()} if _, ok = t.objects[gvr][namespacedName]; ok { if replaceExisting { for _, w := range t.getWatches(gvr, ns) { // To avoid the object from being accidentally modified by watcher w.Modify(obj.DeepCopyObject()) } t.objects[gvr][namespacedName] = obj return nil } return apierrors.NewAlreadyExists(gr, newMeta.GetName()) } if replaceExisting { // Tried to update but no matching object was found. return apierrors.NewNotFound(gr, newMeta.GetName()) } t.objects[gvr][namespacedName] = obj for _, w := range t.getWatches(gvr, ns) { // To avoid the object from being accidentally modified by watcher w.Add(obj.DeepCopyObject()) } return nil } func (t *tracker) addList(obj runtime.Object, replaceExisting bool) error { list, err := meta.ExtractList(obj) if err != nil { return err } errs := runtime.DecodeList(list, t.decoder) if len(errs) > 0 { return errs[0] } for _, obj := range list { if err := t.Add(obj); err != nil { return err } } return nil } func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.DeleteOptions) error { _, err := assertOptionalSingleArgument(opts) if err != nil { return err } t.lock.Lock() defer t.lock.Unlock() objs, ok := t.objects[gvr] if !ok { return apierrors.NewNotFound(gvr.GroupResource(), name) } namespacedName := types.NamespacedName{Namespace: ns, Name: name} obj, ok := objs[namespacedName] if !ok { return apierrors.NewNotFound(gvr.GroupResource(), name) } delete(objs, namespacedName) for _, w := range t.getWatches(gvr, ns) { w.Delete(obj.DeepCopyObject()) } return nil } type managedFieldObjectTracker struct { ObjectTracker scheme ObjectScheme objectConverter runtime.ObjectConvertor mapper meta.RESTMapper typeConverter managedfields.TypeConverter } var _ ObjectTracker = &managedFieldObjectTracker{} // NewFieldManagedObjectTracker returns an ObjectTracker that can be used to keep track // of objects and managed fields for the fake clientset. Mostly useful for unit tests. func NewFieldManagedObjectTracker(scheme *runtime.Scheme, decoder runtime.Decoder, typeConverter managedfields.TypeConverter) ObjectTracker { return &managedFieldObjectTracker{ ObjectTracker: NewObjectTracker(scheme, decoder), scheme: scheme, objectConverter: scheme, mapper: testrestmapper.TestOnlyStaticRESTMapper(scheme), typeConverter: typeConverter, } } func (t *managedFieldObjectTracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, vopts ...metav1.CreateOptions) error { opts, err := assertOptionalSingleArgument(vopts) if err != nil { return err } gvk, err := t.mapper.KindFor(gvr) if err != nil { return err } mgr, err := t.fieldManagerFor(gvk) if err != nil { return err } objType, err := meta.TypeAccessor(obj) if err != nil { return err } // Stamp GVK apiVersion, kind := gvk.ToAPIVersionAndKind() objType.SetAPIVersion(apiVersion) objType.SetKind(kind) objMeta, err := meta.Accessor(obj) if err != nil { return err } liveObject, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) if apierrors.IsNotFound(err) { liveObject, err = t.scheme.New(gvk) if err != nil { return err } liveObject.GetObjectKind().SetGroupVersionKind(gvk) } else if err != nil { return err } objWithManagedFields, err := mgr.Update(liveObject, obj, opts.FieldManager) if err != nil { return err } return t.ObjectTracker.Create(gvr, objWithManagedFields, ns, opts) } func (t *managedFieldObjectTracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, vopts ...metav1.UpdateOptions) error { opts, err := assertOptionalSingleArgument(vopts) if err != nil { return err } gvk, err := t.mapper.KindFor(gvr) if err != nil { return err } mgr, err := t.fieldManagerFor(gvk) if err != nil { return err } objMeta, err := meta.Accessor(obj) if err != nil { return err } oldObj, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) if err != nil { return err } objWithManagedFields, err := mgr.Update(oldObj, obj, opts.FieldManager) if err != nil { return err } return t.ObjectTracker.Update(gvr, objWithManagedFields, ns, opts) } func (t *managedFieldObjectTracker) Patch(gvr schema.GroupVersionResource, patchedObject runtime.Object, ns string, vopts ...metav1.PatchOptions) error { opts, err := assertOptionalSingleArgument(vopts) if err != nil { return err } gvk, err := t.mapper.KindFor(gvr) if err != nil { return err } mgr, err := t.fieldManagerFor(gvk) if err != nil { return err } objMeta, err := meta.Accessor(patchedObject) if err != nil { return err } oldObj, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) if err != nil { return err } objWithManagedFields, err := mgr.Update(oldObj, patchedObject, opts.FieldManager) if err != nil { return err } return t.ObjectTracker.Patch(gvr, objWithManagedFields, ns, vopts...) } func (t *managedFieldObjectTracker) Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, vopts ...metav1.PatchOptions) error { opts, err := assertOptionalSingleArgument(vopts) if err != nil { return err } gvk, err := t.mapper.KindFor(gvr) if err != nil { return err } applyConfigurationMeta, err := meta.Accessor(applyConfiguration) if err != nil { return err } exists := true liveObject, err := t.ObjectTracker.Get(gvr, ns, applyConfigurationMeta.GetName(), metav1.GetOptions{}) if apierrors.IsNotFound(err) { exists = false liveObject, err = t.scheme.New(gvk) if err != nil { return err } liveObject.GetObjectKind().SetGroupVersionKind(gvk) } else if err != nil { return err } mgr, err := t.fieldManagerFor(gvk) if err != nil { return err } force := false if opts.Force != nil { force = *opts.Force } objWithManagedFields, err := mgr.Apply(liveObject, applyConfiguration, opts.FieldManager, force) if err != nil { return err } if !exists { return t.ObjectTracker.Create(gvr, objWithManagedFields, ns, metav1.CreateOptions{ DryRun: opts.DryRun, FieldManager: opts.FieldManager, FieldValidation: opts.FieldValidation, }) } else { return t.ObjectTracker.Update(gvr, objWithManagedFields, ns, metav1.UpdateOptions{ DryRun: opts.DryRun, FieldManager: opts.FieldManager, FieldValidation: opts.FieldValidation, }) } } func (t *managedFieldObjectTracker) fieldManagerFor(gvk schema.GroupVersionKind) (*managedfields.FieldManager, error) { return managedfields.NewDefaultFieldManager( t.typeConverter, t.objectConverter, &objectDefaulter{}, t.scheme, gvk, gvk.GroupVersion(), "", nil) } // objectDefaulter implements runtime.Defaulter, but it actually // does nothing. type objectDefaulter struct{} func (d *objectDefaulter) Default(_ runtime.Object) {} // filterByNamespace returns all objects in the collection that // match provided namespace. Empty namespace matches // non-namespaced objects. func filterByNamespace(objs map[types.NamespacedName]runtime.Object, ns string) ([]runtime.Object, error) { var res []runtime.Object for _, obj := range objs { acc, err := meta.Accessor(obj) if err != nil { return nil, err } if ns != "" && acc.GetNamespace() != ns { continue } res = append(res, obj) } // Sort res to get deterministic order. sort.Slice(res, func(i, j int) bool { acc1, _ := meta.Accessor(res[i]) acc2, _ := meta.Accessor(res[j]) if acc1.GetNamespace() != acc2.GetNamespace() { return acc1.GetNamespace() < acc2.GetNamespace() } return acc1.GetName() < acc2.GetName() }) return res, nil } func DefaultWatchReactor(watchInterface watch.Interface, err error) WatchReactionFunc { return func(action Action) (bool, watch.Interface, error) { return true, watchInterface, err } } // SimpleReactor is a Reactor. Each reaction function is attached to a given verb,resource tuple. "*" in either field matches everything for that value. // For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions type SimpleReactor struct { Verb string Resource string Reaction ReactionFunc } func (r *SimpleReactor) Handles(action Action) bool { verbCovers := r.Verb == "*" || r.Verb == action.GetVerb() if !verbCovers { return false } return resourceCovers(r.Resource, action) } func (r *SimpleReactor) React(action Action) (bool, runtime.Object, error) { return r.Reaction(action) } // SimpleWatchReactor is a WatchReactor. Each reaction function is attached to a given resource. "*" matches everything for that value. // For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions type SimpleWatchReactor struct { Resource string Reaction WatchReactionFunc } func (r *SimpleWatchReactor) Handles(action Action) bool { return resourceCovers(r.Resource, action) } func (r *SimpleWatchReactor) React(action Action) (bool, watch.Interface, error) { return r.Reaction(action) } // SimpleProxyReactor is a ProxyReactor. Each reaction function is attached to a given resource. "*" matches everything for that value. // For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions. type SimpleProxyReactor struct { Resource string Reaction ProxyReactionFunc } func (r *SimpleProxyReactor) Handles(action Action) bool { return resourceCovers(r.Resource, action) } func (r *SimpleProxyReactor) React(action Action) (bool, restclient.ResponseWrapper, error) { return r.Reaction(action) } func resourceCovers(resource string, action Action) bool { if resource == "*" { return true } if resource == action.GetResource().Resource { return true } if index := strings.Index(resource, "/"); index != -1 && resource[:index] == action.GetResource().Resource && resource[index+1:] == action.GetSubresource() { return true } return false } // assertOptionalSingleArgument returns an error if there is more than one variadic argument. // Otherwise, it returns the first variadic argument, or zero value if there are no arguments. func assertOptionalSingleArgument[T any](arguments []T) (T, error) { var a T switch len(arguments) { case 0: return a, nil case 1: return arguments[0], nil default: return a, fmt.Errorf("expected only one option argument but got %d", len(arguments)) } } type TypeResolver interface { Type(openAPIName string) typed.ParseableType } type TypeConverter struct { Scheme *runtime.Scheme TypeResolver TypeResolver } func (tc TypeConverter) ObjectToTyped(obj runtime.Object, opts ...typed.ValidationOptions) (*typed.TypedValue, error) { gvk := obj.GetObjectKind().GroupVersionKind() name, err := tc.openAPIName(gvk) if err != nil { return nil, err } t := tc.TypeResolver.Type(name) switch o := obj.(type) { case *unstructured.Unstructured: return t.FromUnstructured(o.UnstructuredContent(), opts...) default: return t.FromStructured(obj, opts...) } } func (tc TypeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error) { vu := value.AsValue().Unstructured() switch o := vu.(type) { case map[string]interface{}: return &unstructured.Unstructured{Object: o}, nil default: return nil, fmt.Errorf("failed to convert value to unstructured for type %T", vu) } } func (tc TypeConverter) openAPIName(kind schema.GroupVersionKind) (string, error) { example, err := tc.Scheme.New(kind) if err != nil { return "", err } rtype := reflect.TypeOf(example).Elem() name := friendlyName(rtype.PkgPath() + "." + rtype.Name()) return name, nil } // This is a copy of openapi.friendlyName. // TODO: consider introducing a shared version of this function in apimachinery. func friendlyName(name string) string { nameParts := strings.Split(name, "/") // Reverse first part. e.g., io.k8s... instead of k8s.io... if len(nameParts) > 0 && strings.Contains(nameParts[0], ".") { parts := strings.Split(nameParts[0], ".") for i, j := 0, len(parts)-1; i < j; i, j = i+1, j-1 { parts[i], parts[j] = parts[j], parts[i] } nameParts[0] = strings.Join(parts, ".") } return strings.Join(nameParts, ".") } kubernetes-client-go-a2dfcab/testing/fixture_test.go000066400000000000000000000456121472614177300231410ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "fmt" "math/rand" "sigs.k8s.io/structured-merge-diff/v4/typed" "strconv" "sync" "testing" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/managedfields" "k8s.io/apimachinery/pkg/watch" "k8s.io/utils/ptr" ) func getArbitraryResource(s schema.GroupVersionResource, name, namespace string) *unstructured.Unstructured { return &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": s.Resource, "apiVersion": s.Version, "metadata": map[string]interface{}{ "name": name, "namespace": namespace, "generateName": "test_generateName", "uid": "test_uid", "resourceVersion": "test_resourceVersion", }, "data": strconv.Itoa(rand.Int()), }, } } func TestWatchCallNonNamespace(t *testing.T) { testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} testObj := getArbitraryResource(testResource, "test_name", "test_namespace") accessor, err := meta.Accessor(testObj) if err != nil { t.Fatalf("unexpected error: %v", err) } ns := accessor.GetNamespace() scheme := runtime.NewScheme() codecs := serializer.NewCodecFactory(scheme) o := NewObjectTracker(scheme, codecs.UniversalDecoder()) watch, err := o.Watch(testResource, ns) if err != nil { t.Fatalf("test resource watch failed in %s: %v ", ns, err) } go func() { err := o.Create(testResource, testObj, ns) if err != nil { t.Errorf("test resource creation failed: %v", err) } }() out := <-watch.ResultChan() assert.Equal(t, testObj, out.Object, "watched object mismatch") } func TestWatchCallAllNamespace(t *testing.T) { testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} testObj := getArbitraryResource(testResource, "test_name", "test_namespace") accessor, err := meta.Accessor(testObj) if err != nil { t.Fatalf("unexpected error: %v", err) } ns := accessor.GetNamespace() scheme := runtime.NewScheme() codecs := serializer.NewCodecFactory(scheme) o := NewObjectTracker(scheme, codecs.UniversalDecoder()) w, err := o.Watch(testResource, "test_namespace") if err != nil { t.Fatalf("test resource watch failed in test_namespace: %v", err) } wAll, err := o.Watch(testResource, "") if err != nil { t.Fatalf("test resource watch failed in all namespaces: %v", err) } go func() { err := o.Create(testResource, testObj, ns) assert.NoError(t, err, "test resource creation failed") }() out := <-w.ResultChan() outAll := <-wAll.ResultChan() assert.Equal(t, watch.Added, out.Type, "watch event mismatch") assert.Equal(t, watch.Added, outAll.Type, "watch event mismatch") assert.Equal(t, testObj, out.Object, "watched created object mismatch") assert.Equal(t, testObj, outAll.Object, "watched created object mismatch") go func() { err := o.Update(testResource, testObj, ns) assert.NoError(t, err, "test resource updating failed") }() out = <-w.ResultChan() outAll = <-wAll.ResultChan() assert.Equal(t, watch.Modified, out.Type, "watch event mismatch") assert.Equal(t, watch.Modified, outAll.Type, "watch event mismatch") assert.Equal(t, testObj, out.Object, "watched updated object mismatch") assert.Equal(t, testObj, outAll.Object, "watched updated object mismatch") go func() { err := o.Delete(testResource, "test_namespace", "test_name") assert.NoError(t, err, "test resource deletion failed") }() out = <-w.ResultChan() outAll = <-wAll.ResultChan() assert.Equal(t, watch.Deleted, out.Type, "watch event mismatch") assert.Equal(t, watch.Deleted, outAll.Type, "watch event mismatch") assert.Equal(t, testObj, out.Object, "watched deleted object mismatch") assert.Equal(t, testObj, outAll.Object, "watched deleted object mismatch") } func TestWatchCallMultipleInvocation(t *testing.T) { cases := []struct { name string op watch.EventType ns string }{ { "foo", watch.Added, "test_namespace", }, { "bar", watch.Added, "test_namespace", }, { "baz", watch.Added, "", }, { "bar", watch.Modified, "test_namespace", }, { "baz", watch.Modified, "", }, { "foo", watch.Deleted, "test_namespace", }, { "bar", watch.Deleted, "test_namespace", }, { "baz", watch.Deleted, "", }, } scheme := runtime.NewScheme() codecs := serializer.NewCodecFactory(scheme) testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} o := NewObjectTracker(scheme, codecs.UniversalDecoder()) watchNamespaces := []string{ "", "", "test_namespace", "test_namespace", } var wg sync.WaitGroup wg.Add(len(watchNamespaces)) for idx, watchNamespace := range watchNamespaces { i := idx watchNamespace := watchNamespace w, err := o.Watch(testResource, watchNamespace) if err != nil { t.Fatalf("test resource watch failed in %s: %v", watchNamespace, err) } go func() { assert.NoError(t, err, "watch invocation failed") for _, c := range cases { if watchNamespace == "" || c.ns == watchNamespace { fmt.Printf("%#v %#v\n", c, i) event := <-w.ResultChan() accessor, err := meta.Accessor(event.Object) if err != nil { t.Errorf("unexpected error: %v", err) break } assert.Equal(t, c.op, event.Type, "watch event mismatched") assert.Equal(t, c.name, accessor.GetName(), "watched object mismatch") assert.Equal(t, c.ns, accessor.GetNamespace(), "watched object mismatch") } } wg.Done() }() } for _, c := range cases { switch c.op { case watch.Added: obj := getArbitraryResource(testResource, c.name, c.ns) o.Create(testResource, obj, c.ns) case watch.Modified: obj := getArbitraryResource(testResource, c.name, c.ns) o.Update(testResource, obj, c.ns) case watch.Deleted: o.Delete(testResource, c.ns, c.name) } } wg.Wait() } func TestWatchAddAfterStop(t *testing.T) { testResource := schema.GroupVersionResource{Group: "", Version: "test_version", Resource: "test_kind"} testObj := getArbitraryResource(testResource, "test_name", "test_namespace") accessor, err := meta.Accessor(testObj) if err != nil { t.Fatalf("unexpected error: %v", err) } ns := accessor.GetNamespace() scheme := runtime.NewScheme() codecs := serializer.NewCodecFactory(scheme) o := NewObjectTracker(scheme, codecs.UniversalDecoder()) watch, err := o.Watch(testResource, ns) if err != nil { t.Errorf("watch creation failed: %v", err) } // When the watch is stopped it should ignore later events without panicking. defer func() { if r := recover(); r != nil { t.Errorf("Watch panicked when it should have ignored create after stop: %v", r) } }() watch.Stop() err = o.Create(testResource, testObj, ns) if err != nil { t.Errorf("test resource creation failed: %v", err) } } func TestPatchWithMissingObject(t *testing.T) { nodesResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "nodes"} scheme := runtime.NewScheme() codecs := serializer.NewCodecFactory(scheme) o := NewObjectTracker(scheme, codecs.UniversalDecoder()) reaction := ObjectReaction(o) action := NewRootPatchSubresourceAction(nodesResource, "node-1", types.StrategicMergePatchType, []byte(`{}`)) handled, node, err := reaction(action) assert.True(t, handled) assert.Nil(t, node) assert.EqualError(t, err, `nodes "node-1" not found`) } func TestApplyCreate(t *testing.T) { cmResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configMaps"} scheme := runtime.NewScheme() scheme.AddKnownTypes(cmResource.GroupVersion(), &v1.ConfigMap{}) codecs := serializer.NewCodecFactory(scheme) o := NewFieldManagedObjectTracker(scheme, codecs.UniversalDecoder(), configMapTypeConverter(scheme)) reaction := ObjectReaction(o) patch := []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k": "v"}}`) action := NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, metav1.PatchOptions{FieldManager: "test-manager"}) handled, configMap, err := reaction(action) assert.True(t, handled) if err != nil { t.Errorf("Failed to create a resource with apply: %v", err) } cm := configMap.(*v1.ConfigMap) assert.Equal(t, cm.Data, map[string]string{"k": "v"}) } func TestApplyUpdateMultipleFieldManagers(t *testing.T) { cmResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configMaps"} scheme := runtime.NewScheme() scheme.AddKnownTypes(cmResource.GroupVersion(), &v1.ConfigMap{}) codecs := serializer.NewCodecFactory(scheme) o := NewFieldManagedObjectTracker(scheme, codecs.UniversalDecoder(), configMapTypeConverter(scheme)) reaction := ObjectReaction(o) action := NewCreateAction(cmResource, "default", &v1.ConfigMap{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "ConfigMap", }, ObjectMeta: metav1.ObjectMeta{ Name: "cm-1", }, Data: map[string]string{ "k0": "v0", }, }) handled, _, err := reaction(action) assert.True(t, handled) if err != nil { t.Errorf("Failed to create resource: %v", err) } // Apply with test-manager-1 // Expect data to be shared with initial create patch := []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k1": "v1"}}`) applyAction := NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, metav1.PatchOptions{FieldManager: "test-manager-1"}) handled, configMap, err := reaction(applyAction) assert.True(t, handled) if err != nil { t.Errorf("Failed to apply resource: %v", err) } cm := configMap.(*v1.ConfigMap) assert.Equal(t, map[string]string{"k0": "v0", "k1": "v1"}, cm.Data) // Apply conflicting with test-manager-2, expect apply to fail patch = []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k1": "xyz"}}`) applyAction = NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, metav1.PatchOptions{FieldManager: "test-manager-2"}) handled, _, err = reaction(applyAction) assert.True(t, handled) if assert.Error(t, err) { assert.Equal(t, "Apply failed with 1 conflict: conflict with \"test-manager-1\": .data.k1", err.Error()) } // Apply with test-manager-2 // Expect data to be shared with initial create and test-manager-1 patch = []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k2": "v2"}}`) applyAction = NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, metav1.PatchOptions{FieldManager: "test-manager-2"}) handled, configMap, err = reaction(applyAction) assert.True(t, handled) if err != nil { t.Errorf("Failed to apply resource: %v", err) } cm = configMap.(*v1.ConfigMap) assert.Equal(t, map[string]string{"k0": "v0", "k1": "v1", "k2": "v2"}, cm.Data) // Apply with test-manager-1 // Expect owned data to be updated patch = []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k1": "v101"}}`) applyAction = NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, metav1.PatchOptions{FieldManager: "test-manager-1"}) handled, configMap, err = reaction(applyAction) assert.True(t, handled) if err != nil { t.Errorf("Failed to apply resource: %v", err) } cm = configMap.(*v1.ConfigMap) assert.Equal(t, map[string]string{"k0": "v0", "k1": "v101", "k2": "v2"}, cm.Data) // Force apply with test-manager-2 // Expect data owned by test-manager-1 to be updated, expect data already owned but not in apply configuration to be removed patch = []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k1": "v202"}}`) applyAction = NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, metav1.PatchOptions{FieldManager: "test-manager-2", Force: ptr.To(true)}) handled, configMap, err = reaction(applyAction) assert.True(t, handled) if err != nil { t.Errorf("Failed to apply resource: %v", err) } cm = configMap.(*v1.ConfigMap) assert.Equal(t, map[string]string{"k0": "v0", "k1": "v202"}, cm.Data) // Update with test-manager-1 to perform a force update of the entire resource reaction = ObjectReaction(o) updateAction := NewUpdateActionWithOptions(cmResource, "default", &v1.ConfigMap{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "ConfigMap", }, ObjectMeta: metav1.ObjectMeta{ Name: "cm-1", }, Data: map[string]string{ "k99": "v99", }, }, metav1.UpdateOptions{FieldManager: "test-manager-1"}) handled, configMap, err = reaction(updateAction) assert.True(t, handled) if err != nil { t.Errorf("Failed to apply resource: %v", err) } typedCm := configMap.(*v1.ConfigMap) assert.Equal(t, map[string]string{"k99": "v99"}, typedCm.Data) } func TestGetWithExactMatch(t *testing.T) { scheme := runtime.NewScheme() codecs := serializer.NewCodecFactory(scheme) constructObject := func(s schema.GroupVersionResource, name, namespace string) (*unstructured.Unstructured, schema.GroupVersionResource) { obj := getArbitraryResource(s, name, namespace) gvks, _, err := scheme.ObjectKinds(obj) assert.NoError(t, err) gvr, _ := meta.UnsafeGuessKindToResource(gvks[0]) return obj, gvr } var err error // Object with empty namespace o := NewObjectTracker(scheme, codecs.UniversalDecoder()) nodeResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "node"} node, gvr := constructObject(nodeResource, "node", "") assert.Nil(t, o.Add(node)) // Exact match _, err = o.Get(gvr, "", "node") assert.NoError(t, err) // Unexpected namespace provided _, err = o.Get(gvr, "ns", "node") assert.Error(t, err) errNotFound := errors.NewNotFound(gvr.GroupResource(), "node") assert.EqualError(t, err, errNotFound.Error()) // Object with non-empty namespace o = NewObjectTracker(scheme, codecs.UniversalDecoder()) podResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pod"} pod, gvr := constructObject(podResource, "pod", "default") assert.Nil(t, o.Add(pod)) // Exact match _, err = o.Get(gvr, "default", "pod") assert.NoError(t, err) // Missing namespace _, err = o.Get(gvr, "", "pod") assert.Error(t, err) errNotFound = errors.NewNotFound(gvr.GroupResource(), "pod") assert.EqualError(t, err, errNotFound.Error()) } func Test_resourceCovers(t *testing.T) { type args struct { resource string action Action } tests := []struct { name string args args want bool }{ { args: args{ resource: "*", action: ActionImpl{}, }, want: true, }, { args: args{ resource: "serviceaccounts", action: ActionImpl{}, }, want: false, }, { args: args{ resource: "serviceaccounts", action: ActionImpl{ Resource: schema.GroupVersionResource{ Resource: "serviceaccounts", }, }, }, want: true, }, { args: args{ resource: "serviceaccounts/token", action: ActionImpl{ Resource: schema.GroupVersionResource{}, }, }, want: false, }, { args: args{ resource: "serviceaccounts/token", action: ActionImpl{ Resource: schema.GroupVersionResource{ Resource: "serviceaccounts", }, }, }, want: false, }, { args: args{ resource: "serviceaccounts/token", action: ActionImpl{ Resource: schema.GroupVersionResource{}, Subresource: "token", }, }, want: false, }, { args: args{ resource: "serviceaccounts/token", action: ActionImpl{ Resource: schema.GroupVersionResource{ Resource: "serviceaccounts", }, Subresource: "token", }, }, want: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := resourceCovers(tt.args.resource, tt.args.action); got != tt.want { t.Errorf("resourceCovers() = %v, want %v", got, tt.want) } }) } } func configMapTypeConverter(scheme *runtime.Scheme) managedfields.TypeConverter { parser, err := typed.NewParser(configMapTypedSchema) if err != nil { panic(fmt.Sprintf("Failed to parse schema: %v", err)) } return TypeConverter{Scheme: scheme, TypeResolver: parser} } var configMapTypedSchema = typed.YAMLObject(`types: - name: io.k8s.api.core.v1.ConfigMap map: fields: - name: apiVersion type: scalar: string - name: data type: map: elementType: scalar: string - name: kind type: scalar: string - name: metadata type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta map: fields: - name: creationTimestamp type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: managedFields type: list: elementType: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry elementRelationship: atomic - name: name type: scalar: string - name: namespace type: scalar: string - name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry map: fields: - name: apiVersion type: scalar: string - name: fieldsType type: scalar: string - name: fieldsV1 type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 - name: manager type: scalar: string - name: operation type: scalar: string - name: subresource type: scalar: string - name: time type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 map: elementType: scalar: untyped list: elementType: namedType: __untyped_atomic_ elementRelationship: atomic map: elementType: namedType: __untyped_deduced_ elementRelationship: separable - name: io.k8s.apimachinery.pkg.apis.meta.v1.Time scalar: untyped - name: __untyped_deduced_ scalar: untyped list: elementType: namedType: __untyped_atomic_ elementRelationship: atomic map: elementType: namedType: __untyped_deduced_ elementRelationship: separable `) kubernetes-client-go-a2dfcab/testing/interface.go000066400000000000000000000046241472614177300223520ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" restclient "k8s.io/client-go/rest" ) type FakeClient interface { // Tracker gives access to the ObjectTracker internal to the fake client. Tracker() ObjectTracker // AddReactor appends a reactor to the end of the chain. AddReactor(verb, resource string, reaction ReactionFunc) // PrependReactor adds a reactor to the beginning of the chain. PrependReactor(verb, resource string, reaction ReactionFunc) // AddWatchReactor appends a reactor to the end of the chain. AddWatchReactor(resource string, reaction WatchReactionFunc) // PrependWatchReactor adds a reactor to the beginning of the chain. PrependWatchReactor(resource string, reaction WatchReactionFunc) // AddProxyReactor appends a reactor to the end of the chain. AddProxyReactor(resource string, reaction ProxyReactionFunc) // PrependProxyReactor adds a reactor to the beginning of the chain. PrependProxyReactor(resource string, reaction ProxyReactionFunc) // Invokes records the provided Action and then invokes the ReactionFunc that // handles the action if one exists. defaultReturnObj is expected to be of the // same type a normal call would return. Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error) // InvokesWatch records the provided Action and then invokes the ReactionFunc // that handles the action if one exists. InvokesWatch(action Action) (watch.Interface, error) // InvokesProxy records the provided Action and then invokes the ReactionFunc // that handles the action if one exists. InvokesProxy(action Action) restclient.ResponseWrapper // ClearActions clears the history of actions called on the fake client. ClearActions() // Actions returns a chronologically ordered slice fake actions called on the // fake client. Actions() []Action } kubernetes-client-go-a2dfcab/third_party/000077500000000000000000000000001472614177300207315ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/third_party/forked/000077500000000000000000000000001472614177300222035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/third_party/forked/golang/000077500000000000000000000000001472614177300234525ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/third_party/forked/golang/LICENSE000066400000000000000000000027071472614177300244650ustar00rootroot00000000000000Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. kubernetes-client-go-a2dfcab/third_party/forked/golang/PATENTS000066400000000000000000000024271472614177300245200ustar00rootroot00000000000000Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. kubernetes-client-go-a2dfcab/third_party/forked/golang/template/000077500000000000000000000000001472614177300252655ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/third_party/forked/golang/template/exec.go000066400000000000000000000027371472614177300265510ustar00rootroot00000000000000//This package is copied from Go library text/template. //The original private functions indirect and printableValue //are exported as public functions. package template import ( "fmt" "reflect" ) var ( errorType = reflect.TypeOf((*error)(nil)).Elem() fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem() ) // Indirect returns the item at the end of indirection, and a bool to indicate if it's nil. // We indirect through pointers and empty interfaces (only) because // non-empty interfaces have methods we might need. func Indirect(v reflect.Value) (rv reflect.Value, isNil bool) { for ; v.Kind() == reflect.Pointer || v.Kind() == reflect.Interface; v = v.Elem() { if v.IsNil() { return v, true } if v.Kind() == reflect.Interface && v.NumMethod() > 0 { break } } return v, false } // PrintableValue returns the, possibly indirected, interface value inside v that // is best for a call to formatted printer. func PrintableValue(v reflect.Value) (interface{}, bool) { if v.Kind() == reflect.Pointer { v, _ = Indirect(v) // fmt.Fprint handles nil. } if !v.IsValid() { return "", true } if !v.Type().Implements(errorType) && !v.Type().Implements(fmtStringerType) { if v.CanAddr() && (reflect.PointerTo(v.Type()).Implements(errorType) || reflect.PointerTo(v.Type()).Implements(fmtStringerType)) { v = v.Addr() } else { switch v.Kind() { case reflect.Chan, reflect.Func: return nil, false } } } return v.Interface(), true } kubernetes-client-go-a2dfcab/third_party/forked/golang/template/funcs.go000066400000000000000000000102251472614177300267320ustar00rootroot00000000000000//This package is copied from Go library text/template. //The original private functions eq, ge, gt, le, lt, and ne //are exported as public functions. package template import ( "errors" "reflect" ) var ( errBadComparisonType = errors.New("invalid type for comparison") errBadComparison = errors.New("incompatible types for comparison") errNoComparison = errors.New("missing argument for comparison") ) type kind int const ( invalidKind kind = iota boolKind complexKind intKind floatKind integerKind stringKind uintKind ) func basicKind(v reflect.Value) (kind, error) { switch v.Kind() { case reflect.Bool: return boolKind, nil case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return intKind, nil case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return uintKind, nil case reflect.Float32, reflect.Float64: return floatKind, nil case reflect.Complex64, reflect.Complex128: return complexKind, nil case reflect.String: return stringKind, nil } return invalidKind, errBadComparisonType } // Equal evaluates the comparison a == b || a == c || ... func Equal(arg1 interface{}, arg2 ...interface{}) (bool, error) { v1 := reflect.ValueOf(arg1) k1, err := basicKind(v1) if err != nil { return false, err } if len(arg2) == 0 { return false, errNoComparison } for _, arg := range arg2 { v2 := reflect.ValueOf(arg) k2, err := basicKind(v2) if err != nil { return false, err } truth := false if k1 != k2 { // Special case: Can compare integer values regardless of type's sign. switch { case k1 == intKind && k2 == uintKind: truth = v1.Int() >= 0 && uint64(v1.Int()) == v2.Uint() case k1 == uintKind && k2 == intKind: truth = v2.Int() >= 0 && v1.Uint() == uint64(v2.Int()) default: return false, errBadComparison } } else { switch k1 { case boolKind: truth = v1.Bool() == v2.Bool() case complexKind: truth = v1.Complex() == v2.Complex() case floatKind: truth = v1.Float() == v2.Float() case intKind: truth = v1.Int() == v2.Int() case stringKind: truth = v1.String() == v2.String() case uintKind: truth = v1.Uint() == v2.Uint() default: panic("invalid kind") } } if truth { return true, nil } } return false, nil } // NotEqual evaluates the comparison a != b. func NotEqual(arg1, arg2 interface{}) (bool, error) { // != is the inverse of ==. equal, err := Equal(arg1, arg2) return !equal, err } // Less evaluates the comparison a < b. func Less(arg1, arg2 interface{}) (bool, error) { v1 := reflect.ValueOf(arg1) k1, err := basicKind(v1) if err != nil { return false, err } v2 := reflect.ValueOf(arg2) k2, err := basicKind(v2) if err != nil { return false, err } truth := false if k1 != k2 { // Special case: Can compare integer values regardless of type's sign. switch { case k1 == intKind && k2 == uintKind: truth = v1.Int() < 0 || uint64(v1.Int()) < v2.Uint() case k1 == uintKind && k2 == intKind: truth = v2.Int() >= 0 && v1.Uint() < uint64(v2.Int()) default: return false, errBadComparison } } else { switch k1 { case boolKind, complexKind: return false, errBadComparisonType case floatKind: truth = v1.Float() < v2.Float() case intKind: truth = v1.Int() < v2.Int() case stringKind: truth = v1.String() < v2.String() case uintKind: truth = v1.Uint() < v2.Uint() default: panic("invalid kind") } } return truth, nil } // LessEqual evaluates the comparison <= b. func LessEqual(arg1, arg2 interface{}) (bool, error) { // <= is < or ==. lessThan, err := Less(arg1, arg2) if lessThan || err != nil { return lessThan, err } return Equal(arg1, arg2) } // Greater evaluates the comparison a > b. func Greater(arg1, arg2 interface{}) (bool, error) { // > is the inverse of <=. lessOrEqual, err := LessEqual(arg1, arg2) if err != nil { return false, err } return !lessOrEqual, nil } // GreaterEqual evaluates the comparison a >= b. func GreaterEqual(arg1, arg2 interface{}) (bool, error) { // >= is the inverse of <. lessThan, err := Less(arg1, arg2) if err != nil { return false, err } return !lessThan, nil } kubernetes-client-go-a2dfcab/tools/000077500000000000000000000000001472614177300175405ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/auth/000077500000000000000000000000001472614177300205015ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/auth/OWNERS000066400000000000000000000002521472614177300214400ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-auth-authenticators-approvers reviewers: - sig-auth-authenticators-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/tools/auth/clientauth.go000066400000000000000000000074131472614177300231750ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Package auth defines a file format for holding authentication information needed by clients of Kubernetes. Typically, a Kubernetes cluster will put auth info for the admin in a known location when it is created, and will (soon) put it in a known location within a Container's file tree for Containers that need access to the Kubernetes API. Having a defined format allows: - clients to be implemented in multiple languages - applications which link clients to be portable across clusters with different authentication styles (e.g. some may use SSL Client certs, others may not, etc) - when the format changes, applications only need to update this code. The file format is json, marshalled from a struct authcfg.Info. Client libraries in other languages should use the same format. It is not intended to store general preferences, such as default namespace, output options, etc. CLIs (such as kubectl) and UIs should develop their own format and may wish to inline the authcfg.Info type. The authcfg.Info is just a file format. It is distinct from client.Config which holds options for creating a client.Client. Helper functions are provided in this package to fill in a client.Client from an authcfg.Info. Example: import ( "pkg/client" "pkg/client/auth" ) info, err := auth.LoadFromFile(filename) if err != nil { // handle error } clientConfig = client.Config{} clientConfig.Host = "example.com:4901" clientConfig = info.MergeWithConfig() client := client.New(clientConfig) client.Pods(ns).List() */ package auth // TODO: need a way to rotate Tokens. Therefore, need a way for client object to be reset when the authcfg is updated. import ( "encoding/json" "os" restclient "k8s.io/client-go/rest" ) // Info holds Kubernetes API authorization config. It is intended // to be read/written from a file as a JSON object. type Info struct { User string Password string `datapolicy:"password"` CAFile string CertFile string KeyFile string BearerToken string `datapolicy:"token"` Insecure *bool } // LoadFromFile parses an Info object from a file path. // If the file does not exist, then os.IsNotExist(err) == true func LoadFromFile(path string) (*Info, error) { var info Info if _, err := os.Stat(path); os.IsNotExist(err) { return nil, err } data, err := os.ReadFile(path) if err != nil { return nil, err } err = json.Unmarshal(data, &info) if err != nil { return nil, err } return &info, err } // MergeWithConfig returns a copy of a client.Config with values from the Info. // The fields of client.Config with a corresponding field in the Info are set // with the value from the Info. func (info Info) MergeWithConfig(c restclient.Config) (restclient.Config, error) { var config = c config.Username = info.User config.Password = info.Password config.CAFile = info.CAFile config.CertFile = info.CertFile config.KeyFile = info.KeyFile config.BearerToken = info.BearerToken if info.Insecure != nil { config.Insecure = *info.Insecure } return config, nil } // Complete returns true if the Kubernetes API authorization info is complete. func (info Info) Complete() bool { return len(info.User) > 0 || len(info.CertFile) > 0 || len(info.BearerToken) > 0 } kubernetes-client-go-a2dfcab/tools/auth/clientauth_test.go000066400000000000000000000032751472614177300242360ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package auth_test import ( "os" "reflect" "testing" clientauth "k8s.io/client-go/tools/auth" ) func TestLoadFromFile(t *testing.T) { loadAuthInfoTests := []struct { authData string authInfo *clientauth.Info expectErr bool }{ { `{"user": "user", "password": "pass"}`, &clientauth.Info{User: "user", Password: "pass"}, false, }, { "", nil, true, }, } for _, loadAuthInfoTest := range loadAuthInfoTests { tt := loadAuthInfoTest aifile, err := os.CreateTemp("", "testAuthInfo") if err != nil { t.Errorf("Unexpected error: %v", err) } if tt.authData != "missing" { defer os.Remove(aifile.Name()) defer aifile.Close() _, err = aifile.WriteString(tt.authData) if err != nil { t.Errorf("Unexpected error: %v", err) } } else { aifile.Close() os.Remove(aifile.Name()) } authInfo, err := clientauth.LoadFromFile(aifile.Name()) gotErr := err != nil if gotErr != tt.expectErr { t.Errorf("expected errorness: %v, actual errorness: %v", tt.expectErr, gotErr) } if !reflect.DeepEqual(authInfo, tt.authInfo) { t.Errorf("Expected %v, got %v", tt.authInfo, authInfo) } } } kubernetes-client-go-a2dfcab/tools/auth/exec/000077500000000000000000000000001472614177300214255ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/auth/exec/exec.go000066400000000000000000000071131472614177300227020ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package exec contains helper utilities for exec credential plugins. package exec import ( "errors" "fmt" "os" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/pkg/apis/clientauthentication" "k8s.io/client-go/pkg/apis/clientauthentication/install" "k8s.io/client-go/rest" ) const execInfoEnv = "KUBERNETES_EXEC_INFO" var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) func init() { install.Install(scheme) } // LoadExecCredentialFromEnv is a helper-wrapper around LoadExecCredential that loads from the // well-known KUBERNETES_EXEC_INFO environment variable. // // When the KUBERNETES_EXEC_INFO environment variable is not set or is empty, then this function // will immediately return an error. func LoadExecCredentialFromEnv() (runtime.Object, *rest.Config, error) { env := os.Getenv(execInfoEnv) if env == "" { return nil, nil, errors.New("KUBERNETES_EXEC_INFO env var is unset or empty") } return LoadExecCredential([]byte(env)) } // LoadExecCredential loads the configuration needed for an exec plugin to communicate with a // cluster. // // LoadExecCredential expects the provided data to be a serialized client.authentication.k8s.io // ExecCredential object (of any version). If the provided data is invalid (i.e., it cannot be // unmarshalled into any known client.authentication.k8s.io ExecCredential version), an error will // be returned. A successfully unmarshalled ExecCredential will be returned as the first return // value. // // If the provided data is successfully unmarshalled, but it does not contain cluster information // (i.e., ExecCredential.Spec.Cluster == nil), then an error will be returned. // // Note that the returned rest.Config will use anonymous authentication, since the exec plugin has // not returned credentials for this cluster yet. func LoadExecCredential(data []byte) (runtime.Object, *rest.Config, error) { obj, gvk, err := codecs.UniversalDeserializer().Decode(data, nil, nil) if err != nil { return nil, nil, fmt.Errorf("decode: %w", err) } expectedGK := schema.GroupKind{ Group: clientauthentication.SchemeGroupVersion.Group, Kind: "ExecCredential", } if gvk.GroupKind() != expectedGK { return nil, nil, fmt.Errorf( "invalid group/kind: wanted %s, got %s", expectedGK.String(), gvk.GroupKind().String(), ) } // Explicitly convert object here so that we can return a nicer error message above for when the // data represents an invalid type. var execCredential clientauthentication.ExecCredential if err := scheme.Convert(obj, &execCredential, nil); err != nil { return nil, nil, fmt.Errorf("cannot convert to ExecCredential: %w", err) } if execCredential.Spec.Cluster == nil { return nil, nil, errors.New("ExecCredential does not contain cluster information") } restConfig, err := rest.ExecClusterToConfig(execCredential.Spec.Cluster) if err != nil { return nil, nil, fmt.Errorf("cannot create rest.Config: %w", err) } return obj, restConfig, nil } kubernetes-client-go-a2dfcab/tools/auth/exec/exec_test.go000066400000000000000000000244441472614177300237470ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package exec import ( "strings" "testing" "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" "k8s.io/client-go/rest" ) // restInfo holds the rest.Client fields that we care about for test assertions. type restInfo struct { host string tlsClientConfig rest.TLSClientConfig proxyURL string } func TestLoadExecCredential(t *testing.T) { t.Parallel() tests := []struct { name string data []byte wantExecCredential runtime.Object wantRESTInfo restInfo wantErrorPrefix string }{ { name: "v1 happy path", data: marshal(t, clientauthenticationv1.SchemeGroupVersion, &clientauthenticationv1.ExecCredential{ Spec: clientauthenticationv1.ExecCredentialSpec{ Cluster: &clientauthenticationv1.Cluster{ Server: "https://some-server/some/path", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: "https://some-proxy-url:12345", Config: runtime.RawExtension{ Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"names":["marshmallow","zelda"]}}`), }, }, }, }), wantExecCredential: &clientauthenticationv1.ExecCredential{ TypeMeta: metav1.TypeMeta{ Kind: "ExecCredential", APIVersion: clientauthenticationv1.SchemeGroupVersion.String(), }, Spec: clientauthenticationv1.ExecCredentialSpec{ Cluster: &clientauthenticationv1.Cluster{ Server: "https://some-server/some/path", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: "https://some-proxy-url:12345", Config: runtime.RawExtension{ Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"names":["marshmallow","zelda"]}}`), }, }, }, }, wantRESTInfo: restInfo{ host: "https://some-server/some/path", tlsClientConfig: rest.TLSClientConfig{ Insecure: true, ServerName: "some-server-name", CAData: []byte("some-ca-data"), }, proxyURL: "https://some-proxy-url:12345", }, }, { name: "v1beta1 happy path", data: marshal(t, clientauthenticationv1beta1.SchemeGroupVersion, &clientauthenticationv1beta1.ExecCredential{ Spec: clientauthenticationv1beta1.ExecCredentialSpec{ Cluster: &clientauthenticationv1beta1.Cluster{ Server: "https://some-server/some/path", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: "https://some-proxy-url:12345", Config: runtime.RawExtension{ Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"names":["marshmallow","zelda"]}}`), }, }, }, }), wantExecCredential: &clientauthenticationv1beta1.ExecCredential{ TypeMeta: metav1.TypeMeta{ Kind: "ExecCredential", APIVersion: clientauthenticationv1beta1.SchemeGroupVersion.String(), }, Spec: clientauthenticationv1beta1.ExecCredentialSpec{ Cluster: &clientauthenticationv1beta1.Cluster{ Server: "https://some-server/some/path", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: "https://some-proxy-url:12345", Config: runtime.RawExtension{ Raw: []byte(`{"apiVersion":"group/v1","kind":"PluginConfig","spec":{"names":["marshmallow","zelda"]}}`), }, }, }, }, wantRESTInfo: restInfo{ host: "https://some-server/some/path", tlsClientConfig: rest.TLSClientConfig{ Insecure: true, ServerName: "some-server-name", CAData: []byte("some-ca-data"), }, proxyURL: "https://some-proxy-url:12345", }, }, { name: "v1 nil config", data: marshal(t, clientauthenticationv1.SchemeGroupVersion, &clientauthenticationv1.ExecCredential{ Spec: clientauthenticationv1.ExecCredentialSpec{ Cluster: &clientauthenticationv1.Cluster{ Server: "https://some-server/some/path", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: "https://some-proxy-url:12345", }, }, }), wantExecCredential: &clientauthenticationv1.ExecCredential{ TypeMeta: metav1.TypeMeta{ Kind: "ExecCredential", APIVersion: clientauthenticationv1.SchemeGroupVersion.String(), }, Spec: clientauthenticationv1.ExecCredentialSpec{ Cluster: &clientauthenticationv1.Cluster{ Server: "https://some-server/some/path", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: "https://some-proxy-url:12345", }, }, }, wantRESTInfo: restInfo{ host: "https://some-server/some/path", tlsClientConfig: rest.TLSClientConfig{ Insecure: true, ServerName: "some-server-name", CAData: []byte("some-ca-data"), }, proxyURL: "https://some-proxy-url:12345", }, }, { name: "v1beta1 nil config", data: marshal(t, clientauthenticationv1beta1.SchemeGroupVersion, &clientauthenticationv1beta1.ExecCredential{ Spec: clientauthenticationv1beta1.ExecCredentialSpec{ Cluster: &clientauthenticationv1beta1.Cluster{ Server: "https://some-server/some/path", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: "https://some-proxy-url:12345", }, }, }), wantExecCredential: &clientauthenticationv1beta1.ExecCredential{ TypeMeta: metav1.TypeMeta{ Kind: "ExecCredential", APIVersion: clientauthenticationv1beta1.SchemeGroupVersion.String(), }, Spec: clientauthenticationv1beta1.ExecCredentialSpec{ Cluster: &clientauthenticationv1beta1.Cluster{ Server: "https://some-server/some/path", TLSServerName: "some-server-name", InsecureSkipTLSVerify: true, CertificateAuthorityData: []byte("some-ca-data"), ProxyURL: "https://some-proxy-url:12345", }, }, }, wantRESTInfo: restInfo{ host: "https://some-server/some/path", tlsClientConfig: rest.TLSClientConfig{ Insecure: true, ServerName: "some-server-name", CAData: []byte("some-ca-data"), }, proxyURL: "https://some-proxy-url:12345", }, }, { name: "v1 invalid cluster", data: marshal(t, clientauthenticationv1.SchemeGroupVersion, &clientauthenticationv1.ExecCredential{ Spec: clientauthenticationv1.ExecCredentialSpec{ Cluster: &clientauthenticationv1.Cluster{ ProxyURL: "invalid- url\n", }, }, }), wantErrorPrefix: "cannot create rest.Config", }, { name: "v1beta1 invalid cluster", data: marshal(t, clientauthenticationv1beta1.SchemeGroupVersion, &clientauthenticationv1beta1.ExecCredential{ Spec: clientauthenticationv1beta1.ExecCredentialSpec{ Cluster: &clientauthenticationv1beta1.Cluster{ ProxyURL: "invalid- url\n", }, }, }), wantErrorPrefix: "cannot create rest.Config", }, { name: "v1 nil cluster", data: marshal(t, clientauthenticationv1.SchemeGroupVersion, &clientauthenticationv1.ExecCredential{}), wantErrorPrefix: "ExecCredential does not contain cluster information", }, { name: "v1beta1 nil cluster", data: marshal(t, clientauthenticationv1beta1.SchemeGroupVersion, &clientauthenticationv1beta1.ExecCredential{}), wantErrorPrefix: "ExecCredential does not contain cluster information", }, { name: "invalid object kind", data: marshal(t, metav1.SchemeGroupVersion, &metav1.Status{}), wantErrorPrefix: "invalid group/kind: wanted ExecCredential.client.authentication.k8s.io, got Status", }, { name: "bad data", data: []byte("bad data"), wantErrorPrefix: "decode: ", }, } for _, test := range tests { test := test t.Run(test.name, func(t *testing.T) { t.Parallel() execCredential, restConfig, err := LoadExecCredential(test.data) if test.wantErrorPrefix != "" { if err == nil { t.Error("wanted error, got success") } else if !strings.HasPrefix(err.Error(), test.wantErrorPrefix) { t.Errorf("wanted '%s', got '%s'", test.wantErrorPrefix, err.Error()) } } else if err != nil { t.Error(err) } else { if diff := cmp.Diff(test.wantExecCredential, execCredential); diff != "" { t.Error(diff) } if diff := cmp.Diff(test.wantRESTInfo.host, restConfig.Host); diff != "" { t.Error(diff) } if diff := cmp.Diff(test.wantRESTInfo.tlsClientConfig, restConfig.TLSClientConfig); diff != "" { t.Error(diff) } proxyURL, err := restConfig.Proxy(nil) if err != nil { t.Fatal(err) } if diff := cmp.Diff(test.wantRESTInfo.proxyURL, proxyURL.String()); diff != "" { t.Error(diff) } } }) } } func marshal(t *testing.T, gv schema.GroupVersion, obj runtime.Object) []byte { t.Helper() data, err := runtime.Encode(codecs.LegacyCodec(gv), obj) if err != nil { t.Fatal(err) } return data } kubernetes-client-go-a2dfcab/tools/auth/exec/types_test.go000066400000000000000000000130171472614177300241610ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package exec import ( "fmt" "reflect" "testing" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" clientcmdv1 "k8s.io/client-go/tools/clientcmd/api/v1" ) func TestClientAuthenticationClusterTypesAreSynced(t *testing.T) { t.Parallel() for _, cluster := range []interface{}{ clientauthenticationv1beta1.Cluster{}, clientauthenticationv1.Cluster{}, } { cluster := cluster t.Run(fmt.Sprintf("%T", cluster), func(t *testing.T) { t.Parallel() testClientAuthenticationClusterTypesAreSynced(t, cluster) }) } } // testClusterTypesAreSynced ensures that the provided cluster type stays in sync // with clientcmdv1.Cluster. // // We want clientauthentication*.Cluster types to offer the same knobs as clientcmdv1.Cluster to // allow someone to connect to the kubernetes API. This test should fail if a new field is added to // one of the structs without updating the other. func testClientAuthenticationClusterTypesAreSynced(t *testing.T, cluster interface{}) { execType := reflect.TypeOf(cluster) clientcmdType := reflect.TypeOf(clientcmdv1.Cluster{}) t.Run("exec cluster fields match clientcmd cluster fields", func(t *testing.T) { t.Parallel() // These are fields that are specific to Cluster and shouldn't be in clientcmdv1.Cluster. execSkippedFieldNames := sets.NewString( // Cluster uses Config to provide its cluster-specific configuration object. "Config", ) for i := 0; i < execType.NumField(); i++ { execField := execType.Field(i) if execSkippedFieldNames.Has(execField.Name) { continue } t.Run(execField.Name, func(t *testing.T) { t.Parallel() clientcmdField, ok := clientcmdType.FieldByName(execField.Name) if !ok { t.Errorf("unknown field (please add field to clientcmdv1.Cluster): '%s'", execField.Name) } else if execField.Type != clientcmdField.Type { t.Errorf( "type mismatch (please update Cluster.%s field type to match clientcmdv1.Cluster.%s field type): %q != %q", execField.Name, clientcmdField.Name, execField.Type, clientcmdField.Type, ) } else if execField.Tag != clientcmdField.Tag { t.Errorf( "tag mismatch (please update Cluster.%s tag to match clientcmdv1.Cluster.%s tag): %q != %q", execField.Name, clientcmdField.Name, execField.Tag, clientcmdField.Tag, ) } }) } }) t.Run("clientcmd cluster fields match exec cluster fields", func(t *testing.T) { t.Parallel() // These are the fields that we don't want to shadow from clientcmdv1.Cluster. clientcmdSkippedFieldNames := sets.NewString( // CA data will be passed via CertificateAuthorityData, so we don't need this field. "CertificateAuthority", // Cluster uses Config to provide its cluster-specific configuration object. "Extensions", ) for i := 0; i < clientcmdType.NumField(); i++ { clientcmdField := clientcmdType.Field(i) if clientcmdSkippedFieldNames.Has(clientcmdField.Name) { continue } t.Run(clientcmdField.Name, func(t *testing.T) { t.Parallel() execField, ok := execType.FieldByName(clientcmdField.Name) if !ok { t.Errorf("unknown field (please add field to Cluster): '%s'", clientcmdField.Name) } else if clientcmdField.Type != execField.Type { t.Errorf( "type mismatch (please update clientcmdv1.Cluster.%s field type to match Cluster.%s field type): %q != %q", clientcmdField.Name, execField.Name, clientcmdField.Type, execField.Type, ) } else if clientcmdField.Tag != execField.Tag { t.Errorf( "tag mismatch (please update clientcmdv1.Cluster.%s tag to match Cluster.%s tag): %q != %q", clientcmdField.Name, execField.Name, clientcmdField.Tag, execField.Tag, ) } }) } }) } // TestAllClusterTypesAreSynced is a TODO so that we remember to write a test similar to // TestClientAuthenticationClusterTypesAreSynced for any future ExecCredential version. It should start failing // when someone adds support for any other ExecCredential type to this package. func TestAllClusterTypesAreSynced(t *testing.T) { versionsThatDontNeedTests := sets.NewString( // The internal Cluster type should only be used...internally...and therefore doesn't // necessarily need to be synced with clientcmdv1. runtime.APIVersionInternal, // We have a test for v1beta1 above. clientauthenticationv1beta1.SchemeGroupVersion.Version, // We have a test for v1 above. clientauthenticationv1.SchemeGroupVersion.Version, ) for gvk := range scheme.AllKnownTypes() { if gvk.Group == clientauthenticationv1beta1.SchemeGroupVersion.Group && gvk.Kind == "ExecCredential" { if !versionsThatDontNeedTests.Has(gvk.Version) { t.Errorf( "TODO: add test similar to TestV1beta1ClusterTypesAreSynced for client.authentication.k8s.io/%s", gvk.Version, ) } } } } kubernetes-client-go-a2dfcab/tools/cache/000077500000000000000000000000001472614177300206035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/cache/OWNERS000066400000000000000000000006241472614177300215450ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - thockin - smarterclayton - wojtek-t - deads2k - caesarxuchao - liggitt - ncdc reviewers: - thockin - smarterclayton - wojtek-t - deads2k - derekwaynecarr - caesarxuchao - mikedanese - liggitt - janetkuo - justinsb - soltysh - jsafrane - dims - ingvagabund - ncdc emeritus_approvers: - lavalamp kubernetes-client-go-a2dfcab/tools/cache/controller.go000066400000000000000000000506321472614177300233230ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "errors" "sync" "time" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/utils/clock" ) // This file implements a low-level controller that is used in // sharedIndexInformer, which is an implementation of // SharedIndexInformer. Such informers, in turn, are key components // in the high level controllers that form the backbone of the // Kubernetes control plane. Look at those for examples, or the // example in // https://github.com/kubernetes/client-go/tree/master/examples/workqueue // . // Config contains all the settings for one of these low-level controllers. type Config struct { // The queue for your objects - has to be a DeltaFIFO due to // assumptions in the implementation. Your Process() function // should accept the output of this Queue's Pop() method. Queue // Something that can list and watch your objects. ListerWatcher // Something that can process a popped Deltas. Process ProcessFunc // ObjectType is an example object of the type this controller is // expected to handle. ObjectType runtime.Object // ObjectDescription is the description to use when logging type-specific information about this controller. ObjectDescription string // FullResyncPeriod is the period at which ShouldResync is considered. FullResyncPeriod time.Duration // MinWatchTimeout, if set, will define the minimum timeout for watch requests send // to kube-apiserver. However, values lower than 5m will not be honored to avoid // negative performance impact on controlplane. // Optional - if unset a default value of 5m will be used. MinWatchTimeout time.Duration // ShouldResync is periodically used by the reflector to determine // whether to Resync the Queue. If ShouldResync is `nil` or // returns true, it means the reflector should proceed with the // resync. ShouldResync ShouldResyncFunc // If true, when Process() returns an error, re-enqueue the object. // TODO: add interface to let you inject a delay/backoff or drop // the object completely if desired. Pass the object in // question to this interface as a parameter. This is probably moot // now that this functionality appears at a higher level. RetryOnError bool // Called whenever the ListAndWatch drops the connection with an error. WatchErrorHandler WatchErrorHandler // WatchListPageSize is the requested chunk size of initial and relist watch lists. WatchListPageSize int64 } // ShouldResyncFunc is a type of function that indicates if a reflector should perform a // resync or not. It can be used by a shared informer to support multiple event handlers with custom // resync periods. type ShouldResyncFunc func() bool // ProcessFunc processes a single object. type ProcessFunc func(obj interface{}, isInInitialList bool) error // `*controller` implements Controller type controller struct { config Config reflector *Reflector reflectorMutex sync.RWMutex clock clock.Clock } // Controller is a low-level controller that is parameterized by a // Config and used in sharedIndexInformer. type Controller interface { // Run does two things. One is to construct and run a Reflector // to pump objects/notifications from the Config's ListerWatcher // to the Config's Queue and possibly invoke the occasional Resync // on that Queue. The other is to repeatedly Pop from the Queue // and process with the Config's ProcessFunc. Both of these // continue until `stopCh` is closed. Run(stopCh <-chan struct{}) // HasSynced delegates to the Config's Queue HasSynced() bool // LastSyncResourceVersion delegates to the Reflector when there // is one, otherwise returns the empty string LastSyncResourceVersion() string } // New makes a new Controller from the given Config. func New(c *Config) Controller { ctlr := &controller{ config: *c, clock: &clock.RealClock{}, } return ctlr } // Run begins processing items, and will continue until a value is sent down stopCh or it is closed. // It's an error to call Run more than once. // Run blocks; call via go. func (c *controller) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() go func() { <-stopCh c.config.Queue.Close() }() r := NewReflectorWithOptions( c.config.ListerWatcher, c.config.ObjectType, c.config.Queue, ReflectorOptions{ ResyncPeriod: c.config.FullResyncPeriod, MinWatchTimeout: c.config.MinWatchTimeout, TypeDescription: c.config.ObjectDescription, Clock: c.clock, }, ) r.ShouldResync = c.config.ShouldResync r.WatchListPageSize = c.config.WatchListPageSize if c.config.WatchErrorHandler != nil { r.watchErrorHandler = c.config.WatchErrorHandler } c.reflectorMutex.Lock() c.reflector = r c.reflectorMutex.Unlock() var wg wait.Group wg.StartWithChannel(stopCh, r.Run) wait.Until(c.processLoop, time.Second, stopCh) wg.Wait() } // Returns true once this controller has completed an initial resource listing func (c *controller) HasSynced() bool { return c.config.Queue.HasSynced() } func (c *controller) LastSyncResourceVersion() string { c.reflectorMutex.RLock() defer c.reflectorMutex.RUnlock() if c.reflector == nil { return "" } return c.reflector.LastSyncResourceVersion() } // processLoop drains the work queue. // TODO: Consider doing the processing in parallel. This will require a little thought // to make sure that we don't end up processing the same object multiple times // concurrently. // // TODO: Plumb through the stopCh here (and down to the queue) so that this can // actually exit when the controller is stopped. Or just give up on this stuff // ever being stoppable. Converting this whole package to use Context would // also be helpful. func (c *controller) processLoop() { for { obj, err := c.config.Queue.Pop(PopProcessFunc(c.config.Process)) if err != nil { if err == ErrFIFOClosed { return } if c.config.RetryOnError { // This is the safe way to re-enqueue. c.config.Queue.AddIfNotPresent(obj) } } } } // ResourceEventHandler can handle notifications for events that // happen to a resource. The events are informational only, so you // can't return an error. The handlers MUST NOT modify the objects // received; this concerns not only the top level of structure but all // the data structures reachable from it. // - OnAdd is called when an object is added. // - OnUpdate is called when an object is modified. Note that oldObj is the // last known state of the object-- it is possible that several changes // were combined together, so you can't use this to see every single // change. OnUpdate is also called when a re-list happens, and it will // get called even if nothing changed. This is useful for periodically // evaluating or syncing something. // - OnDelete will get the final state of the item if it is known, otherwise // it will get an object of type DeletedFinalStateUnknown. This can // happen if the watch is closed and misses the delete event and we don't // notice the deletion until the subsequent re-list. type ResourceEventHandler interface { OnAdd(obj interface{}, isInInitialList bool) OnUpdate(oldObj, newObj interface{}) OnDelete(obj interface{}) } // ResourceEventHandlerFuncs is an adaptor to let you easily specify as many or // as few of the notification functions as you want while still implementing // ResourceEventHandler. This adapter does not remove the prohibition against // modifying the objects. // // See ResourceEventHandlerDetailedFuncs if your use needs to propagate // HasSynced. type ResourceEventHandlerFuncs struct { AddFunc func(obj interface{}) UpdateFunc func(oldObj, newObj interface{}) DeleteFunc func(obj interface{}) } // OnAdd calls AddFunc if it's not nil. func (r ResourceEventHandlerFuncs) OnAdd(obj interface{}, isInInitialList bool) { if r.AddFunc != nil { r.AddFunc(obj) } } // OnUpdate calls UpdateFunc if it's not nil. func (r ResourceEventHandlerFuncs) OnUpdate(oldObj, newObj interface{}) { if r.UpdateFunc != nil { r.UpdateFunc(oldObj, newObj) } } // OnDelete calls DeleteFunc if it's not nil. func (r ResourceEventHandlerFuncs) OnDelete(obj interface{}) { if r.DeleteFunc != nil { r.DeleteFunc(obj) } } // ResourceEventHandlerDetailedFuncs is exactly like ResourceEventHandlerFuncs // except its AddFunc accepts the isInInitialList parameter, for propagating // HasSynced. type ResourceEventHandlerDetailedFuncs struct { AddFunc func(obj interface{}, isInInitialList bool) UpdateFunc func(oldObj, newObj interface{}) DeleteFunc func(obj interface{}) } // OnAdd calls AddFunc if it's not nil. func (r ResourceEventHandlerDetailedFuncs) OnAdd(obj interface{}, isInInitialList bool) { if r.AddFunc != nil { r.AddFunc(obj, isInInitialList) } } // OnUpdate calls UpdateFunc if it's not nil. func (r ResourceEventHandlerDetailedFuncs) OnUpdate(oldObj, newObj interface{}) { if r.UpdateFunc != nil { r.UpdateFunc(oldObj, newObj) } } // OnDelete calls DeleteFunc if it's not nil. func (r ResourceEventHandlerDetailedFuncs) OnDelete(obj interface{}) { if r.DeleteFunc != nil { r.DeleteFunc(obj) } } // FilteringResourceEventHandler applies the provided filter to all events coming // in, ensuring the appropriate nested handler method is invoked. An object // that starts passing the filter after an update is considered an add, and an // object that stops passing the filter after an update is considered a delete. // Like the handlers, the filter MUST NOT modify the objects it is given. type FilteringResourceEventHandler struct { FilterFunc func(obj interface{}) bool Handler ResourceEventHandler } // OnAdd calls the nested handler only if the filter succeeds func (r FilteringResourceEventHandler) OnAdd(obj interface{}, isInInitialList bool) { if !r.FilterFunc(obj) { return } r.Handler.OnAdd(obj, isInInitialList) } // OnUpdate ensures the proper handler is called depending on whether the filter matches func (r FilteringResourceEventHandler) OnUpdate(oldObj, newObj interface{}) { newer := r.FilterFunc(newObj) older := r.FilterFunc(oldObj) switch { case newer && older: r.Handler.OnUpdate(oldObj, newObj) case newer && !older: r.Handler.OnAdd(newObj, false) case !newer && older: r.Handler.OnDelete(oldObj) default: // do nothing } } // OnDelete calls the nested handler only if the filter succeeds func (r FilteringResourceEventHandler) OnDelete(obj interface{}) { if !r.FilterFunc(obj) { return } r.Handler.OnDelete(obj) } // DeletionHandlingMetaNamespaceKeyFunc checks for // DeletedFinalStateUnknown objects before calling // MetaNamespaceKeyFunc. func DeletionHandlingMetaNamespaceKeyFunc(obj interface{}) (string, error) { if d, ok := obj.(DeletedFinalStateUnknown); ok { return d.Key, nil } return MetaNamespaceKeyFunc(obj) } // DeletionHandlingObjectToName checks for // DeletedFinalStateUnknown objects before calling // ObjectToName. func DeletionHandlingObjectToName(obj interface{}) (ObjectName, error) { if d, ok := obj.(DeletedFinalStateUnknown); ok { return ParseObjectName(d.Key) } return ObjectToName(obj) } // InformerOptions configure a Reflector. type InformerOptions struct { // ListerWatcher implements List and Watch functions for the source of the resource // the informer will be informing about. ListerWatcher ListerWatcher // ObjectType is an object of the type that informer is expected to receive. ObjectType runtime.Object // Handler defines functions that should called on object mutations. Handler ResourceEventHandler // ResyncPeriod is the underlying Reflector's resync period. If non-zero, the store // is re-synced with that frequency - Modify events are delivered even if objects // didn't change. // This is useful for synchronizing objects that configure external resources // (e.g. configure cloud provider functionalities). // Optional - if unset, store resyncing is not happening periodically. ResyncPeriod time.Duration // MinWatchTimeout, if set, will define the minimum timeout for watch requests send // to kube-apiserver. However, values lower than 5m will not be honored to avoid // negative performance impact on controlplane. // Optional - if unset a default value of 5m will be used. MinWatchTimeout time.Duration // Indexers, if set, are the indexers for the received objects to optimize // certain queries. // Optional - if unset no indexes are maintained. Indexers Indexers // Transform function, if set, will be called on all objects before they will be // put into the Store and corresponding Add/Modify/Delete handlers will be invoked // for them. // Optional - if unset no additional transforming is happening. Transform TransformFunc } // NewInformerWithOptions returns a Store and a controller for populating the store // while also providing event notifications. You should only used the returned // Store for Get/List operations; Add/Modify/Deletes will cause the event // notifications to be faulty. func NewInformerWithOptions(options InformerOptions) (Store, Controller) { var clientState Store if options.Indexers == nil { clientState = NewStore(DeletionHandlingMetaNamespaceKeyFunc) } else { clientState = NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, options.Indexers) } return clientState, newInformer(clientState, options) } // NewInformer returns a Store and a controller for populating the store // while also providing event notifications. You should only used the returned // Store for Get/List operations; Add/Modify/Deletes will cause the event // notifications to be faulty. // // Parameters: // - lw is list and watch functions for the source of the resource you want to // be informed of. // - objType is an object of the type that you expect to receive. // - resyncPeriod: if non-zero, will re-list this often (you will get OnUpdate // calls, even if nothing changed). Otherwise, re-list will be delayed as // long as possible (until the upstream source closes the watch or times out, // or you stop the controller). // - h is the object you want notifications sent to. // // Deprecated: Use NewInformerWithOptions instead. func NewInformer( lw ListerWatcher, objType runtime.Object, resyncPeriod time.Duration, h ResourceEventHandler, ) (Store, Controller) { // This will hold the client state, as we know it. clientState := NewStore(DeletionHandlingMetaNamespaceKeyFunc) options := InformerOptions{ ListerWatcher: lw, ObjectType: objType, Handler: h, ResyncPeriod: resyncPeriod, } return clientState, newInformer(clientState, options) } // NewIndexerInformer returns an Indexer and a Controller for populating the index // while also providing event notifications. You should only used the returned // Index for Get/List operations; Add/Modify/Deletes will cause the event // notifications to be faulty. // // Parameters: // - lw is list and watch functions for the source of the resource you want to // be informed of. // - objType is an object of the type that you expect to receive. // - resyncPeriod: if non-zero, will re-list this often (you will get OnUpdate // calls, even if nothing changed). Otherwise, re-list will be delayed as // long as possible (until the upstream source closes the watch or times out, // or you stop the controller). // - h is the object you want notifications sent to. // - indexers is the indexer for the received object type. // // Deprecated: Use NewInformerWithOptions instead. func NewIndexerInformer( lw ListerWatcher, objType runtime.Object, resyncPeriod time.Duration, h ResourceEventHandler, indexers Indexers, ) (Indexer, Controller) { // This will hold the client state, as we know it. clientState := NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, indexers) options := InformerOptions{ ListerWatcher: lw, ObjectType: objType, Handler: h, ResyncPeriod: resyncPeriod, Indexers: indexers, } return clientState, newInformer(clientState, options) } // NewTransformingInformer returns a Store and a controller for populating // the store while also providing event notifications. You should only used // the returned Store for Get/List operations; Add/Modify/Deletes will cause // the event notifications to be faulty. // The given transform function will be called on all objects before they will // put into the Store and corresponding Add/Modify/Delete handlers will // be invoked for them. // // Deprecated: Use NewInformerWithOptions instead. func NewTransformingInformer( lw ListerWatcher, objType runtime.Object, resyncPeriod time.Duration, h ResourceEventHandler, transformer TransformFunc, ) (Store, Controller) { // This will hold the client state, as we know it. clientState := NewStore(DeletionHandlingMetaNamespaceKeyFunc) options := InformerOptions{ ListerWatcher: lw, ObjectType: objType, Handler: h, ResyncPeriod: resyncPeriod, Transform: transformer, } return clientState, newInformer(clientState, options) } // NewTransformingIndexerInformer returns an Indexer and a controller for // populating the index while also providing event notifications. You should // only used the returned Index for Get/List operations; Add/Modify/Deletes // will cause the event notifications to be faulty. // The given transform function will be called on all objects before they will // be put into the Index and corresponding Add/Modify/Delete handlers will // be invoked for them. // // Deprecated: Use NewInformerWithOptions instead. func NewTransformingIndexerInformer( lw ListerWatcher, objType runtime.Object, resyncPeriod time.Duration, h ResourceEventHandler, indexers Indexers, transformer TransformFunc, ) (Indexer, Controller) { // This will hold the client state, as we know it. clientState := NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, indexers) options := InformerOptions{ ListerWatcher: lw, ObjectType: objType, Handler: h, ResyncPeriod: resyncPeriod, Indexers: indexers, Transform: transformer, } return clientState, newInformer(clientState, options) } // Multiplexes updates in the form of a list of Deltas into a Store, and informs // a given handler of events OnUpdate, OnAdd, OnDelete func processDeltas( // Object which receives event notifications from the given deltas handler ResourceEventHandler, clientState Store, deltas Deltas, isInInitialList bool, ) error { // from oldest to newest for _, d := range deltas { obj := d.Object switch d.Type { case Sync, Replaced, Added, Updated: if old, exists, err := clientState.Get(obj); err == nil && exists { if err := clientState.Update(obj); err != nil { return err } handler.OnUpdate(old, obj) } else { if err := clientState.Add(obj); err != nil { return err } handler.OnAdd(obj, isInInitialList) } case Deleted: if err := clientState.Delete(obj); err != nil { return err } handler.OnDelete(obj) } } return nil } // newInformer returns a controller for populating the store while also // providing event notifications. // // Parameters // - clientState is the store you want to populate // - options contain the options to configure the controller func newInformer(clientState Store, options InformerOptions) Controller { // This will hold incoming changes. Note how we pass clientState in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KnownObjects: clientState, EmitDeltaTypeReplaced: true, Transformer: options.Transform, }) cfg := &Config{ Queue: fifo, ListerWatcher: options.ListerWatcher, ObjectType: options.ObjectType, FullResyncPeriod: options.ResyncPeriod, MinWatchTimeout: options.MinWatchTimeout, RetryOnError: false, Process: func(obj interface{}, isInInitialList bool) error { if deltas, ok := obj.(Deltas); ok { return processDeltas(options.Handler, clientState, deltas, isInInitialList) } return errors.New("object given as Process argument is not Deltas") }, } return New(cfg) } kubernetes-client-go-a2dfcab/tools/cache/controller_test.go000066400000000000000000000452731472614177300243670ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "math/rand" "sync" "sync/atomic" "testing" "time" v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" fcache "k8s.io/client-go/tools/cache/testing" fuzz "github.com/google/gofuzz" ) func Example() { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() // This will hold the downstream state, as we know it. downstream := NewStore(DeletionHandlingMetaNamespaceKeyFunc) // This will hold incoming changes. Note how we pass downstream in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: MetaNamespaceKeyFunc, KnownObjects: downstream, }) // Let's do threadsafe output to get predictable test results. deletionCounter := make(chan string, 1000) cfg := &Config{ Queue: fifo, ListerWatcher: source, ObjectType: &v1.Pod{}, FullResyncPeriod: time.Millisecond * 100, RetryOnError: false, // Let's implement a simple controller that just deletes // everything that comes in. Process: func(obj interface{}, isInInitialList bool) error { // Obj is from the Pop method of the Queue we make above. newest := obj.(Deltas).Newest() if newest.Type != Deleted { // Update our downstream store. err := downstream.Add(newest.Object) if err != nil { return err } // Delete this object. source.Delete(newest.Object.(runtime.Object)) } else { // Update our downstream store. err := downstream.Delete(newest.Object) if err != nil { return err } // fifo's KeyOf is easiest, because it handles // DeletedFinalStateUnknown markers. key, err := fifo.KeyOf(newest.Object) if err != nil { return err } // Report this deletion. deletionCounter <- key } return nil }, } // Create the controller and run it until we close stop. stop := make(chan struct{}) defer close(stop) go New(cfg).Run(stop) // Let's add a few objects to the source. testIDs := []string{"a-hello", "b-controller", "c-framework"} for _, name := range testIDs { // Note that these pods are not valid-- the fake source doesn't // call validation or anything. source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: name}}) } // Let's wait for the controller to process the things we just added. outputSet := sets.String{} for i := 0; i < len(testIDs); i++ { outputSet.Insert(<-deletionCounter) } for _, key := range outputSet.List() { fmt.Println(key) } // Output: // a-hello // b-controller // c-framework } func ExampleNewInformer() { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() // Let's do threadsafe output to get predictable test results. deletionCounter := make(chan string, 1000) // Make a controller that immediately deletes anything added to it, and // logs anything deleted. _, controller := NewInformer( source, &v1.Pod{}, time.Millisecond*100, ResourceEventHandlerDetailedFuncs{ AddFunc: func(obj interface{}, isInInitialList bool) { source.Delete(obj.(runtime.Object)) }, DeleteFunc: func(obj interface{}) { key, err := DeletionHandlingMetaNamespaceKeyFunc(obj) if err != nil { key = "oops something went wrong with the key" } // Report this deletion. deletionCounter <- key }, }, ) // Run the controller and run it until we close stop. stop := make(chan struct{}) defer close(stop) go controller.Run(stop) // Let's add a few objects to the source. testIDs := []string{"a-hello", "b-controller", "c-framework"} for _, name := range testIDs { // Note that these pods are not valid-- the fake source doesn't // call validation or anything. source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: name}}) } // Let's wait for the controller to process the things we just added. outputSet := sets.String{} for i := 0; i < len(testIDs); i++ { outputSet.Insert(<-deletionCounter) } for _, key := range outputSet.List() { fmt.Println(key) } // Output: // a-hello // b-controller // c-framework } func TestHammerController(t *testing.T) { // This test executes a bunch of requests through the fake source and // controller framework to make sure there's no locking/threading // errors. If an error happens, it should hang forever or trigger the // race detector. // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() // Let's do threadsafe output to get predictable test results. outputSetLock := sync.Mutex{} // map of key to operations done on the key outputSet := map[string][]string{} recordFunc := func(eventType string, obj interface{}) { key, err := DeletionHandlingMetaNamespaceKeyFunc(obj) if err != nil { t.Errorf("something wrong with key: %v", err) key = "oops something went wrong with the key" } // Record some output when items are deleted. outputSetLock.Lock() defer outputSetLock.Unlock() outputSet[key] = append(outputSet[key], eventType) } // Make a controller which just logs all the changes it gets. _, controller := NewInformer( source, &v1.Pod{}, time.Millisecond*100, ResourceEventHandlerDetailedFuncs{ AddFunc: func(obj interface{}, isInInitialList bool) { recordFunc("add", obj) }, UpdateFunc: func(oldObj, newObj interface{}) { recordFunc("update", newObj) }, DeleteFunc: func(obj interface{}) { recordFunc("delete", obj) }, }, ) if controller.HasSynced() { t.Errorf("Expected HasSynced() to return false before we started the controller") } // Run the controller and run it until we close stop. stop := make(chan struct{}) go controller.Run(stop) // Let's wait for the controller to do its initial sync wait.Poll(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { return controller.HasSynced(), nil }) if !controller.HasSynced() { t.Errorf("Expected HasSynced() to return true after the initial sync") } wg := sync.WaitGroup{} const threads = 3 wg.Add(threads) for i := 0; i < threads; i++ { go func() { defer wg.Done() // Let's add a few objects to the source. currentNames := sets.String{} rs := rand.NewSource(rand.Int63()) f := fuzz.New().NilChance(.5).NumElements(0, 2).RandSource(rs) for i := 0; i < 100; i++ { var name string var isNew bool if currentNames.Len() == 0 || rand.Intn(3) == 1 { f.Fuzz(&name) isNew = true } else { l := currentNames.List() name = l[rand.Intn(len(l))] } pod := &v1.Pod{} f.Fuzz(pod) pod.ObjectMeta.Name = name pod.ObjectMeta.Namespace = "default" // Add, update, or delete randomly. // Note that these pods are not valid-- the fake source doesn't // call validation or perform any other checking. if isNew { currentNames.Insert(name) source.Add(pod) continue } switch rand.Intn(2) { case 0: currentNames.Insert(name) source.Modify(pod) case 1: currentNames.Delete(name) source.Delete(pod) } } }() } wg.Wait() // Let's wait for the controller to finish processing the things we just added. // TODO: look in the queue to see how many items need to be processed. time.Sleep(100 * time.Millisecond) close(stop) // TODO: Verify that no goroutines were leaked here and that everything shut // down cleanly. outputSetLock.Lock() t.Logf("got: %#v", outputSet) } func TestUpdate(t *testing.T) { // This test is going to exercise the various paths that result in a // call to update. // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() const ( FROM = "from" TO = "to" ) // These are the transitions we expect to see; because this is // asynchronous, there are a lot of valid possibilities. type pair struct{ from, to string } allowedTransitions := map[pair]bool{ {FROM, TO}: true, // Because a resync can happen when we've already observed one // of the above but before the item is deleted. {TO, TO}: true, // Because a resync could happen before we observe an update. {FROM, FROM}: true, } pod := func(name, check string, final bool) *v1.Pod { p := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, Labels: map[string]string{"check": check}, }, } if final { p.Labels["final"] = "true" } return p } deletePod := func(p *v1.Pod) bool { return p.Labels["final"] == "true" } tests := []func(string){ func(name string) { name = "a-" + name source.Add(pod(name, FROM, false)) source.Modify(pod(name, TO, true)) }, } const threads = 3 var testDoneWG sync.WaitGroup testDoneWG.Add(threads * len(tests)) // Make a controller that deletes things once it observes an update. // It calls Done() on the wait group on deletions so we can tell when // everything we've added has been deleted. watchCh := make(chan struct{}) _, controller := NewInformer( &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { watch, err := source.Watch(options) close(watchCh) return watch, err }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return source.List(options) }, }, &v1.Pod{}, 0, ResourceEventHandlerFuncs{ UpdateFunc: func(oldObj, newObj interface{}) { o, n := oldObj.(*v1.Pod), newObj.(*v1.Pod) from, to := o.Labels["check"], n.Labels["check"] if !allowedTransitions[pair{from, to}] { t.Errorf("observed transition %q -> %q for %v", from, to, n.Name) } if deletePod(n) { source.Delete(n) } }, DeleteFunc: func(obj interface{}) { testDoneWG.Done() }, }, ) // Run the controller and run it until we close stop. // Once Run() is called, calls to testDoneWG.Done() might start, so // all testDoneWG.Add() calls must happen before this point stop := make(chan struct{}) go controller.Run(stop) <-watchCh // run every test a few times, in parallel var wg sync.WaitGroup wg.Add(threads * len(tests)) for i := 0; i < threads; i++ { for j, f := range tests { go func(name string, f func(string)) { defer wg.Done() f(name) }(fmt.Sprintf("%v-%v", i, j), f) } } wg.Wait() // Let's wait for the controller to process the things we just added. testDoneWG.Wait() close(stop) } func TestPanicPropagated(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() // Make a controller that just panic if the AddFunc is called. _, controller := NewInformer( source, &v1.Pod{}, time.Millisecond*100, ResourceEventHandlerDetailedFuncs{ AddFunc: func(obj interface{}, isInInitialList bool) { // Create a panic. panic("Just panic.") }, }, ) // Run the controller and run it until we close stop. stop := make(chan struct{}) defer close(stop) propagated := make(chan interface{}) go func() { defer func() { if r := recover(); r != nil { propagated <- r } }() controller.Run(stop) }() // Let's add a object to the source. It will trigger a panic. source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test"}}) // Check if the panic propagated up. select { case p := <-propagated: if p == "Just panic." { t.Logf("Test Passed") } else { t.Errorf("unrecognized panic in controller run: %v", p) } case <-time.After(wait.ForeverTestTimeout): t.Errorf("timeout: the panic failed to propagate from the controller run method!") } } func TestTransformingInformer(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() makePod := func(name, generation string) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: "namespace", Labels: map[string]string{"generation": generation}, }, Spec: v1.PodSpec{ Hostname: "hostname", Subdomain: "subdomain", }, } } expectedPod := func(name, generation string) *v1.Pod { pod := makePod(name, generation) pod.Spec.Hostname = "new-hostname" pod.Spec.Subdomain = "" pod.Spec.NodeName = "nodename" return pod } source.Add(makePod("pod1", "1")) source.Modify(makePod("pod1", "2")) type event struct { eventType watch.EventType previous interface{} current interface{} } events := make(chan event, 10) recordEvent := func(eventType watch.EventType, previous, current interface{}) { events <- event{eventType: eventType, previous: previous, current: current} } verifyEvent := func(eventType watch.EventType, previous, current interface{}) { select { case event := <-events: if event.eventType != eventType { t.Errorf("expected type %v, got %v", eventType, event.eventType) } if !apiequality.Semantic.DeepEqual(event.previous, previous) { t.Errorf("expected previous object %#v, got %#v", previous, event.previous) } if !apiequality.Semantic.DeepEqual(event.current, current) { t.Errorf("expected object %#v, got %#v", current, event.current) } case <-time.After(wait.ForeverTestTimeout): t.Errorf("failed to get event") } } podTransformer := func(obj interface{}) (interface{}, error) { pod, ok := obj.(*v1.Pod) if !ok { return nil, fmt.Errorf("unexpected object type: %T", obj) } pod.Spec.Hostname = "new-hostname" pod.Spec.Subdomain = "" pod.Spec.NodeName = "nodename" // Clear out ResourceVersion to simplify comparisons. pod.ResourceVersion = "" return pod, nil } store, controller := NewTransformingInformer( source, &v1.Pod{}, 0, ResourceEventHandlerDetailedFuncs{ AddFunc: func(obj interface{}, isInInitialList bool) { recordEvent(watch.Added, nil, obj) }, UpdateFunc: func(oldObj, newObj interface{}) { recordEvent(watch.Modified, oldObj, newObj) }, DeleteFunc: func(obj interface{}) { recordEvent(watch.Deleted, obj, nil) }, }, podTransformer, ) verifyStore := func(expectedItems []interface{}) { items := store.List() if len(items) != len(expectedItems) { t.Errorf("unexpected items %v, expected %v", items, expectedItems) } for _, expectedItem := range expectedItems { found := false for _, item := range items { if apiequality.Semantic.DeepEqual(item, expectedItem) { found = true } } if !found { t.Errorf("expected item %v not found in %v", expectedItem, items) } } } stopCh := make(chan struct{}) go controller.Run(stopCh) verifyEvent(watch.Added, nil, expectedPod("pod1", "2")) verifyStore([]interface{}{expectedPod("pod1", "2")}) source.Add(makePod("pod2", "1")) verifyEvent(watch.Added, nil, expectedPod("pod2", "1")) verifyStore([]interface{}{expectedPod("pod1", "2"), expectedPod("pod2", "1")}) source.Add(makePod("pod3", "1")) verifyEvent(watch.Added, nil, expectedPod("pod3", "1")) source.Modify(makePod("pod2", "2")) verifyEvent(watch.Modified, expectedPod("pod2", "1"), expectedPod("pod2", "2")) source.Delete(makePod("pod1", "2")) verifyEvent(watch.Deleted, expectedPod("pod1", "2"), nil) verifyStore([]interface{}{expectedPod("pod2", "2"), expectedPod("pod3", "1")}) close(stopCh) } func TestTransformingInformerRace(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() label := "to-be-transformed" makePod := func(name string) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: "namespace", Labels: map[string]string{label: "true"}, }, Spec: v1.PodSpec{ Hostname: "hostname", }, } } badTransform := atomic.Bool{} podTransformer := func(obj interface{}) (interface{}, error) { pod, ok := obj.(*v1.Pod) if !ok { return nil, fmt.Errorf("unexpected object type: %T", obj) } if pod.ObjectMeta.Labels[label] != "true" { badTransform.Store(true) return nil, fmt.Errorf("object already transformed: %#v", obj) } pod.ObjectMeta.Labels[label] = "false" return pod, nil } numObjs := 5 for i := 0; i < numObjs; i++ { source.Add(makePod(fmt.Sprintf("pod-%d", i))) } type event struct{} events := make(chan event, numObjs) recordEvent := func(eventType watch.EventType, previous, current interface{}) { events <- event{} } checkEvents := func(count int) { for i := 0; i < count; i++ { <-events } } store, controller := NewTransformingInformer( source, &v1.Pod{}, 5*time.Millisecond, ResourceEventHandlerDetailedFuncs{ AddFunc: func(obj interface{}, isInInitialList bool) { recordEvent(watch.Added, nil, obj) }, UpdateFunc: func(oldObj, newObj interface{}) { recordEvent(watch.Modified, oldObj, newObj) }, DeleteFunc: func(obj interface{}) { recordEvent(watch.Deleted, obj, nil) }, }, podTransformer, ) stopCh := make(chan struct{}) go controller.Run(stopCh) checkEvents(numObjs) // Periodically fetch objects to ensure no access races. wg := sync.WaitGroup{} errors := make(chan error, numObjs) for i := 0; i < numObjs; i++ { wg.Add(1) go func(index int) { defer wg.Done() key := fmt.Sprintf("namespace/pod-%d", index) for { select { case <-stopCh: return default: } obj, ok, err := store.GetByKey(key) if !ok || err != nil { errors <- fmt.Errorf("couldn't get the object for %v", key) return } pod := obj.(*v1.Pod) if pod.ObjectMeta.Labels[label] != "false" { errors <- fmt.Errorf("unexpected object: %#v", pod) return } } }(i) } // Let resyncs to happen for some time. time.Sleep(time.Second) close(stopCh) wg.Wait() close(errors) for err := range errors { t.Error(err) } if badTransform.Load() { t.Errorf("unexpected transformation happened") } } func TestDeletionHandlingObjectToName(t *testing.T) { cm := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: "testname", Namespace: "testnamespace", }, } stringKey, err := MetaNamespaceKeyFunc(cm) if err != nil { t.Error(err) } deleted := DeletedFinalStateUnknown{ Key: stringKey, Obj: cm, } expected, err := ObjectToName(cm) if err != nil { t.Error(err) } actual, err := DeletionHandlingObjectToName(deleted) if err != nil { t.Error(err) } if expected != actual { t.Errorf("Expected %#v, got %#v", expected, actual) } } kubernetes-client-go-a2dfcab/tools/cache/delta_fifo.go000066400000000000000000000671251472614177300232410ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "errors" "fmt" "sync" "time" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/klog/v2" utiltrace "k8s.io/utils/trace" ) // DeltaFIFOOptions is the configuration parameters for DeltaFIFO. All are // optional. type DeltaFIFOOptions struct { // KeyFunction is used to figure out what key an object should have. (It's // exposed in the returned DeltaFIFO's KeyOf() method, with additional // handling around deleted objects and queue state). // Optional, the default is MetaNamespaceKeyFunc. KeyFunction KeyFunc // KnownObjects is expected to return a list of keys that the consumer of // this queue "knows about". It is used to decide which items are missing // when Replace() is called; 'Deleted' deltas are produced for the missing items. // KnownObjects may be nil if you can tolerate missing deletions on Replace(). KnownObjects KeyListerGetter // EmitDeltaTypeReplaced indicates that the queue consumer // understands the Replaced DeltaType. Before the `Replaced` event type was // added, calls to Replace() were handled the same as Sync(). For // backwards-compatibility purposes, this is false by default. // When true, `Replaced` events will be sent for items passed to a Replace() call. // When false, `Sync` events will be sent instead. EmitDeltaTypeReplaced bool // If set, will be called for objects before enqueueing them. Please // see the comment on TransformFunc for details. Transformer TransformFunc } // DeltaFIFO is like FIFO, but differs in two ways. One is that the // accumulator associated with a given object's key is not that object // but rather a Deltas, which is a slice of Delta values for that // object. Applying an object to a Deltas means to append a Delta // except when the potentially appended Delta is a Deleted and the // Deltas already ends with a Deleted. In that case the Deltas does // not grow, although the terminal Deleted will be replaced by the new // Deleted if the older Deleted's object is a // DeletedFinalStateUnknown. // // The other difference is that DeltaFIFO has two additional ways that // an object can be applied to an accumulator: Replaced and Sync. // If EmitDeltaTypeReplaced is not set to true, Sync will be used in // replace events for backwards compatibility. Sync is used for periodic // resync events. // // DeltaFIFO is a producer-consumer queue, where a Reflector is // intended to be the producer, and the consumer is whatever calls // the Pop() method. // // DeltaFIFO solves this use case: // - You want to process every object change (delta) at most once. // - When you process an object, you want to see everything // that's happened to it since you last processed it. // - You want to process the deletion of some of the objects. // - You might want to periodically reprocess objects. // // DeltaFIFO's Pop(), Get(), and GetByKey() methods return // interface{} to satisfy the Store/Queue interfaces, but they // will always return an object of type Deltas. List() returns // the newest object from each accumulator in the FIFO. // // A DeltaFIFO's knownObjects KeyListerGetter provides the abilities // to list Store keys and to get objects by Store key. The objects in // question are called "known objects" and this set of objects // modifies the behavior of the Delete, Replace, and Resync methods // (each in a different way). // // A note on threading: If you call Pop() in parallel from multiple // threads, you could end up with multiple threads processing slightly // different versions of the same object. type DeltaFIFO struct { // lock/cond protects access to 'items' and 'queue'. lock sync.RWMutex cond sync.Cond // `items` maps a key to a Deltas. // Each such Deltas has at least one Delta. items map[string]Deltas // `queue` maintains FIFO order of keys for consumption in Pop(). // There are no duplicates in `queue`. // A key is in `queue` if and only if it is in `items`. queue []string // populated is true if the first batch of items inserted by Replace() has been populated // or Delete/Add/Update/AddIfNotPresent was called first. populated bool // initialPopulationCount is the number of items inserted by the first call of Replace() initialPopulationCount int // keyFunc is used to make the key used for queued item // insertion and retrieval, and should be deterministic. keyFunc KeyFunc // knownObjects list keys that are "known" --- affecting Delete(), // Replace(), and Resync() knownObjects KeyListerGetter // Used to indicate a queue is closed so a control loop can exit when a queue is empty. // Currently, not used to gate any of CRUD operations. closed bool // emitDeltaTypeReplaced is whether to emit the Replaced or Sync // DeltaType when Replace() is called (to preserve backwards compat). emitDeltaTypeReplaced bool // Called with every object if non-nil. transformer TransformFunc } // TransformFunc allows for transforming an object before it will be processed. // // The most common usage pattern is to clean-up some parts of the object to // reduce component memory usage if a given component doesn't care about them. // // New in v1.27: TransformFunc sees the object before any other actor, and it // is now safe to mutate the object in place instead of making a copy. // // It's recommended for the TransformFunc to be idempotent. // It MUST be idempotent if objects already present in the cache are passed to // the Replace() to avoid re-mutating them. Default informers do not pass // existing objects to Replace though. // // Note that TransformFunc is called while inserting objects into the // notification queue and is therefore extremely performance sensitive; please // do not do anything that will take a long time. type TransformFunc func(interface{}) (interface{}, error) // DeltaType is the type of a change (addition, deletion, etc) type DeltaType string // Change type definition const ( Added DeltaType = "Added" Updated DeltaType = "Updated" Deleted DeltaType = "Deleted" // Replaced is emitted when we encountered watch errors and had to do a // relist. We don't know if the replaced object has changed. // // NOTE: Previous versions of DeltaFIFO would use Sync for Replace events // as well. Hence, Replaced is only emitted when the option // EmitDeltaTypeReplaced is true. Replaced DeltaType = "Replaced" // Sync is for synthetic events during a periodic resync. Sync DeltaType = "Sync" ) // Delta is a member of Deltas (a list of Delta objects) which // in its turn is the type stored by a DeltaFIFO. It tells you what // change happened, and the object's state after* that change. // // [*] Unless the change is a deletion, and then you'll get the final // state of the object before it was deleted. type Delta struct { Type DeltaType Object interface{} } // Deltas is a list of one or more 'Delta's to an individual object. // The oldest delta is at index 0, the newest delta is the last one. type Deltas []Delta // NewDeltaFIFO returns a Queue which can be used to process changes to items. // // keyFunc is used to figure out what key an object should have. (It is // exposed in the returned DeltaFIFO's KeyOf() method, with additional handling // around deleted objects and queue state). // // 'knownObjects' may be supplied to modify the behavior of Delete, // Replace, and Resync. It may be nil if you do not need those // modifications. // // TODO: consider merging keyLister with this object, tracking a list of // "known" keys when Pop() is called. Have to think about how that // affects error retrying. // // NOTE: It is possible to misuse this and cause a race when using an // external known object source. // Whether there is a potential race depends on how the consumer // modifies knownObjects. In Pop(), process function is called under // lock, so it is safe to update data structures in it that need to be // in sync with the queue (e.g. knownObjects). // // Example: // In case of sharedIndexInformer being a consumer // (https://github.com/kubernetes/kubernetes/blob/0cdd940f/staging/src/k8s.io/client-go/tools/cache/shared_informer.go#L192), // there is no race as knownObjects (s.indexer) is modified safely // under DeltaFIFO's lock. The only exceptions are GetStore() and // GetIndexer() methods, which expose ways to modify the underlying // storage. Currently these two methods are used for creating Lister // and internal tests. // // Also see the comment on DeltaFIFO. // // Warning: This constructs a DeltaFIFO that does not differentiate between // events caused by a call to Replace (e.g., from a relist, which may // contain object updates), and synthetic events caused by a periodic resync // (which just emit the existing object). See https://issue.k8s.io/86015 for details. // // Use `NewDeltaFIFOWithOptions(DeltaFIFOOptions{..., EmitDeltaTypeReplaced: true})` // instead to receive a `Replaced` event depending on the type. // // Deprecated: Equivalent to NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: keyFunc, KnownObjects: knownObjects}) func NewDeltaFIFO(keyFunc KeyFunc, knownObjects KeyListerGetter) *DeltaFIFO { return NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: keyFunc, KnownObjects: knownObjects, }) } // NewDeltaFIFOWithOptions returns a Queue which can be used to process changes to // items. See also the comment on DeltaFIFO. func NewDeltaFIFOWithOptions(opts DeltaFIFOOptions) *DeltaFIFO { if opts.KeyFunction == nil { opts.KeyFunction = MetaNamespaceKeyFunc } f := &DeltaFIFO{ items: map[string]Deltas{}, queue: []string{}, keyFunc: opts.KeyFunction, knownObjects: opts.KnownObjects, emitDeltaTypeReplaced: opts.EmitDeltaTypeReplaced, transformer: opts.Transformer, } f.cond.L = &f.lock return f } var ( _ = Queue(&DeltaFIFO{}) // DeltaFIFO is a Queue ) var ( // ErrZeroLengthDeltasObject is returned in a KeyError if a Deltas // object with zero length is encountered (should be impossible, // but included for completeness). ErrZeroLengthDeltasObject = errors.New("0 length Deltas object; can't get key") ) // Close the queue. func (f *DeltaFIFO) Close() { f.lock.Lock() defer f.lock.Unlock() f.closed = true f.cond.Broadcast() } // KeyOf exposes f's keyFunc, but also detects the key of a Deltas object or // DeletedFinalStateUnknown objects. func (f *DeltaFIFO) KeyOf(obj interface{}) (string, error) { if d, ok := obj.(Deltas); ok { if len(d) == 0 { return "", KeyError{obj, ErrZeroLengthDeltasObject} } obj = d.Newest().Object } if d, ok := obj.(DeletedFinalStateUnknown); ok { return d.Key, nil } return f.keyFunc(obj) } // HasSynced returns true if an Add/Update/Delete/AddIfNotPresent are called first, // or the first batch of items inserted by Replace() has been popped. func (f *DeltaFIFO) HasSynced() bool { f.lock.Lock() defer f.lock.Unlock() return f.hasSynced_locked() } func (f *DeltaFIFO) hasSynced_locked() bool { return f.populated && f.initialPopulationCount == 0 } // Add inserts an item, and puts it in the queue. The item is only enqueued // if it doesn't already exist in the set. func (f *DeltaFIFO) Add(obj interface{}) error { f.lock.Lock() defer f.lock.Unlock() f.populated = true return f.queueActionLocked(Added, obj) } // Update is just like Add, but makes an Updated Delta. func (f *DeltaFIFO) Update(obj interface{}) error { f.lock.Lock() defer f.lock.Unlock() f.populated = true return f.queueActionLocked(Updated, obj) } // Delete is just like Add, but makes a Deleted Delta. If the given // object does not already exist, it will be ignored. (It may have // already been deleted by a Replace (re-list), for example.) In this // method `f.knownObjects`, if not nil, provides (via GetByKey) // _additional_ objects that are considered to already exist. func (f *DeltaFIFO) Delete(obj interface{}) error { id, err := f.KeyOf(obj) if err != nil { return KeyError{obj, err} } f.lock.Lock() defer f.lock.Unlock() f.populated = true if f.knownObjects == nil { if _, exists := f.items[id]; !exists { // Presumably, this was deleted when a relist happened. // Don't provide a second report of the same deletion. return nil } } else { // We only want to skip the "deletion" action if the object doesn't // exist in knownObjects and it doesn't have corresponding item in items. // Note that even if there is a "deletion" action in items, we can ignore it, // because it will be deduped automatically in "queueActionLocked" _, exists, err := f.knownObjects.GetByKey(id) _, itemsExist := f.items[id] if err == nil && !exists && !itemsExist { // Presumably, this was deleted when a relist happened. // Don't provide a second report of the same deletion. return nil } } // exist in items and/or KnownObjects return f.queueActionLocked(Deleted, obj) } // AddIfNotPresent inserts an item, and puts it in the queue. If the item is already // present in the set, it is neither enqueued nor added to the set. // // This is useful in a single producer/consumer scenario so that the consumer can // safely retry items without contending with the producer and potentially enqueueing // stale items. // // Important: obj must be a Deltas (the output of the Pop() function). Yes, this is // different from the Add/Update/Delete functions. func (f *DeltaFIFO) AddIfNotPresent(obj interface{}) error { deltas, ok := obj.(Deltas) if !ok { return fmt.Errorf("object must be of type deltas, but got: %#v", obj) } id, err := f.KeyOf(deltas) if err != nil { return KeyError{obj, err} } f.lock.Lock() defer f.lock.Unlock() f.addIfNotPresent(id, deltas) return nil } // addIfNotPresent inserts deltas under id if it does not exist, and assumes the caller // already holds the fifo lock. func (f *DeltaFIFO) addIfNotPresent(id string, deltas Deltas) { f.populated = true if _, exists := f.items[id]; exists { return } f.queue = append(f.queue, id) f.items[id] = deltas f.cond.Broadcast() } // re-listing and watching can deliver the same update multiple times in any // order. This will combine the most recent two deltas if they are the same. func dedupDeltas(deltas Deltas) Deltas { n := len(deltas) if n < 2 { return deltas } a := &deltas[n-1] b := &deltas[n-2] if out := isDup(a, b); out != nil { deltas[n-2] = *out return deltas[:n-1] } return deltas } // If a & b represent the same event, returns the delta that ought to be kept. // Otherwise, returns nil. // TODO: is there anything other than deletions that need deduping? func isDup(a, b *Delta) *Delta { if out := isDeletionDup(a, b); out != nil { return out } // TODO: Detect other duplicate situations? Are there any? return nil } // keep the one with the most information if both are deletions. func isDeletionDup(a, b *Delta) *Delta { if b.Type != Deleted || a.Type != Deleted { return nil } // Do more sophisticated checks, or is this sufficient? if _, ok := b.Object.(DeletedFinalStateUnknown); ok { return a } return b } // queueActionLocked appends to the delta list for the object. // Caller must lock first. func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) error { return f.queueActionInternalLocked(actionType, actionType, obj) } // queueActionInternalLocked appends to the delta list for the object. // The actionType is emitted and must honor emitDeltaTypeReplaced. // The internalActionType is only used within this function and must // ignore emitDeltaTypeReplaced. // Caller must lock first. func (f *DeltaFIFO) queueActionInternalLocked(actionType, internalActionType DeltaType, obj interface{}) error { id, err := f.KeyOf(obj) if err != nil { return KeyError{obj, err} } // Every object comes through this code path once, so this is a good // place to call the transform func. // // If obj is a DeletedFinalStateUnknown tombstone or the action is a Sync, // then the object have already gone through the transformer. // // If the objects already present in the cache are passed to Replace(), // the transformer must be idempotent to avoid re-mutating them, // or coordinate with all readers from the cache to avoid data races. // Default informers do not pass existing objects to Replace. if f.transformer != nil { _, isTombstone := obj.(DeletedFinalStateUnknown) if !isTombstone && internalActionType != Sync { var err error obj, err = f.transformer(obj) if err != nil { return err } } } oldDeltas := f.items[id] newDeltas := append(oldDeltas, Delta{actionType, obj}) newDeltas = dedupDeltas(newDeltas) if len(newDeltas) > 0 { if _, exists := f.items[id]; !exists { f.queue = append(f.queue, id) } f.items[id] = newDeltas f.cond.Broadcast() } else { // This never happens, because dedupDeltas never returns an empty list // when given a non-empty list (as it is here). // If somehow it happens anyway, deal with it but complain. if oldDeltas == nil { klog.Errorf("Impossible dedupDeltas for id=%q: oldDeltas=%#+v, obj=%#+v; ignoring", id, oldDeltas, obj) return nil } klog.Errorf("Impossible dedupDeltas for id=%q: oldDeltas=%#+v, obj=%#+v; breaking invariant by storing empty Deltas", id, oldDeltas, obj) f.items[id] = newDeltas return fmt.Errorf("Impossible dedupDeltas for id=%q: oldDeltas=%#+v, obj=%#+v; broke DeltaFIFO invariant by storing empty Deltas", id, oldDeltas, obj) } return nil } // List returns a list of all the items; it returns the object // from the most recent Delta. // You should treat the items returned inside the deltas as immutable. func (f *DeltaFIFO) List() []interface{} { f.lock.RLock() defer f.lock.RUnlock() return f.listLocked() } func (f *DeltaFIFO) listLocked() []interface{} { list := make([]interface{}, 0, len(f.items)) for _, item := range f.items { list = append(list, item.Newest().Object) } return list } // ListKeys returns a list of all the keys of the objects currently // in the FIFO. func (f *DeltaFIFO) ListKeys() []string { f.lock.RLock() defer f.lock.RUnlock() list := make([]string, 0, len(f.queue)) for _, key := range f.queue { list = append(list, key) } return list } // Get returns the complete list of deltas for the requested item, // or sets exists=false. // You should treat the items returned inside the deltas as immutable. func (f *DeltaFIFO) Get(obj interface{}) (item interface{}, exists bool, err error) { key, err := f.KeyOf(obj) if err != nil { return nil, false, KeyError{obj, err} } return f.GetByKey(key) } // GetByKey returns the complete list of deltas for the requested item, // setting exists=false if that list is empty. // You should treat the items returned inside the deltas as immutable. func (f *DeltaFIFO) GetByKey(key string) (item interface{}, exists bool, err error) { f.lock.RLock() defer f.lock.RUnlock() d, exists := f.items[key] if exists { // Copy item's slice so operations on this slice // won't interfere with the object we return. d = copyDeltas(d) } return d, exists, nil } // IsClosed checks if the queue is closed func (f *DeltaFIFO) IsClosed() bool { f.lock.Lock() defer f.lock.Unlock() return f.closed } // Pop blocks until the queue has some items, and then returns one. If // multiple items are ready, they are returned in the order in which they were // added/updated. The item is removed from the queue (and the store) before it // is returned, so if you don't successfully process it, you need to add it back // with AddIfNotPresent(). // process function is called under lock, so it is safe to update data structures // in it that need to be in sync with the queue (e.g. knownKeys). The PopProcessFunc // may return an instance of ErrRequeue with a nested error to indicate the current // item should be requeued (equivalent to calling AddIfNotPresent under the lock). // process should avoid expensive I/O operation so that other queue operations, i.e. // Add() and Get(), won't be blocked for too long. // // Pop returns a 'Deltas', which has a complete list of all the things // that happened to the object (deltas) while it was sitting in the queue. func (f *DeltaFIFO) Pop(process PopProcessFunc) (interface{}, error) { f.lock.Lock() defer f.lock.Unlock() for { for len(f.queue) == 0 { // When the queue is empty, invocation of Pop() is blocked until new item is enqueued. // When Close() is called, the f.closed is set and the condition is broadcasted. // Which causes this loop to continue and return from the Pop(). if f.closed { return nil, ErrFIFOClosed } f.cond.Wait() } isInInitialList := !f.hasSynced_locked() id := f.queue[0] f.queue = f.queue[1:] depth := len(f.queue) if f.initialPopulationCount > 0 { f.initialPopulationCount-- } item, ok := f.items[id] if !ok { // This should never happen klog.Errorf("Inconceivable! %q was in f.queue but not f.items; ignoring.", id) continue } delete(f.items, id) // Only log traces if the queue depth is greater than 10 and it takes more than // 100 milliseconds to process one item from the queue. // Queue depth never goes high because processing an item is locking the queue, // and new items can't be added until processing finish. // https://github.com/kubernetes/kubernetes/issues/103789 if depth > 10 { trace := utiltrace.New("DeltaFIFO Pop Process", utiltrace.Field{Key: "ID", Value: id}, utiltrace.Field{Key: "Depth", Value: depth}, utiltrace.Field{Key: "Reason", Value: "slow event handlers blocking the queue"}) defer trace.LogIfLong(100 * time.Millisecond) } err := process(item, isInInitialList) if e, ok := err.(ErrRequeue); ok { f.addIfNotPresent(id, item) err = e.Err } // Don't need to copyDeltas here, because we're transferring // ownership to the caller. return item, err } } // Replace atomically does two things: (1) it adds the given objects // using the Sync or Replace DeltaType and then (2) it does some deletions. // In particular: for every pre-existing key K that is not the key of // an object in `list` there is the effect of // `Delete(DeletedFinalStateUnknown{K, O})` where O is the latest known // object of K. The pre-existing keys are those in the union set of the keys in // `f.items` and `f.knownObjects` (if not nil). The last known object for key K is // the one present in the last delta in `f.items`. If there is no delta for K // in `f.items`, it is the object in `f.knownObjects` func (f *DeltaFIFO) Replace(list []interface{}, _ string) error { f.lock.Lock() defer f.lock.Unlock() keys := make(sets.String, len(list)) // keep backwards compat for old clients action := Sync if f.emitDeltaTypeReplaced { action = Replaced } // Add Sync/Replaced action for each new item. for _, item := range list { key, err := f.KeyOf(item) if err != nil { return KeyError{item, err} } keys.Insert(key) if err := f.queueActionInternalLocked(action, Replaced, item); err != nil { return fmt.Errorf("couldn't enqueue object: %v", err) } } // Do deletion detection against objects in the queue queuedDeletions := 0 for k, oldItem := range f.items { if keys.Has(k) { continue } // Delete pre-existing items not in the new list. // This could happen if watch deletion event was missed while // disconnected from apiserver. var deletedObj interface{} if n := oldItem.Newest(); n != nil { deletedObj = n.Object // if the previous object is a DeletedFinalStateUnknown, we have to extract the actual Object if d, ok := deletedObj.(DeletedFinalStateUnknown); ok { deletedObj = d.Obj } } queuedDeletions++ if err := f.queueActionLocked(Deleted, DeletedFinalStateUnknown{k, deletedObj}); err != nil { return err } } if f.knownObjects != nil { // Detect deletions for objects not present in the queue, but present in KnownObjects knownKeys := f.knownObjects.ListKeys() for _, k := range knownKeys { if keys.Has(k) { continue } if len(f.items[k]) > 0 { continue } deletedObj, exists, err := f.knownObjects.GetByKey(k) if err != nil { deletedObj = nil klog.Errorf("Unexpected error %v during lookup of key %v, placing DeleteFinalStateUnknown marker without object", err, k) } else if !exists { deletedObj = nil klog.Infof("Key %v does not exist in known objects store, placing DeleteFinalStateUnknown marker without object", k) } queuedDeletions++ if err := f.queueActionLocked(Deleted, DeletedFinalStateUnknown{k, deletedObj}); err != nil { return err } } } if !f.populated { f.populated = true f.initialPopulationCount = keys.Len() + queuedDeletions } return nil } // Resync adds, with a Sync type of Delta, every object listed by // `f.knownObjects` whose key is not already queued for processing. // If `f.knownObjects` is `nil` then Resync does nothing. func (f *DeltaFIFO) Resync() error { f.lock.Lock() defer f.lock.Unlock() if f.knownObjects == nil { return nil } keys := f.knownObjects.ListKeys() for _, k := range keys { if err := f.syncKeyLocked(k); err != nil { return err } } return nil } func (f *DeltaFIFO) syncKeyLocked(key string) error { obj, exists, err := f.knownObjects.GetByKey(key) if err != nil { klog.Errorf("Unexpected error %v during lookup of key %v, unable to queue object for sync", err, key) return nil } else if !exists { klog.Infof("Key %v does not exist in known objects store, unable to queue object for sync", key) return nil } // If we are doing Resync() and there is already an event queued for that object, // we ignore the Resync for it. This is to avoid the race, in which the resync // comes with the previous value of object (since queueing an event for the object // doesn't trigger changing the underlying store . id, err := f.KeyOf(obj) if err != nil { return KeyError{obj, err} } if len(f.items[id]) > 0 { return nil } if err := f.queueActionLocked(Sync, obj); err != nil { return fmt.Errorf("couldn't queue object: %v", err) } return nil } // A KeyListerGetter is anything that knows how to list its keys and look up by key. type KeyListerGetter interface { KeyLister KeyGetter } // A KeyLister is anything that knows how to list its keys. type KeyLister interface { ListKeys() []string } // A KeyGetter is anything that knows how to get the value stored under a given key. type KeyGetter interface { // GetByKey returns the value associated with the key, or sets exists=false. GetByKey(key string) (value interface{}, exists bool, err error) } // Oldest is a convenience function that returns the oldest delta, or // nil if there are no deltas. func (d Deltas) Oldest() *Delta { if len(d) > 0 { return &d[0] } return nil } // Newest is a convenience function that returns the newest delta, or // nil if there are no deltas. func (d Deltas) Newest() *Delta { if n := len(d); n > 0 { return &d[n-1] } return nil } // copyDeltas returns a shallow copy of d; that is, it copies the slice but not // the objects in the slice. This allows Get/List to return an object that we // know won't be clobbered by a subsequent modifications. func copyDeltas(d Deltas) Deltas { d2 := make(Deltas, len(d)) copy(d2, d) return d2 } // DeletedFinalStateUnknown is placed into a DeltaFIFO in the case where an object // was deleted but the watch deletion event was missed while disconnected from // apiserver. In this case we don't know the final "resting" state of the object, so // there's a chance the included `Obj` is stale. type DeletedFinalStateUnknown struct { Key string Obj interface{} } kubernetes-client-go-a2dfcab/tools/cache/delta_fifo_test.go000066400000000000000000000701121472614177300242660ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "errors" "fmt" "reflect" "runtime" "testing" "time" ) // helper function to reduce stuttering func testPop(f *DeltaFIFO) testFifoObject { return Pop(f).(Deltas).Newest().Object.(testFifoObject) } // literalListerGetter is a KeyListerGetter that is based on a // function that returns a slice of objects to list and get. // The function must list the same objects every time. type literalListerGetter func() []testFifoObject var _ KeyListerGetter = literalListerGetter(nil) // ListKeys just calls kl. func (kl literalListerGetter) ListKeys() []string { result := []string{} for _, fifoObj := range kl() { result = append(result, fifoObj.name) } return result } // GetByKey returns the key if it exists in the list returned by kl. func (kl literalListerGetter) GetByKey(key string) (interface{}, bool, error) { for _, v := range kl() { if v.name == key { return v, true, nil } } return nil, false, nil } func TestDeltaFIFO_basic(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) const amount = 500 go func() { for i := 0; i < amount; i++ { f.Add(mkFifoObj(string([]rune{'a', rune(i)}), i+1)) } }() go func() { for u := uint64(0); u < amount; u++ { f.Add(mkFifoObj(string([]rune{'b', rune(u)}), u+1)) } }() lastInt := int(0) lastUint := uint64(0) for i := 0; i < amount*2; i++ { switch obj := testPop(f).val.(type) { case int: if obj <= lastInt { t.Errorf("got %v (int) out of order, last was %v", obj, lastInt) } lastInt = obj case uint64: if obj <= lastUint { t.Errorf("got %v (uint) out of order, last was %v", obj, lastUint) } else { lastUint = obj } default: t.Fatalf("unexpected type %#v", obj) } } } // TestDeltaFIFO_replaceWithDeleteDeltaIn tests that a `Sync` delta for an // object `O` with ID `X` is added when .Replace is called and `O` is among the // replacement objects even if the DeltaFIFO already stores in terminal position // a delta of type `Delete` for ID `X`. Not adding the `Sync` delta causes // SharedIndexInformers to miss `O`'s create notification, see https://github.com/kubernetes/kubernetes/issues/83810 // for more details. func TestDeltaFIFO_replaceWithDeleteDeltaIn(t *testing.T) { oldObj := mkFifoObj("foo", 1) newObj := mkFifoObj("foo", 2) f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{oldObj} }), }) f.Delete(oldObj) f.Replace([]interface{}{newObj}, "") actualDeltas := Pop(f) expectedDeltas := Deltas{ Delta{Type: Deleted, Object: oldObj}, Delta{Type: Sync, Object: newObj}, } if !reflect.DeepEqual(expectedDeltas, actualDeltas) { t.Errorf("expected %#v, got %#v", expectedDeltas, actualDeltas) } } func TestDeltaFIFOW_ReplaceMakesDeletionsForObjectsOnlyInQueue(t *testing.T) { obj := mkFifoObj("foo", 2) objV2 := mkFifoObj("foo", 3) table := []struct { name string operations func(f *DeltaFIFO) expectedDeltas Deltas }{ { name: "Added object should be deleted on Replace", operations: func(f *DeltaFIFO) { f.Add(obj) f.Replace([]interface{}{}, "0") }, expectedDeltas: Deltas{ {Added, obj}, {Deleted, DeletedFinalStateUnknown{Key: "foo", Obj: obj}}, }, }, { name: "Replaced object should have only a single Delete", operations: func(f *DeltaFIFO) { f.emitDeltaTypeReplaced = true f.Add(obj) f.Replace([]interface{}{obj}, "0") f.Replace([]interface{}{}, "0") }, expectedDeltas: Deltas{ {Added, obj}, {Replaced, obj}, {Deleted, DeletedFinalStateUnknown{Key: "foo", Obj: obj}}, }, }, { name: "Deleted object should have only a single Delete", operations: func(f *DeltaFIFO) { f.Add(obj) f.Delete(obj) f.Replace([]interface{}{}, "0") }, expectedDeltas: Deltas{ {Added, obj}, {Deleted, obj}, }, }, { name: "Synced objects should have a single delete", operations: func(f *DeltaFIFO) { f.Add(obj) f.Replace([]interface{}{obj}, "0") f.Replace([]interface{}{obj}, "0") f.Replace([]interface{}{}, "0") }, expectedDeltas: Deltas{ {Added, obj}, {Sync, obj}, {Sync, obj}, {Deleted, DeletedFinalStateUnknown{Key: "foo", Obj: obj}}, }, }, { name: "Added objects should have a single delete on multiple Replaces", operations: func(f *DeltaFIFO) { f.Add(obj) f.Replace([]interface{}{}, "0") f.Replace([]interface{}{}, "1") }, expectedDeltas: Deltas{ {Added, obj}, {Deleted, DeletedFinalStateUnknown{Key: "foo", Obj: obj}}, }, }, { name: "Added and deleted and added object should be deleted", operations: func(f *DeltaFIFO) { f.Add(obj) f.Delete(obj) f.Add(objV2) f.Replace([]interface{}{}, "0") }, expectedDeltas: Deltas{ {Added, obj}, {Deleted, obj}, {Added, objV2}, {Deleted, DeletedFinalStateUnknown{Key: "foo", Obj: objV2}}, }, }, } for _, tt := range table { tt := tt t.Run(tt.name, func(t *testing.T) { // Test with a DeltaFIFO with a backing KnownObjects fWithKnownObjects := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{} }), }) tt.operations(fWithKnownObjects) actualDeltasWithKnownObjects := Pop(fWithKnownObjects) if !reflect.DeepEqual(tt.expectedDeltas, actualDeltasWithKnownObjects) { t.Errorf("expected %#v, got %#v", tt.expectedDeltas, actualDeltasWithKnownObjects) } if len(fWithKnownObjects.items) != 0 { t.Errorf("expected no extra deltas (empty map), got %#v", fWithKnownObjects.items) } // Test with a DeltaFIFO without a backing KnownObjects fWithoutKnownObjects := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, }) tt.operations(fWithoutKnownObjects) actualDeltasWithoutKnownObjects := Pop(fWithoutKnownObjects) if !reflect.DeepEqual(tt.expectedDeltas, actualDeltasWithoutKnownObjects) { t.Errorf("expected %#v, got %#v", tt.expectedDeltas, actualDeltasWithoutKnownObjects) } if len(fWithoutKnownObjects.items) != 0 { t.Errorf("expected no extra deltas (empty map), got %#v", fWithoutKnownObjects.items) } }) } } func TestDeltaFIFO_requeueOnPop(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) f.Add(mkFifoObj("foo", 10)) _, err := f.Pop(func(obj interface{}, isInInitialList bool) error { if obj.(Deltas)[0].Object.(testFifoObject).name != "foo" { t.Fatalf("unexpected object: %#v", obj) } return ErrRequeue{Err: nil} }) if err != nil { t.Fatalf("unexpected error: %v", err) } if _, ok, err := f.GetByKey("foo"); !ok || err != nil { t.Fatalf("object should have been requeued: %t %v", ok, err) } _, err = f.Pop(func(obj interface{}, isInInitialList bool) error { if obj.(Deltas)[0].Object.(testFifoObject).name != "foo" { t.Fatalf("unexpected object: %#v", obj) } return ErrRequeue{Err: fmt.Errorf("test error")} }) if err == nil || err.Error() != "test error" { t.Fatalf("unexpected error: %v", err) } if _, ok, err := f.GetByKey("foo"); !ok || err != nil { t.Fatalf("object should have been requeued: %t %v", ok, err) } _, err = f.Pop(func(obj interface{}, isInInitialList bool) error { if obj.(Deltas)[0].Object.(testFifoObject).name != "foo" { t.Fatalf("unexpected object: %#v", obj) } return nil }) if err != nil { t.Fatalf("unexpected error: %v", err) } if _, ok, err := f.GetByKey("foo"); ok || err != nil { t.Fatalf("object should have been removed: %t %v", ok, err) } } func TestDeltaFIFO_addUpdate(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) f.Add(mkFifoObj("foo", 10)) f.Update(mkFifoObj("foo", 12)) f.Delete(mkFifoObj("foo", 15)) if e, a := []interface{}{mkFifoObj("foo", 15)}, f.List(); !reflect.DeepEqual(e, a) { t.Errorf("Expected %+v, got %+v", e, a) } if e, a := []string{"foo"}, f.ListKeys(); !reflect.DeepEqual(e, a) { t.Errorf("Expected %+v, got %+v", e, a) } got := make(chan testFifoObject, 2) go func() { for { obj := testPop(f) t.Logf("got a thing %#v", obj) t.Logf("D len: %v", len(f.queue)) got <- obj } }() first := <-got if e, a := 15, first.val; e != a { t.Errorf("Didn't get updated value (%v), got %v", e, a) } select { case unexpected := <-got: t.Errorf("Got second value %v", unexpected.val) case <-time.After(50 * time.Millisecond): } _, exists, _ := f.Get(mkFifoObj("foo", "")) if exists { t.Errorf("item did not get removed") } } type rvAndXfrm struct { rv int xfrm int } func TestDeltaFIFO_transformer(t *testing.T) { mk := func(name string, rv int) testFifoObject { return mkFifoObj(name, &rvAndXfrm{rv, 0}) } xfrm := TransformFunc(func(obj interface{}) (interface{}, error) { switch v := obj.(type) { case testFifoObject: v.val.(*rvAndXfrm).xfrm++ case DeletedFinalStateUnknown: if x := v.Obj.(testFifoObject).val.(*rvAndXfrm).xfrm; x != 1 { return nil, fmt.Errorf("object has been transformed wrong number of times: %#v", obj) } default: return nil, fmt.Errorf("unexpected object: %#v", obj) } return obj, nil }) must := func(err error) { if err != nil { t.Fatal(err) } } f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, Transformer: xfrm, }) must(f.Add(mk("foo", 10))) must(f.Add(mk("bar", 11))) must(f.Update(mk("foo", 12))) must(f.Delete(mk("foo", 15))) must(f.Replace([]interface{}{}, "")) must(f.Add(mk("bar", 16))) must(f.Replace([]interface{}{}, "")) // Should be empty if e, a := []string{"foo", "bar"}, f.ListKeys(); !reflect.DeepEqual(e, a) { t.Errorf("Expected %+v, got %+v", e, a) } for i := 0; i < 2; i++ { obj, err := f.Pop(func(o interface{}, isInInitialList bool) error { return nil }) if err != nil { t.Fatalf("got nothing on try %v?", i) } obj = obj.(Deltas).Newest().Object switch v := obj.(type) { case testFifoObject: if v.name != "foo" { t.Errorf("expected regular deletion of foo, got %q", v.name) } rx := v.val.(*rvAndXfrm) if rx.rv != 15 { t.Errorf("expected last message, got %#v", obj) } if rx.xfrm != 1 { t.Errorf("obj %v transformed wrong number of times.", obj) } case DeletedFinalStateUnknown: tf := v.Obj.(testFifoObject) rx := tf.val.(*rvAndXfrm) if tf.name != "bar" { t.Errorf("expected tombstone deletion of bar, got %q", tf.name) } if rx.rv != 16 { t.Errorf("expected last message, got %#v", obj) } if rx.xfrm != 1 { t.Errorf("tombstoned obj %v transformed wrong number of times.", obj) } default: t.Errorf("unknown item %#v", obj) } } } func TestDeltaFIFO_enqueueingNoLister(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) f.Add(mkFifoObj("foo", 10)) f.Update(mkFifoObj("bar", 15)) f.Add(mkFifoObj("qux", 17)) f.Delete(mkFifoObj("qux", 18)) // This delete does not enqueue anything because baz doesn't exist. f.Delete(mkFifoObj("baz", 20)) expectList := []int{10, 15, 18} for _, expect := range expectList { if e, a := expect, testPop(f).val; e != a { t.Errorf("Didn't get updated value (%v), got %v", e, a) } } if e, a := 0, len(f.items); e != a { t.Errorf("queue unexpectedly not empty: %v != %v\n%#v", e, a, f.items) } } func TestDeltaFIFO_enqueueingWithLister(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), }) f.Add(mkFifoObj("foo", 10)) f.Update(mkFifoObj("bar", 15)) // This delete does enqueue the deletion, because "baz" is in the key lister. f.Delete(mkFifoObj("baz", 20)) expectList := []int{10, 15, 20} for _, expect := range expectList { if e, a := expect, testPop(f).val; e != a { t.Errorf("Didn't get updated value (%v), got %v", e, a) } } if e, a := 0, len(f.items); e != a { t.Errorf("queue unexpectedly not empty: %v != %v", e, a) } } func TestDeltaFIFO_addReplace(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) f.Add(mkFifoObj("foo", 10)) f.Replace([]interface{}{mkFifoObj("foo", 15)}, "0") got := make(chan testFifoObject, 2) go func() { for { got <- testPop(f) } }() first := <-got if e, a := 15, first.val; e != a { t.Errorf("Didn't get updated value (%v), got %v", e, a) } select { case unexpected := <-got: t.Errorf("Got second value %v", unexpected.val) case <-time.After(50 * time.Millisecond): } _, exists, _ := f.Get(mkFifoObj("foo", "")) if exists { t.Errorf("item did not get removed") } } func TestDeltaFIFO_ResyncNonExisting(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), }) f.Delete(mkFifoObj("foo", 10)) f.Resync() deltas := f.items["foo"] if len(deltas) != 1 { t.Fatalf("unexpected deltas length: %v", deltas) } if deltas[0].Type != Deleted { t.Errorf("unexpected delta: %v", deltas[0]) } } func TestDeltaFIFO_Resync(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), }) f.Resync() deltas := f.items["foo"] if len(deltas) != 1 { t.Fatalf("unexpected deltas length: %v", deltas) } if deltas[0].Type != Sync { t.Errorf("unexpected delta: %v", deltas[0]) } } func TestDeltaFIFO_DeleteExistingNonPropagated(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{} }), }) f.Add(mkFifoObj("foo", 5)) f.Delete(mkFifoObj("foo", 6)) deltas := f.items["foo"] if len(deltas) != 2 { t.Fatalf("unexpected deltas length: %v", deltas) } if deltas[len(deltas)-1].Type != Deleted { t.Errorf("unexpected delta: %v", deltas[len(deltas)-1]) } } func TestDeltaFIFO_ReplaceMakesDeletions(t *testing.T) { // We test with only one pre-existing object because there is no // promise about how their deletes are ordered. // Try it with a pre-existing Delete f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), }) f.Delete(mkFifoObj("baz", 10)) f.Replace([]interface{}{mkFifoObj("foo", 5)}, "0") expectedList := []Deltas{ {{Deleted, mkFifoObj("baz", 10)}}, {{Sync, mkFifoObj("foo", 5)}}, // Since "bar" didn't have a delete event and wasn't in the Replace list // it should get a tombstone key with the right Obj. {{Deleted, DeletedFinalStateUnknown{Key: "bar", Obj: mkFifoObj("bar", 6)}}}, } for _, expected := range expectedList { cur := Pop(f).(Deltas) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } // Now try starting with an Add instead of a Delete f = NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), }) f.Add(mkFifoObj("baz", 10)) f.Replace([]interface{}{mkFifoObj("foo", 5)}, "0") expectedList = []Deltas{ {{Added, mkFifoObj("baz", 10)}, {Deleted, DeletedFinalStateUnknown{Key: "baz", Obj: mkFifoObj("baz", 10)}}}, {{Sync, mkFifoObj("foo", 5)}}, // Since "bar" didn't have a delete event and wasn't in the Replace list // it should get a tombstone key with the right Obj. {{Deleted, DeletedFinalStateUnknown{Key: "bar", Obj: mkFifoObj("bar", 6)}}}, } for _, expected := range expectedList { cur := Pop(f).(Deltas) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } // Now try deleting and recreating the object in the queue, then delete it by a Replace call f = NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), }) f.Delete(mkFifoObj("bar", 6)) f.Add(mkFifoObj("bar", 100)) f.Replace([]interface{}{mkFifoObj("foo", 5)}, "0") expectedList = []Deltas{ { {Deleted, mkFifoObj("bar", 6)}, {Added, mkFifoObj("bar", 100)}, // Since "bar" has a newer object in the queue than in the state, // it should get a tombstone key with the latest object from the queue {Deleted, DeletedFinalStateUnknown{Key: "bar", Obj: mkFifoObj("bar", 100)}}, }, {{Sync, mkFifoObj("foo", 5)}}, {{Deleted, DeletedFinalStateUnknown{Key: "baz", Obj: mkFifoObj("baz", 7)}}}, } for _, expected := range expectedList { cur := Pop(f).(Deltas) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } // Now try syncing it first to ensure the delete use the latest version f = NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), }) f.Replace([]interface{}{mkFifoObj("bar", 100), mkFifoObj("foo", 5)}, "0") f.Replace([]interface{}{mkFifoObj("foo", 5)}, "0") expectedList = []Deltas{ { {Sync, mkFifoObj("bar", 100)}, // Since "bar" didn't have a delete event and wasn't in the Replace list // it should get a tombstone key with the right Obj. {Deleted, DeletedFinalStateUnknown{Key: "bar", Obj: mkFifoObj("bar", 100)}}, }, { {Sync, mkFifoObj("foo", 5)}, {Sync, mkFifoObj("foo", 5)}, }, {{Deleted, DeletedFinalStateUnknown{Key: "baz", Obj: mkFifoObj("baz", 7)}}}, } for _, expected := range expectedList { cur := Pop(f).(Deltas) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } // Now try starting without an explicit KeyListerGetter f = NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) f.Add(mkFifoObj("baz", 10)) f.Replace([]interface{}{mkFifoObj("foo", 5)}, "0") expectedList = []Deltas{ {{Added, mkFifoObj("baz", 10)}, {Deleted, DeletedFinalStateUnknown{Key: "baz", Obj: mkFifoObj("baz", 10)}}}, {{Sync, mkFifoObj("foo", 5)}}, } for _, expected := range expectedList { cur := Pop(f).(Deltas) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } } // TestDeltaFIFO_ReplaceMakesDeletionsReplaced is the same as the above test, but // ensures that a Replaced DeltaType is emitted. func TestDeltaFIFO_ReplaceMakesDeletionsReplaced(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), EmitDeltaTypeReplaced: true, }) f.Delete(mkFifoObj("baz", 10)) f.Replace([]interface{}{mkFifoObj("foo", 6)}, "0") expectedList := []Deltas{ {{Deleted, mkFifoObj("baz", 10)}}, {{Replaced, mkFifoObj("foo", 6)}}, // Since "bar" didn't have a delete event and wasn't in the Replace list // it should get a tombstone key with the right Obj. {{Deleted, DeletedFinalStateUnknown{Key: "bar", Obj: mkFifoObj("bar", 6)}}}, } for _, expected := range expectedList { cur := Pop(f).(Deltas) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } } // TestDeltaFIFO_ReplaceDeltaType checks that passing EmitDeltaTypeReplaced // means that Replaced is correctly emitted. func TestDeltaFIFO_ReplaceDeltaType(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), EmitDeltaTypeReplaced: true, }) f.Replace([]interface{}{mkFifoObj("foo", 5)}, "0") expectedList := []Deltas{ {{Replaced, mkFifoObj("foo", 5)}}, } for _, expected := range expectedList { cur := Pop(f).(Deltas) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } } func TestDeltaFIFO_UpdateResyncRace(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), }) f.Update(mkFifoObj("foo", 6)) f.Resync() expectedList := []Deltas{ {{Updated, mkFifoObj("foo", 6)}}, } for _, expected := range expectedList { cur := Pop(f).(Deltas) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } } } // pop2 captures both parameters, unlike Pop(). func pop2[T any](queue Queue) (T, bool) { var result interface{} var isList bool queue.Pop(func(obj interface{}, isInInitialList bool) error { result = obj isList = isInInitialList return nil }) return result.(T), isList } func TestDeltaFIFO_HasSyncedCorrectOnDeletion(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), }) f.Replace([]interface{}{mkFifoObj("foo", 5)}, "0") expectedList := []Deltas{ {{Sync, mkFifoObj("foo", 5)}}, // Since "bar" didn't have a delete event and wasn't in the Replace list // it should get a tombstone key with the right Obj. {{Deleted, DeletedFinalStateUnknown{Key: "bar", Obj: mkFifoObj("bar", 6)}}}, {{Deleted, DeletedFinalStateUnknown{Key: "baz", Obj: mkFifoObj("baz", 7)}}}, } for _, expected := range expectedList { if f.HasSynced() { t.Errorf("Expected HasSynced to be false") } cur, initial := pop2[Deltas](f) if e, a := expected, cur; !reflect.DeepEqual(e, a) { t.Errorf("Expected %#v, got %#v", e, a) } if initial != true { t.Error("Expected initial list item") } } if !f.HasSynced() { t.Errorf("Expected HasSynced to be true") } } func TestDeltaFIFO_detectLineJumpers(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) f.Add(mkFifoObj("foo", 10)) f.Add(mkFifoObj("bar", 1)) f.Add(mkFifoObj("foo", 11)) f.Add(mkFifoObj("foo", 13)) f.Add(mkFifoObj("zab", 30)) if e, a := 13, testPop(f).val; a != e { t.Fatalf("expected %d, got %d", e, a) } f.Add(mkFifoObj("foo", 14)) // ensure foo doesn't jump back in line if e, a := 1, testPop(f).val; a != e { t.Fatalf("expected %d, got %d", e, a) } if e, a := 30, testPop(f).val; a != e { t.Fatalf("expected %d, got %d", e, a) } if e, a := 14, testPop(f).val; a != e { t.Fatalf("expected %d, got %d", e, a) } } func TestDeltaFIFO_addIfNotPresent(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) emptyDeltas := Deltas{} if err := f.AddIfNotPresent(emptyDeltas); err == nil || !errors.Is(err, ErrZeroLengthDeltasObject) { t.Errorf("Expected error '%v', got %v", ErrZeroLengthDeltasObject, err) } f.Add(mkFifoObj("b", 3)) b3 := Pop(f) f.Add(mkFifoObj("c", 4)) c4 := Pop(f) if e, a := 0, len(f.items); e != a { t.Fatalf("Expected %v, got %v items in queue", e, a) } f.Add(mkFifoObj("a", 1)) f.Add(mkFifoObj("b", 2)) f.AddIfNotPresent(b3) f.AddIfNotPresent(c4) if e, a := 3, len(f.items); a != e { t.Fatalf("expected queue length %d, got %d", e, a) } expectedValues := []int{1, 2, 4} for _, expected := range expectedValues { if actual := testPop(f).val; actual != expected { t.Fatalf("expected value %d, got %d", expected, actual) } } } func TestDeltaFIFO_KeyOf(t *testing.T) { f := DeltaFIFO{keyFunc: testFifoObjectKeyFunc} table := []struct { obj interface{} key string }{ {obj: testFifoObject{name: "A"}, key: "A"}, {obj: DeletedFinalStateUnknown{Key: "B", Obj: nil}, key: "B"}, {obj: Deltas{{Object: testFifoObject{name: "C"}}}, key: "C"}, {obj: Deltas{{Object: DeletedFinalStateUnknown{Key: "D", Obj: nil}}}, key: "D"}, } for _, item := range table { got, err := f.KeyOf(item.obj) if err != nil { t.Errorf("Unexpected error for %q: %v", item.obj, err) continue } if e, a := item.key, got; e != a { t.Errorf("Expected %v, got %v", e, a) } } } func TestDeltaFIFO_HasSynced(t *testing.T) { tests := []struct { actions []func(f *DeltaFIFO) expectedSynced bool }{ { actions: []func(f *DeltaFIFO){}, expectedSynced: false, }, { actions: []func(f *DeltaFIFO){ func(f *DeltaFIFO) { f.Add(mkFifoObj("a", 1)) }, }, expectedSynced: true, }, { actions: []func(f *DeltaFIFO){ func(f *DeltaFIFO) { f.Replace([]interface{}{}, "0") }, }, expectedSynced: true, }, { actions: []func(f *DeltaFIFO){ func(f *DeltaFIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, }, expectedSynced: false, }, { actions: []func(f *DeltaFIFO){ func(f *DeltaFIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, func(f *DeltaFIFO) { Pop(f) }, }, expectedSynced: false, }, { actions: []func(f *DeltaFIFO){ func(f *DeltaFIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, func(f *DeltaFIFO) { Pop(f) }, func(f *DeltaFIFO) { Pop(f) }, }, expectedSynced: true, }, { // This test case won't happen in practice since a Reflector, the only producer for delta_fifo today, always passes a complete snapshot consistent in time; // there cannot be duplicate keys in the list or apiserver is broken. actions: []func(f *DeltaFIFO){ func(f *DeltaFIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("a", 2)}, "0") }, func(f *DeltaFIFO) { Pop(f) }, }, expectedSynced: true, }, } for i, test := range tests { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) for _, action := range test.actions { action(f) } if e, a := test.expectedSynced, f.HasSynced(); a != e { t.Errorf("test case %v failed, expected: %v , got %v", i, e, a) } } } // TestDeltaFIFO_PopShouldUnblockWhenClosed checks that any blocking Pop on an empty queue // should unblock and return after Close is called. func TestDeltaFIFO_PopShouldUnblockWhenClosed(t *testing.T) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KeyFunction: testFifoObjectKeyFunc, KnownObjects: literalListerGetter(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), }) c := make(chan struct{}) const jobs = 10 for i := 0; i < jobs; i++ { go func() { f.Pop(func(obj interface{}, isInInitialList bool) error { return nil }) c <- struct{}{} }() } runtime.Gosched() f.Close() for i := 0; i < jobs; i++ { select { case <-c: case <-time.After(500 * time.Millisecond): t.Fatalf("timed out waiting for Pop to return after Close") } } } func BenchmarkDeltaFIFOListKeys(b *testing.B) { f := NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: testFifoObjectKeyFunc}) const amount = 10000 for i := 0; i < amount; i++ { f.Add(mkFifoObj(string([]rune{'a', rune(i)}), i+1)) } for u := uint64(0); u < amount; u++ { f.Add(mkFifoObj(string([]rune{'b', rune(u)}), u+1)) } b.ResetTimer() b.RunParallel(func(pb *testing.PB) { for pb.Next() { _ = f.ListKeys() } }) b.StopTimer() } kubernetes-client-go-a2dfcab/tools/cache/doc.go000066400000000000000000000020501472614177300216740ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package cache is a client-side caching mechanism. It is useful for // reducing the number of server calls you'd otherwise need to make. // Reflector watches a server and updates a Store. Two stores are provided; // one that simply caches objects (for example, to allow a scheduler to // list currently available nodes), and one that additionally acts as // a FIFO queue (for example, to allow a scheduler to process incoming // pods). package cache // import "k8s.io/client-go/tools/cache" kubernetes-client-go-a2dfcab/tools/cache/expiration_cache.go000066400000000000000000000154231472614177300244440ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "sync" "time" "k8s.io/utils/clock" ) // ExpirationCache implements the store interface // 1. All entries are automatically time stamped on insert // a. The key is computed based off the original item/keyFunc // b. The value inserted under that key is the timestamped item // 2. Expiration happens lazily on read based on the expiration policy // a. No item can be inserted into the store while we're expiring // *any* item in the cache. // 3. Time-stamps are stripped off unexpired entries before return // // Note that the ExpirationCache is inherently slower than a normal // threadSafeStore because it takes a write lock every time it checks if // an item has expired. type ExpirationCache struct { cacheStorage ThreadSafeStore keyFunc KeyFunc clock clock.Clock expirationPolicy ExpirationPolicy // expirationLock is a write lock used to guarantee that we don't clobber // newly inserted objects because of a stale expiration timestamp comparison expirationLock sync.Mutex } // ExpirationPolicy dictates when an object expires. Currently only abstracted out // so unittests don't rely on the system clock. type ExpirationPolicy interface { IsExpired(obj *TimestampedEntry) bool } // TTLPolicy implements a ttl based ExpirationPolicy. type TTLPolicy struct { // >0: Expire entries with an age > ttl // <=0: Don't expire any entry TTL time.Duration // Clock used to calculate ttl expiration Clock clock.Clock } // IsExpired returns true if the given object is older than the ttl, or it can't // determine its age. func (p *TTLPolicy) IsExpired(obj *TimestampedEntry) bool { return p.TTL > 0 && p.Clock.Since(obj.Timestamp) > p.TTL } // TimestampedEntry is the only type allowed in a ExpirationCache. // Keep in mind that it is not safe to share timestamps between computers. // Behavior may be inconsistent if you get a timestamp from the API Server and // use it on the client machine as part of your ExpirationCache. type TimestampedEntry struct { Obj interface{} Timestamp time.Time key string } // getTimestampedEntry returns the TimestampedEntry stored under the given key. func (c *ExpirationCache) getTimestampedEntry(key string) (*TimestampedEntry, bool) { item, _ := c.cacheStorage.Get(key) if tsEntry, ok := item.(*TimestampedEntry); ok { return tsEntry, true } return nil, false } // getOrExpire retrieves the object from the TimestampedEntry if and only if it hasn't // already expired. It holds a write lock across deletion. func (c *ExpirationCache) getOrExpire(key string) (interface{}, bool) { // Prevent all inserts from the time we deem an item as "expired" to when we // delete it, so an un-expired item doesn't sneak in under the same key, just // before the Delete. c.expirationLock.Lock() defer c.expirationLock.Unlock() timestampedItem, exists := c.getTimestampedEntry(key) if !exists { return nil, false } if c.expirationPolicy.IsExpired(timestampedItem) { c.cacheStorage.Delete(key) return nil, false } return timestampedItem.Obj, true } // GetByKey returns the item stored under the key, or sets exists=false. func (c *ExpirationCache) GetByKey(key string) (interface{}, bool, error) { obj, exists := c.getOrExpire(key) return obj, exists, nil } // Get returns unexpired items. It purges the cache of expired items in the // process. func (c *ExpirationCache) Get(obj interface{}) (interface{}, bool, error) { key, err := c.keyFunc(obj) if err != nil { return nil, false, KeyError{obj, err} } obj, exists := c.getOrExpire(key) return obj, exists, nil } // List retrieves a list of unexpired items. It purges the cache of expired // items in the process. func (c *ExpirationCache) List() []interface{} { items := c.cacheStorage.List() list := make([]interface{}, 0, len(items)) for _, item := range items { key := item.(*TimestampedEntry).key if obj, exists := c.getOrExpire(key); exists { list = append(list, obj) } } return list } // ListKeys returns a list of all keys in the expiration cache. func (c *ExpirationCache) ListKeys() []string { return c.cacheStorage.ListKeys() } // Add timestamps an item and inserts it into the cache, overwriting entries // that might exist under the same key. func (c *ExpirationCache) Add(obj interface{}) error { key, err := c.keyFunc(obj) if err != nil { return KeyError{obj, err} } c.expirationLock.Lock() defer c.expirationLock.Unlock() c.cacheStorage.Add(key, &TimestampedEntry{obj, c.clock.Now(), key}) return nil } // Update has not been implemented yet for lack of a use case, so this method // simply calls `Add`. This effectively refreshes the timestamp. func (c *ExpirationCache) Update(obj interface{}) error { return c.Add(obj) } // Delete removes an item from the cache. func (c *ExpirationCache) Delete(obj interface{}) error { key, err := c.keyFunc(obj) if err != nil { return KeyError{obj, err} } c.expirationLock.Lock() defer c.expirationLock.Unlock() c.cacheStorage.Delete(key) return nil } // Replace will convert all items in the given list to TimestampedEntries // before attempting the replace operation. The replace operation will // delete the contents of the ExpirationCache `c`. func (c *ExpirationCache) Replace(list []interface{}, resourceVersion string) error { items := make(map[string]interface{}, len(list)) ts := c.clock.Now() for _, item := range list { key, err := c.keyFunc(item) if err != nil { return KeyError{item, err} } items[key] = &TimestampedEntry{item, ts, key} } c.expirationLock.Lock() defer c.expirationLock.Unlock() c.cacheStorage.Replace(items, resourceVersion) return nil } // Resync is a no-op for one of these func (c *ExpirationCache) Resync() error { return nil } // NewTTLStore creates and returns a ExpirationCache with a TTLPolicy func NewTTLStore(keyFunc KeyFunc, ttl time.Duration) Store { return NewExpirationStore(keyFunc, &TTLPolicy{ttl, clock.RealClock{}}) } // NewExpirationStore creates and returns a ExpirationCache for a given policy func NewExpirationStore(keyFunc KeyFunc, expirationPolicy ExpirationPolicy) Store { return &ExpirationCache{ cacheStorage: NewThreadSafeStore(Indexers{}, Indices{}), keyFunc: keyFunc, clock: clock.RealClock{}, expirationPolicy: expirationPolicy, } } kubernetes-client-go-a2dfcab/tools/cache/expiration_cache_fakes.go000066400000000000000000000032341472614177300256120ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/utils/clock" ) type fakeThreadSafeMap struct { ThreadSafeStore deletedKeys chan<- string } func (c *fakeThreadSafeMap) Delete(key string) { if c.deletedKeys != nil { c.ThreadSafeStore.Delete(key) c.deletedKeys <- key } } // FakeExpirationPolicy keeps the list for keys which never expires. type FakeExpirationPolicy struct { NeverExpire sets.String RetrieveKeyFunc KeyFunc } // IsExpired used to check if object is expired. func (p *FakeExpirationPolicy) IsExpired(obj *TimestampedEntry) bool { key, _ := p.RetrieveKeyFunc(obj) return !p.NeverExpire.Has(key) } // NewFakeExpirationStore creates a new instance for the ExpirationCache. func NewFakeExpirationStore(keyFunc KeyFunc, deletedKeys chan<- string, expirationPolicy ExpirationPolicy, cacheClock clock.Clock) Store { cacheStorage := NewThreadSafeStore(Indexers{}, Indices{}) return &ExpirationCache{ cacheStorage: &fakeThreadSafeMap{cacheStorage, deletedKeys}, keyFunc: keyFunc, clock: cacheClock, expirationPolicy: expirationPolicy, } } kubernetes-client-go-a2dfcab/tools/cache/expiration_cache_test.go000066400000000000000000000126761472614177300255120ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "reflect" "testing" "time" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/utils/clock" testingclock "k8s.io/utils/clock/testing" ) func TestTTLExpirationBasic(t *testing.T) { testObj := testStoreObject{id: "foo", val: "bar"} deleteChan := make(chan string, 1) ttlStore := NewFakeExpirationStore( testStoreKeyFunc, deleteChan, &FakeExpirationPolicy{ NeverExpire: sets.NewString(), RetrieveKeyFunc: func(obj interface{}) (string, error) { return obj.(*TimestampedEntry).Obj.(testStoreObject).id, nil }, }, clock.RealClock{}, ) err := ttlStore.Add(testObj) if err != nil { t.Errorf("Unable to add obj %#v", testObj) } item, exists, err := ttlStore.Get(testObj) if err != nil { t.Errorf("Failed to get from store, %v", err) } if exists || item != nil { t.Errorf("Got unexpected item %#v", item) } key, _ := testStoreKeyFunc(testObj) select { case delKey := <-deleteChan: if delKey != key { t.Errorf("Unexpected delete for key %s", key) } case <-time.After(wait.ForeverTestTimeout): t.Errorf("Unexpected timeout waiting on delete") } close(deleteChan) } func TestReAddExpiredItem(t *testing.T) { deleteChan := make(chan string, 1) exp := &FakeExpirationPolicy{ NeverExpire: sets.NewString(), RetrieveKeyFunc: func(obj interface{}) (string, error) { return obj.(*TimestampedEntry).Obj.(testStoreObject).id, nil }, } ttlStore := NewFakeExpirationStore( testStoreKeyFunc, deleteChan, exp, clock.RealClock{}) testKey := "foo" testObj := testStoreObject{id: testKey, val: "bar"} err := ttlStore.Add(testObj) if err != nil { t.Errorf("Unable to add obj %#v", testObj) } // This get will expire the item. item, exists, err := ttlStore.Get(testObj) if err != nil { t.Errorf("Failed to get from store, %v", err) } if exists || item != nil { t.Errorf("Got unexpected item %#v", item) } key, _ := testStoreKeyFunc(testObj) differentValue := "different_bar" err = ttlStore.Add( testStoreObject{id: testKey, val: differentValue}) if err != nil { t.Errorf("Failed to add second value") } select { case delKey := <-deleteChan: if delKey != key { t.Errorf("Unexpected delete for key %s", key) } case <-time.After(wait.ForeverTestTimeout): t.Errorf("Unexpected timeout waiting on delete") } exp.NeverExpire = sets.NewString(testKey) item, exists, err = ttlStore.GetByKey(testKey) if err != nil { t.Errorf("Failed to get from store, %v", err) } if !exists || item == nil || item.(testStoreObject).val != differentValue { t.Errorf("Got unexpected item %#v", item) } close(deleteChan) } func TestTTLList(t *testing.T) { testObjs := []testStoreObject{ {id: "foo", val: "bar"}, {id: "foo1", val: "bar1"}, {id: "foo2", val: "bar2"}, } expireKeys := sets.NewString(testObjs[0].id, testObjs[2].id) deleteChan := make(chan string, len(testObjs)) defer close(deleteChan) ttlStore := NewFakeExpirationStore( testStoreKeyFunc, deleteChan, &FakeExpirationPolicy{ NeverExpire: sets.NewString(testObjs[1].id), RetrieveKeyFunc: func(obj interface{}) (string, error) { return obj.(*TimestampedEntry).Obj.(testStoreObject).id, nil }, }, clock.RealClock{}, ) for _, obj := range testObjs { err := ttlStore.Add(obj) if err != nil { t.Errorf("Unable to add obj %#v", obj) } } listObjs := ttlStore.List() if len(listObjs) != 1 || !reflect.DeepEqual(listObjs[0], testObjs[1]) { t.Errorf("List returned unexpected results %#v", listObjs) } // Make sure all our deletes come through in an acceptable rate (1/100ms) for expireKeys.Len() != 0 { select { case delKey := <-deleteChan: if !expireKeys.Has(delKey) { t.Errorf("Unexpected delete for key %s", delKey) } expireKeys.Delete(delKey) case <-time.After(wait.ForeverTestTimeout): t.Errorf("Unexpected timeout waiting on delete") return } } } func TestTTLPolicy(t *testing.T) { fakeTime := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) ttl := 30 * time.Second exactlyOnTTL := fakeTime.Add(-ttl) expiredTime := fakeTime.Add(-(ttl + 1)) policy := TTLPolicy{ttl, testingclock.NewFakeClock(fakeTime)} item := testStoreObject{id: "foo", val: "bar"} itemkey, _ := testStoreKeyFunc(item) fakeTimestampedEntry := &TimestampedEntry{Obj: item, Timestamp: exactlyOnTTL, key: itemkey} if policy.IsExpired(fakeTimestampedEntry) { t.Errorf("TTL cache should not expire entries exactly on ttl") } fakeTimestampedEntry.Timestamp = fakeTime if policy.IsExpired(fakeTimestampedEntry) { t.Errorf("TTL Cache should not expire entries before ttl") } fakeTimestampedEntry.Timestamp = expiredTime if !policy.IsExpired(fakeTimestampedEntry) { t.Errorf("TTL Cache should expire entries older than ttl") } for _, ttl = range []time.Duration{0, -1} { policy.TTL = ttl if policy.IsExpired(fakeTimestampedEntry) { t.Errorf("TTL policy should only expire entries when initialized with a ttl > 0") } } } kubernetes-client-go-a2dfcab/tools/cache/fake_custom_store.go000066400000000000000000000054531472614177300246550ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache // FakeCustomStore lets you define custom functions for store operations. type FakeCustomStore struct { AddFunc func(obj interface{}) error UpdateFunc func(obj interface{}) error DeleteFunc func(obj interface{}) error ListFunc func() []interface{} ListKeysFunc func() []string GetFunc func(obj interface{}) (item interface{}, exists bool, err error) GetByKeyFunc func(key string) (item interface{}, exists bool, err error) ReplaceFunc func(list []interface{}, resourceVersion string) error ResyncFunc func() error } // Add calls the custom Add function if defined func (f *FakeCustomStore) Add(obj interface{}) error { if f.AddFunc != nil { return f.AddFunc(obj) } return nil } // Update calls the custom Update function if defined func (f *FakeCustomStore) Update(obj interface{}) error { if f.UpdateFunc != nil { return f.UpdateFunc(obj) } return nil } // Delete calls the custom Delete function if defined func (f *FakeCustomStore) Delete(obj interface{}) error { if f.DeleteFunc != nil { return f.DeleteFunc(obj) } return nil } // List calls the custom List function if defined func (f *FakeCustomStore) List() []interface{} { if f.ListFunc != nil { return f.ListFunc() } return nil } // ListKeys calls the custom ListKeys function if defined func (f *FakeCustomStore) ListKeys() []string { if f.ListKeysFunc != nil { return f.ListKeysFunc() } return nil } // Get calls the custom Get function if defined func (f *FakeCustomStore) Get(obj interface{}) (item interface{}, exists bool, err error) { if f.GetFunc != nil { return f.GetFunc(obj) } return nil, false, nil } // GetByKey calls the custom GetByKey function if defined func (f *FakeCustomStore) GetByKey(key string) (item interface{}, exists bool, err error) { if f.GetByKeyFunc != nil { return f.GetByKeyFunc(key) } return nil, false, nil } // Replace calls the custom Replace function if defined func (f *FakeCustomStore) Replace(list []interface{}, resourceVersion string) error { if f.ReplaceFunc != nil { return f.ReplaceFunc(list, resourceVersion) } return nil } // Resync calls the custom Resync function if defined func (f *FakeCustomStore) Resync() error { if f.ResyncFunc != nil { return f.ResyncFunc() } return nil } kubernetes-client-go-a2dfcab/tools/cache/fifo.go000066400000000000000000000263701472614177300220650ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "errors" "sync" "k8s.io/apimachinery/pkg/util/sets" ) // PopProcessFunc is passed to Pop() method of Queue interface. // It is supposed to process the accumulator popped from the queue. type PopProcessFunc func(obj interface{}, isInInitialList bool) error // ErrRequeue may be returned by a PopProcessFunc to safely requeue // the current item. The value of Err will be returned from Pop. type ErrRequeue struct { // Err is returned by the Pop function Err error } // ErrFIFOClosed used when FIFO is closed var ErrFIFOClosed = errors.New("DeltaFIFO: manipulating with closed queue") func (e ErrRequeue) Error() string { if e.Err == nil { return "the popped item should be requeued without returning an error" } return e.Err.Error() } // Queue extends Store with a collection of Store keys to "process". // Every Add, Update, or Delete may put the object's key in that collection. // A Queue has a way to derive the corresponding key given an accumulator. // A Queue can be accessed concurrently from multiple goroutines. // A Queue can be "closed", after which Pop operations return an error. type Queue interface { Store // Pop blocks until there is at least one key to process or the // Queue is closed. In the latter case Pop returns with an error. // In the former case Pop atomically picks one key to process, // removes that (key, accumulator) association from the Store, and // processes the accumulator. Pop returns the accumulator that // was processed and the result of processing. The PopProcessFunc // may return an ErrRequeue{inner} and in this case Pop will (a) // return that (key, accumulator) association to the Queue as part // of the atomic processing and (b) return the inner error from // Pop. Pop(PopProcessFunc) (interface{}, error) // AddIfNotPresent puts the given accumulator into the Queue (in // association with the accumulator's key) if and only if that key // is not already associated with a non-empty accumulator. AddIfNotPresent(interface{}) error // HasSynced returns true if the first batch of keys have all been // popped. The first batch of keys are those of the first Replace // operation if that happened before any Add, AddIfNotPresent, // Update, or Delete; otherwise the first batch is empty. HasSynced() bool // Close the queue Close() } // Pop is helper function for popping from Queue. // WARNING: Do NOT use this function in non-test code to avoid races // unless you really really really really know what you are doing. // // NOTE: This function is deprecated and may be removed in the future without // additional warning. func Pop(queue Queue) interface{} { var result interface{} queue.Pop(func(obj interface{}, isInInitialList bool) error { result = obj return nil }) return result } // FIFO is a Queue in which (a) each accumulator is simply the most // recently provided object and (b) the collection of keys to process // is a FIFO. The accumulators all start out empty, and deleting an // object from its accumulator empties the accumulator. The Resync // operation is a no-op. // // Thus: if multiple adds/updates of a single object happen while that // object's key is in the queue before it has been processed then it // will only be processed once, and when it is processed the most // recent version will be processed. This can't be done with a channel // // FIFO solves this use case: // - You want to process every object (exactly) once. // - You want to process the most recent version of the object when you process it. // - You do not want to process deleted objects, they should be removed from the queue. // - You do not want to periodically reprocess objects. // // Compare with DeltaFIFO for other use cases. type FIFO struct { lock sync.RWMutex cond sync.Cond // We depend on the property that every key in `items` is also in `queue` items map[string]interface{} queue []string // populated is true if the first batch of items inserted by Replace() has been populated // or Delete/Add/Update was called first. populated bool // initialPopulationCount is the number of items inserted by the first call of Replace() initialPopulationCount int // keyFunc is used to make the key used for queued item insertion and retrieval, and // should be deterministic. keyFunc KeyFunc // Indication the queue is closed. // Used to indicate a queue is closed so a control loop can exit when a queue is empty. // Currently, not used to gate any of CRUD operations. closed bool } var ( _ = Queue(&FIFO{}) // FIFO is a Queue ) // Close the queue. func (f *FIFO) Close() { f.lock.Lock() defer f.lock.Unlock() f.closed = true f.cond.Broadcast() } // HasSynced returns true if an Add/Update/Delete/AddIfNotPresent are called first, // or the first batch of items inserted by Replace() has been popped. func (f *FIFO) HasSynced() bool { f.lock.Lock() defer f.lock.Unlock() return f.hasSynced_locked() } func (f *FIFO) hasSynced_locked() bool { return f.populated && f.initialPopulationCount == 0 } // Add inserts an item, and puts it in the queue. The item is only enqueued // if it doesn't already exist in the set. func (f *FIFO) Add(obj interface{}) error { id, err := f.keyFunc(obj) if err != nil { return KeyError{obj, err} } f.lock.Lock() defer f.lock.Unlock() f.populated = true if _, exists := f.items[id]; !exists { f.queue = append(f.queue, id) } f.items[id] = obj f.cond.Broadcast() return nil } // AddIfNotPresent inserts an item, and puts it in the queue. If the item is already // present in the set, it is neither enqueued nor added to the set. // // This is useful in a single producer/consumer scenario so that the consumer can // safely retry items without contending with the producer and potentially enqueueing // stale items. func (f *FIFO) AddIfNotPresent(obj interface{}) error { id, err := f.keyFunc(obj) if err != nil { return KeyError{obj, err} } f.lock.Lock() defer f.lock.Unlock() f.addIfNotPresent(id, obj) return nil } // addIfNotPresent assumes the fifo lock is already held and adds the provided // item to the queue under id if it does not already exist. func (f *FIFO) addIfNotPresent(id string, obj interface{}) { f.populated = true if _, exists := f.items[id]; exists { return } f.queue = append(f.queue, id) f.items[id] = obj f.cond.Broadcast() } // Update is the same as Add in this implementation. func (f *FIFO) Update(obj interface{}) error { return f.Add(obj) } // Delete removes an item. It doesn't add it to the queue, because // this implementation assumes the consumer only cares about the objects, // not the order in which they were created/added. func (f *FIFO) Delete(obj interface{}) error { id, err := f.keyFunc(obj) if err != nil { return KeyError{obj, err} } f.lock.Lock() defer f.lock.Unlock() f.populated = true delete(f.items, id) return err } // List returns a list of all the items. func (f *FIFO) List() []interface{} { f.lock.RLock() defer f.lock.RUnlock() list := make([]interface{}, 0, len(f.items)) for _, item := range f.items { list = append(list, item) } return list } // ListKeys returns a list of all the keys of the objects currently // in the FIFO. func (f *FIFO) ListKeys() []string { f.lock.RLock() defer f.lock.RUnlock() list := make([]string, 0, len(f.items)) for key := range f.items { list = append(list, key) } return list } // Get returns the requested item, or sets exists=false. func (f *FIFO) Get(obj interface{}) (item interface{}, exists bool, err error) { key, err := f.keyFunc(obj) if err != nil { return nil, false, KeyError{obj, err} } return f.GetByKey(key) } // GetByKey returns the requested item, or sets exists=false. func (f *FIFO) GetByKey(key string) (item interface{}, exists bool, err error) { f.lock.RLock() defer f.lock.RUnlock() item, exists = f.items[key] return item, exists, nil } // IsClosed checks if the queue is closed func (f *FIFO) IsClosed() bool { f.lock.Lock() defer f.lock.Unlock() return f.closed } // Pop waits until an item is ready and processes it. If multiple items are // ready, they are returned in the order in which they were added/updated. // The item is removed from the queue (and the store) before it is processed, // so if you don't successfully process it, it should be added back with // AddIfNotPresent(). process function is called under lock, so it is safe // update data structures in it that need to be in sync with the queue. func (f *FIFO) Pop(process PopProcessFunc) (interface{}, error) { f.lock.Lock() defer f.lock.Unlock() for { for len(f.queue) == 0 { // When the queue is empty, invocation of Pop() is blocked until new item is enqueued. // When Close() is called, the f.closed is set and the condition is broadcasted. // Which causes this loop to continue and return from the Pop(). if f.closed { return nil, ErrFIFOClosed } f.cond.Wait() } isInInitialList := !f.hasSynced_locked() id := f.queue[0] f.queue = f.queue[1:] if f.initialPopulationCount > 0 { f.initialPopulationCount-- } item, ok := f.items[id] if !ok { // Item may have been deleted subsequently. continue } delete(f.items, id) err := process(item, isInInitialList) if e, ok := err.(ErrRequeue); ok { f.addIfNotPresent(id, item) err = e.Err } return item, err } } // Replace will delete the contents of 'f', using instead the given map. // 'f' takes ownership of the map, you should not reference the map again // after calling this function. f's queue is reset, too; upon return, it // will contain the items in the map, in no particular order. func (f *FIFO) Replace(list []interface{}, resourceVersion string) error { items := make(map[string]interface{}, len(list)) for _, item := range list { key, err := f.keyFunc(item) if err != nil { return KeyError{item, err} } items[key] = item } f.lock.Lock() defer f.lock.Unlock() if !f.populated { f.populated = true f.initialPopulationCount = len(items) } f.items = items f.queue = f.queue[:0] for id := range items { f.queue = append(f.queue, id) } if len(f.queue) > 0 { f.cond.Broadcast() } return nil } // Resync will ensure that every object in the Store has its key in the queue. // This should be a no-op, because that property is maintained by all operations. func (f *FIFO) Resync() error { f.lock.Lock() defer f.lock.Unlock() inQueue := sets.NewString() for _, id := range f.queue { inQueue.Insert(id) } for id := range f.items { if !inQueue.Has(id) { f.queue = append(f.queue, id) } } if len(f.queue) > 0 { f.cond.Broadcast() } return nil } // NewFIFO returns a Store which can be used to queue up items to // process. func NewFIFO(keyFunc KeyFunc) *FIFO { f := &FIFO{ items: map[string]interface{}{}, queue: []string{}, keyFunc: keyFunc, } f.cond.L = &f.lock return f } kubernetes-client-go-a2dfcab/tools/cache/fifo_test.go000066400000000000000000000165621472614177300231260ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "reflect" "runtime" "testing" "time" ) func testFifoObjectKeyFunc(obj interface{}) (string, error) { return obj.(testFifoObject).name, nil } type testFifoObject struct { name string val interface{} } func mkFifoObj(name string, val interface{}) testFifoObject { return testFifoObject{name: name, val: val} } func TestFIFO_basic(t *testing.T) { f := NewFIFO(testFifoObjectKeyFunc) const amount = 500 go func() { for i := 0; i < amount; i++ { f.Add(mkFifoObj(string([]rune{'a', rune(i)}), i+1)) } }() go func() { for u := uint64(0); u < amount; u++ { f.Add(mkFifoObj(string([]rune{'b', rune(u)}), u+1)) } }() lastInt := int(0) lastUint := uint64(0) for i := 0; i < amount*2; i++ { switch obj := Pop(f).(testFifoObject).val.(type) { case int: if obj <= lastInt { t.Errorf("got %v (int) out of order, last was %v", obj, lastInt) } lastInt = obj case uint64: if obj <= lastUint { t.Errorf("got %v (uint) out of order, last was %v", obj, lastUint) } else { lastUint = obj } default: t.Fatalf("unexpected type %#v", obj) } } } func TestFIFO_requeueOnPop(t *testing.T) { f := NewFIFO(testFifoObjectKeyFunc) f.Add(mkFifoObj("foo", 10)) _, err := f.Pop(func(obj interface{}, isInInitialList bool) error { if obj.(testFifoObject).name != "foo" { t.Fatalf("unexpected object: %#v", obj) } return ErrRequeue{Err: nil} }) if err != nil { t.Fatalf("unexpected error: %v", err) } if _, ok, err := f.GetByKey("foo"); !ok || err != nil { t.Fatalf("object should have been requeued: %t %v", ok, err) } _, err = f.Pop(func(obj interface{}, isInInitialList bool) error { if obj.(testFifoObject).name != "foo" { t.Fatalf("unexpected object: %#v", obj) } return ErrRequeue{Err: fmt.Errorf("test error")} }) if err == nil || err.Error() != "test error" { t.Fatalf("unexpected error: %v", err) } if _, ok, err := f.GetByKey("foo"); !ok || err != nil { t.Fatalf("object should have been requeued: %t %v", ok, err) } _, err = f.Pop(func(obj interface{}, isInInitialList bool) error { if obj.(testFifoObject).name != "foo" { t.Fatalf("unexpected object: %#v", obj) } return nil }) if err != nil { t.Fatalf("unexpected error: %v", err) } if _, ok, err := f.GetByKey("foo"); ok || err != nil { t.Fatalf("object should have been removed: %t %v", ok, err) } } func TestFIFO_addUpdate(t *testing.T) { f := NewFIFO(testFifoObjectKeyFunc) f.Add(mkFifoObj("foo", 10)) f.Update(mkFifoObj("foo", 15)) if e, a := []interface{}{mkFifoObj("foo", 15)}, f.List(); !reflect.DeepEqual(e, a) { t.Errorf("Expected %+v, got %+v", e, a) } if e, a := []string{"foo"}, f.ListKeys(); !reflect.DeepEqual(e, a) { t.Errorf("Expected %+v, got %+v", e, a) } got := make(chan testFifoObject, 2) go func() { for { got <- Pop(f).(testFifoObject) } }() first := <-got if e, a := 15, first.val; e != a { t.Errorf("Didn't get updated value (%v), got %v", e, a) } select { case unexpected := <-got: t.Errorf("Got second value %v", unexpected.val) case <-time.After(50 * time.Millisecond): } _, exists, _ := f.Get(mkFifoObj("foo", "")) if exists { t.Errorf("item did not get removed") } } func TestFIFO_addReplace(t *testing.T) { f := NewFIFO(testFifoObjectKeyFunc) f.Add(mkFifoObj("foo", 10)) f.Replace([]interface{}{mkFifoObj("foo", 15)}, "15") got := make(chan testFifoObject, 2) go func() { for { got <- Pop(f).(testFifoObject) } }() first := <-got if e, a := 15, first.val; e != a { t.Errorf("Didn't get updated value (%v), got %v", e, a) } select { case unexpected := <-got: t.Errorf("Got second value %v", unexpected.val) case <-time.After(50 * time.Millisecond): } _, exists, _ := f.Get(mkFifoObj("foo", "")) if exists { t.Errorf("item did not get removed") } } func TestFIFO_detectLineJumpers(t *testing.T) { f := NewFIFO(testFifoObjectKeyFunc) f.Add(mkFifoObj("foo", 10)) f.Add(mkFifoObj("bar", 1)) f.Add(mkFifoObj("foo", 11)) f.Add(mkFifoObj("foo", 13)) f.Add(mkFifoObj("zab", 30)) if e, a := 13, Pop(f).(testFifoObject).val; a != e { t.Fatalf("expected %d, got %d", e, a) } f.Add(mkFifoObj("foo", 14)) // ensure foo doesn't jump back in line if e, a := 1, Pop(f).(testFifoObject).val; a != e { t.Fatalf("expected %d, got %d", e, a) } if e, a := 30, Pop(f).(testFifoObject).val; a != e { t.Fatalf("expected %d, got %d", e, a) } if e, a := 14, Pop(f).(testFifoObject).val; a != e { t.Fatalf("expected %d, got %d", e, a) } } func TestFIFO_addIfNotPresent(t *testing.T) { f := NewFIFO(testFifoObjectKeyFunc) f.Add(mkFifoObj("a", 1)) f.Add(mkFifoObj("b", 2)) f.AddIfNotPresent(mkFifoObj("b", 3)) f.AddIfNotPresent(mkFifoObj("c", 4)) if e, a := 3, len(f.items); a != e { t.Fatalf("expected queue length %d, got %d", e, a) } expectedValues := []int{1, 2, 4} for _, expected := range expectedValues { if actual := Pop(f).(testFifoObject).val; actual != expected { t.Fatalf("expected value %d, got %d", expected, actual) } } } func TestFIFO_HasSynced(t *testing.T) { tests := []struct { actions []func(f *FIFO) expectedSynced bool }{ { actions: []func(f *FIFO){}, expectedSynced: false, }, { actions: []func(f *FIFO){ func(f *FIFO) { f.Add(mkFifoObj("a", 1)) }, }, expectedSynced: true, }, { actions: []func(f *FIFO){ func(f *FIFO) { f.Replace([]interface{}{}, "0") }, }, expectedSynced: true, }, { actions: []func(f *FIFO){ func(f *FIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, }, expectedSynced: false, }, { actions: []func(f *FIFO){ func(f *FIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, func(f *FIFO) { Pop(f) }, }, expectedSynced: false, }, { actions: []func(f *FIFO){ func(f *FIFO) { f.Replace([]interface{}{mkFifoObj("a", 1), mkFifoObj("b", 2)}, "0") }, func(f *FIFO) { Pop(f) }, func(f *FIFO) { Pop(f) }, }, expectedSynced: true, }, } for i, test := range tests { f := NewFIFO(testFifoObjectKeyFunc) for _, action := range test.actions { action(f) } if e, a := test.expectedSynced, f.HasSynced(); a != e { t.Errorf("test case %v failed, expected: %v , got %v", i, e, a) } } } // TestFIFO_PopShouldUnblockWhenClosed checks that any blocking Pop on an empty queue // should unblock and return after Close is called. func TestFIFO_PopShouldUnblockWhenClosed(t *testing.T) { f := NewFIFO(testFifoObjectKeyFunc) c := make(chan struct{}) const jobs = 10 for i := 0; i < jobs; i++ { go func() { f.Pop(func(obj interface{}, isInInitialList bool) error { return nil }) c <- struct{}{} }() } runtime.Gosched() f.Close() for i := 0; i < jobs; i++ { select { case <-c: case <-time.After(500 * time.Millisecond): t.Fatalf("timed out waiting for Pop to return after Close") } } } kubernetes-client-go-a2dfcab/tools/cache/heap.go000066400000000000000000000207251472614177300220550ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // This file implements a heap data structure. package cache import ( "container/heap" "fmt" "sync" ) const ( closedMsg = "heap is closed" ) // LessFunc is used to compare two objects in the heap. type LessFunc func(interface{}, interface{}) bool type heapItem struct { obj interface{} // The object which is stored in the heap. index int // The index of the object's key in the Heap.queue. } type itemKeyValue struct { key string obj interface{} } // heapData is an internal struct that implements the standard heap interface // and keeps the data stored in the heap. type heapData struct { // items is a map from key of the objects to the objects and their index. // We depend on the property that items in the map are in the queue and vice versa. items map[string]*heapItem // queue implements a heap data structure and keeps the order of elements // according to the heap invariant. The queue keeps the keys of objects stored // in "items". queue []string // keyFunc is used to make the key used for queued item insertion and retrieval, and // should be deterministic. keyFunc KeyFunc // lessFunc is used to compare two objects in the heap. lessFunc LessFunc } var ( _ = heap.Interface(&heapData{}) // heapData is a standard heap ) // Less compares two objects and returns true if the first one should go // in front of the second one in the heap. func (h *heapData) Less(i, j int) bool { if i > len(h.queue) || j > len(h.queue) { return false } itemi, ok := h.items[h.queue[i]] if !ok { return false } itemj, ok := h.items[h.queue[j]] if !ok { return false } return h.lessFunc(itemi.obj, itemj.obj) } // Len returns the number of items in the Heap. func (h *heapData) Len() int { return len(h.queue) } // Swap implements swapping of two elements in the heap. This is a part of standard // heap interface and should never be called directly. func (h *heapData) Swap(i, j int) { h.queue[i], h.queue[j] = h.queue[j], h.queue[i] item := h.items[h.queue[i]] item.index = i item = h.items[h.queue[j]] item.index = j } // Push is supposed to be called by heap.Push only. func (h *heapData) Push(kv interface{}) { keyValue := kv.(*itemKeyValue) n := len(h.queue) h.items[keyValue.key] = &heapItem{keyValue.obj, n} h.queue = append(h.queue, keyValue.key) } // Pop is supposed to be called by heap.Pop only. func (h *heapData) Pop() interface{} { key := h.queue[len(h.queue)-1] h.queue = h.queue[0 : len(h.queue)-1] item, ok := h.items[key] if !ok { // This is an error return nil } delete(h.items, key) return item.obj } // Heap is a thread-safe producer/consumer queue that implements a heap data structure. // It can be used to implement priority queues and similar data structures. type Heap struct { lock sync.RWMutex cond sync.Cond // data stores objects and has a queue that keeps their ordering according // to the heap invariant. data *heapData // closed indicates that the queue is closed. // It is mainly used to let Pop() exit its control loop while waiting for an item. closed bool } // Close the Heap and signals condition variables that may be waiting to pop // items from the heap. func (h *Heap) Close() { h.lock.Lock() defer h.lock.Unlock() h.closed = true h.cond.Broadcast() } // Add inserts an item, and puts it in the queue. The item is updated if it // already exists. func (h *Heap) Add(obj interface{}) error { key, err := h.data.keyFunc(obj) if err != nil { return KeyError{obj, err} } h.lock.Lock() defer h.lock.Unlock() if h.closed { return fmt.Errorf(closedMsg) } if _, exists := h.data.items[key]; exists { h.data.items[key].obj = obj heap.Fix(h.data, h.data.items[key].index) } else { h.addIfNotPresentLocked(key, obj) } h.cond.Broadcast() return nil } // BulkAdd adds all the items in the list to the queue and then signals the condition // variable. It is useful when the caller would like to add all of the items // to the queue before consumer starts processing them. func (h *Heap) BulkAdd(list []interface{}) error { h.lock.Lock() defer h.lock.Unlock() if h.closed { return fmt.Errorf(closedMsg) } for _, obj := range list { key, err := h.data.keyFunc(obj) if err != nil { return KeyError{obj, err} } if _, exists := h.data.items[key]; exists { h.data.items[key].obj = obj heap.Fix(h.data, h.data.items[key].index) } else { h.addIfNotPresentLocked(key, obj) } } h.cond.Broadcast() return nil } // AddIfNotPresent inserts an item, and puts it in the queue. If an item with // the key is present in the map, no changes is made to the item. // // This is useful in a single producer/consumer scenario so that the consumer can // safely retry items without contending with the producer and potentially enqueueing // stale items. func (h *Heap) AddIfNotPresent(obj interface{}) error { id, err := h.data.keyFunc(obj) if err != nil { return KeyError{obj, err} } h.lock.Lock() defer h.lock.Unlock() if h.closed { return fmt.Errorf(closedMsg) } h.addIfNotPresentLocked(id, obj) h.cond.Broadcast() return nil } // addIfNotPresentLocked assumes the lock is already held and adds the provided // item to the queue if it does not already exist. func (h *Heap) addIfNotPresentLocked(key string, obj interface{}) { if _, exists := h.data.items[key]; exists { return } heap.Push(h.data, &itemKeyValue{key, obj}) } // Update is the same as Add in this implementation. When the item does not // exist, it is added. func (h *Heap) Update(obj interface{}) error { return h.Add(obj) } // Delete removes an item. func (h *Heap) Delete(obj interface{}) error { key, err := h.data.keyFunc(obj) if err != nil { return KeyError{obj, err} } h.lock.Lock() defer h.lock.Unlock() if item, ok := h.data.items[key]; ok { heap.Remove(h.data, item.index) return nil } return fmt.Errorf("object not found") } // Pop waits until an item is ready. If multiple items are // ready, they are returned in the order given by Heap.data.lessFunc. func (h *Heap) Pop() (interface{}, error) { h.lock.Lock() defer h.lock.Unlock() for len(h.data.queue) == 0 { // When the queue is empty, invocation of Pop() is blocked until new item is enqueued. // When Close() is called, the h.closed is set and the condition is broadcast, // which causes this loop to continue and return from the Pop(). if h.closed { return nil, fmt.Errorf("heap is closed") } h.cond.Wait() } obj := heap.Pop(h.data) if obj == nil { return nil, fmt.Errorf("object was removed from heap data") } return obj, nil } // List returns a list of all the items. func (h *Heap) List() []interface{} { h.lock.RLock() defer h.lock.RUnlock() list := make([]interface{}, 0, len(h.data.items)) for _, item := range h.data.items { list = append(list, item.obj) } return list } // ListKeys returns a list of all the keys of the objects currently in the Heap. func (h *Heap) ListKeys() []string { h.lock.RLock() defer h.lock.RUnlock() list := make([]string, 0, len(h.data.items)) for key := range h.data.items { list = append(list, key) } return list } // Get returns the requested item, or sets exists=false. func (h *Heap) Get(obj interface{}) (interface{}, bool, error) { key, err := h.data.keyFunc(obj) if err != nil { return nil, false, KeyError{obj, err} } return h.GetByKey(key) } // GetByKey returns the requested item, or sets exists=false. func (h *Heap) GetByKey(key string) (interface{}, bool, error) { h.lock.RLock() defer h.lock.RUnlock() item, exists := h.data.items[key] if !exists { return nil, false, nil } return item.obj, true, nil } // IsClosed returns true if the queue is closed. func (h *Heap) IsClosed() bool { h.lock.RLock() defer h.lock.RUnlock() return h.closed } // NewHeap returns a Heap which can be used to queue up items to process. func NewHeap(keyFn KeyFunc, lessFn LessFunc) *Heap { h := &Heap{ data: &heapData{ items: map[string]*heapItem{}, queue: []string{}, keyFunc: keyFn, lessFunc: lessFn, }, } h.cond.L = &h.lock return h } kubernetes-client-go-a2dfcab/tools/cache/heap_test.go000066400000000000000000000254701472614177300231160ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "sync" "testing" "time" ) func testHeapObjectKeyFunc(obj interface{}) (string, error) { return obj.(testHeapObject).name, nil } type testHeapObject struct { name string val interface{} } func mkHeapObj(name string, val interface{}) testHeapObject { return testHeapObject{name: name, val: val} } func compareInts(val1 interface{}, val2 interface{}) bool { first := val1.(testHeapObject).val.(int) second := val2.(testHeapObject).val.(int) return first < second } // TestHeapBasic tests Heap invariant and synchronization. func TestHeapBasic(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) var wg sync.WaitGroup wg.Add(2) const amount = 500 var i, u int // Insert items in the heap in opposite orders in two go routines. go func() { for i = amount; i > 0; i-- { h.Add(mkHeapObj(string([]rune{'a', rune(i)}), i)) } wg.Done() }() go func() { for u = 0; u < amount; u++ { h.Add(mkHeapObj(string([]rune{'b', rune(u)}), u+1)) } wg.Done() }() // Wait for the two go routines to finish. wg.Wait() // Make sure that the numbers are popped in ascending order. prevNum := 0 for i := 0; i < amount*2; i++ { obj, err := h.Pop() num := obj.(testHeapObject).val.(int) // All the items must be sorted. if err != nil || prevNum > num { t.Errorf("got %v out of order, last was %v", obj, prevNum) } prevNum = num } } // Tests Heap.Add and ensures that heap invariant is preserved after adding items. func TestHeap_Add(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) h.Add(mkHeapObj("foo", 10)) h.Add(mkHeapObj("bar", 1)) h.Add(mkHeapObj("baz", 11)) h.Add(mkHeapObj("zab", 30)) h.Add(mkHeapObj("foo", 13)) // This updates "foo". item, err := h.Pop() if e, a := 1, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } item, err = h.Pop() if e, a := 11, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } h.Delete(mkHeapObj("baz", 11)) // Nothing is deleted. h.Add(mkHeapObj("foo", 14)) // foo is updated. item, err = h.Pop() if e, a := 14, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } item, err = h.Pop() if e, a := 30, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } } // TestHeap_BulkAdd tests Heap.BulkAdd functionality and ensures that all the // items given to BulkAdd are added to the queue before Pop reads them. func TestHeap_BulkAdd(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) const amount = 500 // Insert items in the heap in opposite orders in a go routine. go func() { l := []interface{}{} for i := amount; i > 0; i-- { l = append(l, mkHeapObj(string([]rune{'a', rune(i)}), i)) } h.BulkAdd(l) }() prevNum := -1 for i := 0; i < amount; i++ { obj, err := h.Pop() num := obj.(testHeapObject).val.(int) // All the items must be sorted. if err != nil || prevNum >= num { t.Errorf("got %v out of order, last was %v", obj, prevNum) } prevNum = num } } // TestHeapEmptyPop tests that pop returns properly after heap is closed. func TestHeapEmptyPop(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) go func() { time.Sleep(1 * time.Second) h.Close() }() _, err := h.Pop() if err == nil || err.Error() != closedMsg { t.Errorf("pop should have returned heap closed error: %v", err) } } // TestHeap_AddIfNotPresent tests Heap.AddIfNotPresent and ensures that heap // invariant is preserved after adding items. func TestHeap_AddIfNotPresent(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) h.AddIfNotPresent(mkHeapObj("foo", 10)) h.AddIfNotPresent(mkHeapObj("bar", 1)) h.AddIfNotPresent(mkHeapObj("baz", 11)) h.AddIfNotPresent(mkHeapObj("zab", 30)) h.AddIfNotPresent(mkHeapObj("foo", 13)) // This is not added. if len := len(h.data.items); len != 4 { t.Errorf("unexpected number of items: %d", len) } if val := h.data.items["foo"].obj.(testHeapObject).val; val != 10 { t.Errorf("unexpected value: %d", val) } item, err := h.Pop() if e, a := 1, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } item, err = h.Pop() if e, a := 10, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } // bar is already popped. Let's add another one. h.AddIfNotPresent(mkHeapObj("bar", 14)) item, err = h.Pop() if e, a := 11, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } item, err = h.Pop() if e, a := 14, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } } // TestHeap_Delete tests Heap.Delete and ensures that heap invariant is // preserved after deleting items. func TestHeap_Delete(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) h.Add(mkHeapObj("foo", 10)) h.Add(mkHeapObj("bar", 1)) h.Add(mkHeapObj("bal", 31)) h.Add(mkHeapObj("baz", 11)) // Delete head. Delete should work with "key" and doesn't care about the value. if err := h.Delete(mkHeapObj("bar", 200)); err != nil { t.Fatalf("Failed to delete head.") } item, err := h.Pop() if e, a := 10, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } h.Add(mkHeapObj("zab", 30)) h.Add(mkHeapObj("faz", 30)) len := h.data.Len() // Delete non-existing item. if err = h.Delete(mkHeapObj("non-existent", 10)); err == nil || len != h.data.Len() { t.Fatalf("Didn't expect any item removal") } // Delete tail. if err = h.Delete(mkHeapObj("bal", 31)); err != nil { t.Fatalf("Failed to delete tail.") } // Delete one of the items with value 30. if err = h.Delete(mkHeapObj("zab", 30)); err != nil { t.Fatalf("Failed to delete item.") } item, err = h.Pop() if e, a := 11, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } item, err = h.Pop() if e, a := 30, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } if h.data.Len() != 0 { t.Fatalf("expected an empty heap.") } } // TestHeap_Update tests Heap.Update and ensures that heap invariant is // preserved after adding items. func TestHeap_Update(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) h.Add(mkHeapObj("foo", 10)) h.Add(mkHeapObj("bar", 1)) h.Add(mkHeapObj("bal", 31)) h.Add(mkHeapObj("baz", 11)) // Update an item to a value that should push it to the head. h.Update(mkHeapObj("baz", 0)) if h.data.queue[0] != "baz" || h.data.items["baz"].index != 0 { t.Fatalf("expected baz to be at the head") } item, err := h.Pop() if e, a := 0, item.(testHeapObject).val; err != nil || a != e { t.Fatalf("expected %d, got %d", e, a) } // Update bar to push it farther back in the queue. h.Update(mkHeapObj("bar", 100)) if h.data.queue[0] != "foo" || h.data.items["foo"].index != 0 { t.Fatalf("expected foo to be at the head") } } // TestHeap_Get tests Heap.Get. func TestHeap_Get(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) h.Add(mkHeapObj("foo", 10)) h.Add(mkHeapObj("bar", 1)) h.Add(mkHeapObj("bal", 31)) h.Add(mkHeapObj("baz", 11)) // Get works with the key. obj, exists, err := h.Get(mkHeapObj("baz", 0)) if err != nil || exists == false || obj.(testHeapObject).val != 11 { t.Fatalf("unexpected error in getting element") } // Get non-existing object. _, exists, err = h.Get(mkHeapObj("non-existing", 0)) if err != nil || exists { t.Fatalf("didn't expect to get any object") } } // TestHeap_GetByKey tests Heap.GetByKey and is very similar to TestHeap_Get. func TestHeap_GetByKey(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) h.Add(mkHeapObj("foo", 10)) h.Add(mkHeapObj("bar", 1)) h.Add(mkHeapObj("bal", 31)) h.Add(mkHeapObj("baz", 11)) obj, exists, err := h.GetByKey("baz") if err != nil || exists == false || obj.(testHeapObject).val != 11 { t.Fatalf("unexpected error in getting element") } // Get non-existing object. _, exists, err = h.GetByKey("non-existing") if err != nil || exists { t.Fatalf("didn't expect to get any object") } } // TestHeap_Close tests Heap.Close and Heap.IsClosed functions. func TestHeap_Close(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) h.Add(mkHeapObj("foo", 10)) h.Add(mkHeapObj("bar", 1)) if h.IsClosed() { t.Fatalf("didn't expect heap to be closed") } h.Close() if !h.IsClosed() { t.Fatalf("expect heap to be closed") } } // TestHeap_List tests Heap.List function. func TestHeap_List(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) list := h.List() if len(list) != 0 { t.Errorf("expected an empty list") } items := map[string]int{ "foo": 10, "bar": 1, "bal": 30, "baz": 11, "faz": 30, } for k, v := range items { h.Add(mkHeapObj(k, v)) } list = h.List() if len(list) != len(items) { t.Errorf("expected %d items, got %d", len(items), len(list)) } for _, obj := range list { heapObj := obj.(testHeapObject) v, ok := items[heapObj.name] if !ok || v != heapObj.val { t.Errorf("unexpected item in the list: %v", heapObj) } } } // TestHeap_ListKeys tests Heap.ListKeys function. Scenario is the same as // TestHeap_list. func TestHeap_ListKeys(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) list := h.ListKeys() if len(list) != 0 { t.Errorf("expected an empty list") } items := map[string]int{ "foo": 10, "bar": 1, "bal": 30, "baz": 11, "faz": 30, } for k, v := range items { h.Add(mkHeapObj(k, v)) } list = h.ListKeys() if len(list) != len(items) { t.Errorf("expected %d items, got %d", len(items), len(list)) } for _, key := range list { _, ok := items[key] if !ok { t.Errorf("unexpected item in the list: %v", key) } } } // TestHeapAddAfterClose tests that heap returns an error if anything is added // after it is closed. func TestHeapAddAfterClose(t *testing.T) { h := NewHeap(testHeapObjectKeyFunc, compareInts) h.Close() if err := h.Add(mkHeapObj("test", 1)); err == nil || err.Error() != closedMsg { t.Errorf("expected heap closed error") } if err := h.AddIfNotPresent(mkHeapObj("test", 1)); err == nil || err.Error() != closedMsg { t.Errorf("expected heap closed error") } if err := h.BulkAdd([]interface{}{mkHeapObj("test", 1)}); err == nil || err.Error() != closedMsg { t.Errorf("expected heap closed error") } } kubernetes-client-go-a2dfcab/tools/cache/index.go000066400000000000000000000070721472614177300222470ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/util/sets" ) // Indexer extends Store with multiple indices and restricts each // accumulator to simply hold the current object (and be empty after // Delete). // // There are three kinds of strings here: // 1. a storage key, as defined in the Store interface, // 2. a name of an index, and // 3. an "indexed value", which is produced by an IndexFunc and // can be a field value or any other string computed from the object. type Indexer interface { Store // Index returns the stored objects whose set of indexed values // intersects the set of indexed values of the given object, for // the named index Index(indexName string, obj interface{}) ([]interface{}, error) // IndexKeys returns the storage keys of the stored objects whose // set of indexed values for the named index includes the given // indexed value IndexKeys(indexName, indexedValue string) ([]string, error) // ListIndexFuncValues returns all the indexed values of the given index ListIndexFuncValues(indexName string) []string // ByIndex returns the stored objects whose set of indexed values // for the named index includes the given indexed value ByIndex(indexName, indexedValue string) ([]interface{}, error) // GetIndexers return the indexers GetIndexers() Indexers // AddIndexers adds more indexers to this store. This supports adding indexes after the store already has items. AddIndexers(newIndexers Indexers) error } // IndexFunc knows how to compute the set of indexed values for an object. type IndexFunc func(obj interface{}) ([]string, error) // IndexFuncToKeyFuncAdapter adapts an indexFunc to a keyFunc. This is only useful if your index function returns // unique values for every object. This conversion can create errors when more than one key is found. You // should prefer to make proper key and index functions. func IndexFuncToKeyFuncAdapter(indexFunc IndexFunc) KeyFunc { return func(obj interface{}) (string, error) { indexKeys, err := indexFunc(obj) if err != nil { return "", err } if len(indexKeys) > 1 { return "", fmt.Errorf("too many keys: %v", indexKeys) } if len(indexKeys) == 0 { return "", fmt.Errorf("unexpected empty indexKeys") } return indexKeys[0], nil } } const ( // NamespaceIndex is the lookup name for the most common index function, which is to index by the namespace field. NamespaceIndex string = "namespace" ) // MetaNamespaceIndexFunc is a default index function that indexes based on an object's namespace func MetaNamespaceIndexFunc(obj interface{}) ([]string, error) { meta, err := meta.Accessor(obj) if err != nil { return []string{""}, fmt.Errorf("object has no meta: %v", err) } return []string{meta.GetNamespace()}, nil } // Index maps the indexed value to a set of keys in the store that match on that value type Index map[string]sets.String // Indexers maps a name to an IndexFunc type Indexers map[string]IndexFunc // Indices maps a name to an Index type Indices map[string]Index kubernetes-client-go-a2dfcab/tools/cache/index_test.go000066400000000000000000000075651472614177300233150ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "k8s.io/apimachinery/pkg/util/sets" "strings" "testing" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func testIndexFunc(obj interface{}) ([]string, error) { pod := obj.(*v1.Pod) return []string{pod.Labels["foo"]}, nil } func TestGetIndexFuncValues(t *testing.T) { index := NewIndexer(MetaNamespaceKeyFunc, Indexers{"testmodes": testIndexFunc}) pod1 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "one", Labels: map[string]string{"foo": "bar"}}} pod2 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "two", Labels: map[string]string{"foo": "bar"}}} pod3 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "tre", Labels: map[string]string{"foo": "biz"}}} index.Add(pod1) index.Add(pod2) index.Add(pod3) keys := index.ListIndexFuncValues("testmodes") if len(keys) != 2 { t.Errorf("Expected 2 keys but got %v", len(keys)) } for _, key := range keys { if key != "bar" && key != "biz" { t.Errorf("Expected only 'bar' or 'biz' but got %s", key) } } } func testUsersIndexFunc(obj interface{}) ([]string, error) { pod := obj.(*v1.Pod) usersString := pod.Annotations["users"] return strings.Split(usersString, ","), nil } func TestMultiIndexKeys(t *testing.T) { index := NewIndexer(MetaNamespaceKeyFunc, Indexers{"byUser": testUsersIndexFunc}) pod1 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "one", Annotations: map[string]string{"users": "ernie,bert"}}} pod2 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "two", Annotations: map[string]string{"users": "bert,oscar"}}} pod3 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "tre", Annotations: map[string]string{"users": "ernie,elmo"}}} index.Add(pod1) index.Add(pod2) index.Add(pod3) expected := map[string]sets.String{} expected["ernie"] = sets.NewString("one", "tre") expected["bert"] = sets.NewString("one", "two") expected["elmo"] = sets.NewString("tre") expected["oscar"] = sets.NewString("two") expected["elmo1"] = sets.NewString() { for k, v := range expected { found := sets.String{} indexResults, err := index.ByIndex("byUser", k) if err != nil { t.Errorf("Unexpected error %v", err) } for _, item := range indexResults { found.Insert(item.(*v1.Pod).Name) } if !found.Equal(v) { t.Errorf("missing items, index %s, expected %v but found %v", k, v.List(), found.List()) } } } index.Delete(pod3) erniePods, err := index.ByIndex("byUser", "ernie") if err != nil { t.Errorf("unexpected error: %v", err) } if len(erniePods) != 1 { t.Errorf("Expected 1 pods but got %v", len(erniePods)) } for _, erniePod := range erniePods { if erniePod.(*v1.Pod).Name != "one" { t.Errorf("Expected only 'one' but got %s", erniePod.(*v1.Pod).Name) } } elmoPods, err := index.ByIndex("byUser", "elmo") if err != nil { t.Errorf("unexpected error: %v", err) } if len(elmoPods) != 0 { t.Errorf("Expected 0 pods but got %v", len(elmoPods)) } copyOfPod2 := pod2.DeepCopy() copyOfPod2.Annotations["users"] = "oscar" index.Update(copyOfPod2) bertPods, err := index.ByIndex("byUser", "bert") if err != nil { t.Errorf("unexpected error: %v", err) } if len(bertPods) != 1 { t.Errorf("Expected 1 pods but got %v", len(bertPods)) } for _, bertPod := range bertPods { if bertPod.(*v1.Pod).Name != "one" { t.Errorf("Expected only 'one' but got %s", bertPod.(*v1.Pod).Name) } } } kubernetes-client-go-a2dfcab/tools/cache/listers.go000066400000000000000000000120101472614177300226110ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // AppendFunc is used to add a matching item to whatever list the caller is using type AppendFunc func(interface{}) // ListAll lists items in the store matching the given selector, calling appendFn on each one. func ListAll(store Store, selector labels.Selector, appendFn AppendFunc) error { selectAll := selector.Empty() for _, m := range store.List() { if selectAll { // Avoid computing labels of the objects to speed up common flows // of listing all objects. appendFn(m) continue } metadata, err := meta.Accessor(m) if err != nil { return err } if selector.Matches(labels.Set(metadata.GetLabels())) { appendFn(m) } } return nil } // ListAllByNamespace lists items in the given namespace in the store matching the given selector, // calling appendFn on each one. // If a blank namespace (NamespaceAll) is specified, this delegates to ListAll(). func ListAllByNamespace(indexer Indexer, namespace string, selector labels.Selector, appendFn AppendFunc) error { if namespace == metav1.NamespaceAll { return ListAll(indexer, selector, appendFn) } items, err := indexer.Index(NamespaceIndex, &metav1.ObjectMeta{Namespace: namespace}) if err != nil { // Ignore error; do slow search without index. klog.Warningf("can not retrieve list of objects using index : %v", err) for _, m := range indexer.List() { metadata, err := meta.Accessor(m) if err != nil { return err } if metadata.GetNamespace() == namespace && selector.Matches(labels.Set(metadata.GetLabels())) { appendFn(m) } } return nil } selectAll := selector.Empty() for _, m := range items { if selectAll { // Avoid computing labels of the objects to speed up common flows // of listing all objects. appendFn(m) continue } metadata, err := meta.Accessor(m) if err != nil { return err } if selector.Matches(labels.Set(metadata.GetLabels())) { appendFn(m) } } return nil } // GenericLister is a lister skin on a generic Indexer type GenericLister interface { // List will return all objects across namespaces List(selector labels.Selector) (ret []runtime.Object, err error) // Get will attempt to retrieve assuming that name==key Get(name string) (runtime.Object, error) // ByNamespace will give you a GenericNamespaceLister for one namespace ByNamespace(namespace string) GenericNamespaceLister } // GenericNamespaceLister is a lister skin on a generic Indexer type GenericNamespaceLister interface { // List will return all objects in this namespace List(selector labels.Selector) (ret []runtime.Object, err error) // Get will attempt to retrieve by namespace and name Get(name string) (runtime.Object, error) } // NewGenericLister creates a new instance for the genericLister. func NewGenericLister(indexer Indexer, resource schema.GroupResource) GenericLister { return &genericLister{indexer: indexer, resource: resource} } type genericLister struct { indexer Indexer resource schema.GroupResource } func (s *genericLister) List(selector labels.Selector) (ret []runtime.Object, err error) { err = ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(runtime.Object)) }) return ret, err } func (s *genericLister) ByNamespace(namespace string) GenericNamespaceLister { return &genericNamespaceLister{indexer: s.indexer, namespace: namespace, resource: s.resource} } func (s *genericLister) Get(name string) (runtime.Object, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(s.resource, name) } return obj.(runtime.Object), nil } type genericNamespaceLister struct { indexer Indexer namespace string resource schema.GroupResource } func (s *genericNamespaceLister) List(selector labels.Selector) (ret []runtime.Object, err error) { err = ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(runtime.Object)) }) return ret, err } func (s *genericNamespaceLister) Get(name string) (runtime.Object, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(s.resource, name) } return obj.(runtime.Object), nil } kubernetes-client-go-a2dfcab/tools/cache/listwatch.go000066400000000000000000000104361472614177300231400ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" restclient "k8s.io/client-go/rest" ) // Lister is any object that knows how to perform an initial list. type Lister interface { // List should return a list type object; the Items field will be extracted, and the // ResourceVersion field will be used to start the watch in the right place. List(options metav1.ListOptions) (runtime.Object, error) } // Watcher is any object that knows how to start a watch on a resource. type Watcher interface { // Watch should begin a watch at the specified version. // // If Watch returns an error, it should handle its own cleanup, including // but not limited to calling Stop() on the watch, if one was constructed. // This allows the caller to ignore the watch, if the error is non-nil. Watch(options metav1.ListOptions) (watch.Interface, error) } // ListerWatcher is any object that knows how to perform an initial list and start a watch on a resource. type ListerWatcher interface { Lister Watcher } // ListFunc knows how to list resources type ListFunc func(options metav1.ListOptions) (runtime.Object, error) // WatchFunc knows how to watch resources type WatchFunc func(options metav1.ListOptions) (watch.Interface, error) // ListWatch knows how to list and watch a set of apiserver resources. It satisfies the ListerWatcher interface. // It is a convenience function for users of NewReflector, etc. // ListFunc and WatchFunc must not be nil type ListWatch struct { ListFunc ListFunc WatchFunc WatchFunc // DisableChunking requests no chunking for this list watcher. DisableChunking bool } // Getter interface knows how to access Get method from RESTClient. type Getter interface { Get() *restclient.Request } // NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector. func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSelector fields.Selector) *ListWatch { optionsModifier := func(options *metav1.ListOptions) { options.FieldSelector = fieldSelector.String() } return NewFilteredListWatchFromClient(c, resource, namespace, optionsModifier) } // NewFilteredListWatchFromClient creates a new ListWatch from the specified client, resource, namespace, and option modifier. // Option modifier is a function takes a ListOptions and modifies the consumed ListOptions. Provide customized modifier function // to apply modification to ListOptions with a field selector, a label selector, or any other desired options. func NewFilteredListWatchFromClient(c Getter, resource string, namespace string, optionsModifier func(options *metav1.ListOptions)) *ListWatch { listFunc := func(options metav1.ListOptions) (runtime.Object, error) { optionsModifier(&options) return c.Get(). Namespace(namespace). Resource(resource). VersionedParams(&options, metav1.ParameterCodec). Do(context.TODO()). Get() } watchFunc := func(options metav1.ListOptions) (watch.Interface, error) { options.Watch = true optionsModifier(&options) return c.Get(). Namespace(namespace). Resource(resource). VersionedParams(&options, metav1.ParameterCodec). Watch(context.TODO()) } return &ListWatch{ListFunc: listFunc, WatchFunc: watchFunc} } // List a set of apiserver resources func (lw *ListWatch) List(options metav1.ListOptions) (runtime.Object, error) { // ListWatch is used in Reflector, which already supports pagination. // Don't paginate here to avoid duplication. return lw.ListFunc(options) } // Watch a set of apiserver resources func (lw *ListWatch) Watch(options metav1.ListOptions) (watch.Interface, error) { return lw.WatchFunc(options) } kubernetes-client-go-a2dfcab/tools/cache/main_test.go000066400000000000000000000012311472614177300231120ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "os" "testing" ) func TestMain(m *testing.M) { os.Exit(m.Run()) } kubernetes-client-go-a2dfcab/tools/cache/mutation_cache.go000066400000000000000000000203651472614177300241230ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "strconv" "sync" "time" "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" utilcache "k8s.io/apimachinery/pkg/util/cache" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" ) // MutationCache is able to take the result of update operations and stores them in an LRU // that can be used to provide a more current view of a requested object. It requires interpreting // resourceVersions for comparisons. // Implementations must be thread-safe. // TODO find a way to layer this into an informer/lister type MutationCache interface { GetByKey(key string) (interface{}, bool, error) ByIndex(indexName, indexKey string) ([]interface{}, error) Mutation(interface{}) } // ResourceVersionComparator is able to compare object versions. type ResourceVersionComparator interface { CompareResourceVersion(lhs, rhs runtime.Object) int } // NewIntegerResourceVersionMutationCache returns a MutationCache that understands how to // deal with objects that have a resource version that: // // - is an integer // - increases when updated // - is comparable across the same resource in a namespace // // Most backends will have these semantics. Indexer may be nil. ttl controls how long an item // remains in the mutation cache before it is removed. // // If includeAdds is true, objects in the mutation cache will be returned even if they don't exist // in the underlying store. This is only safe if your use of the cache can handle mutation entries // remaining in the cache for up to ttl when mutations and deletes occur very closely in time. func NewIntegerResourceVersionMutationCache(backingCache Store, indexer Indexer, ttl time.Duration, includeAdds bool) MutationCache { return &mutationCache{ backingCache: backingCache, indexer: indexer, mutationCache: utilcache.NewLRUExpireCache(100), comparator: etcdObjectVersioner{}, ttl: ttl, includeAdds: includeAdds, } } // mutationCache doesn't guarantee that it returns values added via Mutation since they can page out and // since you can't distinguish between, "didn't observe create" and "was deleted after create", // if the key is missing from the backing cache, we always return it as missing type mutationCache struct { lock sync.Mutex backingCache Store indexer Indexer mutationCache *utilcache.LRUExpireCache includeAdds bool ttl time.Duration comparator ResourceVersionComparator } // GetByKey is never guaranteed to return back the value set in Mutation. It could be paged out, it could // be older than another copy, the backingCache may be more recent or, you might have written twice into the same key. // You get a value that was valid at some snapshot of time and will always return the newer of backingCache and mutationCache. func (c *mutationCache) GetByKey(key string) (interface{}, bool, error) { c.lock.Lock() defer c.lock.Unlock() obj, exists, err := c.backingCache.GetByKey(key) if err != nil { return nil, false, err } if !exists { if !c.includeAdds { // we can't distinguish between, "didn't observe create" and "was deleted after create", so // if the key is missing, we always return it as missing return nil, false, nil } obj, exists = c.mutationCache.Get(key) if !exists { return nil, false, nil } } objRuntime, ok := obj.(runtime.Object) if !ok { return obj, true, nil } return c.newerObject(key, objRuntime), true, nil } // ByIndex returns the newer objects that match the provided index and indexer key. // Will return an error if no indexer was provided. func (c *mutationCache) ByIndex(name string, indexKey string) ([]interface{}, error) { c.lock.Lock() defer c.lock.Unlock() if c.indexer == nil { return nil, fmt.Errorf("no indexer has been provided to the mutation cache") } keys, err := c.indexer.IndexKeys(name, indexKey) if err != nil { return nil, err } var items []interface{} keySet := sets.NewString() for _, key := range keys { keySet.Insert(key) obj, exists, err := c.indexer.GetByKey(key) if err != nil { return nil, err } if !exists { continue } if objRuntime, ok := obj.(runtime.Object); ok { items = append(items, c.newerObject(key, objRuntime)) } else { items = append(items, obj) } } if c.includeAdds { fn := c.indexer.GetIndexers()[name] // Keys() is returned oldest to newest, so full traversal does not alter the LRU behavior for _, key := range c.mutationCache.Keys() { updated, ok := c.mutationCache.Get(key) if !ok { continue } if keySet.Has(key.(string)) { continue } elements, err := fn(updated) if err != nil { klog.V(4).Infof("Unable to calculate an index entry for mutation cache entry %s: %v", key, err) continue } for _, inIndex := range elements { if inIndex != indexKey { continue } items = append(items, updated) break } } } return items, nil } // newerObject checks the mutation cache for a newer object and returns one if found. If the // mutated object is older than the backing object, it is removed from the Must be // called while the lock is held. func (c *mutationCache) newerObject(key string, backing runtime.Object) runtime.Object { mutatedObj, exists := c.mutationCache.Get(key) if !exists { return backing } mutatedObjRuntime, ok := mutatedObj.(runtime.Object) if !ok { return backing } if c.comparator.CompareResourceVersion(backing, mutatedObjRuntime) >= 0 { c.mutationCache.Remove(key) return backing } return mutatedObjRuntime } // Mutation adds a change to the cache that can be returned in GetByKey if it is newer than the backingCache // copy. If you call Mutation twice with the same object on different threads, one will win, but its not defined // which one. This doesn't affect correctness, since the GetByKey guaranteed of "later of these two caches" is // preserved, but you may not get the version of the object you want. The object you get is only guaranteed to // "one that was valid at some point in time", not "the one that I want". func (c *mutationCache) Mutation(obj interface{}) { c.lock.Lock() defer c.lock.Unlock() key, err := DeletionHandlingMetaNamespaceKeyFunc(obj) if err != nil { // this is a "nice to have", so failures shouldn't do anything weird utilruntime.HandleError(err) return } if objRuntime, ok := obj.(runtime.Object); ok { if mutatedObj, exists := c.mutationCache.Get(key); exists { if mutatedObjRuntime, ok := mutatedObj.(runtime.Object); ok { if c.comparator.CompareResourceVersion(objRuntime, mutatedObjRuntime) < 0 { return } } } } c.mutationCache.Add(key, obj, c.ttl) } // etcdObjectVersioner implements versioning and extracting etcd node information // for objects that have an embedded ObjectMeta or ListMeta field. type etcdObjectVersioner struct{} // ObjectResourceVersion implements Versioner func (a etcdObjectVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, error) { accessor, err := meta.Accessor(obj) if err != nil { return 0, err } version := accessor.GetResourceVersion() if len(version) == 0 { return 0, nil } return strconv.ParseUint(version, 10, 64) } // CompareResourceVersion compares etcd resource versions. Outside this API they are all strings, // but etcd resource versions are special, they're actually ints, so we can easily compare them. func (a etcdObjectVersioner) CompareResourceVersion(lhs, rhs runtime.Object) int { lhsVersion, err := a.ObjectResourceVersion(lhs) if err != nil { // coder error panic(err) } rhsVersion, err := a.ObjectResourceVersion(rhs) if err != nil { // coder error panic(err) } if lhsVersion == rhsVersion { return 0 } if lhsVersion < rhsVersion { return -1 } return 1 } kubernetes-client-go-a2dfcab/tools/cache/mutation_detector.go000066400000000000000000000115031472614177300246630ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "os" "reflect" "strconv" "sync" "time" "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/diff" ) var mutationDetectionEnabled = false func init() { mutationDetectionEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_CACHE_MUTATION_DETECTOR")) } // MutationDetector is able to monitor objects for mutation within a limited window of time type MutationDetector interface { // AddObject adds the given object to the set being monitored for a while from now AddObject(obj interface{}) // Run starts the monitoring and does not return until the monitoring is stopped. Run(stopCh <-chan struct{}) } // NewCacheMutationDetector creates a new instance for the defaultCacheMutationDetector. func NewCacheMutationDetector(name string) MutationDetector { if !mutationDetectionEnabled { return dummyMutationDetector{} } klog.Warningln("Mutation detector is enabled, this will result in memory leakage.") return &defaultCacheMutationDetector{name: name, period: 1 * time.Second, retainDuration: 2 * time.Minute} } type dummyMutationDetector struct{} func (dummyMutationDetector) Run(stopCh <-chan struct{}) { } func (dummyMutationDetector) AddObject(obj interface{}) { } // defaultCacheMutationDetector gives a way to detect if a cached object has been mutated // It has a list of cached objects and their copies. I haven't thought of a way // to see WHO is mutating it, just that it's getting mutated. type defaultCacheMutationDetector struct { name string period time.Duration // compareLock ensures only a single call to CompareObjects runs at a time compareObjectsLock sync.Mutex // addLock guards addedObjs between AddObject and CompareObjects addedObjsLock sync.Mutex addedObjs []cacheObj cachedObjs []cacheObj retainDuration time.Duration lastRotated time.Time retainedCachedObjs []cacheObj // failureFunc is injectable for unit testing. If you don't have it, the process will panic. // This panic is intentional, since turning on this detection indicates you want a strong // failure signal. This failure is effectively a p0 bug and you can't trust process results // after a mutation anyway. failureFunc func(message string) } // cacheObj holds the actual object and a copy type cacheObj struct { cached interface{} copied interface{} } func (d *defaultCacheMutationDetector) Run(stopCh <-chan struct{}) { // we DON'T want protection from panics. If we're running this code, we want to die for { if d.lastRotated.IsZero() { d.lastRotated = time.Now() } else if time.Since(d.lastRotated) > d.retainDuration { d.retainedCachedObjs = d.cachedObjs d.cachedObjs = nil d.lastRotated = time.Now() } d.CompareObjects() select { case <-stopCh: return case <-time.After(d.period): } } } // AddObject makes a deep copy of the object for later comparison. It only works on runtime.Object // but that covers the vast majority of our cached objects func (d *defaultCacheMutationDetector) AddObject(obj interface{}) { if _, ok := obj.(DeletedFinalStateUnknown); ok { return } if obj, ok := obj.(runtime.Object); ok { copiedObj := obj.DeepCopyObject() d.addedObjsLock.Lock() defer d.addedObjsLock.Unlock() d.addedObjs = append(d.addedObjs, cacheObj{cached: obj, copied: copiedObj}) } } func (d *defaultCacheMutationDetector) CompareObjects() { d.compareObjectsLock.Lock() defer d.compareObjectsLock.Unlock() // move addedObjs into cachedObjs under lock // this keeps the critical section small to avoid blocking AddObject while we compare cachedObjs d.addedObjsLock.Lock() d.cachedObjs = append(d.cachedObjs, d.addedObjs...) d.addedObjs = nil d.addedObjsLock.Unlock() altered := false for i, obj := range d.cachedObjs { if !reflect.DeepEqual(obj.cached, obj.copied) { fmt.Printf("CACHE %s[%d] ALTERED!\n%v\n", d.name, i, diff.ObjectGoPrintSideBySide(obj.cached, obj.copied)) altered = true } } for i, obj := range d.retainedCachedObjs { if !reflect.DeepEqual(obj.cached, obj.copied) { fmt.Printf("CACHE %s[%d] ALTERED!\n%v\n", d.name, i, diff.ObjectGoPrintSideBySide(obj.cached, obj.copied)) altered = true } } if altered { msg := fmt.Sprintf("cache %s modified", d.name) if d.failureFunc != nil { d.failureFunc(msg) return } panic(msg) } } kubernetes-client-go-a2dfcab/tools/cache/mutation_detector_test.go000066400000000000000000000041341472614177300257240ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "testing" "time" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" ) func TestMutationDetector(t *testing.T) { fakeWatch := watch.NewFake() lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return fakeWatch, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{}, nil }, } pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "anything", Labels: map[string]string{"check": "foo"}, }, } stopCh := make(chan struct{}) defer close(stopCh) mutationFound := make(chan bool) informer := NewSharedInformer(lw, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) detector := &defaultCacheMutationDetector{ name: "name", period: 1 * time.Second, retainDuration: 2 * time.Minute, failureFunc: func(message string) { mutationFound <- true }, } informer.cacheMutationDetector = detector go informer.Run(stopCh) fakeWatch.Add(pod) wait.PollImmediate(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { detector.addedObjsLock.Lock() defer detector.addedObjsLock.Unlock() return len(detector.addedObjs) > 0, nil }) detector.compareObjectsLock.Lock() pod.Labels["change"] = "true" detector.compareObjectsLock.Unlock() select { case <-mutationFound: case <-time.After(wait.ForeverTestTimeout): t.Fatalf("failed waiting for mutating detector") } } kubernetes-client-go-a2dfcab/tools/cache/object-names.go000066400000000000000000000040101472614177300234740ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "k8s.io/apimachinery/pkg/types" ) // ObjectName is a reference to an object of some implicit kind type ObjectName struct { Namespace string Name string } // NewObjectName constructs a new one func NewObjectName(namespace, name string) ObjectName { return ObjectName{Namespace: namespace, Name: name} } // Parts is the inverse of the constructor func (objName ObjectName) Parts() (namespace, name string) { return objName.Namespace, objName.Name } // String returns the standard string encoding, // which is designed to match the historical behavior of MetaNamespaceKeyFunc. // Note this behavior is different from the String method of types.NamespacedName. func (objName ObjectName) String() string { if len(objName.Namespace) > 0 { return objName.Namespace + "/" + objName.Name } return objName.Name } // ParseObjectName tries to parse the standard encoding func ParseObjectName(str string) (ObjectName, error) { var objName ObjectName var err error objName.Namespace, objName.Name, err = SplitMetaNamespaceKey(str) return objName, err } // NamespacedNameAsObjectName rebrands the given NamespacedName as an ObjectName func NamespacedNameAsObjectName(nn types.NamespacedName) ObjectName { return NewObjectName(nn.Namespace, nn.Name) } // AsNamespacedName rebrands as a NamespacedName func (objName ObjectName) AsNamespacedName() types.NamespacedName { return types.NamespacedName{Namespace: objName.Namespace, Name: objName.Name} } kubernetes-client-go-a2dfcab/tools/cache/object-names_test.go000066400000000000000000000032131472614177300245370ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "math/rand" "strings" "testing" ) func TestObjectNames(t *testing.T) { chars := "abcdefghi/" for count := 1; count <= 100; count++ { var encodedB strings.Builder for index := 0; index < 10; index++ { encodedB.WriteByte(chars[rand.Intn(len(chars))]) } encodedS := encodedB.String() parts := strings.Split(encodedS, "/") on, err := ParseObjectName(encodedS) expectError := len(parts) > 2 if expectError != (err != nil) { t.Errorf("Wrong error; expected=%v, got=%v", expectError, err) } if expectError || err != nil { continue } var expectedObjectName ObjectName if len(parts) == 2 { expectedObjectName = ObjectName{Namespace: parts[0], Name: parts[1]} } else { expectedObjectName = ObjectName{Name: encodedS} } if on != expectedObjectName { t.Errorf("Parse failed, expected=%+v, got=%+v", expectedObjectName, on) } recoded := on.String() if encodedS[0] == '/' { recoded = "/" + recoded } if encodedS != recoded { t.Errorf("Parse().String() was not identity, original=%q, final=%q", encodedS, recoded) } } } kubernetes-client-go-a2dfcab/tools/cache/processor_listener_test.go000066400000000000000000000026551472614177300261250ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "sync" "testing" "time" "k8s.io/apimachinery/pkg/util/wait" ) const ( concurrencyLevel = 5 ) func BenchmarkListener(b *testing.B) { var notification addNotification var swg sync.WaitGroup swg.Add(b.N) b.SetParallelism(concurrencyLevel) // Preallocate enough space so that benchmark does not run out of it pl := newProcessListener(&ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { swg.Done() }, }, 0, 0, time.Now(), 1024*1024, func() bool { return true }) var wg wait.Group defer wg.Wait() // Wait for .run and .pop to stop defer close(pl.addCh) // Tell .run and .pop to stop wg.Start(pl.run) wg.Start(pl.pop) b.ReportAllocs() b.ResetTimer() b.RunParallel(func(pb *testing.PB) { for pb.Next() { pl.add(notification) } }) swg.Wait() // Block until all notifications have been received b.StopTimer() } kubernetes-client-go-a2dfcab/tools/cache/reflector.go000066400000000000000000001262761472614177300231350ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "context" "errors" "fmt" "io" "math/rand" "reflect" "strings" "sync" "time" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/naming" utilnet "k8s.io/apimachinery/pkg/util/net" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" clientfeatures "k8s.io/client-go/features" "k8s.io/client-go/tools/pager" "k8s.io/klog/v2" "k8s.io/utils/clock" "k8s.io/utils/pointer" "k8s.io/utils/ptr" "k8s.io/utils/trace" ) const defaultExpectedTypeName = "" var ( // We try to spread the load on apiserver by setting timeouts for // watch requests - it is random in [minWatchTimeout, 2*minWatchTimeout]. defaultMinWatchTimeout = 5 * time.Minute ) // Reflector watches a specified resource and causes all changes to be reflected in the given store. type Reflector struct { // name identifies this reflector. By default it will be a file:line if possible. name string // The name of the type we expect to place in the store. The name // will be the stringification of expectedGVK if provided, and the // stringification of expectedType otherwise. It is for display // only, and should not be used for parsing or comparison. typeDescription string // An example object of the type we expect to place in the store. // Only the type needs to be right, except that when that is // `unstructured.Unstructured` the object's `"apiVersion"` and // `"kind"` must also be right. expectedType reflect.Type // The GVK of the object we expect to place in the store if unstructured. expectedGVK *schema.GroupVersionKind // The destination to sync up with the watch source store Store // listerWatcher is used to perform lists and watches. listerWatcher ListerWatcher // backoff manages backoff of ListWatch backoffManager wait.BackoffManager resyncPeriod time.Duration // minWatchTimeout defines the minimum timeout for watch requests. minWatchTimeout time.Duration // clock allows tests to manipulate time clock clock.Clock // paginatedResult defines whether pagination should be forced for list calls. // It is set based on the result of the initial list call. paginatedResult bool // lastSyncResourceVersion is the resource version token last // observed when doing a sync with the underlying store // it is thread safe, but not synchronized with the underlying store lastSyncResourceVersion string // isLastSyncResourceVersionUnavailable is true if the previous list or watch request with // lastSyncResourceVersion failed with an "expired" or "too large resource version" error. isLastSyncResourceVersionUnavailable bool // lastSyncResourceVersionMutex guards read/write access to lastSyncResourceVersion lastSyncResourceVersionMutex sync.RWMutex // Called whenever the ListAndWatch drops the connection with an error. watchErrorHandler WatchErrorHandler // WatchListPageSize is the requested chunk size of initial and resync watch lists. // If unset, for consistent reads (RV="") or reads that opt-into arbitrarily old data // (RV="0") it will default to pager.PageSize, for the rest (RV != "" && RV != "0") // it will turn off pagination to allow serving them from watch cache. // NOTE: It should be used carefully as paginated lists are always served directly from // etcd, which is significantly less efficient and may lead to serious performance and // scalability problems. WatchListPageSize int64 // ShouldResync is invoked periodically and whenever it returns `true` the Store's Resync operation is invoked ShouldResync func() bool // MaxInternalErrorRetryDuration defines how long we should retry internal errors returned by watch. MaxInternalErrorRetryDuration time.Duration // UseWatchList if turned on instructs the reflector to open a stream to bring data from the API server. // Streaming has the primary advantage of using fewer server's resources to fetch data. // // The old behaviour establishes a LIST request which gets data in chunks. // Paginated list is less efficient and depending on the actual size of objects // might result in an increased memory consumption of the APIServer. // // See https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/3157-watch-list#design-details // // TODO(#115478): Consider making reflector.UseWatchList a private field. Since we implemented "api streaming" on the etcd storage layer it should work. UseWatchList *bool } // ResourceVersionUpdater is an interface that allows store implementation to // track the current resource version of the reflector. This is especially // important if storage bookmarks are enabled. type ResourceVersionUpdater interface { // UpdateResourceVersion is called each time current resource version of the reflector // is updated. UpdateResourceVersion(resourceVersion string) } // The WatchErrorHandler is called whenever ListAndWatch drops the // connection with an error. After calling this handler, the informer // will backoff and retry. // // The default implementation looks at the error type and tries to log // the error message at an appropriate level. // // Implementations of this handler may display the error message in other // ways. Implementations should return quickly - any expensive processing // should be offloaded. type WatchErrorHandler func(r *Reflector, err error) // DefaultWatchErrorHandler is the default implementation of WatchErrorHandler func DefaultWatchErrorHandler(r *Reflector, err error) { switch { case isExpiredError(err): // Don't set LastSyncResourceVersionUnavailable - LIST call with ResourceVersion=RV already // has a semantic that it returns data at least as fresh as provided RV. // So first try to LIST with setting RV to resource version of last observed object. klog.V(4).Infof("%s: watch of %v closed with: %v", r.name, r.typeDescription, err) case err == io.EOF: // watch closed normally case err == io.ErrUnexpectedEOF: klog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.typeDescription, err) default: utilruntime.HandleError(fmt.Errorf("%s: Failed to watch %v: %v", r.name, r.typeDescription, err)) } } // NewNamespaceKeyedIndexerAndReflector creates an Indexer and a Reflector // The indexer is configured to key on namespace func NewNamespaceKeyedIndexerAndReflector(lw ListerWatcher, expectedType interface{}, resyncPeriod time.Duration) (indexer Indexer, reflector *Reflector) { indexer = NewIndexer(MetaNamespaceKeyFunc, Indexers{NamespaceIndex: MetaNamespaceIndexFunc}) reflector = NewReflector(lw, expectedType, indexer, resyncPeriod) return indexer, reflector } // NewReflector creates a new Reflector with its name defaulted to the closest source_file.go:line in the call stack // that is outside this package. See NewReflectorWithOptions for further information. func NewReflector(lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector { return NewReflectorWithOptions(lw, expectedType, store, ReflectorOptions{ResyncPeriod: resyncPeriod}) } // NewNamedReflector creates a new Reflector with the specified name. See NewReflectorWithOptions for further // information. func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector { return NewReflectorWithOptions(lw, expectedType, store, ReflectorOptions{Name: name, ResyncPeriod: resyncPeriod}) } // ReflectorOptions configures a Reflector. type ReflectorOptions struct { // Name is the Reflector's name. If unset/unspecified, the name defaults to the closest source_file.go:line // in the call stack that is outside this package. Name string // TypeDescription is the Reflector's type description. If unset/unspecified, the type description is defaulted // using the following rules: if the expectedType passed to NewReflectorWithOptions was nil, the type description is // "". If the expectedType is an instance of *unstructured.Unstructured and its apiVersion and kind fields // are set, the type description is the string encoding of those. Otherwise, the type description is set to the // go type of expectedType.. TypeDescription string // ResyncPeriod is the Reflector's resync period. If unset/unspecified, the resync period defaults to 0 // (do not resync). ResyncPeriod time.Duration // MinWatchTimeout, if non-zero, defines the minimum timeout for watch requests send to kube-apiserver. // However, values lower than 5m will not be honored to avoid negative performance impact on controlplane. MinWatchTimeout time.Duration // Clock allows tests to control time. If unset defaults to clock.RealClock{} Clock clock.Clock } // NewReflectorWithOptions creates a new Reflector object which will keep the // given store up to date with the server's contents for the given // resource. Reflector promises to only put things in the store that // have the type of expectedType, unless expectedType is nil. If // resyncPeriod is non-zero, then the reflector will periodically // consult its ShouldResync function to determine whether to invoke // the Store's Resync operation; `ShouldResync==nil` means always // "yes". This enables you to use reflectors to periodically process // everything as well as incrementally processing the things that // change. func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store Store, options ReflectorOptions) *Reflector { reflectorClock := options.Clock if reflectorClock == nil { reflectorClock = clock.RealClock{} } minWatchTimeout := defaultMinWatchTimeout if options.MinWatchTimeout > defaultMinWatchTimeout { minWatchTimeout = options.MinWatchTimeout } r := &Reflector{ name: options.Name, resyncPeriod: options.ResyncPeriod, minWatchTimeout: minWatchTimeout, typeDescription: options.TypeDescription, listerWatcher: lw, store: store, // We used to make the call every 1sec (1 QPS), the goal here is to achieve ~98% traffic reduction when // API server is not healthy. With these parameters, backoff will stop at [30,60) sec interval which is // 0.22 QPS. If we don't backoff for 2min, assume API server is healthy and we reset the backoff. backoffManager: wait.NewExponentialBackoffManager(800*time.Millisecond, 30*time.Second, 2*time.Minute, 2.0, 1.0, reflectorClock), clock: reflectorClock, watchErrorHandler: WatchErrorHandler(DefaultWatchErrorHandler), expectedType: reflect.TypeOf(expectedType), } if r.name == "" { r.name = naming.GetNameFromCallsite(internalPackages...) } if r.typeDescription == "" { r.typeDescription = getTypeDescriptionFromObject(expectedType) } if r.expectedGVK == nil { r.expectedGVK = getExpectedGVKFromObject(expectedType) } // don't overwrite UseWatchList if already set // because the higher layers (e.g. storage/cacher) disabled it on purpose if r.UseWatchList == nil { r.UseWatchList = ptr.To(clientfeatures.FeatureGates().Enabled(clientfeatures.WatchListClient)) } return r } func getTypeDescriptionFromObject(expectedType interface{}) string { if expectedType == nil { return defaultExpectedTypeName } reflectDescription := reflect.TypeOf(expectedType).String() obj, ok := expectedType.(*unstructured.Unstructured) if !ok { return reflectDescription } gvk := obj.GroupVersionKind() if gvk.Empty() { return reflectDescription } return gvk.String() } func getExpectedGVKFromObject(expectedType interface{}) *schema.GroupVersionKind { obj, ok := expectedType.(*unstructured.Unstructured) if !ok { return nil } gvk := obj.GroupVersionKind() if gvk.Empty() { return nil } return &gvk } // internalPackages are packages that ignored when creating a default reflector name. These packages are in the common // call chains to NewReflector, so they'd be low entropy names for reflectors var internalPackages = []string{"client-go/tools/cache/"} // Run repeatedly uses the reflector's ListAndWatch to fetch all the // objects and subsequent deltas. // Run will exit when stopCh is closed. func (r *Reflector) Run(stopCh <-chan struct{}) { klog.V(3).Infof("Starting reflector %s (%s) from %s", r.typeDescription, r.resyncPeriod, r.name) wait.BackoffUntil(func() { if err := r.ListAndWatch(stopCh); err != nil { r.watchErrorHandler(r, err) } }, r.backoffManager, true, stopCh) klog.V(3).Infof("Stopping reflector %s (%s) from %s", r.typeDescription, r.resyncPeriod, r.name) } var ( // nothing will ever be sent down this channel neverExitWatch <-chan time.Time = make(chan time.Time) // Used to indicate that watching stopped because of a signal from the stop // channel passed in from a client of the reflector. errorStopRequested = errors.New("stop requested") ) // resyncChan returns a channel which will receive something when a resync is // required, and a cleanup function. func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) { if r.resyncPeriod == 0 { return neverExitWatch, func() bool { return false } } // The cleanup function is required: imagine the scenario where watches // always fail so we end up listing frequently. Then, if we don't // manually stop the timer, we could end up with many timers active // concurrently. t := r.clock.NewTimer(r.resyncPeriod) return t.C(), t.Stop } // ListAndWatch first lists all items and get the resource version at the moment of call, // and then use the resource version to watch. // It returns error if ListAndWatch didn't even try to initialize watch. func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { klog.V(3).Infof("Listing and watching %v from %s", r.typeDescription, r.name) var err error var w watch.Interface useWatchList := ptr.Deref(r.UseWatchList, false) fallbackToList := !useWatchList if useWatchList { w, err = r.watchList(stopCh) if w == nil && err == nil { // stopCh was closed return nil } if err != nil { klog.Warningf("The watchlist request ended with an error, falling back to the standard LIST/WATCH semantics because making progress is better than deadlocking, err = %v", err) fallbackToList = true // ensure that we won't accidentally pass some garbage down the watch. w = nil } } if fallbackToList { err = r.list(stopCh) if err != nil { return err } } klog.V(2).Infof("Caches populated for %v from %s", r.typeDescription, r.name) return r.watchWithResync(w, stopCh) } // startResync periodically calls r.store.Resync() method. // Note that this method is blocking and should be // called in a separate goroutine. func (r *Reflector) startResync(stopCh <-chan struct{}, cancelCh <-chan struct{}, resyncerrc chan error) { resyncCh, cleanup := r.resyncChan() defer func() { cleanup() // Call the last one written into cleanup }() for { select { case <-resyncCh: case <-stopCh: return case <-cancelCh: return } if r.ShouldResync == nil || r.ShouldResync() { klog.V(4).Infof("%s: forcing resync", r.name) if err := r.store.Resync(); err != nil { resyncerrc <- err return } } cleanup() resyncCh, cleanup = r.resyncChan() } } // watchWithResync runs watch with startResync in the background. func (r *Reflector) watchWithResync(w watch.Interface, stopCh <-chan struct{}) error { resyncerrc := make(chan error, 1) cancelCh := make(chan struct{}) defer close(cancelCh) go r.startResync(stopCh, cancelCh, resyncerrc) return r.watch(w, stopCh, resyncerrc) } // watch simply starts a watch request with the server. func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc chan error) error { var err error retry := NewRetryWithDeadline(r.MaxInternalErrorRetryDuration, time.Minute, apierrors.IsInternalError, r.clock) for { // give the stopCh a chance to stop the loop, even in case of continue statements further down on errors select { case <-stopCh: // we can only end up here when the stopCh // was closed after a successful watchlist or list request if w != nil { w.Stop() } return nil default: } // start the clock before sending the request, since some proxies won't flush headers until after the first watch event is sent start := r.clock.Now() if w == nil { timeoutSeconds := int64(r.minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) options := metav1.ListOptions{ ResourceVersion: r.LastSyncResourceVersion(), // We want to avoid situations of hanging watchers. Stop any watchers that do not // receive any events within the timeout window. TimeoutSeconds: &timeoutSeconds, // To reduce load on kube-apiserver on watch restarts, you may enable watch bookmarks. // Reflector doesn't assume bookmarks are returned at all (if the server do not support // watch bookmarks, it will ignore this field). AllowWatchBookmarks: true, } w, err = r.listerWatcher.Watch(options) if err != nil { if canRetry := isWatchErrorRetriable(err); canRetry { klog.V(4).Infof("%s: watch of %v returned %v - backing off", r.name, r.typeDescription, err) select { case <-stopCh: return nil case <-r.backoffManager.Backoff().C(): continue } } return err } } err = handleWatch(start, w, r.store, r.expectedType, r.expectedGVK, r.name, r.typeDescription, r.setLastSyncResourceVersion, r.clock, resyncerrc, stopCh) // Ensure that watch will not be reused across iterations. w.Stop() w = nil retry.After(err) if err != nil { if !errors.Is(err, errorStopRequested) { switch { case isExpiredError(err): // Don't set LastSyncResourceVersionUnavailable - LIST call with ResourceVersion=RV already // has a semantic that it returns data at least as fresh as provided RV. // So first try to LIST with setting RV to resource version of last observed object. klog.V(4).Infof("%s: watch of %v closed with: %v", r.name, r.typeDescription, err) case apierrors.IsTooManyRequests(err): klog.V(2).Infof("%s: watch of %v returned 429 - backing off", r.name, r.typeDescription) select { case <-stopCh: return nil case <-r.backoffManager.Backoff().C(): continue } case apierrors.IsInternalError(err) && retry.ShouldRetry(): klog.V(2).Infof("%s: retrying watch of %v internal error: %v", r.name, r.typeDescription, err) continue default: klog.Warningf("%s: watch of %v ended with: %v", r.name, r.typeDescription, err) } } return nil } } } // list simply lists all items and records a resource version obtained from the server at the moment of the call. // the resource version can be used for further progress notification (aka. watch). func (r *Reflector) list(stopCh <-chan struct{}) error { var resourceVersion string options := metav1.ListOptions{ResourceVersion: r.relistResourceVersion()} initTrace := trace.New("Reflector ListAndWatch", trace.Field{Key: "name", Value: r.name}) defer initTrace.LogIfLong(10 * time.Second) var list runtime.Object var paginatedResult bool var err error listCh := make(chan struct{}, 1) panicCh := make(chan interface{}, 1) go func() { defer func() { if r := recover(); r != nil { panicCh <- r } }() // Attempt to gather list in chunks, if supported by listerWatcher, if not, the first // list request will return the full response. pager := pager.New(pager.SimplePageFunc(func(opts metav1.ListOptions) (runtime.Object, error) { return r.listerWatcher.List(opts) })) switch { case r.WatchListPageSize != 0: pager.PageSize = r.WatchListPageSize case r.paginatedResult: // We got a paginated result initially. Assume this resource and server honor // paging requests (i.e. watch cache is probably disabled) and leave the default // pager size set. case options.ResourceVersion != "" && options.ResourceVersion != "0": // User didn't explicitly request pagination. // // With ResourceVersion != "", we have a possibility to list from watch cache, // but we do that (for ResourceVersion != "0") only if Limit is unset. // To avoid thundering herd on etcd (e.g. on master upgrades), we explicitly // switch off pagination to force listing from watch cache (if enabled). // With the existing semantic of RV (result is at least as fresh as provided RV), // this is correct and doesn't lead to going back in time. // // We also don't turn off pagination for ResourceVersion="0", since watch cache // is ignoring Limit in that case anyway, and if watch cache is not enabled // we don't introduce regression. pager.PageSize = 0 } list, paginatedResult, err = pager.ListWithAlloc(context.Background(), options) if isExpiredError(err) || isTooLargeResourceVersionError(err) { r.setIsLastSyncResourceVersionUnavailable(true) // Retry immediately if the resource version used to list is unavailable. // The pager already falls back to full list if paginated list calls fail due to an "Expired" error on // continuation pages, but the pager might not be enabled, the full list might fail because the // resource version it is listing at is expired or the cache may not yet be synced to the provided // resource version. So we need to fallback to resourceVersion="" in all to recover and ensure // the reflector makes forward progress. list, paginatedResult, err = pager.ListWithAlloc(context.Background(), metav1.ListOptions{ResourceVersion: r.relistResourceVersion()}) } close(listCh) }() select { case <-stopCh: return nil case r := <-panicCh: panic(r) case <-listCh: } initTrace.Step("Objects listed", trace.Field{Key: "error", Value: err}) if err != nil { klog.Warningf("%s: failed to list %v: %v", r.name, r.typeDescription, err) return fmt.Errorf("failed to list %v: %w", r.typeDescription, err) } // We check if the list was paginated and if so set the paginatedResult based on that. // However, we want to do that only for the initial list (which is the only case // when we set ResourceVersion="0"). The reasoning behind it is that later, in some // situations we may force listing directly from etcd (by setting ResourceVersion="") // which will return paginated result, even if watch cache is enabled. However, in // that case, we still want to prefer sending requests to watch cache if possible. // // Paginated result returned for request with ResourceVersion="0" mean that watch // cache is disabled and there are a lot of objects of a given type. In such case, // there is no need to prefer listing from watch cache. if options.ResourceVersion == "0" && paginatedResult { r.paginatedResult = true } r.setIsLastSyncResourceVersionUnavailable(false) // list was successful listMetaInterface, err := meta.ListAccessor(list) if err != nil { return fmt.Errorf("unable to understand list result %#v: %v", list, err) } resourceVersion = listMetaInterface.GetResourceVersion() initTrace.Step("Resource version extracted") items, err := meta.ExtractListWithAlloc(list) if err != nil { return fmt.Errorf("unable to understand list result %#v (%v)", list, err) } initTrace.Step("Objects extracted") if err := r.syncWith(items, resourceVersion); err != nil { return fmt.Errorf("unable to sync list result: %v", err) } initTrace.Step("SyncWith done") r.setLastSyncResourceVersion(resourceVersion) initTrace.Step("Resource version updated") return nil } // watchList establishes a stream to get a consistent snapshot of data // from the server as described in https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/3157-watch-list#proposal // // case 1: start at Most Recent (RV="", ResourceVersionMatch=ResourceVersionMatchNotOlderThan) // Establishes a consistent stream with the server. // That means the returned data is consistent, as if, served directly from etcd via a quorum read. // It begins with synthetic "Added" events of all resources up to the most recent ResourceVersion. // It ends with a synthetic "Bookmark" event containing the most recent ResourceVersion. // After receiving a "Bookmark" event the reflector is considered to be synchronized. // It replaces its internal store with the collected items and // reuses the current watch requests for getting further events. // // case 2: start at Exact (RV>"0", ResourceVersionMatch=ResourceVersionMatchNotOlderThan) // Establishes a stream with the server at the provided resource version. // To establish the initial state the server begins with synthetic "Added" events. // It ends with a synthetic "Bookmark" event containing the provided or newer resource version. // After receiving a "Bookmark" event the reflector is considered to be synchronized. // It replaces its internal store with the collected items and // reuses the current watch requests for getting further events. func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { var w watch.Interface var err error var temporaryStore Store var resourceVersion string // TODO(#115478): see if this function could be turned // into a method and see if error handling // could be unified with the r.watch method isErrorRetriableWithSideEffectsFn := func(err error) bool { if canRetry := isWatchErrorRetriable(err); canRetry { klog.V(2).Infof("%s: watch-list of %v returned %v - backing off", r.name, r.typeDescription, err) <-r.backoffManager.Backoff().C() return true } if isExpiredError(err) || isTooLargeResourceVersionError(err) { // we tried to re-establish a watch request but the provided RV // has either expired or it is greater than the server knows about. // In that case we reset the RV and // try to get a consistent snapshot from the watch cache (case 1) r.setIsLastSyncResourceVersionUnavailable(true) return true } return false } initTrace := trace.New("Reflector WatchList", trace.Field{Key: "name", Value: r.name}) defer initTrace.LogIfLong(10 * time.Second) for { select { case <-stopCh: return nil, nil default: } resourceVersion = "" lastKnownRV := r.rewatchResourceVersion() temporaryStore = NewStore(DeletionHandlingMetaNamespaceKeyFunc) // TODO(#115478): large "list", slow clients, slow network, p&f // might slow down streaming and eventually fail. // maybe in such a case we should retry with an increased timeout? timeoutSeconds := int64(r.minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) options := metav1.ListOptions{ ResourceVersion: lastKnownRV, AllowWatchBookmarks: true, SendInitialEvents: pointer.Bool(true), ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: &timeoutSeconds, } start := r.clock.Now() w, err = r.listerWatcher.Watch(options) if err != nil { if isErrorRetriableWithSideEffectsFn(err) { continue } return nil, err } watchListBookmarkReceived, err := handleListWatch(start, w, temporaryStore, r.expectedType, r.expectedGVK, r.name, r.typeDescription, func(rv string) { resourceVersion = rv }, r.clock, make(chan error), stopCh) if err != nil { w.Stop() // stop and retry with clean state if errors.Is(err, errorStopRequested) { return nil, nil } if isErrorRetriableWithSideEffectsFn(err) { continue } return nil, err } if watchListBookmarkReceived { break } } // We successfully got initial state from watch-list confirmed by the // "k8s.io/initial-events-end" bookmark. initTrace.Step("Objects streamed", trace.Field{Key: "count", Value: len(temporaryStore.List())}) r.setIsLastSyncResourceVersionUnavailable(false) // we utilize the temporaryStore to ensure independence from the current store implementation. // as of today, the store is implemented as a queue and will be drained by the higher-level // component as soon as it finishes replacing the content. checkWatchListDataConsistencyIfRequested(wait.ContextForChannel(stopCh), r.name, resourceVersion, wrapListFuncWithContext(r.listerWatcher.List), temporaryStore.List) if err := r.store.Replace(temporaryStore.List(), resourceVersion); err != nil { return nil, fmt.Errorf("unable to sync watch-list result: %w", err) } initTrace.Step("SyncWith done") r.setLastSyncResourceVersion(resourceVersion) return w, nil } // syncWith replaces the store's items with the given list. func (r *Reflector) syncWith(items []runtime.Object, resourceVersion string) error { found := make([]interface{}, 0, len(items)) for _, item := range items { found = append(found, item) } return r.store.Replace(found, resourceVersion) } // handleListWatch consumes events from w, updates the Store, and records the // last seen ResourceVersion, to allow continuing from that ResourceVersion on // retry. If successful, the watcher will be left open after receiving the // initial set of objects, to allow watching for future events. func handleListWatch( start time.Time, w watch.Interface, store Store, expectedType reflect.Type, expectedGVK *schema.GroupVersionKind, name string, expectedTypeName string, setLastSyncResourceVersion func(string), clock clock.Clock, errCh chan error, stopCh <-chan struct{}, ) (bool, error) { exitOnWatchListBookmarkReceived := true return handleAnyWatch(start, w, store, expectedType, expectedGVK, name, expectedTypeName, setLastSyncResourceVersion, exitOnWatchListBookmarkReceived, clock, errCh, stopCh) } // handleListWatch consumes events from w, updates the Store, and records the // last seen ResourceVersion, to allow continuing from that ResourceVersion on // retry. The watcher will always be stopped on exit. func handleWatch( start time.Time, w watch.Interface, store Store, expectedType reflect.Type, expectedGVK *schema.GroupVersionKind, name string, expectedTypeName string, setLastSyncResourceVersion func(string), clock clock.Clock, errCh chan error, stopCh <-chan struct{}, ) error { exitOnWatchListBookmarkReceived := false _, err := handleAnyWatch(start, w, store, expectedType, expectedGVK, name, expectedTypeName, setLastSyncResourceVersion, exitOnWatchListBookmarkReceived, clock, errCh, stopCh) return err } // handleAnyWatch consumes events from w, updates the Store, and records the last // seen ResourceVersion, to allow continuing from that ResourceVersion on retry. // If exitOnWatchListBookmarkReceived is true, the watch events will be consumed // until a bookmark event is received with the WatchList annotation present. // Returns true (watchListBookmarkReceived) if the WatchList bookmark was // received, even if exitOnWatchListBookmarkReceived is false. // The watcher will always be stopped, unless exitOnWatchListBookmarkReceived is // true and watchListBookmarkReceived is true. This allows the same watch stream // to be re-used by the caller to continue watching for new events. func handleAnyWatch(start time.Time, w watch.Interface, store Store, expectedType reflect.Type, expectedGVK *schema.GroupVersionKind, name string, expectedTypeName string, setLastSyncResourceVersion func(string), exitOnWatchListBookmarkReceived bool, clock clock.Clock, errCh chan error, stopCh <-chan struct{}, ) (bool, error) { watchListBookmarkReceived := false eventCount := 0 initialEventsEndBookmarkWarningTicker := newInitialEventsEndBookmarkTicker(name, clock, start, exitOnWatchListBookmarkReceived) defer initialEventsEndBookmarkWarningTicker.Stop() loop: for { select { case <-stopCh: return watchListBookmarkReceived, errorStopRequested case err := <-errCh: return watchListBookmarkReceived, err case event, ok := <-w.ResultChan(): if !ok { break loop } if event.Type == watch.Error { return watchListBookmarkReceived, apierrors.FromObject(event.Object) } if expectedType != nil { if e, a := expectedType, reflect.TypeOf(event.Object); e != a { utilruntime.HandleError(fmt.Errorf("%s: expected type %v, but watch event object had type %v", name, e, a)) continue } } if expectedGVK != nil { if e, a := *expectedGVK, event.Object.GetObjectKind().GroupVersionKind(); e != a { utilruntime.HandleError(fmt.Errorf("%s: expected gvk %v, but watch event object had gvk %v", name, e, a)) continue } } meta, err := meta.Accessor(event.Object) if err != nil { utilruntime.HandleError(fmt.Errorf("%s: unable to understand watch event %#v", name, event)) continue } resourceVersion := meta.GetResourceVersion() switch event.Type { case watch.Added: err := store.Add(event.Object) if err != nil { utilruntime.HandleError(fmt.Errorf("%s: unable to add watch event object (%#v) to store: %v", name, event.Object, err)) } case watch.Modified: err := store.Update(event.Object) if err != nil { utilruntime.HandleError(fmt.Errorf("%s: unable to update watch event object (%#v) to store: %v", name, event.Object, err)) } case watch.Deleted: // TODO: Will any consumers need access to the "last known // state", which is passed in event.Object? If so, may need // to change this. err := store.Delete(event.Object) if err != nil { utilruntime.HandleError(fmt.Errorf("%s: unable to delete watch event object (%#v) from store: %v", name, event.Object, err)) } case watch.Bookmark: // A `Bookmark` means watch has synced here, just update the resourceVersion if meta.GetAnnotations()[metav1.InitialEventsAnnotationKey] == "true" { watchListBookmarkReceived = true } default: utilruntime.HandleError(fmt.Errorf("%s: unable to understand watch event %#v", name, event)) } setLastSyncResourceVersion(resourceVersion) if rvu, ok := store.(ResourceVersionUpdater); ok { rvu.UpdateResourceVersion(resourceVersion) } eventCount++ if exitOnWatchListBookmarkReceived && watchListBookmarkReceived { watchDuration := clock.Since(start) klog.V(4).Infof("exiting %v Watch because received the bookmark that marks the end of initial events stream, total %v items received in %v", name, eventCount, watchDuration) return watchListBookmarkReceived, nil } initialEventsEndBookmarkWarningTicker.observeLastEventTimeStamp(clock.Now()) case <-initialEventsEndBookmarkWarningTicker.C(): initialEventsEndBookmarkWarningTicker.warnIfExpired() } } watchDuration := clock.Since(start) if watchDuration < 1*time.Second && eventCount == 0 { return watchListBookmarkReceived, fmt.Errorf("very short watch: %s: Unexpected watch close - watch lasted less than a second and no items received", name) } klog.V(4).Infof("%s: Watch close - %v total %v items received", name, expectedTypeName, eventCount) return watchListBookmarkReceived, nil } // LastSyncResourceVersion is the resource version observed when last sync with the underlying store // The value returned is not synchronized with access to the underlying store and is not thread-safe func (r *Reflector) LastSyncResourceVersion() string { r.lastSyncResourceVersionMutex.RLock() defer r.lastSyncResourceVersionMutex.RUnlock() return r.lastSyncResourceVersion } func (r *Reflector) setLastSyncResourceVersion(v string) { r.lastSyncResourceVersionMutex.Lock() defer r.lastSyncResourceVersionMutex.Unlock() r.lastSyncResourceVersion = v } // relistResourceVersion determines the resource version the reflector should list or relist from. // Returns either the lastSyncResourceVersion so that this reflector will relist with a resource // versions no older than has already been observed in relist results or watch events, or, if the last relist resulted // in an HTTP 410 (Gone) status code, returns "" so that the relist will use the latest resource version available in // etcd via a quorum read. func (r *Reflector) relistResourceVersion() string { r.lastSyncResourceVersionMutex.RLock() defer r.lastSyncResourceVersionMutex.RUnlock() if r.isLastSyncResourceVersionUnavailable { // Since this reflector makes paginated list requests, and all paginated list requests skip the watch cache // if the lastSyncResourceVersion is unavailable, we set ResourceVersion="" and list again to re-establish reflector // to the latest available ResourceVersion, using a consistent read from etcd. return "" } if r.lastSyncResourceVersion == "" { // For performance reasons, initial list performed by reflector uses "0" as resource version to allow it to // be served from the watch cache if it is enabled. return "0" } return r.lastSyncResourceVersion } // rewatchResourceVersion determines the resource version the reflector should start streaming from. func (r *Reflector) rewatchResourceVersion() string { r.lastSyncResourceVersionMutex.RLock() defer r.lastSyncResourceVersionMutex.RUnlock() if r.isLastSyncResourceVersionUnavailable { // initial stream should return data at the most recent resource version. // the returned data must be consistent i.e. as if served from etcd via a quorum read return "" } return r.lastSyncResourceVersion } // setIsLastSyncResourceVersionUnavailable sets if the last list or watch request with lastSyncResourceVersion returned // "expired" or "too large resource version" error. func (r *Reflector) setIsLastSyncResourceVersionUnavailable(isUnavailable bool) { r.lastSyncResourceVersionMutex.Lock() defer r.lastSyncResourceVersionMutex.Unlock() r.isLastSyncResourceVersionUnavailable = isUnavailable } func isExpiredError(err error) bool { // In Kubernetes 1.17 and earlier, the api server returns both apierrors.StatusReasonExpired and // apierrors.StatusReasonGone for HTTP 410 (Gone) status code responses. In 1.18 the kube server is more consistent // and always returns apierrors.StatusReasonExpired. For backward compatibility we can only remove the apierrors.IsGone // check when we fully drop support for Kubernetes 1.17 servers from reflectors. return apierrors.IsResourceExpired(err) || apierrors.IsGone(err) } func isTooLargeResourceVersionError(err error) bool { if apierrors.HasStatusCause(err, metav1.CauseTypeResourceVersionTooLarge) { return true } // In Kubernetes 1.17.0-1.18.5, the api server doesn't set the error status cause to // metav1.CauseTypeResourceVersionTooLarge to indicate that the requested minimum resource // version is larger than the largest currently available resource version. To ensure backward // compatibility with these server versions we also need to detect the error based on the content // of the error message field. if !apierrors.IsTimeout(err) { return false } apierr, ok := err.(apierrors.APIStatus) if !ok || apierr == nil || apierr.Status().Details == nil { return false } for _, cause := range apierr.Status().Details.Causes { // Matches the message returned by api server 1.17.0-1.18.5 for this error condition if cause.Message == "Too large resource version" { return true } } // Matches the message returned by api server before 1.17.0 if strings.Contains(apierr.Status().Message, "Too large resource version") { return true } return false } // isWatchErrorRetriable determines if it is safe to retry // a watch error retrieved from the server. func isWatchErrorRetriable(err error) bool { // If this is "connection refused" error, it means that most likely apiserver is not responsive. // It doesn't make sense to re-list all objects because most likely we will be able to restart // watch where we ended. // If that's the case begin exponentially backing off and resend watch request. // Do the same for "429" errors. if utilnet.IsConnectionRefused(err) || apierrors.IsTooManyRequests(err) { return true } return false } // wrapListFuncWithContext simply wraps ListFunction into another function that accepts a context and ignores it. func wrapListFuncWithContext(listFn ListFunc) func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { return func(_ context.Context, options metav1.ListOptions) (runtime.Object, error) { return listFn(options) } } // initialEventsEndBookmarkTicker a ticker that produces a warning if the bookmark event // which marks the end of the watch stream, has not been received within the defined tick interval. // // Note: // The methods exposed by this type are not thread-safe. type initialEventsEndBookmarkTicker struct { clock.Ticker clock clock.Clock name string watchStart time.Time tickInterval time.Duration lastEventObserveTime time.Time } // newInitialEventsEndBookmarkTicker returns a noop ticker if exitOnInitialEventsEndBookmarkRequested is false. // Otherwise, it returns a ticker that exposes a method producing a warning if the bookmark event, // which marks the end of the watch stream, has not been received within the defined tick interval. // // Note that the caller controls whether to call t.C() and t.Stop(). // // In practice, the reflector exits the watchHandler as soon as the bookmark event is received and calls the t.C() method. func newInitialEventsEndBookmarkTicker(name string, c clock.Clock, watchStart time.Time, exitOnWatchListBookmarkReceived bool) *initialEventsEndBookmarkTicker { return newInitialEventsEndBookmarkTickerInternal(name, c, watchStart, 10*time.Second, exitOnWatchListBookmarkReceived) } func newInitialEventsEndBookmarkTickerInternal(name string, c clock.Clock, watchStart time.Time, tickInterval time.Duration, exitOnWatchListBookmarkReceived bool) *initialEventsEndBookmarkTicker { clockWithTicker, ok := c.(clock.WithTicker) if !ok || !exitOnWatchListBookmarkReceived { if exitOnWatchListBookmarkReceived { klog.Warningf("clock does not support WithTicker interface but exitOnInitialEventsEndBookmark was requested") } return &initialEventsEndBookmarkTicker{ Ticker: &noopTicker{}, } } return &initialEventsEndBookmarkTicker{ Ticker: clockWithTicker.NewTicker(tickInterval), clock: c, name: name, watchStart: watchStart, tickInterval: tickInterval, } } func (t *initialEventsEndBookmarkTicker) observeLastEventTimeStamp(lastEventObserveTime time.Time) { t.lastEventObserveTime = lastEventObserveTime } func (t *initialEventsEndBookmarkTicker) warnIfExpired() { if err := t.produceWarningIfExpired(); err != nil { klog.Warning(err) } } // produceWarningIfExpired returns an error that represents a warning when // the time elapsed since the last received event exceeds the tickInterval. // // Note that this method should be called when t.C() yields a value. func (t *initialEventsEndBookmarkTicker) produceWarningIfExpired() error { if _, ok := t.Ticker.(*noopTicker); ok { return nil /*noop ticker*/ } if t.lastEventObserveTime.IsZero() { return fmt.Errorf("%s: awaiting required bookmark event for initial events stream, no events received for %v", t.name, t.clock.Since(t.watchStart)) } elapsedTime := t.clock.Now().Sub(t.lastEventObserveTime) hasBookmarkTimerExpired := elapsedTime >= t.tickInterval if !hasBookmarkTimerExpired { return nil } return fmt.Errorf("%s: hasn't received required bookmark event marking the end of initial events stream, received last event %v ago", t.name, elapsedTime) } var _ clock.Ticker = &noopTicker{} // TODO(#115478): move to k8s/utils repo type noopTicker struct{} func (t *noopTicker) C() <-chan time.Time { return nil } func (t *noopTicker) Stop() {} kubernetes-client-go-a2dfcab/tools/cache/reflector_data_consistency_detector.go000066400000000000000000000035451472614177300304310ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/util/consistencydetector" ) // checkWatchListDataConsistencyIfRequested performs a data consistency check only when // the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. // // The consistency check is meant to be enforced only in the CI, not in production. // The check ensures that data retrieved by the watch-list api call // is exactly the same as data received by the standard list api call against etcd. // // Note that this function will panic when data inconsistency is detected. // This is intentional because we want to catch it in the CI. func checkWatchListDataConsistencyIfRequested[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn consistencydetector.ListFunc[T], retrieveItemsFn consistencydetector.RetrieveItemsFunc[U]) { if !consistencydetector.IsDataConsistencyDetectionForWatchListEnabled() { return } // for informers we pass an empty ListOptions because // listFn might be wrapped for filtering during informer construction. consistencydetector.CheckDataConsistency(ctx, identity, lastSyncedResourceVersion, listFn, metav1.ListOptions{}, retrieveItemsFn) } kubernetes-client-go-a2dfcab/tools/cache/reflector_metrics.go000066400000000000000000000056051472614177300246530ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // This file provides abstractions for setting the provider (e.g., prometheus) // of metrics. package cache import ( "sync" ) // GaugeMetric represents a single numerical value that can arbitrarily go up // and down. type GaugeMetric interface { Set(float64) } // CounterMetric represents a single numerical value that only ever // goes up. type CounterMetric interface { Inc() } // SummaryMetric captures individual observations. type SummaryMetric interface { Observe(float64) } type noopMetric struct{} func (noopMetric) Inc() {} func (noopMetric) Dec() {} func (noopMetric) Observe(float64) {} func (noopMetric) Set(float64) {} // MetricsProvider generates various metrics used by the reflector. type MetricsProvider interface { NewListsMetric(name string) CounterMetric NewListDurationMetric(name string) SummaryMetric NewItemsInListMetric(name string) SummaryMetric NewWatchesMetric(name string) CounterMetric NewShortWatchesMetric(name string) CounterMetric NewWatchDurationMetric(name string) SummaryMetric NewItemsInWatchMetric(name string) SummaryMetric NewLastResourceVersionMetric(name string) GaugeMetric } type noopMetricsProvider struct{} func (noopMetricsProvider) NewListsMetric(name string) CounterMetric { return noopMetric{} } func (noopMetricsProvider) NewListDurationMetric(name string) SummaryMetric { return noopMetric{} } func (noopMetricsProvider) NewItemsInListMetric(name string) SummaryMetric { return noopMetric{} } func (noopMetricsProvider) NewWatchesMetric(name string) CounterMetric { return noopMetric{} } func (noopMetricsProvider) NewShortWatchesMetric(name string) CounterMetric { return noopMetric{} } func (noopMetricsProvider) NewWatchDurationMetric(name string) SummaryMetric { return noopMetric{} } func (noopMetricsProvider) NewItemsInWatchMetric(name string) SummaryMetric { return noopMetric{} } func (noopMetricsProvider) NewLastResourceVersionMetric(name string) GaugeMetric { return noopMetric{} } var metricsFactory = struct { metricsProvider MetricsProvider setProviders sync.Once }{ metricsProvider: noopMetricsProvider{}, } // SetReflectorMetricsProvider sets the metrics provider func SetReflectorMetricsProvider(metricsProvider MetricsProvider) { metricsFactory.setProviders.Do(func() { metricsFactory.metricsProvider = metricsProvider }) } kubernetes-client-go-a2dfcab/tools/cache/reflector_test.go000066400000000000000000001623441472614177300241700ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "context" "errors" "fmt" "math/rand" "reflect" goruntime "runtime" "strconv" "syscall" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/utils/clock" testingclock "k8s.io/utils/clock/testing" ) var nevererrc chan error type testLW struct { ListFunc func(options metav1.ListOptions) (runtime.Object, error) WatchFunc func(options metav1.ListOptions) (watch.Interface, error) } func (t *testLW) List(options metav1.ListOptions) (runtime.Object, error) { return t.ListFunc(options) } func (t *testLW) Watch(options metav1.ListOptions) (watch.Interface, error) { return t.WatchFunc(options) } func TestCloseWatchChannelOnError(t *testing.T) { r := NewReflector(&testLW{}, &v1.Pod{}, NewStore(MetaNamespaceKeyFunc), 0) pod := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}} fw := watch.NewFake() r.listerWatcher = &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil }, } go r.ListAndWatch(wait.NeverStop) fw.Error(pod) select { case _, ok := <-fw.ResultChan(): if ok { t.Errorf("Watch channel left open after cancellation") } case <-time.After(wait.ForeverTestTimeout): t.Errorf("the cancellation is at least %s late", wait.ForeverTestTimeout.String()) break } } func TestRunUntil(t *testing.T) { stopCh := make(chan struct{}) store := NewStore(MetaNamespaceKeyFunc) r := NewReflector(&testLW{}, &v1.Pod{}, store, 0) fw := watch.NewFake() r.listerWatcher = &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil }, } doneCh := make(chan struct{}) go func() { defer close(doneCh) r.Run(stopCh) }() // Synchronously add a dummy pod into the watch channel so we // know the RunUntil go routine is in the watch handler. fw.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}}) close(stopCh) resultCh := fw.ResultChan() for { select { case <-doneCh: if resultCh == nil { return // both closed } doneCh = nil case _, ok := <-resultCh: if ok { t.Fatalf("Watch channel left open after stopping the watch") } if doneCh == nil { return // both closed } resultCh = nil case <-time.After(wait.ForeverTestTimeout): t.Fatalf("the cancellation is at least %s late", wait.ForeverTestTimeout.String()) } } } func TestReflectorResyncChan(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, time.Millisecond) a, _ := g.resyncChan() b := time.After(wait.ForeverTestTimeout) select { case <-a: t.Logf("got timeout as expected") case <-b: t.Errorf("resyncChan() is at least 99 milliseconds late??") } } // TestReflectorWatchStoppedBefore ensures that neither List nor Watch are // called if the stop channel is closed before Reflector.watch is called. func TestReflectorWatchStoppedBefore(t *testing.T) { stopCh := make(chan struct{}) close(stopCh) lw := &ListWatch{ ListFunc: func(_ metav1.ListOptions) (runtime.Object, error) { t.Fatal("ListFunc called unexpectedly") return nil, nil }, WatchFunc: func(_ metav1.ListOptions) (watch.Interface, error) { // If WatchFunc is never called, the watcher it returns doesn't need to be stopped. t.Fatal("WatchFunc called unexpectedly") return nil, nil }, } target := NewReflector(lw, &v1.Pod{}, nil, 0) err := target.watch(nil, stopCh, nil) require.NoError(t, err) } // TestReflectorWatchStoppedAfter ensures that neither the watcher is stopped if // the stop channel is closed after Reflector.watch has started watching. func TestReflectorWatchStoppedAfter(t *testing.T) { stopCh := make(chan struct{}) var watchers []*watch.FakeWatcher lw := &ListWatch{ ListFunc: func(_ metav1.ListOptions) (runtime.Object, error) { t.Fatal("ListFunc called unexpectedly") return nil, nil }, WatchFunc: func(_ metav1.ListOptions) (watch.Interface, error) { // Simulate the stop channel being closed after watching has started go func() { time.Sleep(10 * time.Millisecond) close(stopCh) }() // Use a fake watcher that never sends events w := watch.NewFake() watchers = append(watchers, w) return w, nil }, } target := NewReflector(lw, &v1.Pod{}, nil, 0) err := target.watch(nil, stopCh, nil) require.NoError(t, err) require.Len(t, watchers, 1) require.True(t, watchers[0].IsStopped()) } func BenchmarkReflectorResyncChanMany(b *testing.B) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 25*time.Millisecond) // The improvement to this (calling the timer's Stop() method) makes // this benchmark about 40% faster. for i := 0; i < b.N; i++ { g.resyncPeriod = time.Duration(rand.Float64() * float64(time.Millisecond) * 25) _, stop := g.resyncChan() stop() } } // TestReflectorHandleWatchStoppedBefore ensures that handleWatch stops when // stopCh is already closed before handleWatch was called. It also ensures that // ResultChan is only called once and that Stop is called after ResultChan. func TestReflectorHandleWatchStoppedBefore(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) stopCh := make(chan struct{}) // Simulate the watch channel being closed before the watchHandler is called close(stopCh) var calls []string resultCh := make(chan watch.Event) fw := watch.MockWatcher{ StopFunc: func() { calls = append(calls, "Stop") close(resultCh) }, ResultChanFunc: func() <-chan watch.Event { calls = append(calls, "ResultChan") return resultCh }, } err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, stopCh) if err == nil { t.Errorf("unexpected non-error") } // Ensure the watcher methods are called exactly once in this exact order. // TODO(karlkfi): Fix watchHandler to call Stop() // assert.Equal(t, []string{"ResultChan", "Stop"}, calls) assert.Equal(t, []string{"ResultChan"}, calls) } // TestReflectorHandleWatchStoppedAfter ensures that handleWatch stops when // stopCh is closed after handleWatch was called. It also ensures that // ResultChan is only called once and that Stop is called after ResultChan. func TestReflectorHandleWatchStoppedAfter(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) var calls []string stopCh := make(chan struct{}) resultCh := make(chan watch.Event) fw := watch.MockWatcher{ StopFunc: func() { calls = append(calls, "Stop") close(resultCh) }, ResultChanFunc: func() <-chan watch.Event { calls = append(calls, "ResultChan") resultCh = make(chan watch.Event) // Simulate the watch handler being stopped asynchronously by the // caller, after watching has started. go func() { time.Sleep(10 * time.Millisecond) close(stopCh) }() return resultCh }, } err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, stopCh) if err == nil { t.Errorf("unexpected non-error") } // Ensure the watcher methods are called exactly once in this exact order. // TODO(karlkfi): Fix watchHandler to call Stop() // assert.Equal(t, []string{"ResultChan", "Stop"}, calls) assert.Equal(t, []string{"ResultChan"}, calls) } // TestReflectorHandleWatchResultChanClosedBefore ensures that handleWatch // stops when the result channel is closed before handleWatch was called. func TestReflectorHandleWatchResultChanClosedBefore(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) var calls []string resultCh := make(chan watch.Event) fw := watch.MockWatcher{ StopFunc: func() { calls = append(calls, "Stop") }, ResultChanFunc: func() <-chan watch.Event { calls = append(calls, "ResultChan") return resultCh }, } // Simulate the result channel being closed by the producer before handleWatch is called. close(resultCh) err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, wait.NeverStop) if err == nil { t.Errorf("unexpected non-error") } // Ensure the watcher methods are called exactly once in this exact order. // TODO(karlkfi): Fix watchHandler to call Stop() // assert.Equal(t, []string{"ResultChan", "Stop"}, calls) assert.Equal(t, []string{"ResultChan"}, calls) } // TestReflectorHandleWatchResultChanClosedAfter ensures that handleWatch // stops when the result channel is closed after handleWatch has started watching. func TestReflectorHandleWatchResultChanClosedAfter(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) var calls []string resultCh := make(chan watch.Event) fw := watch.MockWatcher{ StopFunc: func() { calls = append(calls, "Stop") }, ResultChanFunc: func() <-chan watch.Event { calls = append(calls, "ResultChan") resultCh = make(chan watch.Event) // Simulate the result channel being closed by the producer, after // watching has started. go func() { time.Sleep(10 * time.Millisecond) close(resultCh) }() return resultCh }, } err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, wait.NeverStop) if err == nil { t.Errorf("unexpected non-error") } // Ensure the watcher methods are called exactly once in this exact order. // TODO(karlkfi): Fix watchHandler to call Stop() // assert.Equal(t, []string{"ResultChan", "Stop"}, calls) assert.Equal(t, []string{"ResultChan"}, calls) } func TestReflectorWatchHandler(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) // Wrap setLastSyncResourceVersion so we can tell the watchHandler to stop // watching after all the events have been consumed. This avoids race // conditions which can happen if the producer calls Stop(), instead of the // consumer. stopCh := make(chan struct{}) setLastSyncResourceVersion := func(rv string) { g.setLastSyncResourceVersion(rv) if rv == "32" { close(stopCh) } } fw := watch.NewFake() s.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}) s.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}}) go func() { fw.Add(&v1.Service{ObjectMeta: metav1.ObjectMeta{Name: "rejected"}}) fw.Delete(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}) fw.Modify(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar", ResourceVersion: "55"}}) fw.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "baz", ResourceVersion: "32"}}) fw.Stop() }() err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, setLastSyncResourceVersion, g.clock, nevererrc, stopCh) // TODO(karlkfi): Fix FakeWatcher to avoid race condition between watcher.Stop() & close(stopCh) if err != nil && !errors.Is(err, errorStopRequested) { t.Errorf("unexpected error %v", err) } mkPod := func(id string, rv string) *v1.Pod { return &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: id, ResourceVersion: rv}} } // Validate that the Store was updated by the events table := []struct { Pod *v1.Pod exists bool }{ {mkPod("foo", ""), false}, {mkPod("rejected", ""), false}, {mkPod("bar", "55"), true}, {mkPod("baz", "32"), true}, } for _, item := range table { obj, exists, _ := s.Get(item.Pod) if e, a := item.exists, exists; e != a { t.Errorf("%v: expected %v, got %v", item.Pod, e, a) } if !exists { continue } if e, a := item.Pod.ResourceVersion, obj.(*v1.Pod).ResourceVersion; e != a { t.Errorf("%v: expected %v, got %v", item.Pod, e, a) } } // Validate that setLastSyncResourceVersion was called with the RV from the last event. if e, a := "32", g.LastSyncResourceVersion(); e != a { t.Errorf("expected %v, got %v", e, a) } } func TestReflectorStopWatch(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) fw := watch.NewFake() stopWatch := make(chan struct{}) close(stopWatch) err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, stopWatch) if err != errorStopRequested { t.Errorf("expected stop error, got %q", err) } } func TestReflectorListAndWatch(t *testing.T) { createdFakes := make(chan *watch.FakeWatcher) // The ListFunc says that it's at revision 1. Therefore, we expect our WatchFunc // to get called at the beginning of the watch with 1, and again with 3 when we // inject an error. expectedRVs := []string{"1", "3"} lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { rv := options.ResourceVersion fw := watch.NewFake() if e, a := expectedRVs[0], rv; e != a { t.Errorf("Expected rv %v, but got %v", e, a) } expectedRVs = expectedRVs[1:] // channel is not buffered because the for loop below needs to block. But // we don't want to block here, so report the new fake via a go routine. go func() { createdFakes <- fw }() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil }, } s := NewFIFO(MetaNamespaceKeyFunc) r := NewReflector(lw, &v1.Pod{}, s, 0) go r.ListAndWatch(wait.NeverStop) ids := []string{"foo", "bar", "baz", "qux", "zoo"} var fw *watch.FakeWatcher for i, id := range ids { if fw == nil { fw = <-createdFakes } sendingRV := strconv.FormatUint(uint64(i+2), 10) fw.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: id, ResourceVersion: sendingRV}}) if sendingRV == "3" { // Inject a failure. fw.Stop() fw = nil } } // Verify we received the right ids with the right resource versions. for i, id := range ids { pod := Pop(s).(*v1.Pod) if e, a := id, pod.Name; e != a { t.Errorf("%v: Expected %v, got %v", i, e, a) } if e, a := strconv.FormatUint(uint64(i+2), 10), pod.ResourceVersion; e != a { t.Errorf("%v: Expected %v, got %v", i, e, a) } } if len(expectedRVs) != 0 { t.Error("called watchStarter an unexpected number of times") } } func TestReflectorListAndWatchWithErrors(t *testing.T) { mkPod := func(id string, rv string) *v1.Pod { return &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: id, ResourceVersion: rv}} } mkList := func(rv string, pods ...*v1.Pod) *v1.PodList { list := &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: rv}} for _, pod := range pods { list.Items = append(list.Items, *pod) } return list } table := []struct { list *v1.PodList listErr error events []watch.Event watchErr error }{ { list: mkList("1"), events: []watch.Event{ {Type: watch.Added, Object: mkPod("foo", "2")}, {Type: watch.Added, Object: mkPod("bar", "3")}, }, }, { list: mkList("3", mkPod("foo", "2"), mkPod("bar", "3")), events: []watch.Event{ {Type: watch.Deleted, Object: mkPod("foo", "4")}, {Type: watch.Added, Object: mkPod("qux", "5")}, }, }, { listErr: fmt.Errorf("a list error"), }, { list: mkList("5", mkPod("bar", "3"), mkPod("qux", "5")), watchErr: fmt.Errorf("a watch error"), }, { list: mkList("5", mkPod("bar", "3"), mkPod("qux", "5")), events: []watch.Event{ {Type: watch.Added, Object: mkPod("baz", "6")}, }, }, { list: mkList("6", mkPod("bar", "3"), mkPod("qux", "5"), mkPod("baz", "6")), }, } s := NewFIFO(MetaNamespaceKeyFunc) for line, item := range table { if item.list != nil { // Test that the list is what currently exists in the store. current := s.List() checkMap := map[string]string{} for _, item := range current { pod := item.(*v1.Pod) checkMap[pod.Name] = pod.ResourceVersion } for _, pod := range item.list.Items { if e, a := pod.ResourceVersion, checkMap[pod.Name]; e != a { t.Errorf("%v: expected %v, got %v for pod %v", line, e, a, pod.Name) } } if e, a := len(item.list.Items), len(checkMap); e != a { t.Errorf("%v: expected %v, got %v", line, e, a) } } watchRet, watchErr := item.events, item.watchErr stopCh := make(chan struct{}) lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if watchErr != nil { return nil, watchErr } watchErr = fmt.Errorf("second watch") fw := watch.NewFake() go func() { for _, e := range watchRet { fw.Action(e.Type, e.Object) } // Because FakeWatcher doesn't buffer events, it's safe to // close the stop channel immediately without missing events. // But usually, the event producer would instead close the // result channel, and wait for the consumer to stop the // watcher, to avoid race conditions. // TODO: Fix the FakeWatcher to separate watcher.Stop from close(resultCh) close(stopCh) }() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return item.list, item.listErr }, } r := NewReflector(lw, &v1.Pod{}, s, 0) err := r.ListAndWatch(stopCh) if item.listErr != nil && !errors.Is(err, item.listErr) { t.Errorf("unexpected ListAndWatch error: %v", err) } if item.watchErr != nil && !errors.Is(err, item.watchErr) { t.Errorf("unexpected ListAndWatch error: %v", err) } if item.listErr == nil && item.watchErr == nil { assert.NoError(t, err) } } } func TestReflectorListAndWatchInitConnBackoff(t *testing.T) { maxBackoff := 50 * time.Millisecond table := []struct { numConnFails int expLowerBound time.Duration expUpperBound time.Duration }{ {5, 32 * time.Millisecond, 64 * time.Millisecond}, // case where maxBackoff is not hit, time should grow exponentially {40, 35 * 2 * maxBackoff, 40 * 2 * maxBackoff}, // case where maxBoff is hit, backoff time should flatten } for _, test := range table { t.Run(fmt.Sprintf("%d connection failures takes at least %d ms", test.numConnFails, 1< maxBackoff*2 { step = maxBackoff * 2 } fakeClock.Step(step) i++ } time.Sleep(100 * time.Microsecond) } }() lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if connFails > 0 { connFails-- return nil, syscall.ECONNREFUSED } close(stopCh) return watch.NewFake(), nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil }, } r := &Reflector{ name: "test-reflector", listerWatcher: lw, store: NewFIFO(MetaNamespaceKeyFunc), backoffManager: bm, clock: fakeClock, watchErrorHandler: WatchErrorHandler(DefaultWatchErrorHandler), } start := fakeClock.Now() err := r.ListAndWatch(stopCh) elapsed := fakeClock.Since(start) if err != nil { t.Errorf("unexpected error %v", err) } if elapsed < (test.expLowerBound) { t.Errorf("expected lower bound of ListAndWatch: %v, got %v", test.expLowerBound, elapsed) } if elapsed > (test.expUpperBound) { t.Errorf("expected upper bound of ListAndWatch: %v, got %v", test.expUpperBound, elapsed) } }) } } type fakeBackoff struct { clock clock.Clock calls int } func (f *fakeBackoff) Backoff() clock.Timer { f.calls++ return f.clock.NewTimer(time.Duration(0)) } func TestBackoffOnTooManyRequests(t *testing.T) { err := apierrors.NewTooManyRequests("too many requests", 1) clock := &clock.RealClock{} bm := &fakeBackoff{clock: clock} lw := &testLW{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { switch bm.calls { case 0: return nil, err case 1: w := watch.NewFakeWithChanSize(1, false) status := err.Status() w.Error(&status) return w, nil default: w := watch.NewFake() w.Stop() return w, nil } }, } r := &Reflector{ name: "test-reflector", listerWatcher: lw, store: NewFIFO(MetaNamespaceKeyFunc), backoffManager: bm, clock: clock, watchErrorHandler: WatchErrorHandler(DefaultWatchErrorHandler), } stopCh := make(chan struct{}) if err := r.ListAndWatch(stopCh); err != nil { t.Fatal(err) } close(stopCh) if bm.calls != 2 { t.Errorf("unexpected watch backoff calls: %d", bm.calls) } } func TestNoRelistOnTooManyRequests(t *testing.T) { err := apierrors.NewTooManyRequests("too many requests", 1) clock := &clock.RealClock{} bm := &fakeBackoff{clock: clock} listCalls, watchCalls := 0, 0 lw := &testLW{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { listCalls++ return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { watchCalls++ if watchCalls < 5 { return nil, err } w := watch.NewFake() w.Stop() return w, nil }, } r := &Reflector{ name: "test-reflector", listerWatcher: lw, store: NewFIFO(MetaNamespaceKeyFunc), backoffManager: bm, clock: clock, watchErrorHandler: WatchErrorHandler(DefaultWatchErrorHandler), } stopCh := make(chan struct{}) if err := r.ListAndWatch(stopCh); err != nil { t.Fatal(err) } close(stopCh) if listCalls != 1 { t.Errorf("unexpected list calls: %d", listCalls) } if watchCalls != 5 { t.Errorf("unexpected watch calls: %d", watchCalls) } } func TestRetryInternalError(t *testing.T) { testCases := []struct { name string maxInternalDuration time.Duration rewindTime int wantRetries int }{ { name: "retries off", maxInternalDuration: time.Duration(0), wantRetries: 0, }, { name: "retries on, all calls fail", maxInternalDuration: time.Second * 30, wantRetries: 31, }, { name: "retries on, one call successful", maxInternalDuration: time.Second * 30, rewindTime: 10, wantRetries: 40, }, } for _, tc := range testCases { err := apierrors.NewInternalError(fmt.Errorf("etcdserver: no leader")) fakeClock := testingclock.NewFakeClock(time.Now()) bm := &fakeBackoff{clock: fakeClock} counter := 0 lw := &testLW{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { counter = counter + 1 t.Logf("Counter: %v", counter) if counter == tc.rewindTime { t.Logf("Rewinding") fakeClock.Step(time.Minute) } fakeClock.Step(time.Second) w := watch.NewFakeWithChanSize(1, false) status := err.Status() w.Error(&status) return w, nil }, } r := &Reflector{ name: "test-reflector", listerWatcher: lw, store: NewFIFO(MetaNamespaceKeyFunc), backoffManager: bm, clock: fakeClock, watchErrorHandler: WatchErrorHandler(DefaultWatchErrorHandler), } r.MaxInternalErrorRetryDuration = tc.maxInternalDuration stopCh := make(chan struct{}) r.ListAndWatch(stopCh) close(stopCh) if counter-1 != tc.wantRetries { t.Errorf("%v unexpected number of retries: %d", tc, counter-1) } } } func TestReflectorResync(t *testing.T) { iteration := 0 stopCh := make(chan struct{}) rerr := errors.New("expected resync reached") s := &FakeCustomStore{ ResyncFunc: func() error { iteration++ if iteration == 2 { return rerr } return nil }, } lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { fw := watch.NewFake() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "0"}}, nil }, } resyncPeriod := 1 * time.Millisecond r := NewReflector(lw, &v1.Pod{}, s, resyncPeriod) if err := r.ListAndWatch(stopCh); err != nil { // error from Resync is not propaged up to here. t.Errorf("expected error %v", err) } if iteration != 2 { t.Errorf("exactly 2 iterations were expected, got: %v", iteration) } } func TestReflectorWatchListPageSize(t *testing.T) { stopCh := make(chan struct{}) s := NewStore(MetaNamespaceKeyFunc) lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { // Stop once the reflector begins watching since we're only interested in the list. close(stopCh) fw := watch.NewFake() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if options.Limit != 4 { t.Fatalf("Expected list Limit of 4 but got %d", options.Limit) } pods := make([]v1.Pod, 10) for i := 0; i < 10; i++ { pods[i] = v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("pod-%d", i), ResourceVersion: fmt.Sprintf("%d", i)}} } switch options.Continue { case "": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10", Continue: "C1"}, Items: pods[0:4]}, nil case "C1": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10", Continue: "C2"}, Items: pods[4:8]}, nil case "C2": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}, Items: pods[8:10]}, nil default: t.Fatalf("Unrecognized continue: %s", options.Continue) } return nil, nil }, } r := NewReflector(lw, &v1.Pod{}, s, 0) // Set resource version to test pagination also for not consistent reads. r.setLastSyncResourceVersion("10") // Set the reflector to paginate the list request in 4 item chunks. r.WatchListPageSize = 4 r.ListAndWatch(stopCh) results := s.List() if len(results) != 10 { t.Errorf("Expected 10 results, got %d", len(results)) } } func TestReflectorNotPaginatingNotConsistentReads(t *testing.T) { stopCh := make(chan struct{}) s := NewStore(MetaNamespaceKeyFunc) lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { // Stop once the reflector begins watching since we're only interested in the list. close(stopCh) fw := watch.NewFake() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if options.ResourceVersion != "10" { t.Fatalf("Expected ResourceVersion: \"10\", got: %s", options.ResourceVersion) } if options.Limit != 0 { t.Fatalf("Expected list Limit of 0 but got %d", options.Limit) } pods := make([]v1.Pod, 10) for i := 0; i < 10; i++ { pods[i] = v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("pod-%d", i), ResourceVersion: fmt.Sprintf("%d", i)}} } return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}, Items: pods}, nil }, } r := NewReflector(lw, &v1.Pod{}, s, 0) r.setLastSyncResourceVersion("10") r.ListAndWatch(stopCh) results := s.List() if len(results) != 10 { t.Errorf("Expected 10 results, got %d", len(results)) } } func TestReflectorPaginatingNonConsistentReadsIfWatchCacheDisabled(t *testing.T) { var stopCh chan struct{} s := NewStore(MetaNamespaceKeyFunc) lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { // Stop once the reflector begins watching since we're only interested in the list. close(stopCh) fw := watch.NewFake() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { // Check that default pager limit is set. if options.Limit != 500 { t.Fatalf("Expected list Limit of 500 but got %d", options.Limit) } pods := make([]v1.Pod, 10) for i := 0; i < 10; i++ { pods[i] = v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("pod-%d", i), ResourceVersion: fmt.Sprintf("%d", i)}} } switch options.Continue { case "": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10", Continue: "C1"}, Items: pods[0:4]}, nil case "C1": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10", Continue: "C2"}, Items: pods[4:8]}, nil case "C2": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}, Items: pods[8:10]}, nil default: t.Fatalf("Unrecognized continue: %s", options.Continue) } return nil, nil }, } r := NewReflector(lw, &v1.Pod{}, s, 0) // Initial list should initialize paginatedResult in the reflector. stopCh = make(chan struct{}) r.ListAndWatch(stopCh) if results := s.List(); len(results) != 10 { t.Errorf("Expected 10 results, got %d", len(results)) } // Since initial list for ResourceVersion="0" was paginated, the subsequent // ones should also be paginated. stopCh = make(chan struct{}) r.ListAndWatch(stopCh) if results := s.List(); len(results) != 10 { t.Errorf("Expected 10 results, got %d", len(results)) } } // TestReflectorResyncWithResourceVersion ensures that a reflector keeps track of the ResourceVersion and sends // it in relist requests to prevent the reflector from traveling back in time if the relist is to a api-server or // etcd that is partitioned and serving older data than the reflector has already processed. func TestReflectorResyncWithResourceVersion(t *testing.T) { stopCh := make(chan struct{}) s := NewStore(MetaNamespaceKeyFunc) listCallRVs := []string{} lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { // Stop once the reflector begins watching since we're only interested in the list. close(stopCh) fw := watch.NewFake() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { listCallRVs = append(listCallRVs, options.ResourceVersion) pods := make([]v1.Pod, 8) for i := 0; i < 8; i++ { pods[i] = v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("pod-%d", i), ResourceVersion: fmt.Sprintf("%d", i)}} } switch options.ResourceVersion { case "0": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}, Items: pods[0:4]}, nil case "10": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "11"}, Items: pods[0:8]}, nil default: t.Fatalf("Unrecognized ResourceVersion: %s", options.ResourceVersion) } return nil, nil }, } r := NewReflector(lw, &v1.Pod{}, s, 0) // Initial list should use RV=0 r.ListAndWatch(stopCh) results := s.List() if len(results) != 4 { t.Errorf("Expected 4 results, got %d", len(results)) } // relist should use lastSyncResourceVersions (RV=10) stopCh = make(chan struct{}) r.ListAndWatch(stopCh) results = s.List() if len(results) != 8 { t.Errorf("Expected 8 results, got %d", len(results)) } expectedRVs := []string{"0", "10"} if !reflect.DeepEqual(listCallRVs, expectedRVs) { t.Errorf("Expected series of list calls with resource versiosn of %v but got: %v", expectedRVs, listCallRVs) } } // TestReflectorExpiredExactResourceVersion tests that a reflector handles the behavior of kubernetes 1.16 an earlier // where if the exact ResourceVersion requested is not available for a List request for a non-zero ResourceVersion, // an "Expired" error is returned if the ResourceVersion has expired (etcd has compacted it). // (In kubernetes 1.17, or when the watch cache is enabled, the List will instead return the list that is no older than // the requested ResourceVersion). func TestReflectorExpiredExactResourceVersion(t *testing.T) { stopCh := make(chan struct{}) s := NewStore(MetaNamespaceKeyFunc) listCallRVs := []string{} lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { // Stop once the reflector begins watching since we're only interested in the list. close(stopCh) fw := watch.NewFake() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { listCallRVs = append(listCallRVs, options.ResourceVersion) pods := make([]v1.Pod, 8) for i := 0; i < 8; i++ { pods[i] = v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("pod-%d", i), ResourceVersion: fmt.Sprintf("%d", i)}} } switch options.ResourceVersion { case "0": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}, Items: pods[0:4]}, nil case "10": // When watch cache is disabled, if the exact ResourceVersion requested is not available, a "Expired" error is returned. return nil, apierrors.NewResourceExpired("The resourceVersion for the provided watch is too old.") case "": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "11"}, Items: pods[0:8]}, nil default: t.Fatalf("Unrecognized ResourceVersion: %s", options.ResourceVersion) } return nil, nil }, } r := NewReflector(lw, &v1.Pod{}, s, 0) // Initial list should use RV=0 r.ListAndWatch(stopCh) results := s.List() if len(results) != 4 { t.Errorf("Expected 4 results, got %d", len(results)) } // relist should use lastSyncResourceVersions (RV=10) and since RV=10 is expired, it should retry with RV="". stopCh = make(chan struct{}) r.ListAndWatch(stopCh) results = s.List() if len(results) != 8 { t.Errorf("Expected 8 results, got %d", len(results)) } expectedRVs := []string{"0", "10", ""} if !reflect.DeepEqual(listCallRVs, expectedRVs) { t.Errorf("Expected series of list calls with resource versiosn of %v but got: %v", expectedRVs, listCallRVs) } } func TestReflectorFullListIfExpired(t *testing.T) { stopCh := make(chan struct{}) s := NewStore(MetaNamespaceKeyFunc) listCallRVs := []string{} lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { // Stop once the reflector begins watching since we're only interested in the list. close(stopCh) fw := watch.NewFake() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { listCallRVs = append(listCallRVs, options.ResourceVersion) pods := make([]v1.Pod, 8) for i := 0; i < 8; i++ { pods[i] = v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("pod-%d", i), ResourceVersion: fmt.Sprintf("%d", i)}} } rvContinueLimit := func(rv, c string, l int64) metav1.ListOptions { return metav1.ListOptions{ResourceVersion: rv, Continue: c, Limit: l} } switch rvContinueLimit(options.ResourceVersion, options.Continue, options.Limit) { // initial limited list case rvContinueLimit("0", "", 4): return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}, Items: pods[0:4]}, nil // first page of the rv=10 list case rvContinueLimit("10", "", 4): return &v1.PodList{ListMeta: metav1.ListMeta{Continue: "C1", ResourceVersion: "11"}, Items: pods[0:4]}, nil // second page of the above list case rvContinueLimit("", "C1", 4): return nil, apierrors.NewResourceExpired("The resourceVersion for the provided watch is too old.") // rv=10 unlimited list case rvContinueLimit("10", "", 0): return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "11"}, Items: pods[0:8]}, nil default: err := fmt.Errorf("unexpected list options: %#v", options) t.Error(err) return nil, err } }, } r := NewReflector(lw, &v1.Pod{}, s, 0) r.WatchListPageSize = 4 // Initial list should use RV=0 if err := r.ListAndWatch(stopCh); err != nil { t.Fatal(err) } results := s.List() if len(results) != 4 { t.Errorf("Expected 4 results, got %d", len(results)) } // relist should use lastSyncResourceVersions (RV=10) and since second page of that expired, it should full list with RV=10 stopCh = make(chan struct{}) if err := r.ListAndWatch(stopCh); err != nil { t.Fatal(err) } results = s.List() if len(results) != 8 { t.Errorf("Expected 8 results, got %d", len(results)) } expectedRVs := []string{"0", "10", "", "10"} if !reflect.DeepEqual(listCallRVs, expectedRVs) { t.Errorf("Expected series of list calls with resource versiosn of %#v but got: %#v", expectedRVs, listCallRVs) } } func TestReflectorFullListIfTooLarge(t *testing.T) { stopCh := make(chan struct{}) s := NewStore(MetaNamespaceKeyFunc) listCallRVs := []string{} version := 30 lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { // Stop once the reflector begins watching since we're only interested in the list. close(stopCh) fw := watch.NewFake() return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { listCallRVs = append(listCallRVs, options.ResourceVersion) resourceVersion := strconv.Itoa(version) switch options.ResourceVersion { // initial list case "0": return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "20"}}, nil // relist after the initial list case "20": err := apierrors.NewTimeoutError("too large resource version", 1) err.ErrStatus.Details.Causes = []metav1.StatusCause{{Type: metav1.CauseTypeResourceVersionTooLarge}} return nil, err // relist after the initial list (covers the error format used in api server 1.17.0-1.18.5) case "30": err := apierrors.NewTimeoutError("too large resource version", 1) err.ErrStatus.Details.Causes = []metav1.StatusCause{{Message: "Too large resource version"}} return nil, err // relist after the initial list (covers the error format used in api server before 1.17.0) case "40": err := apierrors.NewTimeoutError("Too large resource version", 1) return nil, err // relist from etcd after "too large" error case "": version += 10 return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: resourceVersion}}, nil default: return nil, fmt.Errorf("unexpected List call: %s", options.ResourceVersion) } }, } r := NewReflector(lw, &v1.Pod{}, s, 0) // Initial list should use RV=0 if err := r.ListAndWatch(stopCh); err != nil { t.Fatal(err) } // Relist from the future version. // This may happen, as watchcache is initialized from "current global etcd resource version" // when kube-apiserver is starting and if no objects are changing after that each kube-apiserver // may be synced to a different version and they will never converge. // TODO: We should use etcd progress-notify feature to avoid this behavior but until this is // done we simply try to relist from now to avoid continuous errors on relists. for i := 1; i <= 3; i++ { // relist twice to cover the two variants of TooLargeResourceVersion api errors stopCh = make(chan struct{}) if err := r.ListAndWatch(stopCh); err != nil { t.Fatal(err) } } expectedRVs := []string{"0", "20", "", "30", "", "40", ""} if !reflect.DeepEqual(listCallRVs, expectedRVs) { t.Errorf("Expected series of list calls with resource version of %#v but got: %#v", expectedRVs, listCallRVs) } } func TestGetTypeDescriptionFromObject(t *testing.T) { obj := &unstructured.Unstructured{} gvk := schema.GroupVersionKind{ Group: "mygroup", Version: "v1", Kind: "MyKind", } obj.SetGroupVersionKind(gvk) testCases := map[string]struct { inputType interface{} expectedTypeDescription string }{ "Nil type": { expectedTypeDescription: defaultExpectedTypeName, }, "Normal type": { inputType: &v1.Pod{}, expectedTypeDescription: "*v1.Pod", }, "Unstructured type without GVK": { inputType: &unstructured.Unstructured{}, expectedTypeDescription: "*unstructured.Unstructured", }, "Unstructured type with GVK": { inputType: obj, expectedTypeDescription: gvk.String(), }, } for testName, tc := range testCases { t.Run(testName, func(t *testing.T) { typeDescription := getTypeDescriptionFromObject(tc.inputType) if tc.expectedTypeDescription != typeDescription { t.Fatalf("Expected typeDescription %v, got %v", tc.expectedTypeDescription, typeDescription) } }) } } func TestGetExpectedGVKFromObject(t *testing.T) { obj := &unstructured.Unstructured{} gvk := schema.GroupVersionKind{ Group: "mygroup", Version: "v1", Kind: "MyKind", } obj.SetGroupVersionKind(gvk) testCases := map[string]struct { inputType interface{} expectedGVK *schema.GroupVersionKind }{ "Nil type": {}, "Some non Unstructured type": { inputType: &v1.Pod{}, }, "Unstructured type without GVK": { inputType: &unstructured.Unstructured{}, }, "Unstructured type with GVK": { inputType: obj, expectedGVK: &gvk, }, } for testName, tc := range testCases { t.Run(testName, func(t *testing.T) { expectedGVK := getExpectedGVKFromObject(tc.inputType) gvkNotEqual := (tc.expectedGVK == nil) != (expectedGVK == nil) if tc.expectedGVK != nil && expectedGVK != nil { gvkNotEqual = *tc.expectedGVK != *expectedGVK } if gvkNotEqual { t.Fatalf("Expected expectedGVK %v, got %v", tc.expectedGVK, expectedGVK) } }) } } func TestWatchTimeout(t *testing.T) { testCases := []struct { name string minWatchTimeout time.Duration expectedMinTimeoutSeconds int64 }{ { name: "no timeout", expectedMinTimeoutSeconds: 5 * 60, }, { name: "small timeout not honored", minWatchTimeout: time.Second, expectedMinTimeoutSeconds: 5 * 60, }, { name: "30m timeout", minWatchTimeout: 30 * time.Minute, expectedMinTimeoutSeconds: 30 * 60, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { stopCh := make(chan struct{}) s := NewStore(MetaNamespaceKeyFunc) var gotTimeoutSeconds int64 lw := &testLW{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}}, nil }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if options.TimeoutSeconds != nil { gotTimeoutSeconds = *options.TimeoutSeconds } // Stop once the reflector begins watching since we're only interested in the list. close(stopCh) return watch.NewFake(), nil }, } opts := ReflectorOptions{ MinWatchTimeout: tc.minWatchTimeout, } r := NewReflectorWithOptions(lw, &v1.Pod{}, s, opts) if err := r.ListAndWatch(stopCh); err != nil { t.Fatal(err) } minExpected := tc.expectedMinTimeoutSeconds maxExpected := 2 * tc.expectedMinTimeoutSeconds if gotTimeoutSeconds < minExpected || gotTimeoutSeconds > maxExpected { t.Errorf("unexpected TimeoutSecond, got %v, expected in [%v, %v]", gotTimeoutSeconds, minExpected, maxExpected) } }) } } type storeWithRV struct { Store // resourceVersions tracks values passed by UpdateResourceVersion resourceVersions []string } func (s *storeWithRV) UpdateResourceVersion(resourceVersion string) { s.resourceVersions = append(s.resourceVersions, resourceVersion) } func newStoreWithRV() *storeWithRV { return &storeWithRV{ Store: NewStore(MetaNamespaceKeyFunc), } } func TestReflectorResourceVersionUpdate(t *testing.T) { s := newStoreWithRV() stopCh := make(chan struct{}) fw := watch.NewFake() lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return fw, nil }, ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}}, nil }, } r := NewReflector(lw, &v1.Pod{}, s, 0) makePod := func(rv string) *v1.Pod { return &v1.Pod{ObjectMeta: metav1.ObjectMeta{ResourceVersion: rv}} } go func() { fw.Action(watch.Added, makePod("10")) fw.Action(watch.Modified, makePod("20")) fw.Action(watch.Bookmark, makePod("30")) fw.Action(watch.Deleted, makePod("40")) close(stopCh) }() // Initial list should use RV=0 if err := r.ListAndWatch(stopCh); err != nil { t.Fatal(err) } expectedRVs := []string{"10", "20", "30", "40"} if !reflect.DeepEqual(s.resourceVersions, expectedRVs) { t.Errorf("Expected series of resource version updates of %#v but got: %#v", expectedRVs, s.resourceVersions) } } const ( fakeItemsNum = 100 exemptObjectIndex = fakeItemsNum / 4 pageNum = 3 ) func getPodListItems(start int, numItems int) (string, string, *v1.PodList) { out := &v1.PodList{ Items: make([]v1.Pod, numItems), } for i := 0; i < numItems; i++ { out.Items[i] = v1.Pod{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "Pod", }, ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("pod-%d", i+start), Namespace: "default", Labels: map[string]string{ "label-key-1": "label-value-1", }, Annotations: map[string]string{ "annotations-key-1": "annotations-value-1", }, }, Spec: v1.PodSpec{ Overhead: v1.ResourceList{ v1.ResourceCPU: resource.MustParse("3"), v1.ResourceMemory: resource.MustParse("8"), }, NodeSelector: map[string]string{ "foo": "bar", "baz": "quux", }, Affinity: &v1.Affinity{ NodeAffinity: &v1.NodeAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ NodeSelectorTerms: []v1.NodeSelectorTerm{ {MatchExpressions: []v1.NodeSelectorRequirement{{Key: `foo`}}}, }, }, PreferredDuringSchedulingIgnoredDuringExecution: []v1.PreferredSchedulingTerm{ {Preference: v1.NodeSelectorTerm{MatchExpressions: []v1.NodeSelectorRequirement{{Key: `foo`}}}}, }, }, }, TopologySpreadConstraints: []v1.TopologySpreadConstraint{ {TopologyKey: `foo`}, }, HostAliases: []v1.HostAlias{ {IP: "1.1.1.1"}, {IP: "2.2.2.2"}, }, ImagePullSecrets: []v1.LocalObjectReference{ {Name: "secret1"}, {Name: "secret2"}, }, Containers: []v1.Container{ { Name: "foobar", Image: "alpine", Resources: v1.ResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("1"), v1.ResourceName(v1.ResourceMemory): resource.MustParse("5"), }, Limits: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("2"), v1.ResourceName(v1.ResourceMemory): resource.MustParse("10"), }, }, }, { Name: "foobar2", Image: "alpine", Resources: v1.ResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("4"), v1.ResourceName(v1.ResourceMemory): resource.MustParse("12"), }, Limits: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("8"), v1.ResourceName(v1.ResourceMemory): resource.MustParse("24"), }, }, }, }, InitContainers: []v1.Container{ { Name: "small-init", Image: "alpine", Resources: v1.ResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("1"), v1.ResourceName(v1.ResourceMemory): resource.MustParse("5"), }, Limits: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("1"), v1.ResourceName(v1.ResourceMemory): resource.MustParse("5"), }, }, }, { Name: "big-init", Image: "alpine", Resources: v1.ResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("40"), v1.ResourceName(v1.ResourceMemory): resource.MustParse("120"), }, Limits: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("80"), v1.ResourceName(v1.ResourceMemory): resource.MustParse("240"), }, }, }, }, Hostname: fmt.Sprintf("node-%d", i), }, Status: v1.PodStatus{ Phase: v1.PodRunning, ContainerStatuses: []v1.ContainerStatus{ { ContainerID: "docker://numbers", Image: "alpine", Name: "foobar", Ready: false, }, { ContainerID: "docker://numbers", Image: "alpine", Name: "foobar2", Ready: false, }, }, InitContainerStatuses: []v1.ContainerStatus{ { ContainerID: "docker://numbers", Image: "alpine", Name: "small-init", Ready: false, }, { ContainerID: "docker://numbers", Image: "alpine", Name: "big-init", Ready: false, }, }, Conditions: []v1.PodCondition{ { Type: v1.PodScheduled, Status: v1.ConditionTrue, Reason: "successfully", Message: "sync pod successfully", LastProbeTime: metav1.Now(), LastTransitionTime: metav1.Now(), }, }, }, } } return out.Items[0].GetName(), out.Items[exemptObjectIndex].GetName(), out } func getConfigmapListItems(start int, numItems int) (string, string, *v1.ConfigMapList) { out := &v1.ConfigMapList{ Items: make([]v1.ConfigMap, numItems), } for i := 0; i < numItems; i++ { out.Items[i] = v1.ConfigMap{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "ConfigMap", }, ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("cm-%d", i+start), Namespace: "default", Labels: map[string]string{ "label-key-1": "label-value-1", }, Annotations: map[string]string{ "annotations-key-1": "annotations-value-1", }, }, Data: map[string]string{ "data-1": "value-1", "data-2": "value-2", }, } } return out.Items[0].GetName(), out.Items[exemptObjectIndex].GetName(), out } type TestPagingPodsLW struct { totalPageCount int fetchedPageCount int detectedObjectNameList []string exemptObjectNameList []string } func newPageTestLW(totalPageNum int) *TestPagingPodsLW { return &TestPagingPodsLW{ totalPageCount: totalPageNum, fetchedPageCount: 0, } } func (t *TestPagingPodsLW) List(options metav1.ListOptions) (runtime.Object, error) { firstPodName, exemptPodName, list := getPodListItems(t.fetchedPageCount*fakeItemsNum, fakeItemsNum) t.detectedObjectNameList = append(t.detectedObjectNameList, firstPodName) t.exemptObjectNameList = append(t.exemptObjectNameList, exemptPodName) t.fetchedPageCount++ if t.fetchedPageCount >= t.totalPageCount { return list, nil } list.SetContinue("true") return list, nil } func (t *TestPagingPodsLW) Watch(options metav1.ListOptions) (watch.Interface, error) { return nil, nil } func TestReflectorListExtract(t *testing.T) { store := NewStore(func(obj interface{}) (string, error) { pod, ok := obj.(*v1.Pod) if !ok { return "", fmt.Errorf("expect *v1.Pod, but got %T", obj) } return pod.GetName(), nil }) lw := newPageTestLW(5) reflector := NewReflector(lw, &v1.Pod{}, store, 0) reflector.WatchListPageSize = fakeItemsNum // execute list to fill store stopCh := make(chan struct{}) if err := reflector.list(stopCh); err != nil { t.Fatal(err) } // We will not delete exemptPod, // in order to see if the existence of this Pod causes other Pods that are not used to be unable to properly clear. for _, podName := range lw.exemptObjectNameList { _, exist, err := store.GetByKey(podName) if err != nil || !exist { t.Fatalf("%s should exist in pod store", podName) } } // we will pay attention to whether the memory occupied by the first Pod is released // Golang's can only be SetFinalizer for the first element of the array, // so pod-0 will be the object of our attention detectedPodAlreadyBeCleared := make(chan struct{}, len(lw.detectedObjectNameList)) for _, firstPodName := range lw.detectedObjectNameList { _, exist, err := store.GetByKey(firstPodName) if err != nil || !exist { t.Fatalf("%s should exist in pod store", firstPodName) } firstPod, exist, err := store.GetByKey(firstPodName) if err != nil || !exist { t.Fatalf("%s should exist in pod store", firstPodName) } goruntime.SetFinalizer(firstPod, func(obj interface{}) { t.Logf("%s already be gc\n", obj.(*v1.Pod).GetName()) detectedPodAlreadyBeCleared <- struct{}{} }) } storedObjectKeys := store.ListKeys() for _, k := range storedObjectKeys { // delete all Pods except the exempted Pods. if sets.NewString(lw.exemptObjectNameList...).Has(k) { continue } obj, exist, err := store.GetByKey(k) if err != nil || !exist { t.Fatalf("%s should exist in pod store", k) } if err := store.Delete(obj); err != nil { t.Fatalf("delete object: %v", err) } goruntime.GC() } clearedNum := 0 for { select { case <-detectedPodAlreadyBeCleared: clearedNum++ if clearedNum == len(lw.detectedObjectNameList) { return } } } } func BenchmarkExtractList(b *testing.B) { _, _, podList := getPodListItems(0, fakeItemsNum) _, _, configMapList := getConfigmapListItems(0, fakeItemsNum) tests := []struct { name string list runtime.Object }{ { name: "PodList", list: podList, }, { name: "ConfigMapList", list: configMapList, }, } for _, tc := range tests { b.Run(tc.name, func(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { _, err := meta.ExtractList(tc.list) if err != nil { b.Errorf("extract list: %v", err) } } b.StopTimer() }) } } func BenchmarkEachListItem(b *testing.B) { _, _, podList := getPodListItems(0, fakeItemsNum) _, _, configMapList := getConfigmapListItems(0, fakeItemsNum) tests := []struct { name string list runtime.Object }{ { name: "PodList", list: podList, }, { name: "ConfigMapList", list: configMapList, }, } for _, tc := range tests { b.Run(tc.name, func(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { err := meta.EachListItem(tc.list, func(object runtime.Object) error { return nil }) if err != nil { b.Errorf("each list: %v", err) } } b.StopTimer() }) } } func BenchmarkExtractListWithAlloc(b *testing.B) { _, _, podList := getPodListItems(0, fakeItemsNum) _, _, configMapList := getConfigmapListItems(0, fakeItemsNum) tests := []struct { name string list runtime.Object }{ { name: "PodList", list: podList, }, { name: "ConfigMapList", list: configMapList, }, } for _, tc := range tests { b.Run(tc.name, func(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { _, err := meta.ExtractListWithAlloc(tc.list) if err != nil { b.Errorf("extract list with alloc: %v", err) } } b.StopTimer() }) } } func BenchmarkEachListItemWithAlloc(b *testing.B) { _, _, podList := getPodListItems(0, fakeItemsNum) _, _, configMapList := getConfigmapListItems(0, fakeItemsNum) tests := []struct { name string list runtime.Object }{ { name: "PodList", list: podList, }, { name: "ConfigMapList", list: configMapList, }, } for _, tc := range tests { b.Run(tc.name, func(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { err := meta.EachListItemWithAlloc(tc.list, func(object runtime.Object) error { return nil }) if err != nil { b.Errorf("each list with alloc: %v", err) } } b.StopTimer() }) } } func BenchmarkReflectorList(b *testing.B) { ctx, cancel := context.WithTimeout(context.Background(), wait.ForeverTestTimeout) defer cancel() store := NewStore(func(obj interface{}) (string, error) { o, err := meta.Accessor(obj) if err != nil { return "", err } return o.GetName(), nil }) _, _, podList := getPodListItems(0, fakeItemsNum) _, _, configMapList := getConfigmapListItems(0, fakeItemsNum) tests := []struct { name string sample func() interface{} list runtime.Object }{ { name: "PodList", sample: func() interface{} { return v1.Pod{} }, list: podList, }, { name: "ConfigMapList", sample: func() interface{} { return v1.ConfigMap{} }, list: configMapList, }, } for _, tc := range tests { b.Run(tc.name, func(b *testing.B) { sample := tc.sample() reflector := NewReflector(newPageTestLW(pageNum), &sample, store, 0) reflector.WatchListPageSize = fakeItemsNum b.ResetTimer() for i := 0; i < b.N; i++ { err := reflector.list(ctx.Done()) if err != nil { b.Fatalf("reflect list: %v", err) } } b.StopTimer() }) } } kubernetes-client-go-a2dfcab/tools/cache/reflector_watchlist_test.go000066400000000000000000000520711472614177300262450ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "errors" "fmt" "sort" "sync" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" testingclock "k8s.io/utils/clock/testing" "k8s.io/utils/pointer" "k8s.io/utils/ptr" ) func TestInitialEventsEndBookmarkTicker(t *testing.T) { assertNoEvents := func(t *testing.T, c <-chan time.Time) { select { case e := <-c: t.Errorf("Unexpected: %#v event received, expected no events", e) default: return } } t.Run("testing NoopInitialEventsEndBookmarkTicker", func(t *testing.T) { clock := testingclock.NewFakeClock(time.Now()) target := newInitialEventsEndBookmarkTickerInternal("testName", clock, clock.Now(), time.Second, false) clock.Step(30 * time.Second) assertNoEvents(t, target.C()) actualWarning := target.produceWarningIfExpired() require.Empty(t, actualWarning, "didn't expect any warning") // validate if the other methods don't produce panic target.warnIfExpired() target.observeLastEventTimeStamp(clock.Now()) // make sure that after calling the other methods // nothing hasn't changed actualWarning = target.produceWarningIfExpired() require.Empty(t, actualWarning, "didn't expect any warning") assertNoEvents(t, target.C()) target.Stop() }) t.Run("testing InitialEventsEndBookmarkTicker backed by a fake clock", func(t *testing.T) { clock := testingclock.NewFakeClock(time.Now()) target := newInitialEventsEndBookmarkTickerInternal("testName", clock, clock.Now(), time.Second, true) clock.Step(500 * time.Millisecond) assertNoEvents(t, target.C()) clock.Step(500 * time.Millisecond) <-target.C() actualWarning := target.produceWarningIfExpired() require.Equal(t, errors.New("testName: awaiting required bookmark event for initial events stream, no events received for 1s"), actualWarning) clock.Step(time.Second) <-target.C() actualWarning = target.produceWarningIfExpired() require.Equal(t, errors.New("testName: awaiting required bookmark event for initial events stream, no events received for 2s"), actualWarning) target.observeLastEventTimeStamp(clock.Now()) clock.Step(500 * time.Millisecond) assertNoEvents(t, target.C()) clock.Step(500 * time.Millisecond) <-target.C() actualWarning = target.produceWarningIfExpired() require.Equal(t, errors.New("testName: hasn't received required bookmark event marking the end of initial events stream, received last event 1s ago"), actualWarning) clock.Step(time.Second) <-target.C() actualWarning = target.produceWarningIfExpired() require.Equal(t, errors.New("testName: hasn't received required bookmark event marking the end of initial events stream, received last event 2s ago"), actualWarning) target.Stop() assertNoEvents(t, target.C()) }) } func TestWatchList(t *testing.T) { scenarios := []struct { name string disableUseWatchList bool // closes listWatcher after sending the specified number of watch events closeAfterWatchEvents int // closes listWatcher after getting the specified number of watch requests closeAfterWatchRequests int // closes listWatcher after getting the specified number of list requests closeAfterListRequests int // stops Watcher after sending the specified number of watch events stopAfterWatchEvents int watchOptionsPredicate func(options metav1.ListOptions) error watchEvents []watch.Event podList *v1.PodList expectedRequestOptions []metav1.ListOptions expectedWatchRequests int expectedListRequests int expectedStoreContent []v1.Pod expectedError error }{ { name: "the reflector won't be synced if the bookmark event has been received", watchEvents: []watch.Event{{Type: watch.Added, Object: makePod("p1", "1")}}, closeAfterWatchEvents: 1, expectedWatchRequests: 1, expectedRequestOptions: []metav1.ListOptions{{ SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }}, }, { name: "the reflector uses the old LIST/WATCH semantics if the UseWatchList is turned off", disableUseWatchList: true, closeAfterWatchRequests: 1, podList: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "1"}, Items: []v1.Pod{*makePod("p1", "1")}, }, expectedWatchRequests: 1, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "0", Limit: 500, }, { AllowWatchBookmarks: true, ResourceVersion: "1", TimeoutSeconds: pointer.Int64(1), }}, expectedStoreContent: []v1.Pod{*makePod("p1", "1")}, }, { name: "returning any other error than apierrors.NewInvalid forces fallback", watchOptionsPredicate: func(options metav1.ListOptions) error { if options.SendInitialEvents != nil && *options.SendInitialEvents { return fmt.Errorf("dummy error") } return nil }, podList: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "1"}, Items: []v1.Pod{*makePod("p1", "1")}, }, closeAfterWatchEvents: 1, watchEvents: []watch.Event{{Type: watch.Added, Object: makePod("p2", "2")}}, expectedWatchRequests: 2, expectedListRequests: 1, expectedStoreContent: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, expectedRequestOptions: []metav1.ListOptions{ { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, { ResourceVersion: "0", Limit: 500, }, { AllowWatchBookmarks: true, ResourceVersion: "1", TimeoutSeconds: pointer.Int64(1), }, }, }, { name: "the reflector can fall back to old LIST/WATCH semantics when a server doesn't support streaming", watchOptionsPredicate: func(options metav1.ListOptions) error { if options.SendInitialEvents != nil && *options.SendInitialEvents { return apierrors.NewInvalid(schema.GroupKind{}, "streaming is not allowed", nil) } return nil }, podList: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "1"}, Items: []v1.Pod{*makePod("p1", "1")}, }, closeAfterWatchEvents: 1, watchEvents: []watch.Event{{Type: watch.Added, Object: makePod("p2", "2")}}, expectedWatchRequests: 2, expectedListRequests: 1, expectedStoreContent: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, expectedRequestOptions: []metav1.ListOptions{ { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, { ResourceVersion: "0", Limit: 500, }, { AllowWatchBookmarks: true, ResourceVersion: "1", TimeoutSeconds: pointer.Int64(1), }, }, }, { name: "prove that the reflector is synced after receiving a bookmark event", closeAfterWatchEvents: 3, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod("p1", "1")}, {Type: watch.Added, Object: makePod("p2", "2")}, {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, }, expectedWatchRequests: 1, expectedRequestOptions: []metav1.ListOptions{{ SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }}, expectedStoreContent: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, }, { name: "check if Updates and Deletes events are propagated during streaming (until the bookmark is received)", closeAfterWatchEvents: 6, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod("p1", "1")}, {Type: watch.Added, Object: makePod("p2", "2")}, {Type: watch.Modified, Object: func() runtime.Object { p1 := makePod("p1", "3") p1.Spec.ActiveDeadlineSeconds = pointer.Int64(12) return p1 }()}, {Type: watch.Added, Object: makePod("p3", "4")}, {Type: watch.Deleted, Object: makePod("p3", "5")}, {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "5", Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, }, expectedWatchRequests: 1, expectedRequestOptions: []metav1.ListOptions{{ SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }}, expectedStoreContent: []v1.Pod{ *makePod("p2", "2"), func() v1.Pod { p1 := *makePod("p1", "3") p1.Spec.ActiveDeadlineSeconds = pointer.Int64(12) return p1 }(), }, }, { name: "checks if the reflector retries 429", watchOptionsPredicate: func() func(options metav1.ListOptions) error { counter := 1 return func(options metav1.ListOptions) error { if counter < 3 { counter++ return apierrors.NewTooManyRequests("busy, check again later", 1) } return nil } }(), closeAfterWatchEvents: 2, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod("p1", "1")}, {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, }, expectedWatchRequests: 3, expectedRequestOptions: []metav1.ListOptions{ { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, }, expectedStoreContent: []v1.Pod{*makePod("p1", "1")}, }, { name: "check if stopping a watcher before sync results in creating a new watch-list request", stopAfterWatchEvents: 1, closeAfterWatchEvents: 3, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod("p1", "1")}, // second request {Type: watch.Added, Object: makePod("p1", "1")}, {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "1", Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, }, expectedWatchRequests: 2, expectedRequestOptions: []metav1.ListOptions{ { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, }, expectedStoreContent: []v1.Pod{*makePod("p1", "1")}, }, { name: "stopping a watcher after synchronization results in creating a new watch request", stopAfterWatchEvents: 4, closeAfterWatchEvents: 5, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod("p1", "1")}, {Type: watch.Added, Object: makePod("p2", "2")}, {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, {Type: watch.Added, Object: makePod("p3", "3")}, // second request {Type: watch.Added, Object: makePod("p4", "4")}, }, expectedWatchRequests: 2, expectedRequestOptions: []metav1.ListOptions{ { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, { AllowWatchBookmarks: true, ResourceVersion: "3", TimeoutSeconds: pointer.Int64(1), }, }, expectedStoreContent: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3"), *makePod("p4", "4")}, }, { name: "expiring an established watcher results in returning an error from the reflector", watchOptionsPredicate: func() func(options metav1.ListOptions) error { counter := 0 return func(options metav1.ListOptions) error { counter++ if counter == 2 { return apierrors.NewResourceExpired("rv already expired") } return nil } }(), stopAfterWatchEvents: 3, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod("p1", "1")}, {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, {Type: watch.Added, Object: makePod("p3", "3")}, }, expectedWatchRequests: 2, expectedRequestOptions: []metav1.ListOptions{ { SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }, { AllowWatchBookmarks: true, ResourceVersion: "3", TimeoutSeconds: pointer.Int64(1), }, }, expectedStoreContent: []v1.Pod{*makePod("p1", "1"), *makePod("p3", "3")}, expectedError: apierrors.NewResourceExpired("rv already expired"), }, { name: "prove that the reflector is checking the value of the initialEventsEnd annotation", closeAfterWatchEvents: 3, watchEvents: []watch.Event{ {Type: watch.Added, Object: makePod("p1", "1")}, {Type: watch.Added, Object: makePod("p2", "2")}, {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "false"}, }, }}, }, expectedWatchRequests: 1, expectedRequestOptions: []metav1.ListOptions{{ SendInitialEvents: pointer.Bool(true), AllowWatchBookmarks: true, ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, TimeoutSeconds: pointer.Int64(1), }}, }, } for _, s := range scenarios { t.Run(s.name, func(t *testing.T) { scenario := s // capture as local variable listWatcher, store, reflector, stopCh := testData() go func() { for i, e := range scenario.watchEvents { listWatcher.fakeWatcher.Action(e.Type, e.Object) if i+1 == scenario.stopAfterWatchEvents { listWatcher.StopAndRecreateWatch() continue } if i+1 == scenario.closeAfterWatchEvents { close(stopCh) } } }() listWatcher.watchOptionsPredicate = scenario.watchOptionsPredicate listWatcher.closeAfterWatchRequests = scenario.closeAfterWatchRequests listWatcher.customListResponse = scenario.podList listWatcher.closeAfterListRequests = scenario.closeAfterListRequests if scenario.disableUseWatchList { reflector.UseWatchList = ptr.To(false) } err := reflector.ListAndWatch(stopCh) if scenario.expectedError != nil && err == nil { t.Fatalf("expected error %q, got nil", scenario.expectedError) } if scenario.expectedError == nil && err != nil { t.Fatalf("unexpected error: %v", err) } if scenario.expectedError != nil && err.Error() != scenario.expectedError.Error() { t.Fatalf("expected error %q, got %q", scenario.expectedError, err.Error()) } verifyWatchCounter(t, listWatcher, scenario.expectedWatchRequests) verifyListCounter(t, listWatcher, scenario.expectedListRequests) verifyRequestOptions(t, listWatcher, scenario.expectedRequestOptions) verifyStore(t, store, scenario.expectedStoreContent) }) } } func verifyRequestOptions(t *testing.T, lw *fakeListWatcher, expectedRequestOptions []metav1.ListOptions) { if len(lw.requestOptions) != len(expectedRequestOptions) { t.Fatalf("expected to receive exactly %v requests, got %v", len(expectedRequestOptions), len(lw.requestOptions)) } for index, expectedRequestOption := range expectedRequestOptions { actualRequestOption := lw.requestOptions[index] if actualRequestOption.TimeoutSeconds == nil && expectedRequestOption.TimeoutSeconds != nil { t.Fatalf("expected the request to specify TimeoutSeconds option but it didn't, actual = %#v, expected = %#v", actualRequestOption, expectedRequestOption) } if actualRequestOption.TimeoutSeconds != nil && expectedRequestOption.TimeoutSeconds == nil { t.Fatalf("unexpected TimeoutSeconds option specified, actual = %#v, expected = %#v", actualRequestOption, expectedRequestOption) } // ignore actual values actualRequestOption.TimeoutSeconds = nil expectedRequestOption.TimeoutSeconds = nil if !cmp.Equal(actualRequestOption, expectedRequestOption) { t.Fatalf("expected %#v, got %#v", expectedRequestOption, actualRequestOption) } } } func verifyListCounter(t *testing.T, lw *fakeListWatcher, expectedListCounter int) { if lw.listCounter != expectedListCounter { t.Fatalf("unexpected number of LIST requests, got: %v, expected: %v", lw.listCounter, expectedListCounter) } } func verifyWatchCounter(t *testing.T, lw *fakeListWatcher, expectedWatchCounter int) { if lw.watchCounter != expectedWatchCounter { t.Fatalf("unexpected number of WATCH requests, got: %v, expected: %v", lw.watchCounter, expectedWatchCounter) } } type byName []v1.Pod func (a byName) Len() int { return len(a) } func (a byName) Less(i, j int) bool { return a[i].Name < a[j].Name } func (a byName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func verifyStore(t *testing.T, s Store, expectedPods []v1.Pod) { rawPods := s.List() actualPods := []v1.Pod{} for _, p := range rawPods { actualPods = append(actualPods, *p.(*v1.Pod)) } sort.Sort(byName(actualPods)) sort.Sort(byName(expectedPods)) if !cmp.Equal(actualPods, expectedPods, cmpopts.EquateEmpty()) { t.Fatalf("unexpected store content, diff: %s", cmp.Diff(actualPods, expectedPods)) } } func makePod(name, rv string) *v1.Pod { return &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: name, ResourceVersion: rv, UID: types.UID(name)}} } func testData() (*fakeListWatcher, Store, *Reflector, chan struct{}) { s := NewStore(MetaNamespaceKeyFunc) stopCh := make(chan struct{}) lw := &fakeListWatcher{ fakeWatcher: watch.NewFake(), stop: func() { close(stopCh) }, } r := NewReflector(lw, &v1.Pod{}, s, 0) r.UseWatchList = ptr.To(true) return lw, s, r, stopCh } type fakeListWatcher struct { lock sync.Mutex fakeWatcher *watch.FakeWatcher listCounter int watchCounter int closeAfterWatchRequests int closeAfterListRequests int stop func() requestOptions []metav1.ListOptions customListResponse *v1.PodList watchOptionsPredicate func(options metav1.ListOptions) error } func (lw *fakeListWatcher) List(options metav1.ListOptions) (runtime.Object, error) { lw.listCounter++ lw.requestOptions = append(lw.requestOptions, options) if lw.listCounter == lw.closeAfterListRequests { lw.stop() } if lw.customListResponse != nil { return lw.customListResponse, nil } return nil, fmt.Errorf("not implemented") } func (lw *fakeListWatcher) Watch(options metav1.ListOptions) (watch.Interface, error) { lw.watchCounter++ lw.requestOptions = append(lw.requestOptions, options) if lw.watchCounter == lw.closeAfterWatchRequests { lw.stop() } if lw.watchOptionsPredicate != nil { if err := lw.watchOptionsPredicate(options); err != nil { return nil, err } } lw.lock.Lock() defer lw.lock.Unlock() return lw.fakeWatcher, nil } func (lw *fakeListWatcher) StopAndRecreateWatch() { lw.lock.Lock() defer lw.lock.Unlock() lw.fakeWatcher.Stop() lw.fakeWatcher = watch.NewFake() } kubernetes-client-go-a2dfcab/tools/cache/retry_with_deadline.go000066400000000000000000000035641472614177300251670ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "k8s.io/utils/clock" "time" ) type RetryWithDeadline interface { After(error) ShouldRetry() bool } type retryWithDeadlineImpl struct { firstErrorTime time.Time lastErrorTime time.Time maxRetryDuration time.Duration minResetPeriod time.Duration isRetryable func(error) bool clock clock.Clock } func NewRetryWithDeadline(maxRetryDuration, minResetPeriod time.Duration, isRetryable func(error) bool, clock clock.Clock) RetryWithDeadline { return &retryWithDeadlineImpl{ firstErrorTime: time.Time{}, lastErrorTime: time.Time{}, maxRetryDuration: maxRetryDuration, minResetPeriod: minResetPeriod, isRetryable: isRetryable, clock: clock, } } func (r *retryWithDeadlineImpl) reset() { r.firstErrorTime = time.Time{} r.lastErrorTime = time.Time{} } func (r *retryWithDeadlineImpl) After(err error) { if r.isRetryable(err) { if r.clock.Now().Sub(r.lastErrorTime) >= r.minResetPeriod { r.reset() } if r.firstErrorTime.IsZero() { r.firstErrorTime = r.clock.Now() } r.lastErrorTime = r.clock.Now() } } func (r *retryWithDeadlineImpl) ShouldRetry() bool { if r.maxRetryDuration <= time.Duration(0) { return false } if r.clock.Now().Sub(r.firstErrorTime) <= r.maxRetryDuration { return true } r.reset() return false } kubernetes-client-go-a2dfcab/tools/cache/retry_with_deadline_test.go000066400000000000000000000066101472614177300262210ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "testing" "time" apierrors "k8s.io/apimachinery/pkg/api/errors" testingclock "k8s.io/utils/clock/testing" ) type retryScenarioStep struct { clockStep time.Duration err error wantRetry bool } func TestRetryWithDeadline(t *testing.T) { internalError := apierrors.NewInternalError(fmt.Errorf("etcdserver: no leader")) otherError := fmt.Errorf("some other error") testCases := []struct { name string duration time.Duration reset time.Duration isRetryable func(error) bool scenario []retryScenarioStep }{ { name: "Never retry when duration is zero", duration: time.Duration(0), reset: time.Second * 30, isRetryable: func(err error) bool { return false }, scenario: []retryScenarioStep{ { clockStep: time.Second * 1, err: nil, wantRetry: false, }, { clockStep: time.Second * 0, err: internalError, wantRetry: false, }, { clockStep: time.Second * 1, err: otherError, wantRetry: false, }, }, }, { name: "Retry when internal error happens only within duration", duration: time.Second * 1, reset: time.Second * 30, isRetryable: apierrors.IsInternalError, scenario: []retryScenarioStep{ { clockStep: time.Second * 1, err: internalError, wantRetry: true, }, { clockStep: time.Second * 1, err: internalError, wantRetry: true, }, { clockStep: time.Second * 1, err: internalError, wantRetry: false, }, }, }, { name: "Don't retry when other error happens", duration: time.Second * 1, reset: time.Second * 30, isRetryable: apierrors.IsInternalError, scenario: []retryScenarioStep{ { clockStep: time.Second * 1, err: otherError, wantRetry: false, }, }, }, { name: "Ignore other errors for retries", duration: time.Second * 1, reset: time.Second * 30, isRetryable: apierrors.IsInternalError, scenario: []retryScenarioStep{ { clockStep: time.Second * 1, err: internalError, wantRetry: true, }, { clockStep: time.Second * 0, err: otherError, wantRetry: true, }, { clockStep: time.Second * 1, err: internalError, wantRetry: true, }, }, }, } for _, tc := range testCases { fakeClock := testingclock.NewFakeClock(time.Now()) retry := NewRetryWithDeadline(tc.duration, tc.reset, tc.isRetryable, fakeClock) for i, step := range tc.scenario { fakeClock.Step(step.clockStep) retry.After(step.err) result := retry.ShouldRetry() if result != step.wantRetry { t.Errorf("%v unexpected retry, step %d, result %v want %v", tc, i, result, step.wantRetry) break } } } } kubernetes-client-go-a2dfcab/tools/cache/shared_informer.go000066400000000000000000001115171472614177300243070ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "errors" "fmt" "sync" "time" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/cache/synctrack" "k8s.io/utils/buffer" "k8s.io/utils/clock" "k8s.io/klog/v2" clientgofeaturegate "k8s.io/client-go/features" ) // SharedInformer provides eventually consistent linkage of its // clients to the authoritative state of a given collection of // objects. An object is identified by its API group, kind/resource, // namespace (if any), and name; the `ObjectMeta.UID` is not part of // an object's ID as far as this contract is concerned. One // SharedInformer provides linkage to objects of a particular API // group and kind/resource. The linked object collection of a // SharedInformer may be further restricted to one namespace (if // applicable) and/or by label selector and/or field selector. // // The authoritative state of an object is what apiservers provide // access to, and an object goes through a strict sequence of states. // An object state is either (1) present with a ResourceVersion and // other appropriate content or (2) "absent". // // A SharedInformer maintains a local cache --- exposed by GetStore(), // by GetIndexer() in the case of an indexed informer, and possibly by // machinery involved in creating and/or accessing the informer --- of // the state of each relevant object. This cache is eventually // consistent with the authoritative state. This means that, unless // prevented by persistent communication problems, if ever a // particular object ID X is authoritatively associated with a state S // then for every SharedInformer I whose collection includes (X, S) // eventually either (1) I's cache associates X with S or a later // state of X, (2) I is stopped, or (3) the authoritative state // service for X terminates. To be formally complete, we say that the // absent state meets any restriction by label selector or field // selector. // // For a given informer and relevant object ID X, the sequence of // states that appears in the informer's cache is a subsequence of the // states authoritatively associated with X. That is, some states // might never appear in the cache but ordering among the appearing // states is correct. Note, however, that there is no promise about // ordering between states seen for different objects. // // The local cache starts out empty, and gets populated and updated // during `Run()`. // // As a simple example, if a collection of objects is henceforth // unchanging, a SharedInformer is created that links to that // collection, and that SharedInformer is `Run()` then that // SharedInformer's cache eventually holds an exact copy of that // collection (unless it is stopped too soon, the authoritative state // service ends, or communication problems between the two // persistently thwart achievement). // // As another simple example, if the local cache ever holds a // non-absent state for some object ID and the object is eventually // removed from the authoritative state then eventually the object is // removed from the local cache (unless the SharedInformer is stopped // too soon, the authoritative state service ends, or communication // problems persistently thwart the desired result). // // The keys in the Store are of the form namespace/name for namespaced // objects, and are simply the name for non-namespaced objects. // Clients can use `MetaNamespaceKeyFunc(obj)` to extract the key for // a given object, and `SplitMetaNamespaceKey(key)` to split a key // into its constituent parts. // // Every query against the local cache is answered entirely from one // snapshot of the cache's state. Thus, the result of a `List` call // will not contain two entries with the same namespace and name. // // A client is identified here by a ResourceEventHandler. For every // update to the SharedInformer's local cache and for every client // added before `Run()`, eventually either the SharedInformer is // stopped or the client is notified of the update. A client added // after `Run()` starts gets a startup batch of notifications of // additions of the objects existing in the cache at the time that // client was added; also, for every update to the SharedInformer's // local cache after that client was added, eventually either the // SharedInformer is stopped or that client is notified of that // update. Client notifications happen after the corresponding cache // update and, in the case of a SharedIndexInformer, after the // corresponding index updates. It is possible that additional cache // and index updates happen before such a prescribed notification. // For a given SharedInformer and client, the notifications are // delivered sequentially. For a given SharedInformer, client, and // object ID, the notifications are delivered in order. Because // `ObjectMeta.UID` has no role in identifying objects, it is possible // that when (1) object O1 with ID (e.g. namespace and name) X and // `ObjectMeta.UID` U1 in the SharedInformer's local cache is deleted // and later (2) another object O2 with ID X and ObjectMeta.UID U2 is // created the informer's clients are not notified of (1) and (2) but // rather are notified only of an update from O1 to O2. Clients that // need to detect such cases might do so by comparing the `ObjectMeta.UID` // field of the old and the new object in the code that handles update // notifications (i.e. `OnUpdate` method of ResourceEventHandler). // // A client must process each notification promptly; a SharedInformer // is not engineered to deal well with a large backlog of // notifications to deliver. Lengthy processing should be passed off // to something else, for example through a // `client-go/util/workqueue`. // // A delete notification exposes the last locally known non-absent // state, except that its ResourceVersion is replaced with a // ResourceVersion in which the object is actually absent. type SharedInformer interface { // AddEventHandler adds an event handler to the shared informer using // the shared informer's resync period. Events to a single handler are // delivered sequentially, but there is no coordination between // different handlers. // It returns a registration handle for the handler that can be used to // remove the handler again, or to tell if the handler is synced (has // seen every item in the initial list). AddEventHandler(handler ResourceEventHandler) (ResourceEventHandlerRegistration, error) // AddEventHandlerWithResyncPeriod adds an event handler to the // shared informer with the requested resync period; zero means // this handler does not care about resyncs. The resync operation // consists of delivering to the handler an update notification // for every object in the informer's local cache; it does not add // any interactions with the authoritative storage. Some // informers do no resyncs at all, not even for handlers added // with a non-zero resyncPeriod. For an informer that does // resyncs, and for each handler that requests resyncs, that // informer develops a nominal resync period that is no shorter // than the requested period but may be longer. The actual time // between any two resyncs may be longer than the nominal period // because the implementation takes time to do work and there may // be competing load and scheduling noise. // It returns a registration handle for the handler that can be used to remove // the handler again and an error if the handler cannot be added. AddEventHandlerWithResyncPeriod(handler ResourceEventHandler, resyncPeriod time.Duration) (ResourceEventHandlerRegistration, error) // RemoveEventHandler removes a formerly added event handler given by // its registration handle. // This function is guaranteed to be idempotent, and thread-safe. RemoveEventHandler(handle ResourceEventHandlerRegistration) error // GetStore returns the informer's local cache as a Store. GetStore() Store // GetController is deprecated, it does nothing useful GetController() Controller // Run starts and runs the shared informer, returning after it stops. // The informer will be stopped when stopCh is closed. Run(stopCh <-chan struct{}) // HasSynced returns true if the shared informer's store has been // informed by at least one full LIST of the authoritative state // of the informer's object collection. This is unrelated to "resync". // // Note that this doesn't tell you if an individual handler is synced!! // For that, please call HasSynced on the handle returned by // AddEventHandler. HasSynced() bool // LastSyncResourceVersion is the resource version observed when last synced with the underlying // store. The value returned is not synchronized with access to the underlying store and is not // thread-safe. LastSyncResourceVersion() string // The WatchErrorHandler is called whenever ListAndWatch drops the // connection with an error. After calling this handler, the informer // will backoff and retry. // // The default implementation looks at the error type and tries to log // the error message at an appropriate level. // // There's only one handler, so if you call this multiple times, last one // wins; calling after the informer has been started returns an error. // // The handler is intended for visibility, not to e.g. pause the consumers. // The handler should return quickly - any expensive processing should be // offloaded. SetWatchErrorHandler(handler WatchErrorHandler) error // The TransformFunc is called for each object which is about to be stored. // // This function is intended for you to take the opportunity to // remove, transform, or normalize fields. One use case is to strip unused // metadata fields out of objects to save on RAM cost. // // Must be set before starting the informer. // // Please see the comment on TransformFunc for more details. SetTransform(handler TransformFunc) error // IsStopped reports whether the informer has already been stopped. // Adding event handlers to already stopped informers is not possible. // An informer already stopped will never be started again. IsStopped() bool } // Opaque interface representing the registration of ResourceEventHandler for // a SharedInformer. Must be supplied back to the same SharedInformer's // `RemoveEventHandler` to unregister the handlers. // // Also used to tell if the handler is synced (has had all items in the initial // list delivered). type ResourceEventHandlerRegistration interface { // HasSynced reports if both the parent has synced and all pre-sync // events have been delivered. HasSynced() bool } // SharedIndexInformer provides add and get Indexers ability based on SharedInformer. type SharedIndexInformer interface { SharedInformer // AddIndexers add indexers to the informer before it starts. AddIndexers(indexers Indexers) error GetIndexer() Indexer } // NewSharedInformer creates a new instance for the ListerWatcher. See NewSharedIndexInformerWithOptions for full details. func NewSharedInformer(lw ListerWatcher, exampleObject runtime.Object, defaultEventHandlerResyncPeriod time.Duration) SharedInformer { return NewSharedIndexInformer(lw, exampleObject, defaultEventHandlerResyncPeriod, Indexers{}) } // NewSharedIndexInformer creates a new instance for the ListerWatcher and specified Indexers. See // NewSharedIndexInformerWithOptions for full details. func NewSharedIndexInformer(lw ListerWatcher, exampleObject runtime.Object, defaultEventHandlerResyncPeriod time.Duration, indexers Indexers) SharedIndexInformer { return NewSharedIndexInformerWithOptions( lw, exampleObject, SharedIndexInformerOptions{ ResyncPeriod: defaultEventHandlerResyncPeriod, Indexers: indexers, }, ) } // NewSharedIndexInformerWithOptions creates a new instance for the ListerWatcher. // The created informer will not do resyncs if options.ResyncPeriod is zero. Otherwise: for each // handler that with a non-zero requested resync period, whether added // before or after the informer starts, the nominal resync period is // the requested resync period rounded up to a multiple of the // informer's resync checking period. Such an informer's resync // checking period is established when the informer starts running, // and is the maximum of (a) the minimum of the resync periods // requested before the informer starts and the // options.ResyncPeriod given here and (b) the constant // `minimumResyncPeriod` defined in this file. func NewSharedIndexInformerWithOptions(lw ListerWatcher, exampleObject runtime.Object, options SharedIndexInformerOptions) SharedIndexInformer { realClock := &clock.RealClock{} return &sharedIndexInformer{ indexer: NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, options.Indexers), processor: &sharedProcessor{clock: realClock}, listerWatcher: lw, objectType: exampleObject, objectDescription: options.ObjectDescription, resyncCheckPeriod: options.ResyncPeriod, defaultEventHandlerResyncPeriod: options.ResyncPeriod, clock: realClock, cacheMutationDetector: NewCacheMutationDetector(fmt.Sprintf("%T", exampleObject)), } } // SharedIndexInformerOptions configures a sharedIndexInformer. type SharedIndexInformerOptions struct { // ResyncPeriod is the default event handler resync period and resync check // period. If unset/unspecified, these are defaulted to 0 (do not resync). ResyncPeriod time.Duration // Indexers is the sharedIndexInformer's indexers. If unset/unspecified, no indexers are configured. Indexers Indexers // ObjectDescription is the sharedIndexInformer's object description. This is passed through to the // underlying Reflector's type description. ObjectDescription string } // InformerSynced is a function that can be used to determine if an informer has synced. This is useful for determining if caches have synced. type InformerSynced func() bool const ( // syncedPollPeriod controls how often you look at the status of your sync funcs syncedPollPeriod = 100 * time.Millisecond // initialBufferSize is the initial number of event notifications that can be buffered. initialBufferSize = 1024 ) // WaitForNamedCacheSync is a wrapper around WaitForCacheSync that generates log messages // indicating that the caller identified by name is waiting for syncs, followed by // either a successful or failed sync. func WaitForNamedCacheSync(controllerName string, stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool { klog.Infof("Waiting for caches to sync for %s", controllerName) if !WaitForCacheSync(stopCh, cacheSyncs...) { utilruntime.HandleError(fmt.Errorf("unable to sync caches for %s", controllerName)) return false } klog.Infof("Caches are synced for %s", controllerName) return true } // WaitForCacheSync waits for caches to populate. It returns true if it was successful, false // if the controller should shutdown // callers should prefer WaitForNamedCacheSync() func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool { err := wait.PollImmediateUntil(syncedPollPeriod, func() (bool, error) { for _, syncFunc := range cacheSyncs { if !syncFunc() { return false, nil } } return true, nil }, stopCh) if err != nil { return false } return true } // `*sharedIndexInformer` implements SharedIndexInformer and has three // main components. One is an indexed local cache, `indexer Indexer`. // The second main component is a Controller that pulls // objects/notifications using the ListerWatcher and pushes them into // a DeltaFIFO --- whose knownObjects is the informer's local cache // --- while concurrently Popping Deltas values from that fifo and // processing them with `sharedIndexInformer::HandleDeltas`. Each // invocation of HandleDeltas, which is done with the fifo's lock // held, processes each Delta in turn. For each Delta this both // updates the local cache and stuffs the relevant notification into // the sharedProcessor. The third main component is that // sharedProcessor, which is responsible for relaying those // notifications to each of the informer's clients. type sharedIndexInformer struct { indexer Indexer controller Controller processor *sharedProcessor cacheMutationDetector MutationDetector listerWatcher ListerWatcher // objectType is an example object of the type this informer is expected to handle. If set, an event // with an object with a mismatching type is dropped instead of being delivered to listeners. objectType runtime.Object // objectDescription is the description of this informer's objects. This typically defaults to objectDescription string // resyncCheckPeriod is how often we want the reflector's resync timer to fire so it can call // shouldResync to check if any of our listeners need a resync. resyncCheckPeriod time.Duration // defaultEventHandlerResyncPeriod is the default resync period for any handlers added via // AddEventHandler (i.e. they don't specify one and just want to use the shared informer's default // value). defaultEventHandlerResyncPeriod time.Duration // clock allows for testability clock clock.Clock started, stopped bool startedLock sync.Mutex // blockDeltas gives a way to stop all event distribution so that a late event handler // can safely join the shared informer. blockDeltas sync.Mutex // Called whenever the ListAndWatch drops the connection with an error. watchErrorHandler WatchErrorHandler transform TransformFunc } // dummyController hides the fact that a SharedInformer is different from a dedicated one // where a caller can `Run`. The run method is disconnected in this case, because higher // level logic will decide when to start the SharedInformer and related controller. // Because returning information back is always asynchronous, the legacy callers shouldn't // notice any change in behavior. type dummyController struct { informer *sharedIndexInformer } func (v *dummyController) Run(stopCh <-chan struct{}) { } func (v *dummyController) HasSynced() bool { return v.informer.HasSynced() } func (v *dummyController) LastSyncResourceVersion() string { if clientgofeaturegate.FeatureGates().Enabled(clientgofeaturegate.InformerResourceVersion) { return v.informer.LastSyncResourceVersion() } return "" } type updateNotification struct { oldObj interface{} newObj interface{} } type addNotification struct { newObj interface{} isInInitialList bool } type deleteNotification struct { oldObj interface{} } func (s *sharedIndexInformer) SetWatchErrorHandler(handler WatchErrorHandler) error { s.startedLock.Lock() defer s.startedLock.Unlock() if s.started { return fmt.Errorf("informer has already started") } s.watchErrorHandler = handler return nil } func (s *sharedIndexInformer) SetTransform(handler TransformFunc) error { s.startedLock.Lock() defer s.startedLock.Unlock() if s.started { return fmt.Errorf("informer has already started") } s.transform = handler return nil } func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() if s.HasStarted() { klog.Warningf("The sharedIndexInformer has started, run more than once is not allowed") return } func() { s.startedLock.Lock() defer s.startedLock.Unlock() fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KnownObjects: s.indexer, EmitDeltaTypeReplaced: true, Transformer: s.transform, }) cfg := &Config{ Queue: fifo, ListerWatcher: s.listerWatcher, ObjectType: s.objectType, ObjectDescription: s.objectDescription, FullResyncPeriod: s.resyncCheckPeriod, RetryOnError: false, ShouldResync: s.processor.shouldResync, Process: s.HandleDeltas, WatchErrorHandler: s.watchErrorHandler, } s.controller = New(cfg) s.controller.(*controller).clock = s.clock s.started = true }() // Separate stop channel because Processor should be stopped strictly after controller processorStopCh := make(chan struct{}) var wg wait.Group defer wg.Wait() // Wait for Processor to stop defer close(processorStopCh) // Tell Processor to stop wg.StartWithChannel(processorStopCh, s.cacheMutationDetector.Run) wg.StartWithChannel(processorStopCh, s.processor.run) defer func() { s.startedLock.Lock() defer s.startedLock.Unlock() s.stopped = true // Don't want any new listeners }() s.controller.Run(stopCh) } func (s *sharedIndexInformer) HasStarted() bool { s.startedLock.Lock() defer s.startedLock.Unlock() return s.started } func (s *sharedIndexInformer) HasSynced() bool { s.startedLock.Lock() defer s.startedLock.Unlock() if s.controller == nil { return false } return s.controller.HasSynced() } func (s *sharedIndexInformer) LastSyncResourceVersion() string { s.startedLock.Lock() defer s.startedLock.Unlock() if s.controller == nil { return "" } return s.controller.LastSyncResourceVersion() } func (s *sharedIndexInformer) GetStore() Store { return s.indexer } func (s *sharedIndexInformer) GetIndexer() Indexer { return s.indexer } func (s *sharedIndexInformer) AddIndexers(indexers Indexers) error { s.startedLock.Lock() defer s.startedLock.Unlock() if s.stopped { return fmt.Errorf("indexer was not added because it has stopped already") } return s.indexer.AddIndexers(indexers) } func (s *sharedIndexInformer) GetController() Controller { return &dummyController{informer: s} } func (s *sharedIndexInformer) AddEventHandler(handler ResourceEventHandler) (ResourceEventHandlerRegistration, error) { return s.AddEventHandlerWithResyncPeriod(handler, s.defaultEventHandlerResyncPeriod) } func determineResyncPeriod(desired, check time.Duration) time.Duration { if desired == 0 { return desired } if check == 0 { klog.Warningf("The specified resyncPeriod %v is invalid because this shared informer doesn't support resyncing", desired) return 0 } if desired < check { klog.Warningf("The specified resyncPeriod %v is being increased to the minimum resyncCheckPeriod %v", desired, check) return check } return desired } const minimumResyncPeriod = 1 * time.Second func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEventHandler, resyncPeriod time.Duration) (ResourceEventHandlerRegistration, error) { s.startedLock.Lock() defer s.startedLock.Unlock() if s.stopped { return nil, fmt.Errorf("handler %v was not added to shared informer because it has stopped already", handler) } if resyncPeriod > 0 { if resyncPeriod < minimumResyncPeriod { klog.Warningf("resyncPeriod %v is too small. Changing it to the minimum allowed value of %v", resyncPeriod, minimumResyncPeriod) resyncPeriod = minimumResyncPeriod } if resyncPeriod < s.resyncCheckPeriod { if s.started { klog.Warningf("resyncPeriod %v is smaller than resyncCheckPeriod %v and the informer has already started. Changing it to %v", resyncPeriod, s.resyncCheckPeriod, s.resyncCheckPeriod) resyncPeriod = s.resyncCheckPeriod } else { // if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, update // resyncCheckPeriod to match resyncPeriod and adjust the resync periods of all the listeners // accordingly s.resyncCheckPeriod = resyncPeriod s.processor.resyncCheckPeriodChanged(resyncPeriod) } } } listener := newProcessListener(handler, resyncPeriod, determineResyncPeriod(resyncPeriod, s.resyncCheckPeriod), s.clock.Now(), initialBufferSize, s.HasSynced) if !s.started { return s.processor.addListener(listener), nil } // in order to safely join, we have to // 1. stop sending add/update/delete notifications // 2. do a list against the store // 3. send synthetic "Add" events to the new handler // 4. unblock s.blockDeltas.Lock() defer s.blockDeltas.Unlock() handle := s.processor.addListener(listener) for _, item := range s.indexer.List() { // Note that we enqueue these notifications with the lock held // and before returning the handle. That means there is never a // chance for anyone to call the handle's HasSynced method in a // state when it would falsely return true (i.e., when the // shared informer is synced but it has not observed an Add // with isInitialList being true, nor when the thread // processing notifications somehow goes faster than this // thread adding them and the counter is temporarily zero). listener.add(addNotification{newObj: item, isInInitialList: true}) } return handle, nil } func (s *sharedIndexInformer) HandleDeltas(obj interface{}, isInInitialList bool) error { s.blockDeltas.Lock() defer s.blockDeltas.Unlock() if deltas, ok := obj.(Deltas); ok { return processDeltas(s, s.indexer, deltas, isInInitialList) } return errors.New("object given as Process argument is not Deltas") } // Conforms to ResourceEventHandler func (s *sharedIndexInformer) OnAdd(obj interface{}, isInInitialList bool) { // Invocation of this function is locked under s.blockDeltas, so it is // save to distribute the notification s.cacheMutationDetector.AddObject(obj) s.processor.distribute(addNotification{newObj: obj, isInInitialList: isInInitialList}, false) } // Conforms to ResourceEventHandler func (s *sharedIndexInformer) OnUpdate(old, new interface{}) { isSync := false // If is a Sync event, isSync should be true // If is a Replaced event, isSync is true if resource version is unchanged. // If RV is unchanged: this is a Sync/Replaced event, so isSync is true if accessor, err := meta.Accessor(new); err == nil { if oldAccessor, err := meta.Accessor(old); err == nil { // Events that didn't change resourceVersion are treated as resync events // and only propagated to listeners that requested resync isSync = accessor.GetResourceVersion() == oldAccessor.GetResourceVersion() } } // Invocation of this function is locked under s.blockDeltas, so it is // save to distribute the notification s.cacheMutationDetector.AddObject(new) s.processor.distribute(updateNotification{oldObj: old, newObj: new}, isSync) } // Conforms to ResourceEventHandler func (s *sharedIndexInformer) OnDelete(old interface{}) { // Invocation of this function is locked under s.blockDeltas, so it is // save to distribute the notification s.processor.distribute(deleteNotification{oldObj: old}, false) } // IsStopped reports whether the informer has already been stopped func (s *sharedIndexInformer) IsStopped() bool { s.startedLock.Lock() defer s.startedLock.Unlock() return s.stopped } func (s *sharedIndexInformer) RemoveEventHandler(handle ResourceEventHandlerRegistration) error { s.startedLock.Lock() defer s.startedLock.Unlock() // in order to safely remove, we have to // 1. stop sending add/update/delete notifications // 2. remove and stop listener // 3. unblock s.blockDeltas.Lock() defer s.blockDeltas.Unlock() return s.processor.removeListener(handle) } // sharedProcessor has a collection of processorListener and can // distribute a notification object to its listeners. There are two // kinds of distribute operations. The sync distributions go to a // subset of the listeners that (a) is recomputed in the occasional // calls to shouldResync and (b) every listener is initially put in. // The non-sync distributions go to every listener. type sharedProcessor struct { listenersStarted bool listenersLock sync.RWMutex // Map from listeners to whether or not they are currently syncing listeners map[*processorListener]bool clock clock.Clock wg wait.Group } func (p *sharedProcessor) getListener(registration ResourceEventHandlerRegistration) *processorListener { p.listenersLock.RLock() defer p.listenersLock.RUnlock() if p.listeners == nil { return nil } if result, ok := registration.(*processorListener); ok { if _, exists := p.listeners[result]; exists { return result } } return nil } func (p *sharedProcessor) addListener(listener *processorListener) ResourceEventHandlerRegistration { p.listenersLock.Lock() defer p.listenersLock.Unlock() if p.listeners == nil { p.listeners = make(map[*processorListener]bool) } p.listeners[listener] = true if p.listenersStarted { p.wg.Start(listener.run) p.wg.Start(listener.pop) } return listener } func (p *sharedProcessor) removeListener(handle ResourceEventHandlerRegistration) error { p.listenersLock.Lock() defer p.listenersLock.Unlock() listener, ok := handle.(*processorListener) if !ok { return fmt.Errorf("invalid key type %t", handle) } else if p.listeners == nil { // No listeners are registered, do nothing return nil } else if _, exists := p.listeners[listener]; !exists { // Listener is not registered, just do nothing return nil } delete(p.listeners, listener) if p.listenersStarted { close(listener.addCh) } return nil } func (p *sharedProcessor) distribute(obj interface{}, sync bool) { p.listenersLock.RLock() defer p.listenersLock.RUnlock() for listener, isSyncing := range p.listeners { switch { case !sync: // non-sync messages are delivered to every listener listener.add(obj) case isSyncing: // sync messages are delivered to every syncing listener listener.add(obj) default: // skipping a sync obj for a non-syncing listener } } } func (p *sharedProcessor) run(stopCh <-chan struct{}) { func() { p.listenersLock.RLock() defer p.listenersLock.RUnlock() for listener := range p.listeners { p.wg.Start(listener.run) p.wg.Start(listener.pop) } p.listenersStarted = true }() <-stopCh p.listenersLock.Lock() defer p.listenersLock.Unlock() for listener := range p.listeners { close(listener.addCh) // Tell .pop() to stop. .pop() will tell .run() to stop } // Wipe out list of listeners since they are now closed // (processorListener cannot be re-used) p.listeners = nil // Reset to false since no listeners are running p.listenersStarted = false p.wg.Wait() // Wait for all .pop() and .run() to stop } // shouldResync queries every listener to determine if any of them need a resync, based on each // listener's resyncPeriod. func (p *sharedProcessor) shouldResync() bool { p.listenersLock.Lock() defer p.listenersLock.Unlock() resyncNeeded := false now := p.clock.Now() for listener := range p.listeners { // need to loop through all the listeners to see if they need to resync so we can prepare any // listeners that are going to be resyncing. shouldResync := listener.shouldResync(now) p.listeners[listener] = shouldResync if shouldResync { resyncNeeded = true listener.determineNextResync(now) } } return resyncNeeded } func (p *sharedProcessor) resyncCheckPeriodChanged(resyncCheckPeriod time.Duration) { p.listenersLock.RLock() defer p.listenersLock.RUnlock() for listener := range p.listeners { resyncPeriod := determineResyncPeriod( listener.requestedResyncPeriod, resyncCheckPeriod) listener.setResyncPeriod(resyncPeriod) } } // processorListener relays notifications from a sharedProcessor to // one ResourceEventHandler --- using two goroutines, two unbuffered // channels, and an unbounded ring buffer. The `add(notification)` // function sends the given notification to `addCh`. One goroutine // runs `pop()`, which pumps notifications from `addCh` to `nextCh` // using storage in the ring buffer while `nextCh` is not keeping up. // Another goroutine runs `run()`, which receives notifications from // `nextCh` and synchronously invokes the appropriate handler method. // // processorListener also keeps track of the adjusted requested resync // period of the listener. type processorListener struct { nextCh chan interface{} addCh chan interface{} handler ResourceEventHandler syncTracker *synctrack.SingleFileTracker // pendingNotifications is an unbounded ring buffer that holds all notifications not yet distributed. // There is one per listener, but a failing/stalled listener will have infinite pendingNotifications // added until we OOM. // TODO: This is no worse than before, since reflectors were backed by unbounded DeltaFIFOs, but // we should try to do something better. pendingNotifications buffer.RingGrowing // requestedResyncPeriod is how frequently the listener wants a // full resync from the shared informer, but modified by two // adjustments. One is imposing a lower bound, // `minimumResyncPeriod`. The other is another lower bound, the // sharedIndexInformer's `resyncCheckPeriod`, that is imposed (a) only // in AddEventHandlerWithResyncPeriod invocations made after the // sharedIndexInformer starts and (b) only if the informer does // resyncs at all. requestedResyncPeriod time.Duration // resyncPeriod is the threshold that will be used in the logic // for this listener. This value differs from // requestedResyncPeriod only when the sharedIndexInformer does // not do resyncs, in which case the value here is zero. The // actual time between resyncs depends on when the // sharedProcessor's `shouldResync` function is invoked and when // the sharedIndexInformer processes `Sync` type Delta objects. resyncPeriod time.Duration // nextResync is the earliest time the listener should get a full resync nextResync time.Time // resyncLock guards access to resyncPeriod and nextResync resyncLock sync.Mutex } // HasSynced returns true if the source informer has synced, and all // corresponding events have been delivered. func (p *processorListener) HasSynced() bool { return p.syncTracker.HasSynced() } func newProcessListener(handler ResourceEventHandler, requestedResyncPeriod, resyncPeriod time.Duration, now time.Time, bufferSize int, hasSynced func() bool) *processorListener { ret := &processorListener{ nextCh: make(chan interface{}), addCh: make(chan interface{}), handler: handler, syncTracker: &synctrack.SingleFileTracker{UpstreamHasSynced: hasSynced}, pendingNotifications: *buffer.NewRingGrowing(bufferSize), requestedResyncPeriod: requestedResyncPeriod, resyncPeriod: resyncPeriod, } ret.determineNextResync(now) return ret } func (p *processorListener) add(notification interface{}) { if a, ok := notification.(addNotification); ok && a.isInInitialList { p.syncTracker.Start() } p.addCh <- notification } func (p *processorListener) pop() { defer utilruntime.HandleCrash() defer close(p.nextCh) // Tell .run() to stop var nextCh chan<- interface{} var notification interface{} for { select { case nextCh <- notification: // Notification dispatched var ok bool notification, ok = p.pendingNotifications.ReadOne() if !ok { // Nothing to pop nextCh = nil // Disable this select case } case notificationToAdd, ok := <-p.addCh: if !ok { return } if notification == nil { // No notification to pop (and pendingNotifications is empty) // Optimize the case - skip adding to pendingNotifications notification = notificationToAdd nextCh = p.nextCh } else { // There is already a notification waiting to be dispatched p.pendingNotifications.WriteOne(notificationToAdd) } } } } func (p *processorListener) run() { // this call blocks until the channel is closed. When a panic happens during the notification // we will catch it, **the offending item will be skipped!**, and after a short delay (one second) // the next notification will be attempted. This is usually better than the alternative of never // delivering again. stopCh := make(chan struct{}) wait.Until(func() { for next := range p.nextCh { switch notification := next.(type) { case updateNotification: p.handler.OnUpdate(notification.oldObj, notification.newObj) case addNotification: p.handler.OnAdd(notification.newObj, notification.isInInitialList) if notification.isInInitialList { p.syncTracker.Finished() } case deleteNotification: p.handler.OnDelete(notification.oldObj) default: utilruntime.HandleError(fmt.Errorf("unrecognized notification: %T", next)) } } // the only way to get here is if the p.nextCh is empty and closed close(stopCh) }, 1*time.Second, stopCh) } // shouldResync deterimines if the listener needs a resync. If the listener's resyncPeriod is 0, // this always returns false. func (p *processorListener) shouldResync(now time.Time) bool { p.resyncLock.Lock() defer p.resyncLock.Unlock() if p.resyncPeriod == 0 { return false } return now.After(p.nextResync) || now.Equal(p.nextResync) } func (p *processorListener) determineNextResync(now time.Time) { p.resyncLock.Lock() defer p.resyncLock.Unlock() p.nextResync = now.Add(p.resyncPeriod) } func (p *processorListener) setResyncPeriod(resyncPeriod time.Duration) { p.resyncLock.Lock() defer p.resyncLock.Unlock() p.resyncPeriod = resyncPeriod } kubernetes-client-go-a2dfcab/tools/cache/shared_informer_test.go000066400000000000000000001004451472614177300253440ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "context" "fmt" "math/rand" "strconv" "strings" "sync" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" fcache "k8s.io/client-go/tools/cache/testing" testingclock "k8s.io/utils/clock/testing" ) type testListener struct { lock sync.RWMutex resyncPeriod time.Duration expectedItemNames sets.String receivedItemNames []string name string } func newTestListener(name string, resyncPeriod time.Duration, expected ...string) *testListener { l := &testListener{ resyncPeriod: resyncPeriod, expectedItemNames: sets.NewString(expected...), name: name, } return l } func (l *testListener) OnAdd(obj interface{}, isInInitialList bool) { l.handle(obj) } func (l *testListener) OnUpdate(old, new interface{}) { l.handle(new) } func (l *testListener) OnDelete(obj interface{}) { } func (l *testListener) handle(obj interface{}) { key, _ := MetaNamespaceKeyFunc(obj) fmt.Printf("%s: handle: %v\n", l.name, key) l.lock.Lock() defer l.lock.Unlock() objectMeta, _ := meta.Accessor(obj) l.receivedItemNames = append(l.receivedItemNames, objectMeta.GetName()) } func (l *testListener) ok() bool { fmt.Println("polling") err := wait.PollImmediate(100*time.Millisecond, 2*time.Second, func() (bool, error) { if l.satisfiedExpectations() { return true, nil } return false, nil }) if err != nil { return false } // wait just a bit to allow any unexpected stragglers to come in fmt.Println("sleeping") time.Sleep(1 * time.Second) fmt.Println("final check") return l.satisfiedExpectations() } func (l *testListener) satisfiedExpectations() bool { l.lock.RLock() defer l.lock.RUnlock() return sets.NewString(l.receivedItemNames...).Equal(l.expectedItemNames) } func eventHandlerCount(i SharedInformer) int { s := i.(*sharedIndexInformer) s.startedLock.Lock() defer s.startedLock.Unlock() return len(s.processor.listeners) } func isStarted(i SharedInformer) bool { s := i.(*sharedIndexInformer) s.startedLock.Lock() defer s.startedLock.Unlock() return s.started } func isRegistered(i SharedInformer, h ResourceEventHandlerRegistration) bool { s := i.(*sharedIndexInformer) return s.processor.getListener(h) != nil } func TestIndexer(t *testing.T) { assert := assert.New(t) // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() pod1 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1", Labels: map[string]string{"a": "a-val", "b": "b-val1"}}} pod2 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod2", Labels: map[string]string{"b": "b-val2"}}} pod3 := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod3", Labels: map[string]string{"a": "a-val2"}}} source.Add(pod1) source.Add(pod2) // create the shared informer and resync every 1s informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) err := informer.AddIndexers(map[string]IndexFunc{ "labels": func(obj interface{}) ([]string, error) { res := []string{} for k := range obj.(*v1.Pod).Labels { res = append(res, k) } return res, nil }, }) if err != nil { t.Fatal(err) } stop := make(chan struct{}) defer close(stop) go informer.Run(stop) WaitForCacheSync(stop, informer.HasSynced) cmpOps := cmpopts.SortSlices(func(a, b any) bool { return a.(*v1.Pod).Name < b.(*v1.Pod).Name }) // We should be able to lookup by index res, err := informer.GetIndexer().ByIndex("labels", "a") assert.NoError(err) if diff := cmp.Diff([]any{pod1}, res); diff != "" { t.Fatal(diff) } // Adding an item later is fine as well source.Add(pod3) // Event is async, need to poll assert.Eventually(func() bool { res, _ := informer.GetIndexer().ByIndex("labels", "a") return cmp.Diff([]any{pod1, pod3}, res, cmpOps) == "" }, time.Second*3, time.Millisecond) // Adding an index later is also fine err = informer.AddIndexers(map[string]IndexFunc{ "labels-again": func(obj interface{}) ([]string, error) { res := []string{} for k := range obj.(*v1.Pod).Labels { res = append(res, k) } return res, nil }, }) assert.NoError(err) // Should be immediately available res, err = informer.GetIndexer().ByIndex("labels-again", "a") assert.NoError(err) if diff := cmp.Diff([]any{pod1, pod3}, res, cmpOps); diff != "" { t.Fatal(diff) } if got := informer.GetIndexer().ListIndexFuncValues("labels"); !sets.New(got...).Equal(sets.New("a", "b")) { t.Fatalf("got %v", got) } if got := informer.GetIndexer().ListIndexFuncValues("labels-again"); !sets.New(got...).Equal(sets.New("a", "b")) { t.Fatalf("got %v", got) } } func TestListenerResyncPeriods(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod2"}}) // create the shared informer and resync every 1s informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) clock := testingclock.NewFakeClock(time.Now()) informer.clock = clock informer.processor.clock = clock // listener 1, never resync listener1 := newTestListener("listener1", 0, "pod1", "pod2") informer.AddEventHandlerWithResyncPeriod(listener1, listener1.resyncPeriod) // listener 2, resync every 2s listener2 := newTestListener("listener2", 2*time.Second, "pod1", "pod2") informer.AddEventHandlerWithResyncPeriod(listener2, listener2.resyncPeriod) // listener 3, resync every 3s listener3 := newTestListener("listener3", 3*time.Second, "pod1", "pod2") informer.AddEventHandlerWithResyncPeriod(listener3, listener3.resyncPeriod) listeners := []*testListener{listener1, listener2, listener3} stop := make(chan struct{}) defer close(stop) go informer.Run(stop) // ensure all listeners got the initial List for _, listener := range listeners { if !listener.ok() { t.Errorf("%s: expected %v, got %v", listener.name, listener.expectedItemNames, listener.receivedItemNames) } } // reset for _, listener := range listeners { listener.receivedItemNames = []string{} } // advance so listener2 gets a resync clock.Step(2 * time.Second) // make sure listener2 got the resync if !listener2.ok() { t.Errorf("%s: expected %v, got %v", listener2.name, listener2.expectedItemNames, listener2.receivedItemNames) } // wait a bit to give errant items a chance to go to 1 and 3 time.Sleep(1 * time.Second) // make sure listeners 1 and 3 got nothing if len(listener1.receivedItemNames) != 0 { t.Errorf("listener1: should not have resynced (got %d)", len(listener1.receivedItemNames)) } if len(listener3.receivedItemNames) != 0 { t.Errorf("listener3: should not have resynced (got %d)", len(listener3.receivedItemNames)) } // reset for _, listener := range listeners { listener.receivedItemNames = []string{} } // advance so listener3 gets a resync clock.Step(1 * time.Second) // make sure listener3 got the resync if !listener3.ok() { t.Errorf("%s: expected %v, got %v", listener3.name, listener3.expectedItemNames, listener3.receivedItemNames) } // wait a bit to give errant items a chance to go to 1 and 2 time.Sleep(1 * time.Second) // make sure listeners 1 and 2 got nothing if len(listener1.receivedItemNames) != 0 { t.Errorf("listener1: should not have resynced (got %d)", len(listener1.receivedItemNames)) } if len(listener2.receivedItemNames) != 0 { t.Errorf("listener2: should not have resynced (got %d)", len(listener2.receivedItemNames)) } } func TestResyncCheckPeriod(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() // create the shared informer and resync every 12 hours informer := NewSharedInformer(source, &v1.Pod{}, 12*time.Hour).(*sharedIndexInformer) gl := informer.processor.getListener clock := testingclock.NewFakeClock(time.Now()) informer.clock = clock informer.processor.clock = clock // listener 1, never resync listener1 := newTestListener("listener1", 0) handler1, _ := informer.AddEventHandlerWithResyncPeriod(listener1, listener1.resyncPeriod) if e, a := 12*time.Hour, informer.resyncCheckPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := time.Duration(0), gl(handler1).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } // listener 2, resync every minute listener2 := newTestListener("listener2", 1*time.Minute) handler2, _ := informer.AddEventHandlerWithResyncPeriod(listener2, listener2.resyncPeriod) if e, a := 1*time.Minute, informer.resyncCheckPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := time.Duration(0), gl(handler1).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := 1*time.Minute, gl(handler2).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } // listener 3, resync every 55 seconds listener3 := newTestListener("listener3", 55*time.Second) handler3, _ := informer.AddEventHandlerWithResyncPeriod(listener3, listener3.resyncPeriod) if e, a := 55*time.Second, informer.resyncCheckPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := time.Duration(0), gl(handler1).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := 1*time.Minute, gl(handler2).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := 55*time.Second, gl(handler3).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } // listener 4, resync every 5 seconds listener4 := newTestListener("listener4", 5*time.Second) handler4, _ := informer.AddEventHandlerWithResyncPeriod(listener4, listener4.resyncPeriod) if e, a := 5*time.Second, informer.resyncCheckPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := time.Duration(0), gl(handler1).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := 1*time.Minute, gl(handler2).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := 55*time.Second, gl(handler3).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } if e, a := 5*time.Second, gl(handler4).resyncPeriod; e != a { t.Errorf("expected %d, got %d", e, a) } } // verify that https://github.com/kubernetes/kubernetes/issues/59822 is fixed func TestSharedInformerInitializationRace(t *testing.T) { source := fcache.NewFakeControllerSource() informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) listener := newTestListener("raceListener", 0) stop := make(chan struct{}) go informer.AddEventHandlerWithResyncPeriod(listener, listener.resyncPeriod) go informer.Run(stop) close(stop) } // TestSharedInformerWatchDisruption simulates a watch that was closed // with updates to the store during that time. We ensure that handlers with // resync and no resync see the expected state. func TestSharedInformerWatchDisruption(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1", UID: "pod1", ResourceVersion: "1"}}) source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod2", UID: "pod2", ResourceVersion: "2"}}) // create the shared informer and resync every 1s informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) clock := testingclock.NewFakeClock(time.Now()) informer.clock = clock informer.processor.clock = clock // listener, never resync listenerNoResync := newTestListener("listenerNoResync", 0, "pod1", "pod2") informer.AddEventHandlerWithResyncPeriod(listenerNoResync, listenerNoResync.resyncPeriod) listenerResync := newTestListener("listenerResync", 1*time.Second, "pod1", "pod2") informer.AddEventHandlerWithResyncPeriod(listenerResync, listenerResync.resyncPeriod) listeners := []*testListener{listenerNoResync, listenerResync} stop := make(chan struct{}) defer close(stop) go informer.Run(stop) for _, listener := range listeners { if !listener.ok() { t.Errorf("%s: expected %v, got %v", listener.name, listener.expectedItemNames, listener.receivedItemNames) } } // Add pod3, bump pod2 but don't broadcast it, so that the change will be seen only on relist source.AddDropWatch(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod3", UID: "pod3", ResourceVersion: "3"}}) source.ModifyDropWatch(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod2", UID: "pod2", ResourceVersion: "4"}}) // Ensure that nobody saw any changes for _, listener := range listeners { if !listener.ok() { t.Errorf("%s: expected %v, got %v", listener.name, listener.expectedItemNames, listener.receivedItemNames) } } for _, listener := range listeners { listener.receivedItemNames = []string{} } listenerNoResync.expectedItemNames = sets.NewString("pod2", "pod3") listenerResync.expectedItemNames = sets.NewString("pod1", "pod2", "pod3") // This calls shouldSync, which deletes noResync from the list of syncingListeners clock.Step(1 * time.Second) // Simulate a connection loss (or even just a too-old-watch) source.ResetWatch() // Wait long enough for the reflector to exit and the backoff function to start waiting // on the fake clock, otherwise advancing the fake clock will have no effect. // TODO: Make this deterministic by counting the number of waiters on FakeClock time.Sleep(10 * time.Millisecond) // Advance the clock to cause the backoff wait to expire. clock.Step(1601 * time.Millisecond) // Wait long enough for backoff to invoke ListWatch a second time and distribute events // to listeners. time.Sleep(10 * time.Millisecond) for _, listener := range listeners { if !listener.ok() { t.Errorf("%s: expected %v, got %v", listener.name, listener.expectedItemNames, listener.receivedItemNames) } } } func TestSharedInformerErrorHandling(t *testing.T) { source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) source.ListError = fmt.Errorf("Access Denied") informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) errCh := make(chan error) _ = informer.SetWatchErrorHandler(func(_ *Reflector, err error) { errCh <- err }) stop := make(chan struct{}) go informer.Run(stop) select { case err := <-errCh: if !strings.Contains(err.Error(), "Access Denied") { t.Errorf("Expected 'Access Denied' error. Actual: %v", err) } case <-time.After(time.Second): t.Errorf("Timeout waiting for error handler call") } close(stop) } // TestSharedInformerStartRace is a regression test to ensure there is no race between // Run and SetWatchErrorHandler, and Run and SetTransform. func TestSharedInformerStartRace(t *testing.T) { source := fcache.NewFakeControllerSource() informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) stop := make(chan struct{}) go func() { for { select { case <-stop: return default: } // Set dummy functions, just to test for race informer.SetTransform(func(i interface{}) (interface{}, error) { return i, nil }) informer.SetWatchErrorHandler(func(r *Reflector, err error) { }) } }() go informer.Run(stop) close(stop) } func TestSharedInformerTransformer(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1", UID: "pod1", ResourceVersion: "1"}}) source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod2", UID: "pod2", ResourceVersion: "2"}}) informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) informer.SetTransform(func(obj interface{}) (interface{}, error) { if pod, ok := obj.(*v1.Pod); ok { name := pod.GetName() if upper := strings.ToUpper(name); upper != name { pod.SetName(upper) return pod, nil } } return obj, nil }) listenerTransformer := newTestListener("listenerTransformer", 0, "POD1", "POD2") informer.AddEventHandler(listenerTransformer) stop := make(chan struct{}) go informer.Run(stop) defer close(stop) if !listenerTransformer.ok() { t.Errorf("%s: expected %v, got %v", listenerTransformer.name, listenerTransformer.expectedItemNames, listenerTransformer.receivedItemNames) } } func TestSharedInformerRemoveHandler(t *testing.T) { source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second) handler1 := &ResourceEventHandlerFuncs{} handle1, err := informer.AddEventHandler(handler1) if err != nil { t.Errorf("informer did not add handler1: %s", err) return } handler2 := &ResourceEventHandlerFuncs{} handle2, err := informer.AddEventHandler(handler2) if err != nil { t.Errorf("informer did not add handler2: %s", err) return } if eventHandlerCount(informer) != 2 { t.Errorf("informer has %d registered handler, instead of 2", eventHandlerCount(informer)) } if err := informer.RemoveEventHandler(handle2); err != nil { t.Errorf("removing of second pointer handler failed: %s", err) } if eventHandlerCount(informer) != 1 { t.Errorf("after removing handler informer has %d registered handler(s), instead of 1", eventHandlerCount(informer)) } if err := informer.RemoveEventHandler(handle1); err != nil { t.Errorf("removing of first pointer handler failed: %s", err) } if eventHandlerCount(informer) != 0 { t.Errorf("informer still has registered handlers after removing both handlers") } } func TestSharedInformerRemoveForeignHandler(t *testing.T) { source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) source2 := fcache.NewFakeControllerSource() source2.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) informer2 := NewSharedInformer(source2, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) handler1 := &ResourceEventHandlerFuncs{} handle1, err := informer.AddEventHandler(handler1) if err != nil { t.Errorf("informer did not add handler1: %s", err) return } handler2 := &ResourceEventHandlerFuncs{} handle2, err := informer.AddEventHandler(handler2) if err != nil { t.Errorf("informer did not add handler2: %s", err) return } if eventHandlerCount(informer) != 2 { t.Errorf("informer has %d registered handler, instead of 2", eventHandlerCount(informer)) } if eventHandlerCount(informer2) != 0 { t.Errorf("informer2 has %d registered handler, instead of 0", eventHandlerCount(informer2)) } // remove handle at foreign informer if isRegistered(informer2, handle1) { t.Errorf("handle1 registered for informer2") } if isRegistered(informer2, handle2) { t.Errorf("handle2 registered for informer2") } if err := informer2.RemoveEventHandler(handle1); err != nil { t.Errorf("removing of second pointer handler failed: %s", err) } if eventHandlerCount(informer) != 2 { t.Errorf("informer has %d registered handler, instead of 2", eventHandlerCount(informer)) } if eventHandlerCount(informer2) != 0 { t.Errorf("informer2 has %d registered handler, instead of 0", eventHandlerCount(informer2)) } if !isRegistered(informer, handle1) { t.Errorf("handle1 not registered anymore for informer") } if !isRegistered(informer, handle2) { t.Errorf("handle2 not registered anymore for informer") } if eventHandlerCount(informer) != 2 { t.Errorf("informer has %d registered handler, instead of 2", eventHandlerCount(informer)) } if eventHandlerCount(informer2) != 0 { t.Errorf("informer2 has %d registered handler, instead of 0", eventHandlerCount(informer2)) } if !isRegistered(informer, handle1) { t.Errorf("handle1 not registered anymore for informer") } if !isRegistered(informer, handle2) { t.Errorf("handle2 not registered anymore for informer") } if err := informer.RemoveEventHandler(handle2); err != nil { t.Errorf("removing of second pointer handler failed: %s", err) } if eventHandlerCount(informer) != 1 { t.Errorf("after removing handler informer has %d registered handler(s), instead of 1", eventHandlerCount(informer)) } if err := informer.RemoveEventHandler(handle1); err != nil { t.Errorf("removing of first pointer handler failed: %s", err) } if eventHandlerCount(informer) != 0 { t.Errorf("informer still has registered handlers after removing both handlers") } } func TestSharedInformerMultipleRegistration(t *testing.T) { source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) handler1 := &ResourceEventHandlerFuncs{} reg1, err := informer.AddEventHandler(handler1) if err != nil { t.Errorf("informer did not add handler for the first time: %s", err) return } if !isRegistered(informer, reg1) { t.Errorf("handle1 is not active after successful registration") return } reg2, err := informer.AddEventHandler(handler1) if err != nil { t.Errorf("informer did not add handler for the second: %s", err) return } if !isRegistered(informer, reg2) { t.Errorf("handle2 is not active after successful registration") return } if eventHandlerCount(informer) != 2 { t.Errorf("informer has %d registered handler(s), instead of 2", eventHandlerCount(informer)) } if err := informer.RemoveEventHandler(reg1); err != nil { t.Errorf("removing of duplicate handler registration failed: %s", err) } if isRegistered(informer, reg1) { t.Errorf("handle1 is still active after successful remove") return } if !isRegistered(informer, reg2) { t.Errorf("handle2 is not active after removing handle1") return } if eventHandlerCount(informer) != 1 { if eventHandlerCount(informer) == 0 { t.Errorf("informer has no registered handler anymore after removal of duplicate registrations") } else { t.Errorf("informer has unexpected number (%d) of handlers after removal of duplicate handler registration", eventHandlerCount(informer)) } } if err := informer.RemoveEventHandler(reg2); err != nil { t.Errorf("removing of second handler registration failed: %s", err) } if isRegistered(informer, reg2) { t.Errorf("handle2 is still active after successful remove") return } if eventHandlerCount(informer) != 0 { t.Errorf("informer has unexpected number (%d) of handlers after removal of second handler registrations", eventHandlerCount(informer)) } } func TestRemovingRemovedSharedInformer(t *testing.T) { source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) handler := &ResourceEventHandlerFuncs{} reg, err := informer.AddEventHandler(handler) if err != nil { t.Errorf("informer did not add handler for the first time: %s", err) return } if err := informer.RemoveEventHandler(reg); err != nil { t.Errorf("removing of handler registration failed: %s", err) return } if isRegistered(informer, reg) { t.Errorf("handle is still active after successful remove") return } if err := informer.RemoveEventHandler(reg); err != nil { t.Errorf("removing of already removed registration yields unexpected error: %s", err) } if isRegistered(informer, reg) { t.Errorf("handle is still active after second remove") return } } // Shows that many concurrent goroutines can be manipulating shared informer // listeners without tripping it up. There are not really many assertions in this // test. Meant to be run with -race to find race conditions func TestSharedInformerHandlerAbuse(t *testing.T) { source := fcache.NewFakeControllerSource() informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) ctx, cancel := context.WithCancel(context.Background()) informerCtx, informerCancel := context.WithCancel(context.Background()) go func() { informer.Run(informerCtx.Done()) cancel() }() worker := func() { // Keep adding and removing handler // Make sure no duplicate events? funcs := ResourceEventHandlerDetailedFuncs{ AddFunc: func(obj interface{}, isInInitialList bool) {}, UpdateFunc: func(oldObj, newObj interface{}) {}, DeleteFunc: func(obj interface{}) {}, } handles := []ResourceEventHandlerRegistration{} for { select { case <-ctx.Done(): return default: switch rand.Intn(2) { case 0: // Register handler again reg, err := informer.AddEventHandlerWithResyncPeriod(funcs, 1*time.Second) if err != nil { if strings.Contains(err.Error(), "stopped already") { // test is over return } t.Errorf("failed to add handler: %v", err) return } handles = append(handles, reg) case 1: // Remove a random handler if len(handles) == 0 { continue } idx := rand.Intn(len(handles)) err := informer.RemoveEventHandler(handles[idx]) if err != nil { if strings.Contains(err.Error(), "stopped already") { // test is over return } t.Errorf("failed to remove handler: %v", err) return } handles = append(handles[:idx], handles[idx+1:]...) } } } } wg := sync.WaitGroup{} for i := 0; i < 100; i++ { wg.Add(1) go func() { worker() wg.Done() }() } objs := []*v1.Pod{} // While workers run, randomly create events for the informer for i := 0; i < 10000; i++ { if len(objs) == 0 { // Make sure there is always an object obj := &v1.Pod{ObjectMeta: metav1.ObjectMeta{ Name: "pod" + strconv.Itoa(i), }} objs = append(objs, obj) // deep copy before adding since the Modify function mutates the obj source.Add(obj.DeepCopy()) } switch rand.Intn(3) { case 0: // Add Object obj := &v1.Pod{ObjectMeta: metav1.ObjectMeta{ Name: "pod" + strconv.Itoa(i), }} objs = append(objs, obj) source.Add(obj.DeepCopy()) case 1: // Update Object idx := rand.Intn(len(objs)) source.Modify(objs[idx].DeepCopy()) case 2: // Remove Object idx := rand.Intn(len(objs)) source.Delete(objs[idx].DeepCopy()) objs = append(objs[:idx], objs[idx+1:]...) } } // sotp informer which stops workers. stopping informer first to exercise // contention for informer while it is closing informerCancel() // wait for workers to finish since they may throw errors wg.Wait() } func TestStateSharedInformer(t *testing.T) { source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) listener := newTestListener("listener", 0, "pod1") informer.AddEventHandlerWithResyncPeriod(listener, listener.resyncPeriod) if isStarted(informer) { t.Errorf("informer already started after creation") return } if informer.IsStopped() { t.Errorf("informer already stopped after creation") return } stop := make(chan struct{}) go informer.Run(stop) if !listener.ok() { t.Errorf("informer did not report initial objects") close(stop) return } if !isStarted(informer) { t.Errorf("informer does not report to be started although handling events") close(stop) return } if informer.IsStopped() { t.Errorf("informer reports to be stopped although stop channel not closed") close(stop) return } close(stop) fmt.Println("sleeping") time.Sleep(1 * time.Second) if !informer.IsStopped() { t.Errorf("informer reports not to be stopped although stop channel closed") return } if !isStarted(informer) { t.Errorf("informer reports not to be started after it has been started and stopped") return } } func TestAddOnStoppedSharedInformer(t *testing.T) { source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) listener := newTestListener("listener", 0, "pod1") stop := make(chan struct{}) go informer.Run(stop) close(stop) err := wait.PollImmediate(100*time.Millisecond, 2*time.Second, func() (bool, error) { if informer.IsStopped() { return true, nil } return false, nil }) if err != nil { t.Errorf("informer reports not to be stopped although stop channel closed") return } _, err = informer.AddEventHandlerWithResyncPeriod(listener, listener.resyncPeriod) if err == nil { t.Errorf("stopped informer did not reject add handler") return } if !strings.HasSuffix(err.Error(), "was not added to shared informer because it has stopped already") { t.Errorf("adding handler to a stopped informer yields unexpected error: %s", err) return } } func TestRemoveOnStoppedSharedInformer(t *testing.T) { source := fcache.NewFakeControllerSource() source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) listener := newTestListener("listener", 0, "pod1") handle, err := informer.AddEventHandlerWithResyncPeriod(listener, listener.resyncPeriod) if err != nil { t.Errorf("informer did not add handler: %s", err) return } stop := make(chan struct{}) go informer.Run(stop) close(stop) fmt.Println("sleeping") time.Sleep(1 * time.Second) if !informer.IsStopped() { t.Errorf("informer reports not to be stopped although stop channel closed") return } err = informer.RemoveEventHandler(handle) if err != nil { t.Errorf("informer does not remove handler on stopped informer") return } } func TestRemoveWhileActive(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() // create the shared informer and resync every 12 hours informer := NewSharedInformer(source, &v1.Pod{}, 0).(*sharedIndexInformer) listener := newTestListener("listener", 0, "pod1") handle, _ := informer.AddEventHandler(listener) stop := make(chan struct{}) defer close(stop) go informer.Run(stop) source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) if !listener.ok() { t.Errorf("event did not occur") return } informer.RemoveEventHandler(handle) if isRegistered(informer, handle) { t.Errorf("handle is still active after successful remove") return } source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod2"}}) if !listener.ok() { t.Errorf("unexpected event occurred") return } } func TestAddWhileActive(t *testing.T) { // source simulates an apiserver object endpoint. source := fcache.NewFakeControllerSource() // create the shared informer and resync every 12 hours informer := NewSharedInformer(source, &v1.Pod{}, 0).(*sharedIndexInformer) listener1 := newTestListener("originalListener", 0, "pod1") listener2 := newTestListener("listener2", 0, "pod1", "pod2") handle1, _ := informer.AddEventHandler(listener1) if handle1.HasSynced() { t.Error("Synced before Run??") } stop := make(chan struct{}) defer close(stop) go informer.Run(stop) source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod1"}}) if !listener1.ok() { t.Errorf("events on listener1 did not occur") return } if !handle1.HasSynced() { t.Error("Not synced after Run??") } listener2.lock.Lock() // ensure we observe it before it has synced handle2, _ := informer.AddEventHandler(listener2) if handle2.HasSynced() { t.Error("Synced before processing anything?") } listener2.lock.Unlock() // permit it to proceed and sync source.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod2"}}) if !listener2.ok() { t.Errorf("event on listener2 did not occur") return } if !handle2.HasSynced() { t.Error("Not synced even after processing?") } if !isRegistered(informer, handle1) { t.Errorf("handle1 is not active") return } if !isRegistered(informer, handle2) { t.Errorf("handle2 is not active") return } listener1.expectedItemNames = listener2.expectedItemNames if !listener1.ok() { t.Errorf("events on listener1 did not occur") return } } kubernetes-client-go-a2dfcab/tools/cache/store.go000066400000000000000000000225431472614177300222740ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "strings" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Store is a generic object storage and processing interface. A // Store holds a map from string keys to accumulators, and has // operations to add, update, and delete a given object to/from the // accumulator currently associated with a given key. A Store also // knows how to extract the key from a given object, so many operations // are given only the object. // // In the simplest Store implementations each accumulator is simply // the last given object, or empty after Delete, and thus the Store's // behavior is simple storage. // // Reflector knows how to watch a server and update a Store. This // package provides a variety of implementations of Store. type Store interface { // Add adds the given object to the accumulator associated with the given object's key Add(obj interface{}) error // Update updates the given object in the accumulator associated with the given object's key Update(obj interface{}) error // Delete deletes the given object from the accumulator associated with the given object's key Delete(obj interface{}) error // List returns a list of all the currently non-empty accumulators List() []interface{} // ListKeys returns a list of all the keys currently associated with non-empty accumulators ListKeys() []string // Get returns the accumulator associated with the given object's key Get(obj interface{}) (item interface{}, exists bool, err error) // GetByKey returns the accumulator associated with the given key GetByKey(key string) (item interface{}, exists bool, err error) // Replace will delete the contents of the store, using instead the // given list. Store takes ownership of the list, you should not reference // it after calling this function. Replace([]interface{}, string) error // Resync is meaningless in the terms appearing here but has // meaning in some implementations that have non-trivial // additional behavior (e.g., DeltaFIFO). Resync() error } // KeyFunc knows how to make a key from an object. Implementations should be deterministic. type KeyFunc func(obj interface{}) (string, error) // KeyError will be returned any time a KeyFunc gives an error; it includes the object // at fault. type KeyError struct { Obj interface{} Err error } // Error gives a human-readable description of the error. func (k KeyError) Error() string { return fmt.Sprintf("couldn't create key for object %+v: %v", k.Obj, k.Err) } // Unwrap implements errors.Unwrap func (k KeyError) Unwrap() error { return k.Err } // ExplicitKey can be passed to MetaNamespaceKeyFunc if you have the key for // the object but not the object itself. type ExplicitKey string // MetaNamespaceKeyFunc is a convenient default KeyFunc which knows how to make // keys for API objects which implement meta.Interface. // The key uses the format / unless is empty, then // it's just . // // Clients that want a structured alternative can use ObjectToName or MetaObjectToName. // Note: this would not be a client that wants a key for a Store because those are // necessarily strings. // // TODO maybe some day?: change Store to be keyed differently func MetaNamespaceKeyFunc(obj interface{}) (string, error) { if key, ok := obj.(ExplicitKey); ok { return string(key), nil } objName, err := ObjectToName(obj) if err != nil { return "", err } return objName.String(), nil } // ObjectToName returns the structured name for the given object, // if indeed it can be viewed as a metav1.Object. func ObjectToName(obj interface{}) (ObjectName, error) { meta, err := meta.Accessor(obj) if err != nil { return ObjectName{}, fmt.Errorf("object has no meta: %v", err) } return MetaObjectToName(meta), nil } // MetaObjectToName returns the structured name for the given object func MetaObjectToName(obj metav1.Object) ObjectName { if len(obj.GetNamespace()) > 0 { return ObjectName{Namespace: obj.GetNamespace(), Name: obj.GetName()} } return ObjectName{Namespace: "", Name: obj.GetName()} } // SplitMetaNamespaceKey returns the namespace and name that // MetaNamespaceKeyFunc encoded into key. // // TODO: replace key-as-string with a key-as-struct so that this // packing/unpacking won't be necessary. func SplitMetaNamespaceKey(key string) (namespace, name string, err error) { parts := strings.Split(key, "/") switch len(parts) { case 1: // name only, no namespace return "", parts[0], nil case 2: // namespace and name return parts[0], parts[1], nil } return "", "", fmt.Errorf("unexpected key format: %q", key) } // `*cache` implements Indexer in terms of a ThreadSafeStore and an // associated KeyFunc. type cache struct { // cacheStorage bears the burden of thread safety for the cache cacheStorage ThreadSafeStore // keyFunc is used to make the key for objects stored in and retrieved from items, and // should be deterministic. keyFunc KeyFunc } var _ Store = &cache{} // Add inserts an item into the cache. func (c *cache) Add(obj interface{}) error { key, err := c.keyFunc(obj) if err != nil { return KeyError{obj, err} } c.cacheStorage.Add(key, obj) return nil } // Update sets an item in the cache to its updated state. func (c *cache) Update(obj interface{}) error { key, err := c.keyFunc(obj) if err != nil { return KeyError{obj, err} } c.cacheStorage.Update(key, obj) return nil } // Delete removes an item from the cache. func (c *cache) Delete(obj interface{}) error { key, err := c.keyFunc(obj) if err != nil { return KeyError{obj, err} } c.cacheStorage.Delete(key) return nil } // List returns a list of all the items. // List is completely threadsafe as long as you treat all items as immutable. func (c *cache) List() []interface{} { return c.cacheStorage.List() } // ListKeys returns a list of all the keys of the objects currently // in the cache. func (c *cache) ListKeys() []string { return c.cacheStorage.ListKeys() } // GetIndexers returns the indexers of cache func (c *cache) GetIndexers() Indexers { return c.cacheStorage.GetIndexers() } // Index returns a list of items that match on the index function // Index is thread-safe so long as you treat all items as immutable func (c *cache) Index(indexName string, obj interface{}) ([]interface{}, error) { return c.cacheStorage.Index(indexName, obj) } // IndexKeys returns the storage keys of the stored objects whose set of // indexed values for the named index includes the given indexed value. // The returned keys are suitable to pass to GetByKey(). func (c *cache) IndexKeys(indexName, indexedValue string) ([]string, error) { return c.cacheStorage.IndexKeys(indexName, indexedValue) } // ListIndexFuncValues returns the list of generated values of an Index func func (c *cache) ListIndexFuncValues(indexName string) []string { return c.cacheStorage.ListIndexFuncValues(indexName) } // ByIndex returns the stored objects whose set of indexed values // for the named index includes the given indexed value. func (c *cache) ByIndex(indexName, indexedValue string) ([]interface{}, error) { return c.cacheStorage.ByIndex(indexName, indexedValue) } func (c *cache) AddIndexers(newIndexers Indexers) error { return c.cacheStorage.AddIndexers(newIndexers) } // Get returns the requested item, or sets exists=false. // Get is completely threadsafe as long as you treat all items as immutable. func (c *cache) Get(obj interface{}) (item interface{}, exists bool, err error) { key, err := c.keyFunc(obj) if err != nil { return nil, false, KeyError{obj, err} } return c.GetByKey(key) } // GetByKey returns the request item, or exists=false. // GetByKey is completely threadsafe as long as you treat all items as immutable. func (c *cache) GetByKey(key string) (item interface{}, exists bool, err error) { item, exists = c.cacheStorage.Get(key) return item, exists, nil } // Replace will delete the contents of 'c', using instead the given list. // 'c' takes ownership of the list, you should not reference the list again // after calling this function. func (c *cache) Replace(list []interface{}, resourceVersion string) error { items := make(map[string]interface{}, len(list)) for _, item := range list { key, err := c.keyFunc(item) if err != nil { return KeyError{item, err} } items[key] = item } c.cacheStorage.Replace(items, resourceVersion) return nil } // Resync is meaningless for one of these func (c *cache) Resync() error { return nil } // NewStore returns a Store implemented simply with a map and a lock. func NewStore(keyFunc KeyFunc) Store { return &cache{ cacheStorage: NewThreadSafeStore(Indexers{}, Indices{}), keyFunc: keyFunc, } } // NewIndexer returns an Indexer implemented simply with a map and a lock. func NewIndexer(keyFunc KeyFunc, indexers Indexers) Indexer { return &cache{ cacheStorage: NewThreadSafeStore(indexers, Indices{}), keyFunc: keyFunc, } } kubernetes-client-go-a2dfcab/tools/cache/store_test.go000066400000000000000000000101001472614177300233150ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "errors" "testing" "k8s.io/apimachinery/pkg/util/sets" ) // Test public interface func doTestStore(t *testing.T, store Store) { mkObj := func(id string, val string) testStoreObject { return testStoreObject{id: id, val: val} } store.Add(mkObj("foo", "bar")) if item, ok, _ := store.Get(mkObj("foo", "")); !ok { t.Errorf("didn't find inserted item") } else { if e, a := "bar", item.(testStoreObject).val; e != a { t.Errorf("expected %v, got %v", e, a) } } store.Update(mkObj("foo", "baz")) if item, ok, _ := store.Get(mkObj("foo", "")); !ok { t.Errorf("didn't find inserted item") } else { if e, a := "baz", item.(testStoreObject).val; e != a { t.Errorf("expected %v, got %v", e, a) } } store.Delete(mkObj("foo", "")) if _, ok, _ := store.Get(mkObj("foo", "")); ok { t.Errorf("found deleted item??") } // Test List. store.Add(mkObj("a", "b")) store.Add(mkObj("c", "d")) store.Add(mkObj("e", "e")) { found := sets.String{} for _, item := range store.List() { found.Insert(item.(testStoreObject).val) } if !found.HasAll("b", "d", "e") { t.Errorf("missing items, found: %v", found) } if len(found) != 3 { t.Errorf("extra items") } } // Test Replace. store.Replace([]interface{}{ mkObj("foo", "foo"), mkObj("bar", "bar"), }, "0") { found := sets.String{} for _, item := range store.List() { found.Insert(item.(testStoreObject).val) } if !found.HasAll("foo", "bar") { t.Errorf("missing items") } if len(found) != 2 { t.Errorf("extra items") } } } // Test public interface func doTestIndex(t *testing.T, indexer Indexer) { mkObj := func(id string, val string) testStoreObject { return testStoreObject{id: id, val: val} } // Test Index expected := map[string]sets.String{} expected["b"] = sets.NewString("a", "c") expected["f"] = sets.NewString("e") expected["h"] = sets.NewString("g") indexer.Add(mkObj("a", "b")) indexer.Add(mkObj("c", "b")) indexer.Add(mkObj("e", "f")) indexer.Add(mkObj("g", "h")) { for k, v := range expected { found := sets.String{} indexResults, err := indexer.Index("by_val", mkObj("", k)) if err != nil { t.Errorf("Unexpected error %v", err) } for _, item := range indexResults { found.Insert(item.(testStoreObject).id) } items := v.List() if !found.HasAll(items...) { t.Errorf("missing items, index %s, expected %v but found %v", k, items, found.List()) } } } } func testStoreKeyFunc(obj interface{}) (string, error) { return obj.(testStoreObject).id, nil } func testStoreIndexFunc(obj interface{}) ([]string, error) { return []string{obj.(testStoreObject).val}, nil } func testStoreIndexers() Indexers { indexers := Indexers{} indexers["by_val"] = testStoreIndexFunc return indexers } type testStoreObject struct { id string val string } func TestCache(t *testing.T) { doTestStore(t, NewStore(testStoreKeyFunc)) } func TestFIFOCache(t *testing.T) { doTestStore(t, NewFIFO(testStoreKeyFunc)) } func TestUndeltaStore(t *testing.T) { nop := func([]interface{}) {} doTestStore(t, NewUndeltaStore(nop, testStoreKeyFunc)) } func TestIndex(t *testing.T) { doTestIndex(t, NewIndexer(testStoreKeyFunc, testStoreIndexers())) } func TestKeyError(t *testing.T) { obj := 100 err := errors.New("error") keyErr := KeyError{obj, err} if errors.Unwrap(keyErr) != err { t.Errorf("expected unwrap error: %v", err) } nestedKeyErr := KeyError{obj, keyErr} if !errors.Is(keyErr, err) || !errors.Is(nestedKeyErr, err) { t.Errorf("not match target error: %v", err) } } kubernetes-client-go-a2dfcab/tools/cache/synctrack/000077500000000000000000000000001472614177300226045ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/cache/synctrack/lazy.go000066400000000000000000000042731472614177300241200ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package synctrack import ( "sync" "sync/atomic" ) // Lazy defers the computation of `Evaluate` to when it is necessary. It is // possible that Evaluate will be called in parallel from multiple goroutines. type Lazy[T any] struct { Evaluate func() (T, error) cache atomic.Pointer[cacheEntry[T]] } type cacheEntry[T any] struct { eval func() (T, error) lock sync.RWMutex result *T } func (e *cacheEntry[T]) get() (T, error) { if cur := func() *T { e.lock.RLock() defer e.lock.RUnlock() return e.result }(); cur != nil { return *cur, nil } e.lock.Lock() defer e.lock.Unlock() if e.result != nil { return *e.result, nil } r, err := e.eval() if err == nil { e.result = &r } return r, err } func (z *Lazy[T]) newCacheEntry() *cacheEntry[T] { return &cacheEntry[T]{eval: z.Evaluate} } // Notify should be called when something has changed necessitating a new call // to Evaluate. func (z *Lazy[T]) Notify() { z.cache.Swap(z.newCacheEntry()) } // Get should be called to get the current result of a call to Evaluate. If the // current cached value is stale (due to a call to Notify), then Evaluate will // be called synchronously. If subsequent calls to Get happen (without another // Notify), they will all wait for the same return value. // // Error returns are not cached and will cause multiple calls to evaluate! func (z *Lazy[T]) Get() (T, error) { e := z.cache.Load() if e == nil { // Since we don't force a constructor, nil is a possible value. // If multiple Gets race to set this, the swap makes sure only // one wins. z.cache.CompareAndSwap(nil, z.newCacheEntry()) e = z.cache.Load() } return e.get() } kubernetes-client-go-a2dfcab/tools/cache/synctrack/lazy_test.go000066400000000000000000000140521472614177300251530ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package synctrack_test import ( "errors" "sync" "sync/atomic" "testing" "time" "k8s.io/client-go/tools/cache/synctrack" ) func TestLazy(t *testing.T) { var reality int64 var z synctrack.Lazy[int64] z.Evaluate = func() (int64, error) { return atomic.LoadInt64(&reality), nil } var wg sync.WaitGroup for i := 0; i < 10; i++ { wg.Add(1) go func(delay time.Duration) { defer wg.Done() for i := 0; i < 100; i++ { t.Helper() set := atomic.AddInt64(&reality, 1) z.Notify() got, err := z.Get() if err != nil { t.Errorf("unexpected error: %v", err) } if got < set { t.Errorf("time went backwards. %v vs %v", got, set) } time.Sleep(delay) } }((1 + time.Duration(i%3)) * time.Microsecond) } wg.Wait() } func TestLazyThroughput(t *testing.T) { var reality int64 var z synctrack.Lazy[int64] var totalWait int64 z.Evaluate = func() (int64, error) { got := atomic.LoadInt64(&reality) time.Sleep(11 * time.Millisecond) return got, nil } var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() notifies := 0 tt := time.NewTicker(10 * time.Millisecond) for { <-tt.C atomic.AddInt64(&reality, 1) z.Notify() notifies++ if notifies >= 100 { tt.Stop() return } wg.Add(1) go func() { t.Helper() defer wg.Done() start := time.Now() z.Get() d := time.Since(start) atomic.AddInt64(&totalWait, int64(d)) }() } }() wg.Wait() twd := time.Duration(totalWait) if twd > 3*time.Second { t.Errorf("total wait was: %v; par would be ~1s", twd) } } // sequence is for controlling the order various lines of code execute in. // Replaces a bunch of time.Sleep() calls that would certainly be flaky. type sequence []sync.WaitGroup func newSequence(n int) sequence { s := make(sequence, n) for i := range s { s[i].Add(1) } return s } func (s sequence) Start() { s[0].Done() } func (s sequence) Step(n int) { s[n].Wait() if n+1 < len(s) { s[n+1].Done() } } // asyncGet runs a goroutine to do the get so it doesn't block. func asyncGet[T any](t *testing.T, seq sequence, z *synctrack.Lazy[T], pre, post int) func() T { var wg sync.WaitGroup var val T wg.Add(1) go func() { defer wg.Done() t.Helper() var err error seq.Step(pre) val, err = z.Get() seq.Step(post) if err != nil { t.Errorf("unexpected error: %v", err) } }() return func() T { wg.Wait(); return val } } func TestLazySlowEval(t *testing.T) { // This tests the case where the first invocation of eval finishes // after a subseqent invocation. The old value should not be put into // the cache and returned. Nor should eval be called an extra time to // correct the old value having been placed into the cache. seq := newSequence(10) var getCount int64 var z synctrack.Lazy[int64] z.Evaluate = func() (int64, error) { count := atomic.AddInt64(&getCount, 1) if count == 1 { seq.Step(1) seq.Step(6) } else if count > 2 { t.Helper() t.Errorf("Eval called extra times. count=%v", count) } else { seq.Step(4) } return time.Now().UnixNano(), nil } seq.Start() getA := asyncGet(t, seq, &z, 0, 7) seq.Step(2) z.Notify() getB := asyncGet(t, seq, &z, 3, 5) getC := asyncGet(t, seq, &z, 8, 9) a, b, c := getA(), getB(), getC() if a < b { t.Errorf("failed to create the test condition") } if b != c && c == a { t.Errorf("wrong value was cached") } } func TestLazySlowEval2(t *testing.T) { // This tests the case where the first invocation of eval finishes // before a subseqent invocation. The old value should be overwritten. // Eval should not be called an extra time to correct the wrong value // having been placed into the cache. seq := newSequence(11) var getCount int64 var z synctrack.Lazy[int64] z.Evaluate = func() (int64, error) { count := atomic.AddInt64(&getCount, 1) if count == 1 { seq.Step(1) seq.Step(5) } else if count > 2 { t.Helper() t.Errorf("Eval called extra times. count=%v", count) } else { seq.Step(4) seq.Step(7) } return time.Now().UnixNano(), nil } seq.Start() getA := asyncGet(t, seq, &z, 0, 6) seq.Step(2) z.Notify() getB := asyncGet(t, seq, &z, 3, 8) getC := asyncGet(t, seq, &z, 9, 10) a, b, c := getA(), getB(), getC() if a > b { t.Errorf("failed to create the test condition") } if b != c && c == a { t.Errorf("wrong value was cached") } } func TestLazyOnlyOnce(t *testing.T) { // This demonstrates that multiple Gets don't cause multiple Evaluates. seq := newSequence(8) var getCount int64 var z synctrack.Lazy[int64] z.Evaluate = func() (int64, error) { count := atomic.AddInt64(&getCount, 1) if count == 1 { seq.Step(1) seq.Step(4) } else if count > 1 { t.Helper() t.Errorf("Eval called extra times. count=%v", count) } return time.Now().UnixNano(), nil } seq.Start() z.Notify() getA := asyncGet(t, seq, &z, 0, 5) getB := asyncGet(t, seq, &z, 2, 6) getC := asyncGet(t, seq, &z, 3, 7) a, b, c := getA(), getB(), getC() if a > b { t.Errorf("failed to create the test condition") } if b != c && c == a { t.Errorf("wrong value was cached") } } func TestLazyError(t *testing.T) { var succeed bool var z synctrack.Lazy[bool] z.Evaluate = func() (bool, error) { if succeed { return true, nil } else { return false, errors.New("deliberate fail") } } if _, err := z.Get(); err == nil { t.Fatalf("expected error") } // Note: no notify, proving the error was not cached succeed = true if _, err := z.Get(); err != nil { t.Fatalf("unexpected error") } } kubernetes-client-go-a2dfcab/tools/cache/synctrack/synctrack.go000066400000000000000000000102571472614177300251410ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package synctrack contains utilities for helping controllers track whether // they are "synced" or not, that is, whether they have processed all items // from the informer's initial list. package synctrack import ( "sync" "sync/atomic" "k8s.io/apimachinery/pkg/util/sets" ) // AsyncTracker helps propagate HasSynced in the face of multiple worker threads. type AsyncTracker[T comparable] struct { UpstreamHasSynced func() bool lock sync.Mutex waiting sets.Set[T] } // Start should be called prior to processing each key which is part of the // initial list. func (t *AsyncTracker[T]) Start(key T) { t.lock.Lock() defer t.lock.Unlock() if t.waiting == nil { t.waiting = sets.New[T](key) } else { t.waiting.Insert(key) } } // Finished should be called when finished processing a key which was part of // the initial list. Since keys are tracked individually, nothing bad happens // if you call Finished without a corresponding call to Start. This makes it // easier to use this in combination with e.g. queues which don't make it easy // to plumb through the isInInitialList boolean. func (t *AsyncTracker[T]) Finished(key T) { t.lock.Lock() defer t.lock.Unlock() if t.waiting != nil { t.waiting.Delete(key) } } // HasSynced returns true if the source is synced and every key present in the // initial list has been processed. This relies on the source not considering // itself synced until *after* it has delivered the notification for the last // key, and that notification handler must have called Start. func (t *AsyncTracker[T]) HasSynced() bool { // Call UpstreamHasSynced first: it might take a lock, which might take // a significant amount of time, and we can't hold our lock while // waiting on that or a user is likely to get a deadlock. if !t.UpstreamHasSynced() { return false } t.lock.Lock() defer t.lock.Unlock() return t.waiting.Len() == 0 } // SingleFileTracker helps propagate HasSynced when events are processed in // order (i.e. via a queue). type SingleFileTracker struct { // Important: count is used with atomic operations so it must be 64-bit // aligned, otherwise atomic operations will panic. Having it at the top of // the struct will guarantee that, even on 32-bit arches. // See https://pkg.go.dev/sync/atomic#pkg-note-BUG for more information. count int64 UpstreamHasSynced func() bool } // Start should be called prior to processing each key which is part of the // initial list. func (t *SingleFileTracker) Start() { atomic.AddInt64(&t.count, 1) } // Finished should be called when finished processing a key which was part of // the initial list. You must never call Finished() before (or without) its // corresponding Start(), that is a logic error that could cause HasSynced to // return a wrong value. To help you notice this should it happen, Finished() // will panic if the internal counter goes negative. func (t *SingleFileTracker) Finished() { result := atomic.AddInt64(&t.count, -1) if result < 0 { panic("synctrack: negative counter; this logic error means HasSynced may return incorrect value") } } // HasSynced returns true if the source is synced and every key present in the // initial list has been processed. This relies on the source not considering // itself synced until *after* it has delivered the notification for the last // key, and that notification handler must have called Start. func (t *SingleFileTracker) HasSynced() bool { // Call UpstreamHasSynced first: it might take a lock, which might take // a significant amount of time, and we don't want to then act on a // stale count value. if !t.UpstreamHasSynced() { return false } return atomic.LoadInt64(&t.count) <= 0 } kubernetes-client-go-a2dfcab/tools/cache/synctrack/synctrack_test.go000066400000000000000000000124111472614177300261720ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package synctrack import ( "strings" "sync" "time" "testing" ) func testSingleFileFuncs(upstreamHasSynced func() bool) (start func(), finished func(), hasSynced func() bool) { tracker := SingleFileTracker{ UpstreamHasSynced: upstreamHasSynced, } return tracker.Start, tracker.Finished, tracker.HasSynced } func testAsyncFuncs(upstreamHasSynced func() bool) (start func(), finished func(), hasSynced func() bool) { tracker := AsyncTracker[string]{ UpstreamHasSynced: upstreamHasSynced, } return func() { tracker.Start("key") }, func() { tracker.Finished("key") }, tracker.HasSynced } func TestBasicLogic(t *testing.T) { table := []struct { name string construct func(func() bool) (func(), func(), func() bool) }{ {"SingleFile", testSingleFileFuncs}, {"Async", testAsyncFuncs}, } for _, entry := range table { t.Run(entry.name, func(t *testing.T) { table := []struct { synced bool start bool finish bool expectSynced bool }{ {false, true, true, false}, {true, true, false, false}, {false, true, false, false}, {true, true, true, true}, } for _, tt := range table { Start, Finished, HasSynced := entry.construct(func() bool { return tt.synced }) if tt.start { Start() } if tt.finish { Finished() } got := HasSynced() if e, a := tt.expectSynced, got; e != a { t.Errorf("for %#v got %v (wanted %v)", tt, a, e) } } }) } } func TestAsyncLocking(t *testing.T) { aft := AsyncTracker[int]{UpstreamHasSynced: func() bool { return true }} var wg sync.WaitGroup for _, i := range []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} { wg.Add(1) go func(i int) { aft.Start(i) go func() { aft.Finished(i) wg.Done() }() }(i) } wg.Wait() if !aft.HasSynced() { t.Errorf("async tracker must have made a threading error?") } } func TestSingleFileCounting(t *testing.T) { sft := SingleFileTracker{UpstreamHasSynced: func() bool { return true }} for i := 0; i < 100; i++ { sft.Start() } if sft.HasSynced() { t.Fatal("Unexpectedly synced?") } for i := 0; i < 99; i++ { sft.Finished() } if sft.HasSynced() { t.Fatal("Unexpectedly synced?") } sft.Finished() if !sft.HasSynced() { t.Fatal("Unexpectedly not synced?") } // Calling an extra time will panic. func() { defer func() { x := recover() if x == nil { t.Error("no panic?") return } msg, ok := x.(string) if !ok { t.Errorf("unexpected panic value: %v", x) return } if !strings.Contains(msg, "negative counter") { t.Errorf("unexpected panic message: %v", msg) return } }() sft.Finished() }() // Negative counter still means it is synced if !sft.HasSynced() { t.Fatal("Unexpectedly not synced?") } } func TestSingleFile(t *testing.T) { table := []struct { synced bool starts int stops int expectSynced bool }{ {false, 1, 1, false}, {true, 1, 0, false}, {false, 1, 0, false}, {true, 1, 1, true}, } for _, tt := range table { sft := SingleFileTracker{UpstreamHasSynced: func() bool { return tt.synced }} for i := 0; i < tt.starts; i++ { sft.Start() } for i := 0; i < tt.stops; i++ { sft.Finished() } got := sft.HasSynced() if e, a := tt.expectSynced, got; e != a { t.Errorf("for %#v got %v (wanted %v)", tt, a, e) } } } func TestNoStaleValue(t *testing.T) { table := []struct { name string construct func(func() bool) (func(), func(), func() bool) }{ {"SingleFile", testSingleFileFuncs}, {"Async", testAsyncFuncs}, } for _, entry := range table { t.Run(entry.name, func(t *testing.T) { var lock sync.Mutex upstreamHasSynced := func() bool { lock.Lock() defer lock.Unlock() return true } Start, Finished, HasSynced := entry.construct(upstreamHasSynced) // Ordinarily the corresponding lock would be held and you wouldn't be // able to call this function at this point. if !HasSynced() { t.Fatal("Unexpectedly not synced??") } Start() if HasSynced() { t.Fatal("Unexpectedly synced??") } Finished() if !HasSynced() { t.Fatal("Unexpectedly not synced??") } // Now we will prove that if the lock is held, you can't get a false // HasSynced return. lock.Lock() // This goroutine calls HasSynced var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() if HasSynced() { t.Error("Unexpectedly synced??") } }() // This goroutine increments + unlocks. The sleep is to bias the // runtime such that the other goroutine usually wins (it needs to work // in both orderings, this one is more likely to be buggy). go func() { time.Sleep(time.Millisecond) Start() lock.Unlock() }() wg.Wait() }) } } kubernetes-client-go-a2dfcab/tools/cache/testing/000077500000000000000000000000001472614177300222605ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/cache/testing/fake_controller_source.go000066400000000000000000000212151472614177300273410ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package framework import ( "errors" "fmt" "math/rand" "strconv" "sync" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" ) func NewFakeControllerSource() *FakeControllerSource { return &FakeControllerSource{ Items: map[nnu]runtime.Object{}, Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), } } func NewFakePVControllerSource() *FakePVControllerSource { return &FakePVControllerSource{ FakeControllerSource{ Items: map[nnu]runtime.Object{}, Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), }} } func NewFakePVCControllerSource() *FakePVCControllerSource { return &FakePVCControllerSource{ FakeControllerSource{ Items: map[nnu]runtime.Object{}, Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), }} } // FakeControllerSource implements listing/watching for testing. type FakeControllerSource struct { lock sync.RWMutex Items map[nnu]runtime.Object changes []watch.Event // one change per resourceVersion Broadcaster *watch.Broadcaster lastRV int // Set this to simulate an error on List() ListError error } type FakePVControllerSource struct { FakeControllerSource } type FakePVCControllerSource struct { FakeControllerSource } // namespace, name, uid to be used as a key. type nnu struct { namespace, name string uid types.UID } // ResetWatch simulates connection problems; creates a new Broadcaster and flushes // the change queue so that clients have to re-list and watch. func (f *FakeControllerSource) ResetWatch() { f.lock.Lock() defer f.lock.Unlock() f.Broadcaster.Shutdown() f.Broadcaster = watch.NewBroadcaster(100, watch.WaitIfChannelFull) f.changes = []watch.Event{} } // Add adds an object to the set and sends an add event to watchers. // obj's ResourceVersion is set. func (f *FakeControllerSource) Add(obj runtime.Object) { f.Change(watch.Event{Type: watch.Added, Object: obj}, 1) } // Modify updates an object in the set and sends a modified event to watchers. // obj's ResourceVersion is set. func (f *FakeControllerSource) Modify(obj runtime.Object) { f.Change(watch.Event{Type: watch.Modified, Object: obj}, 1) } // Delete deletes an object from the set and sends a delete event to watchers. // obj's ResourceVersion is set. func (f *FakeControllerSource) Delete(lastValue runtime.Object) { f.Change(watch.Event{Type: watch.Deleted, Object: lastValue}, 1) } // AddDropWatch adds an object to the set but forgets to send an add event to // watchers. // obj's ResourceVersion is set. func (f *FakeControllerSource) AddDropWatch(obj runtime.Object) { f.Change(watch.Event{Type: watch.Added, Object: obj}, 0) } // ModifyDropWatch updates an object in the set but forgets to send a modify // event to watchers. // obj's ResourceVersion is set. func (f *FakeControllerSource) ModifyDropWatch(obj runtime.Object) { f.Change(watch.Event{Type: watch.Modified, Object: obj}, 0) } // DeleteDropWatch deletes an object from the set but forgets to send a delete // event to watchers. // obj's ResourceVersion is set. func (f *FakeControllerSource) DeleteDropWatch(lastValue runtime.Object) { f.Change(watch.Event{Type: watch.Deleted, Object: lastValue}, 0) } func (f *FakeControllerSource) key(accessor metav1.Object) nnu { return nnu{accessor.GetNamespace(), accessor.GetName(), accessor.GetUID()} } // Change records the given event (setting the object's resource version) and // sends a watch event with the specified probability. func (f *FakeControllerSource) Change(e watch.Event, watchProbability float64) { f.lock.Lock() defer f.lock.Unlock() accessor, err := meta.Accessor(e.Object) if err != nil { panic(err) // this is test code only } f.lastRV += 1 accessor.SetResourceVersion(strconv.Itoa(f.lastRV)) f.changes = append(f.changes, e) key := f.key(accessor) switch e.Type { case watch.Added, watch.Modified: f.Items[key] = e.Object case watch.Deleted: delete(f.Items, key) } if rand.Float64() < watchProbability { f.Broadcaster.Action(e.Type, e.Object) } } func (f *FakeControllerSource) getListItemsLocked() ([]runtime.Object, error) { list := make([]runtime.Object, 0, len(f.Items)) for _, obj := range f.Items { // Must make a copy to allow clients to modify the object. // Otherwise, if they make a change and write it back, they // will inadvertently change our canonical copy (in // addition to racing with other clients). list = append(list, obj.DeepCopyObject()) } return list, nil } // List returns a list object, with its resource version set. func (f *FakeControllerSource) List(options metav1.ListOptions) (runtime.Object, error) { f.lock.RLock() defer f.lock.RUnlock() if f.ListError != nil { return nil, f.ListError } list, err := f.getListItemsLocked() if err != nil { return nil, err } listObj := &v1.List{} if err := meta.SetList(listObj, list); err != nil { return nil, err } listAccessor, err := meta.ListAccessor(listObj) if err != nil { return nil, err } listAccessor.SetResourceVersion(strconv.Itoa(f.lastRV)) return listObj, nil } // List returns a list object, with its resource version set. func (f *FakePVControllerSource) List(options metav1.ListOptions) (runtime.Object, error) { f.lock.RLock() defer f.lock.RUnlock() list, err := f.FakeControllerSource.getListItemsLocked() if err != nil { return nil, err } listObj := &v1.PersistentVolumeList{} if err := meta.SetList(listObj, list); err != nil { return nil, err } listAccessor, err := meta.ListAccessor(listObj) if err != nil { return nil, err } listAccessor.SetResourceVersion(strconv.Itoa(f.lastRV)) return listObj, nil } // List returns a list object, with its resource version set. func (f *FakePVCControllerSource) List(options metav1.ListOptions) (runtime.Object, error) { f.lock.RLock() defer f.lock.RUnlock() list, err := f.FakeControllerSource.getListItemsLocked() if err != nil { return nil, err } listObj := &v1.PersistentVolumeClaimList{} if err := meta.SetList(listObj, list); err != nil { return nil, err } listAccessor, err := meta.ListAccessor(listObj) if err != nil { return nil, err } listAccessor.SetResourceVersion(strconv.Itoa(f.lastRV)) return listObj, nil } // Watch returns a watch, which will be pre-populated with all changes // after resourceVersion. func (f *FakeControllerSource) Watch(options metav1.ListOptions) (watch.Interface, error) { f.lock.RLock() defer f.lock.RUnlock() rc, err := strconv.Atoi(options.ResourceVersion) if err != nil { return nil, err } if rc < f.lastRV { // if the change queue was flushed... if len(f.changes) == 0 { return nil, apierrors.NewResourceExpired(fmt.Sprintf("too old resource version: %d (%d)", rc, f.lastRV)) } // get the RV of the oldest object in the change queue oldestRV, err := meta.NewAccessor().ResourceVersion(f.changes[0].Object) if err != nil { panic(err) } oldestRC, err := strconv.Atoi(oldestRV) if err != nil { panic(err) } if rc < oldestRC { return nil, apierrors.NewResourceExpired(fmt.Sprintf("too old resource version: %d (%d)", rc, oldestRC)) } changes := []watch.Event{} for _, c := range f.changes[rc-oldestRC+1:] { // Must make a copy to allow clients to modify the // object. Otherwise, if they make a change and write // it back, they will inadvertently change the our // canonical copy (in addition to racing with other // clients). changes = append(changes, watch.Event{Type: c.Type, Object: c.Object.DeepCopyObject()}) } return f.Broadcaster.WatchWithPrefix(changes) } else if rc > f.lastRV { return nil, errors.New("resource version in the future not supported by this fake") } return f.Broadcaster.Watch() } // Shutdown closes the underlying broadcaster, waiting for events to be // delivered. It's an error to call any method after calling shutdown. This is // enforced by Shutdown() leaving f locked. func (f *FakeControllerSource) Shutdown() { f.lock.Lock() // Purposely no unlock. f.Broadcaster.Shutdown() } kubernetes-client-go-a2dfcab/tools/cache/testing/fake_controller_source_test.go000066400000000000000000000065471472614177300304130ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package framework import ( "sync" "testing" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/watch" ) // ensure the watch delivers the requested and only the requested items. func consume(t *testing.T, w watch.Interface, rvs []string, done *sync.WaitGroup) { defer done.Done() for _, rv := range rvs { got, ok := <-w.ResultChan() if !ok { t.Errorf("%#v: unexpected channel close, wanted %v", rvs, rv) return } gotRV := got.Object.(*v1.Pod).ObjectMeta.ResourceVersion if e, a := rv, gotRV; e != a { t.Errorf("wanted %v, got %v", e, a) } else { t.Logf("Got %v as expected", gotRV) } } // We should not get anything else. got, open := <-w.ResultChan() if open { t.Errorf("%#v: unwanted object %#v", rvs, got) } } func TestRCNumber(t *testing.T) { pod := func(name string) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, } } wg := &sync.WaitGroup{} wg.Add(3) source := NewFakeControllerSource() source.Add(pod("foo")) source.Modify(pod("foo")) source.Modify(pod("foo")) w, err := source.Watch(metav1.ListOptions{ResourceVersion: "1"}) if err != nil { t.Fatalf("Unexpected error: %v", err) } go consume(t, w, []string{"2", "3"}, wg) list, err := source.List(metav1.ListOptions{}) if err != nil { t.Fatalf("Unexpected error: %v", err) } if e, a := "3", list.(*v1.List).ResourceVersion; e != a { t.Errorf("wanted %v, got %v", e, a) } w2, err := source.Watch(metav1.ListOptions{ResourceVersion: "2"}) if err != nil { t.Fatalf("Unexpected error: %v", err) } go consume(t, w2, []string{"3"}, wg) w3, err := source.Watch(metav1.ListOptions{ResourceVersion: "3"}) if err != nil { t.Fatalf("Unexpected error: %v", err) } go consume(t, w3, []string{}, wg) source.Shutdown() wg.Wait() } // TestResetWatch validates that the FakeController correctly mocks a watch // falling behind and ResourceVersions aging out. func TestResetWatch(t *testing.T) { pod := func(name string) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, } } wg := &sync.WaitGroup{} wg.Add(1) source := NewFakeControllerSource() source.Add(pod("foo")) // RV = 1 source.Modify(pod("foo")) // RV = 2 source.Modify(pod("foo")) // RV = 3 // Kill watch, delete change history source.ResetWatch() // This should fail, RV=1 was lost with ResetWatch _, err := source.Watch(metav1.ListOptions{ResourceVersion: "1"}) if err == nil { t.Fatalf("Unexpected non-error") } // This should succeed, RV=3 is current w, err := source.Watch(metav1.ListOptions{ResourceVersion: "3"}) if err != nil { t.Fatalf("Unexpected error: %v", err) } // Modify again, ensure the watch is still working source.Modify(pod("foo")) go consume(t, w, []string{"4"}, wg) source.Shutdown() wg.Wait() } kubernetes-client-go-a2dfcab/tools/cache/thread_safe_store.go000066400000000000000000000254331472614177300246220ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "sync" "k8s.io/apimachinery/pkg/util/sets" ) // ThreadSafeStore is an interface that allows concurrent indexed // access to a storage backend. It is like Indexer but does not // (necessarily) know how to extract the Store key from a given // object. // // TL;DR caveats: you must not modify anything returned by Get or List as it will break // the indexing feature in addition to not being thread safe. // // The guarantees of thread safety provided by List/Get are only valid if the caller // treats returned items as read-only. For example, a pointer inserted in the store // through `Add` will be returned as is by `Get`. Multiple clients might invoke `Get` // on the same key and modify the pointer in a non-thread-safe way. Also note that // modifying objects stored by the indexers (if any) will *not* automatically lead // to a re-index. So it's not a good idea to directly modify the objects returned by // Get/List, in general. type ThreadSafeStore interface { Add(key string, obj interface{}) Update(key string, obj interface{}) Delete(key string) Get(key string) (item interface{}, exists bool) List() []interface{} ListKeys() []string Replace(map[string]interface{}, string) Index(indexName string, obj interface{}) ([]interface{}, error) IndexKeys(indexName, indexedValue string) ([]string, error) ListIndexFuncValues(name string) []string ByIndex(indexName, indexedValue string) ([]interface{}, error) GetIndexers() Indexers // AddIndexers adds more indexers to this store. This supports adding indexes after the store already has items. AddIndexers(newIndexers Indexers) error // Resync is a no-op and is deprecated Resync() error } // storeIndex implements the indexing functionality for Store interface type storeIndex struct { // indexers maps a name to an IndexFunc indexers Indexers // indices maps a name to an Index indices Indices } func (i *storeIndex) reset() { i.indices = Indices{} } func (i *storeIndex) getKeysFromIndex(indexName string, obj interface{}) (sets.String, error) { indexFunc := i.indexers[indexName] if indexFunc == nil { return nil, fmt.Errorf("Index with name %s does not exist", indexName) } indexedValues, err := indexFunc(obj) if err != nil { return nil, err } index := i.indices[indexName] var storeKeySet sets.String if len(indexedValues) == 1 { // In majority of cases, there is exactly one value matching. // Optimize the most common path - deduping is not needed here. storeKeySet = index[indexedValues[0]] } else { // Need to de-dupe the return list. // Since multiple keys are allowed, this can happen. storeKeySet = sets.String{} for _, indexedValue := range indexedValues { for key := range index[indexedValue] { storeKeySet.Insert(key) } } } return storeKeySet, nil } func (i *storeIndex) getKeysByIndex(indexName, indexedValue string) (sets.String, error) { indexFunc := i.indexers[indexName] if indexFunc == nil { return nil, fmt.Errorf("Index with name %s does not exist", indexName) } index := i.indices[indexName] return index[indexedValue], nil } func (i *storeIndex) getIndexValues(indexName string) []string { index := i.indices[indexName] names := make([]string, 0, len(index)) for key := range index { names = append(names, key) } return names } func (i *storeIndex) addIndexers(newIndexers Indexers) error { oldKeys := sets.StringKeySet(i.indexers) newKeys := sets.StringKeySet(newIndexers) if oldKeys.HasAny(newKeys.List()...) { return fmt.Errorf("indexer conflict: %v", oldKeys.Intersection(newKeys)) } for k, v := range newIndexers { i.indexers[k] = v } return nil } // updateSingleIndex modifies the objects location in the named index: // - for create you must provide only the newObj // - for update you must provide both the oldObj and the newObj // - for delete you must provide only the oldObj // updateSingleIndex must be called from a function that already has a lock on the cache func (i *storeIndex) updateSingleIndex(name string, oldObj interface{}, newObj interface{}, key string) { var oldIndexValues, indexValues []string indexFunc, ok := i.indexers[name] if !ok { // Should never happen. Caller is responsible for ensuring this exists, and should call with lock // held to avoid any races. panic(fmt.Errorf("indexer %q does not exist", name)) } if oldObj != nil { var err error oldIndexValues, err = indexFunc(oldObj) if err != nil { panic(fmt.Errorf("unable to calculate an index entry for key %q on index %q: %v", key, name, err)) } } else { oldIndexValues = oldIndexValues[:0] } if newObj != nil { var err error indexValues, err = indexFunc(newObj) if err != nil { panic(fmt.Errorf("unable to calculate an index entry for key %q on index %q: %v", key, name, err)) } } else { indexValues = indexValues[:0] } index := i.indices[name] if index == nil { index = Index{} i.indices[name] = index } if len(indexValues) == 1 && len(oldIndexValues) == 1 && indexValues[0] == oldIndexValues[0] { // We optimize for the most common case where indexFunc returns a single value which has not been changed return } for _, value := range oldIndexValues { i.deleteKeyFromIndex(key, value, index) } for _, value := range indexValues { i.addKeyToIndex(key, value, index) } } // updateIndices modifies the objects location in the managed indexes: // - for create you must provide only the newObj // - for update you must provide both the oldObj and the newObj // - for delete you must provide only the oldObj // updateIndices must be called from a function that already has a lock on the cache func (i *storeIndex) updateIndices(oldObj interface{}, newObj interface{}, key string) { for name := range i.indexers { i.updateSingleIndex(name, oldObj, newObj, key) } } func (i *storeIndex) addKeyToIndex(key, indexValue string, index Index) { set := index[indexValue] if set == nil { set = sets.String{} index[indexValue] = set } set.Insert(key) } func (i *storeIndex) deleteKeyFromIndex(key, indexValue string, index Index) { set := index[indexValue] if set == nil { return } set.Delete(key) // If we don't delete the set when zero, indices with high cardinality // short lived resources can cause memory to increase over time from // unused empty sets. See `kubernetes/kubernetes/issues/84959`. if len(set) == 0 { delete(index, indexValue) } } // threadSafeMap implements ThreadSafeStore type threadSafeMap struct { lock sync.RWMutex items map[string]interface{} // index implements the indexing functionality index *storeIndex } func (c *threadSafeMap) Add(key string, obj interface{}) { c.Update(key, obj) } func (c *threadSafeMap) Update(key string, obj interface{}) { c.lock.Lock() defer c.lock.Unlock() oldObject := c.items[key] c.items[key] = obj c.index.updateIndices(oldObject, obj, key) } func (c *threadSafeMap) Delete(key string) { c.lock.Lock() defer c.lock.Unlock() if obj, exists := c.items[key]; exists { c.index.updateIndices(obj, nil, key) delete(c.items, key) } } func (c *threadSafeMap) Get(key string) (item interface{}, exists bool) { c.lock.RLock() defer c.lock.RUnlock() item, exists = c.items[key] return item, exists } func (c *threadSafeMap) List() []interface{} { c.lock.RLock() defer c.lock.RUnlock() list := make([]interface{}, 0, len(c.items)) for _, item := range c.items { list = append(list, item) } return list } // ListKeys returns a list of all the keys of the objects currently // in the threadSafeMap. func (c *threadSafeMap) ListKeys() []string { c.lock.RLock() defer c.lock.RUnlock() list := make([]string, 0, len(c.items)) for key := range c.items { list = append(list, key) } return list } func (c *threadSafeMap) Replace(items map[string]interface{}, resourceVersion string) { c.lock.Lock() defer c.lock.Unlock() c.items = items // rebuild any index c.index.reset() for key, item := range c.items { c.index.updateIndices(nil, item, key) } } // Index returns a list of items that match the given object on the index function. // Index is thread-safe so long as you treat all items as immutable. func (c *threadSafeMap) Index(indexName string, obj interface{}) ([]interface{}, error) { c.lock.RLock() defer c.lock.RUnlock() storeKeySet, err := c.index.getKeysFromIndex(indexName, obj) if err != nil { return nil, err } list := make([]interface{}, 0, storeKeySet.Len()) for storeKey := range storeKeySet { list = append(list, c.items[storeKey]) } return list, nil } // ByIndex returns a list of the items whose indexed values in the given index include the given indexed value func (c *threadSafeMap) ByIndex(indexName, indexedValue string) ([]interface{}, error) { c.lock.RLock() defer c.lock.RUnlock() set, err := c.index.getKeysByIndex(indexName, indexedValue) if err != nil { return nil, err } list := make([]interface{}, 0, set.Len()) for key := range set { list = append(list, c.items[key]) } return list, nil } // IndexKeys returns a list of the Store keys of the objects whose indexed values in the given index include the given indexed value. // IndexKeys is thread-safe so long as you treat all items as immutable. func (c *threadSafeMap) IndexKeys(indexName, indexedValue string) ([]string, error) { c.lock.RLock() defer c.lock.RUnlock() set, err := c.index.getKeysByIndex(indexName, indexedValue) if err != nil { return nil, err } return set.List(), nil } func (c *threadSafeMap) ListIndexFuncValues(indexName string) []string { c.lock.RLock() defer c.lock.RUnlock() return c.index.getIndexValues(indexName) } func (c *threadSafeMap) GetIndexers() Indexers { return c.index.indexers } func (c *threadSafeMap) AddIndexers(newIndexers Indexers) error { c.lock.Lock() defer c.lock.Unlock() if err := c.index.addIndexers(newIndexers); err != nil { return err } // If there are already items, index them for key, item := range c.items { for name := range newIndexers { c.index.updateSingleIndex(name, nil, item, key) } } return nil } func (c *threadSafeMap) Resync() error { // Nothing to do return nil } // NewThreadSafeStore creates a new instance of ThreadSafeStore. func NewThreadSafeStore(indexers Indexers, indices Indices) ThreadSafeStore { return &threadSafeMap{ items: map[string]interface{}{}, index: &storeIndex{ indexers: indexers, indices: indices, }, } } kubernetes-client-go-a2dfcab/tools/cache/thread_safe_store_test.go000066400000000000000000000125701472614177300256570ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "strings" "testing" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" ) func TestThreadSafeStoreDeleteRemovesEmptySetsFromIndex(t *testing.T) { testIndexer := "testIndexer" indexers := Indexers{ testIndexer: func(obj interface{}) (strings []string, e error) { indexes := []string{obj.(string)} return indexes, nil }, } indices := Indices{} store := NewThreadSafeStore(indexers, indices).(*threadSafeMap) testKey := "testKey" store.Add(testKey, testKey) // Assumption check, there should be a set for the `testKey` with one element in the added index set := store.index.indices[testIndexer][testKey] if len(set) != 1 { t.Errorf("Initial assumption of index backing string set having 1 element failed. Actual elements: %d", len(set)) return } store.Delete(testKey) set, present := store.index.indices[testIndexer][testKey] if present { t.Errorf("Index backing string set not deleted from index. Set length: %d", len(set)) } } func TestThreadSafeStoreAddKeepsNonEmptySetPostDeleteFromIndex(t *testing.T) { testIndexer := "testIndexer" testIndex := "testIndex" indexers := Indexers{ testIndexer: func(obj interface{}) (strings []string, e error) { indexes := []string{testIndex} return indexes, nil }, } indices := Indices{} store := NewThreadSafeStore(indexers, indices).(*threadSafeMap) store.Add("retain", "retain") store.Add("delete", "delete") // Assumption check, there should be a set for the `testIndex` with two elements set := store.index.indices[testIndexer][testIndex] if len(set) != 2 { t.Errorf("Initial assumption of index backing string set having 2 elements failed. Actual elements: %d", len(set)) return } store.Delete("delete") set, present := store.index.indices[testIndexer][testIndex] if !present { t.Errorf("Index backing string set erroneously deleted from index.") return } if len(set) != 1 { t.Errorf("Index backing string set has incorrect length, expect 1. Set length: %d", len(set)) } } func TestThreadSafeStoreIndexingFunctionsWithMultipleValues(t *testing.T) { testIndexer := "testIndexer" indexers := Indexers{ testIndexer: func(obj interface{}) ([]string, error) { return strings.Split(obj.(string), ","), nil }, } indices := Indices{} store := NewThreadSafeStore(indexers, indices).(*threadSafeMap) store.Add("key1", "foo") store.Add("key2", "bar") assert := assert.New(t) compare := func(key string, expected []string) error { values := store.index.indices[testIndexer][key].List() if cmp.Equal(values, expected) { return nil } return fmt.Errorf("unexpected index for key %s, diff=%s", key, cmp.Diff(values, expected)) } assert.NoError(compare("foo", []string{"key1"})) assert.NoError(compare("bar", []string{"key2"})) store.Update("key2", "foo,bar") assert.NoError(compare("foo", []string{"key1", "key2"})) assert.NoError(compare("bar", []string{"key2"})) store.Update("key1", "foo,bar") assert.NoError(compare("foo", []string{"key1", "key2"})) assert.NoError(compare("bar", []string{"key1", "key2"})) store.Add("key3", "foo,bar,baz") assert.NoError(compare("foo", []string{"key1", "key2", "key3"})) assert.NoError(compare("bar", []string{"key1", "key2", "key3"})) assert.NoError(compare("baz", []string{"key3"})) store.Update("key1", "foo") assert.NoError(compare("foo", []string{"key1", "key2", "key3"})) assert.NoError(compare("bar", []string{"key2", "key3"})) assert.NoError(compare("baz", []string{"key3"})) store.Update("key2", "bar") assert.NoError(compare("foo", []string{"key1", "key3"})) assert.NoError(compare("bar", []string{"key2", "key3"})) assert.NoError(compare("baz", []string{"key3"})) store.Delete("key1") assert.NoError(compare("foo", []string{"key3"})) assert.NoError(compare("bar", []string{"key2", "key3"})) assert.NoError(compare("baz", []string{"key3"})) store.Delete("key3") assert.NoError(compare("foo", []string{})) assert.NoError(compare("bar", []string{"key2"})) assert.NoError(compare("baz", []string{})) } func BenchmarkIndexer(b *testing.B) { testIndexer := "testIndexer" indexers := Indexers{ testIndexer: func(obj interface{}) (strings []string, e error) { indexes := []string{obj.(string)} return indexes, nil }, } indices := Indices{} store := NewThreadSafeStore(indexers, indices).(*threadSafeMap) // The following benchmark imitates what is happening in indexes // used in storage layer, where indexing is mostly static (e.g. // indexing objects by their (namespace, name)). // The 5000 number imitates indexing nodes in 5000-node cluster. objectCount := 5000 objects := make([]string, 0, 5000) for i := 0; i < objectCount; i++ { objects = append(objects, fmt.Sprintf("object-number-%d", i)) } b.ResetTimer() for i := 0; i < b.N; i++ { store.Update(objects[i%objectCount], objects[i%objectCount]) } } kubernetes-client-go-a2dfcab/tools/cache/undelta_store.go000066400000000000000000000065441472614177300240130ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache // UndeltaStore listens to incremental updates and sends complete state on every change. // It implements the Store interface so that it can receive a stream of mirrored objects // from Reflector. Whenever it receives any complete (Store.Replace) or incremental change // (Store.Add, Store.Update, Store.Delete), it sends the complete state by calling PushFunc. // It is thread-safe. It guarantees that every change (Add, Update, Replace, Delete) results // in one call to PushFunc, but sometimes PushFunc may be called twice with the same values. // PushFunc should be thread safe. type UndeltaStore struct { Store PushFunc func([]interface{}) } // Assert that it implements the Store interface. var _ Store = &UndeltaStore{} // Add inserts an object into the store and sends complete state by calling PushFunc. // Note about thread safety. The Store implementation (cache.cache) uses a lock for all methods. // In the functions below, the lock gets released and reacquired betweend the {Add,Delete,etc} // and the List. So, the following can happen, resulting in two identical calls to PushFunc. // time thread 1 thread 2 // 0 UndeltaStore.Add(a) // 1 UndeltaStore.Add(b) // 2 Store.Add(a) // 3 Store.Add(b) // 4 Store.List() -> [a,b] // 5 Store.List() -> [a,b] func (u *UndeltaStore) Add(obj interface{}) error { if err := u.Store.Add(obj); err != nil { return err } u.PushFunc(u.Store.List()) return nil } // Update sets an item in the cache to its updated state and sends complete state by calling PushFunc. func (u *UndeltaStore) Update(obj interface{}) error { if err := u.Store.Update(obj); err != nil { return err } u.PushFunc(u.Store.List()) return nil } // Delete removes an item from the cache and sends complete state by calling PushFunc. func (u *UndeltaStore) Delete(obj interface{}) error { if err := u.Store.Delete(obj); err != nil { return err } u.PushFunc(u.Store.List()) return nil } // Replace will delete the contents of current store, using instead the given list. // 'u' takes ownership of the list, you should not reference the list again // after calling this function. // The new contents complete state will be sent by calling PushFunc after replacement. func (u *UndeltaStore) Replace(list []interface{}, resourceVersion string) error { if err := u.Store.Replace(list, resourceVersion); err != nil { return err } u.PushFunc(u.Store.List()) return nil } // NewUndeltaStore returns an UndeltaStore implemented with a Store. func NewUndeltaStore(pushFunc func([]interface{}), keyFunc KeyFunc) *UndeltaStore { return &UndeltaStore{ Store: NewStore(keyFunc), PushFunc: pushFunc, } } kubernetes-client-go-a2dfcab/tools/cache/undelta_store_test.go000066400000000000000000000056661472614177300250560ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "reflect" "testing" ) // store_test.go checks that UndeltaStore conforms to the Store interface // behavior. This test just tests that it calls the push func in addition. type testUndeltaObject struct { name string val interface{} } func testUndeltaKeyFunc(obj interface{}) (string, error) { return obj.(testUndeltaObject).name, nil } /* var ( o1 interface{} = t{1} o2 interface{} = t{2} l1 []interface{} = []interface{}{t{1}} ) */ func TestUpdateCallsPush(t *testing.T) { mkObj := func(name string, val interface{}) testUndeltaObject { return testUndeltaObject{name: name, val: val} } var got []interface{} var callcount = 0 push := func(m []interface{}) { callcount++ got = m } u := NewUndeltaStore(push, testUndeltaKeyFunc) u.Add(mkObj("a", 2)) u.Update(mkObj("a", 1)) if callcount != 2 { t.Errorf("Expected 2 calls, got %d", callcount) } l := []interface{}{mkObj("a", 1)} if !reflect.DeepEqual(l, got) { t.Errorf("Expected %#v, Got %#v", l, got) } } func TestDeleteCallsPush(t *testing.T) { mkObj := func(name string, val interface{}) testUndeltaObject { return testUndeltaObject{name: name, val: val} } var got []interface{} var callcount = 0 push := func(m []interface{}) { callcount++ got = m } u := NewUndeltaStore(push, testUndeltaKeyFunc) u.Add(mkObj("a", 2)) u.Delete(mkObj("a", "")) if callcount != 2 { t.Errorf("Expected 2 calls, got %d", callcount) } expected := []interface{}{} if !reflect.DeepEqual(expected, got) { t.Errorf("Expected %#v, Got %#v", expected, got) } } func TestReadsDoNotCallPush(t *testing.T) { push := func(m []interface{}) { t.Errorf("Unexpected call to push!") } u := NewUndeltaStore(push, testUndeltaKeyFunc) // These should not call push. _ = u.List() _, _, _ = u.Get(testUndeltaObject{"a", ""}) } func TestReplaceCallsPush(t *testing.T) { mkObj := func(name string, val interface{}) testUndeltaObject { return testUndeltaObject{name: name, val: val} } var got []interface{} var callcount = 0 push := func(m []interface{}) { callcount++ got = m } u := NewUndeltaStore(push, testUndeltaKeyFunc) m := []interface{}{mkObj("a", 1)} u.Replace(m, "0") if callcount != 1 { t.Errorf("Expected 1 calls, got %d", callcount) } expected := []interface{}{mkObj("a", 1)} if !reflect.DeepEqual(expected, got) { t.Errorf("Expected %#v, Got %#v", expected, got) } } kubernetes-client-go-a2dfcab/tools/clientcmd/000077500000000000000000000000001472614177300215025ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/clientcmd/api/000077500000000000000000000000001472614177300222535ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/clientcmd/api/doc.go000066400000000000000000000012261472614177300233500ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:deepcopy-gen=package package api // import "k8s.io/client-go/tools/clientcmd/api" kubernetes-client-go-a2dfcab/tools/clientcmd/api/helpers.go000066400000000000000000000155101472614177300242460ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package api import ( "encoding/base64" "errors" "fmt" "os" "path/filepath" "reflect" "strings" ) func init() { sDec, _ := base64.StdEncoding.DecodeString("REDACTED+") redactedBytes = []byte(string(sDec)) sDec, _ = base64.StdEncoding.DecodeString("DATA+OMITTED") dataOmittedBytes = []byte(string(sDec)) } // IsConfigEmpty returns true if the config is empty. func IsConfigEmpty(config *Config) bool { return len(config.AuthInfos) == 0 && len(config.Clusters) == 0 && len(config.Contexts) == 0 && len(config.CurrentContext) == 0 && len(config.Preferences.Extensions) == 0 && !config.Preferences.Colors && len(config.Extensions) == 0 } // MinifyConfig read the current context and uses that to keep only the relevant pieces of config // This is useful for making secrets based on kubeconfig files func MinifyConfig(config *Config) error { if len(config.CurrentContext) == 0 { return errors.New("current-context must exist in order to minify") } currContext, exists := config.Contexts[config.CurrentContext] if !exists { return fmt.Errorf("cannot locate context %v", config.CurrentContext) } newContexts := map[string]*Context{} newContexts[config.CurrentContext] = currContext newClusters := map[string]*Cluster{} if len(currContext.Cluster) > 0 { if _, exists := config.Clusters[currContext.Cluster]; !exists { return fmt.Errorf("cannot locate cluster %v", currContext.Cluster) } newClusters[currContext.Cluster] = config.Clusters[currContext.Cluster] } newAuthInfos := map[string]*AuthInfo{} if len(currContext.AuthInfo) > 0 { if _, exists := config.AuthInfos[currContext.AuthInfo]; !exists { return fmt.Errorf("cannot locate user %v", currContext.AuthInfo) } newAuthInfos[currContext.AuthInfo] = config.AuthInfos[currContext.AuthInfo] } config.AuthInfos = newAuthInfos config.Clusters = newClusters config.Contexts = newContexts return nil } var ( dataOmittedBytes []byte redactedBytes []byte ) // ShortenConfig redacts raw data entries from the config object for a human-readable view. func ShortenConfig(config *Config) { // trick json encoder into printing a human-readable string in the raw data // by base64 decoding what we want to print. Relies on implementation of // http://golang.org/pkg/encoding/json/#Marshal using base64 to encode []byte for key, authInfo := range config.AuthInfos { if len(authInfo.ClientKeyData) > 0 { authInfo.ClientKeyData = dataOmittedBytes } if len(authInfo.ClientCertificateData) > 0 { authInfo.ClientCertificateData = dataOmittedBytes } if len(authInfo.Token) > 0 { authInfo.Token = "REDACTED" } config.AuthInfos[key] = authInfo } for key, cluster := range config.Clusters { if len(cluster.CertificateAuthorityData) > 0 { cluster.CertificateAuthorityData = dataOmittedBytes } config.Clusters[key] = cluster } } // FlattenConfig changes the config object into a self-contained config (useful for making secrets) func FlattenConfig(config *Config) error { for key, authInfo := range config.AuthInfos { baseDir, err := MakeAbs(filepath.Dir(authInfo.LocationOfOrigin), "") if err != nil { return err } if err := FlattenContent(&authInfo.ClientCertificate, &authInfo.ClientCertificateData, baseDir); err != nil { return err } if err := FlattenContent(&authInfo.ClientKey, &authInfo.ClientKeyData, baseDir); err != nil { return err } config.AuthInfos[key] = authInfo } for key, cluster := range config.Clusters { baseDir, err := MakeAbs(filepath.Dir(cluster.LocationOfOrigin), "") if err != nil { return err } if err := FlattenContent(&cluster.CertificateAuthority, &cluster.CertificateAuthorityData, baseDir); err != nil { return err } config.Clusters[key] = cluster } return nil } func FlattenContent(path *string, contents *[]byte, baseDir string) error { if len(*path) != 0 { if len(*contents) > 0 { return errors.New("cannot have values for both path and contents") } var err error absPath := ResolvePath(*path, baseDir) *contents, err = os.ReadFile(absPath) if err != nil { return err } *path = "" } return nil } // ResolvePath returns the path as an absolute paths, relative to the given base directory func ResolvePath(path string, base string) string { // Don't resolve empty paths if len(path) > 0 { // Don't resolve absolute paths if !filepath.IsAbs(path) { return filepath.Join(base, path) } } return path } func MakeAbs(path, base string) (string, error) { if filepath.IsAbs(path) { return path, nil } if len(base) == 0 { cwd, err := os.Getwd() if err != nil { return "", err } base = cwd } return filepath.Join(base, path), nil } // RedactSecrets replaces any sensitive values with REDACTED func RedactSecrets(config *Config) error { return redactSecrets(reflect.ValueOf(config), false) } func redactSecrets(curr reflect.Value, redact bool) error { redactedBytes = []byte("REDACTED") if !curr.IsValid() { return nil } actualCurrValue := curr if curr.Kind() == reflect.Ptr { actualCurrValue = curr.Elem() } switch actualCurrValue.Kind() { case reflect.Map: for _, v := range actualCurrValue.MapKeys() { err := redactSecrets(actualCurrValue.MapIndex(v), false) if err != nil { return err } } return nil case reflect.String: if redact { if !actualCurrValue.IsZero() { actualCurrValue.SetString("REDACTED") } } return nil case reflect.Slice: if actualCurrValue.Type() == reflect.TypeOf([]byte{}) && redact { if !actualCurrValue.IsNil() { actualCurrValue.SetBytes(redactedBytes) } return nil } for i := 0; i < actualCurrValue.Len(); i++ { err := redactSecrets(actualCurrValue.Index(i), false) if err != nil { return err } } return nil case reflect.Struct: for fieldIndex := 0; fieldIndex < actualCurrValue.NumField(); fieldIndex++ { currFieldValue := actualCurrValue.Field(fieldIndex) currFieldType := actualCurrValue.Type().Field(fieldIndex) currYamlTag := currFieldType.Tag.Get("datapolicy") currFieldTypeYamlName := strings.Split(currYamlTag, ",")[0] if currFieldTypeYamlName != "" { err := redactSecrets(currFieldValue, true) if err != nil { return err } } else { err := redactSecrets(currFieldValue, false) if err != nil { return err } } } return nil default: return nil } } kubernetes-client-go-a2dfcab/tools/clientcmd/api/helpers_test.go000066400000000000000000000304411472614177300253050ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package api import ( "bytes" "fmt" "os" "reflect" "testing" utiltesting "k8s.io/client-go/util/testing" "sigs.k8s.io/yaml" ) func newMergedConfig(certFile, certContent, keyFile, keyContent, caFile, caContent string, t *testing.T) Config { if err := os.WriteFile(certFile, []byte(certContent), 0644); err != nil { t.Errorf("unexpected error: %v", err) } if err := os.WriteFile(keyFile, []byte(keyContent), 0600); err != nil { t.Errorf("unexpected error: %v", err) } if err := os.WriteFile(caFile, []byte(caContent), 0644); err != nil { t.Errorf("unexpected error: %v", err) } return Config{ AuthInfos: map[string]*AuthInfo{ "red-user": {Token: "red-token", ClientCertificateData: []byte(certContent), ClientKeyData: []byte(keyContent)}, "blue-user": {Token: "blue-token", ClientCertificate: certFile, ClientKey: keyFile}}, Clusters: map[string]*Cluster{ "cow-cluster": {Server: "http://cow.org:8080", CertificateAuthorityData: []byte(caContent)}, "chicken-cluster": {Server: "http://chicken.org:8080", CertificateAuthority: caFile}}, Contexts: map[string]*Context{ "federal-context": {AuthInfo: "red-user", Cluster: "cow-cluster"}, "shaker-context": {AuthInfo: "blue-user", Cluster: "chicken-cluster"}}, CurrentContext: "federal-context", } } func TestMinifySuccess(t *testing.T) { certFile, _ := os.CreateTemp("", "") keyFile, _ := os.CreateTemp("", "") caFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, certFile, keyFile, caFile) mutatingConfig := newMergedConfig(certFile.Name(), "cert", keyFile.Name(), "key", caFile.Name(), "ca", t) if err := MinifyConfig(&mutatingConfig); err != nil { t.Errorf("unexpected error: %v", err) } if len(mutatingConfig.Contexts) > 1 { t.Errorf("unexpected contexts: %v", mutatingConfig.Contexts) } if _, exists := mutatingConfig.Contexts["federal-context"]; !exists { t.Errorf("missing context") } if len(mutatingConfig.Clusters) > 1 { t.Errorf("unexpected clusters: %v", mutatingConfig.Clusters) } if _, exists := mutatingConfig.Clusters["cow-cluster"]; !exists { t.Errorf("missing cluster") } if len(mutatingConfig.AuthInfos) > 1 { t.Errorf("unexpected users: %v", mutatingConfig.AuthInfos) } if _, exists := mutatingConfig.AuthInfos["red-user"]; !exists { t.Errorf("missing user") } } func TestMinifyMissingContext(t *testing.T) { certFile, _ := os.CreateTemp("", "") keyFile, _ := os.CreateTemp("", "") caFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, certFile, keyFile, caFile) mutatingConfig := newMergedConfig(certFile.Name(), "cert", keyFile.Name(), "key", caFile.Name(), "ca", t) mutatingConfig.CurrentContext = "missing" errMsg := "cannot locate context missing" if err := MinifyConfig(&mutatingConfig); err == nil || err.Error() != errMsg { t.Errorf("expected %v, got %v", errMsg, err) } } func TestMinifyMissingCluster(t *testing.T) { certFile, _ := os.CreateTemp("", "") keyFile, _ := os.CreateTemp("", "") caFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, certFile, keyFile, caFile) mutatingConfig := newMergedConfig(certFile.Name(), "cert", keyFile.Name(), "key", caFile.Name(), "ca", t) delete(mutatingConfig.Clusters, mutatingConfig.Contexts[mutatingConfig.CurrentContext].Cluster) errMsg := "cannot locate cluster cow-cluster" if err := MinifyConfig(&mutatingConfig); err == nil || err.Error() != errMsg { t.Errorf("expected %v, got %v", errMsg, err) } } func TestMinifyMissingAuthInfo(t *testing.T) { certFile, _ := os.CreateTemp("", "") keyFile, _ := os.CreateTemp("", "") caFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, certFile, keyFile, caFile) mutatingConfig := newMergedConfig(certFile.Name(), "cert", keyFile.Name(), "key", caFile.Name(), "ca", t) delete(mutatingConfig.AuthInfos, mutatingConfig.Contexts[mutatingConfig.CurrentContext].AuthInfo) errMsg := "cannot locate user red-user" if err := MinifyConfig(&mutatingConfig); err == nil || err.Error() != errMsg { t.Errorf("expected %v, got %v", errMsg, err) } } func TestFlattenSuccess(t *testing.T) { certFile, _ := os.CreateTemp("", "") keyFile, _ := os.CreateTemp("", "") caFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, certFile, keyFile, caFile) certData := "cert" keyData := "key" caData := "ca" unchangingCluster := "cow-cluster" unchangingAuthInfo := "red-user" changingCluster := "chicken-cluster" changingAuthInfo := "blue-user" startingConfig := newMergedConfig(certFile.Name(), certData, keyFile.Name(), keyData, caFile.Name(), caData, t) mutatingConfig := startingConfig if err := FlattenConfig(&mutatingConfig); err != nil { t.Errorf("unexpected error: %v", err) } if len(mutatingConfig.Contexts) != 2 { t.Errorf("unexpected contexts: %v", mutatingConfig.Contexts) } if !reflect.DeepEqual(startingConfig.Contexts, mutatingConfig.Contexts) { t.Errorf("expected %v, got %v", startingConfig.Contexts, mutatingConfig.Contexts) } if len(mutatingConfig.Clusters) != 2 { t.Errorf("unexpected clusters: %v", mutatingConfig.Clusters) } if !reflect.DeepEqual(startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) { t.Errorf("expected %v, got %v", startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) } if len(mutatingConfig.Clusters[changingCluster].CertificateAuthority) != 0 { t.Errorf("unexpected caFile") } if string(mutatingConfig.Clusters[changingCluster].CertificateAuthorityData) != caData { t.Errorf("expected %v, got %v", caData, string(mutatingConfig.Clusters[changingCluster].CertificateAuthorityData)) } if len(mutatingConfig.AuthInfos) != 2 { t.Errorf("unexpected users: %v", mutatingConfig.AuthInfos) } if !reflect.DeepEqual(startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) { t.Errorf("expected %v, got %v", startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) } if len(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificate) != 0 { t.Errorf("unexpected caFile") } if string(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificateData) != certData { t.Errorf("expected %v, got %v", certData, string(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificateData)) } if len(mutatingConfig.AuthInfos[changingAuthInfo].ClientKey) != 0 { t.Errorf("unexpected caFile") } if string(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData) != keyData { t.Errorf("expected %v, got %v", keyData, string(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData)) } } func Example_minifyAndShorten() { certFile, _ := os.CreateTemp("", "") keyFile, _ := os.CreateTemp("", "") caFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(&testing.T{}, certFile, keyFile, caFile) certData := "cert" keyData := "key" caData := "ca" config := newMergedConfig(certFile.Name(), certData, keyFile.Name(), keyData, caFile.Name(), caData, nil) MinifyConfig(&config) ShortenConfig(&config) output, _ := yaml.Marshal(config) fmt.Printf("%s", string(output)) // Output: // clusters: // cow-cluster: // certificate-authority-data: DATA+OMITTED // server: http://cow.org:8080 // contexts: // federal-context: // cluster: cow-cluster // user: red-user // current-context: federal-context // preferences: {} // users: // red-user: // client-certificate-data: DATA+OMITTED // client-key-data: DATA+OMITTED // token: REDACTED } func TestShortenSuccess(t *testing.T) { certFile, _ := os.CreateTemp("", "") keyFile, _ := os.CreateTemp("", "") caFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, certFile, keyFile, caFile) certData := "cert" keyData := "key" caData := "ca" unchangingCluster := "chicken-cluster" unchangingAuthInfo := "blue-user" changingCluster := "cow-cluster" changingAuthInfo := "red-user" startingConfig := newMergedConfig(certFile.Name(), certData, keyFile.Name(), keyData, caFile.Name(), caData, t) mutatingConfig := startingConfig ShortenConfig(&mutatingConfig) if len(mutatingConfig.Contexts) != 2 { t.Errorf("unexpected contexts: %v", mutatingConfig.Contexts) } if !reflect.DeepEqual(startingConfig.Contexts, mutatingConfig.Contexts) { t.Errorf("expected %v, got %v", startingConfig.Contexts, mutatingConfig.Contexts) } dataOmitted := string(dataOmittedBytes) if len(mutatingConfig.Clusters) != 2 { t.Errorf("unexpected clusters: %v", mutatingConfig.Clusters) } if !reflect.DeepEqual(startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) { t.Errorf("expected %v, got %v", startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) } if string(mutatingConfig.Clusters[changingCluster].CertificateAuthorityData) != dataOmitted { t.Errorf("expected %v, got %v", dataOmitted, string(mutatingConfig.Clusters[changingCluster].CertificateAuthorityData)) } if len(mutatingConfig.AuthInfos) != 2 { t.Errorf("unexpected users: %v", mutatingConfig.AuthInfos) } if !reflect.DeepEqual(startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) { t.Errorf("expected %v, got %v", startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) } if string(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificateData) != dataOmitted { t.Errorf("expected %v, got %v", dataOmitted, string(mutatingConfig.AuthInfos[changingAuthInfo].ClientCertificateData)) } if string(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData) != dataOmitted { t.Errorf("expected %v, got %v", dataOmitted, string(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData)) } if mutatingConfig.AuthInfos[changingAuthInfo].Token != "REDACTED" { t.Errorf("expected REDACTED, got %q", mutatingConfig.AuthInfos[changingAuthInfo].Token) } } func TestRedactSecrets(t *testing.T) { certFile, _ := os.CreateTemp("", "") defer os.Remove(certFile.Name()) keyFile, _ := os.CreateTemp("", "") defer os.Remove(keyFile.Name()) caFile, _ := os.CreateTemp("", "") defer os.Remove(caFile.Name()) certData := "cert" keyData := "key" caData := "ca" unchangingCluster := "chicken-cluster" unchangingAuthInfo := "blue-user" changingAuthInfo := "red-user" startingConfig := newMergedConfig(certFile.Name(), certData, keyFile.Name(), keyData, caFile.Name(), caData, t) mutatingConfig := startingConfig err := RedactSecrets(&mutatingConfig) if err != nil { t.Errorf("unexpected error redacting secrets:\n%v", err) } if len(mutatingConfig.Contexts) != 2 { t.Errorf("unexpected contexts: %v", mutatingConfig.Contexts) } if !reflect.DeepEqual(startingConfig.Contexts, mutatingConfig.Contexts) { t.Errorf("expected %v, got %v", startingConfig.Contexts, mutatingConfig.Contexts) } if len(mutatingConfig.Clusters) != 2 { t.Errorf("unexpected clusters: %v", mutatingConfig.Clusters) } if !reflect.DeepEqual(startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) { t.Errorf("expected %v, got %v", startingConfig.Clusters[unchangingCluster], mutatingConfig.Clusters[unchangingCluster]) } if len(mutatingConfig.AuthInfos) != 2 { t.Errorf("unexpected users: %v", mutatingConfig.AuthInfos) } if !reflect.DeepEqual(startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) { t.Errorf("expected %v, got %v", startingConfig.AuthInfos[unchangingAuthInfo], mutatingConfig.AuthInfos[unchangingAuthInfo]) } if mutatingConfig.AuthInfos[changingAuthInfo].Token != "REDACTED" { t.Errorf("expected REDACTED, got %v", mutatingConfig.AuthInfos[changingAuthInfo].Token) } if !bytes.Equal(mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData, []byte("REDACTED")) { t.Errorf("expected REDACTED, got %s", mutatingConfig.AuthInfos[changingAuthInfo].ClientKeyData) } } kubernetes-client-go-a2dfcab/tools/clientcmd/api/latest/000077500000000000000000000000001472614177300235475ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/clientcmd/api/latest/latest.go000066400000000000000000000037631472614177300254030ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package latest import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/apimachinery/pkg/runtime/serializer/versioning" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/tools/clientcmd/api/v1" ) // Version is the string that represents the current external default version. const Version = "v1" var ExternalVersion = schema.GroupVersion{Group: "", Version: "v1"} // OldestVersion is the string that represents the oldest server version supported, // for client code that wants to hardcode the lowest common denominator. const OldestVersion = "v1" // Versions is the list of versions that are recognized in code. The order provided // may be assumed to be least feature rich to most feature rich, and clients may // choose to prefer the latter items in the list over the former items when presented // with a set of versions to choose. var Versions = []string{"v1"} var ( Codec runtime.Codec Scheme *runtime.Scheme ) func init() { Scheme = runtime.NewScheme() utilruntime.Must(api.AddToScheme(Scheme)) utilruntime.Must(v1.AddToScheme(Scheme)) yamlSerializer := json.NewYAMLSerializer(json.DefaultMetaFactory, Scheme, Scheme) Codec = versioning.NewDefaultingCodecForScheme( Scheme, yamlSerializer, yamlSerializer, schema.GroupVersion{Version: Version}, runtime.InternalGroupVersioner, ) } kubernetes-client-go-a2dfcab/tools/clientcmd/api/register.go000066400000000000000000000026421472614177300244320ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package api import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // SchemeGroupVersion is group version used to register these objects // TODO this should be in the "kubeconfig" group var SchemeGroupVersion = schema.GroupVersion{Group: "", Version: runtime.APIVersionInternal} var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &Config{}, ) return nil } func (obj *Config) GetObjectKind() schema.ObjectKind { return obj } func (obj *Config) SetGroupVersionKind(gvk schema.GroupVersionKind) { obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind() } func (obj *Config) GroupVersionKind() schema.GroupVersionKind { return schema.FromAPIVersionAndKind(obj.APIVersion, obj.Kind) } kubernetes-client-go-a2dfcab/tools/clientcmd/api/types.go000066400000000000000000000417351472614177300237600ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package api import ( "fmt" "k8s.io/apimachinery/pkg/runtime" ) // Where possible, json tags match the cli argument names. // Top level config objects and all values required for proper functioning are not "omitempty". Any truly optional piece of config is allowed to be omitted. // Config holds the information needed to build connect to remote kubernetes clusters as a given user // IMPORTANT if you add fields to this struct, please update IsConfigEmpty() // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Config struct { // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. // +k8s:conversion-gen=false // +optional Kind string `json:"kind,omitempty"` // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. // +k8s:conversion-gen=false // +optional APIVersion string `json:"apiVersion,omitempty"` // Preferences holds general information to be use for cli interactions Preferences Preferences `json:"preferences"` // Clusters is a map of referencable names to cluster configs Clusters map[string]*Cluster `json:"clusters"` // AuthInfos is a map of referencable names to user configs AuthInfos map[string]*AuthInfo `json:"users"` // Contexts is a map of referencable names to context configs Contexts map[string]*Context `json:"contexts"` // CurrentContext is the name of the context that you would like to use by default CurrentContext string `json:"current-context"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]runtime.Object `json:"extensions,omitempty"` } // IMPORTANT if you add fields to this struct, please update IsConfigEmpty() type Preferences struct { // +optional Colors bool `json:"colors,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]runtime.Object `json:"extensions,omitempty"` } // Cluster contains information about how to communicate with a kubernetes cluster type Cluster struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. // +k8s:conversion-gen=false LocationOfOrigin string `json:"-"` // Server is the address of the kubernetes cluster (https://hostname:port). Server string `json:"server"` // TLSServerName is used to check server certificate. If TLSServerName is empty, the hostname used to contact the server is used. // +optional TLSServerName string `json:"tls-server-name,omitempty"` // InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure. // +optional InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"` // CertificateAuthority is the path to a cert file for the certificate authority. // +optional CertificateAuthority string `json:"certificate-authority,omitempty"` // CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority // +optional CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"` // ProxyURL is the URL to the proxy to be used for all requests made by this // client. URLs with "http", "https", and "socks5" schemes are supported. If // this configuration is not provided or the empty string, the client // attempts to construct a proxy configuration from http_proxy and // https_proxy environment variables. If these environment variables are not // set, the client does not attempt to proxy requests. // // socks5 proxying does not currently support spdy streaming endpoints (exec, // attach, port forward). // +optional ProxyURL string `json:"proxy-url,omitempty"` // DisableCompression allows client to opt-out of response compression for all requests to the server. This is useful // to speed up requests (specifically lists) when client-server network bandwidth is ample, by saving time on // compression (server-side) and decompression (client-side): https://github.com/kubernetes/kubernetes/issues/112296. // +optional DisableCompression bool `json:"disable-compression,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]runtime.Object `json:"extensions,omitempty"` } // AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are. type AuthInfo struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. // +k8s:conversion-gen=false LocationOfOrigin string `json:"-"` // ClientCertificate is the path to a client cert file for TLS. // +optional ClientCertificate string `json:"client-certificate,omitempty"` // ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate // +optional ClientCertificateData []byte `json:"client-certificate-data,omitempty"` // ClientKey is the path to a client key file for TLS. // +optional ClientKey string `json:"client-key,omitempty"` // ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey // +optional ClientKeyData []byte `json:"client-key-data,omitempty" datapolicy:"security-key"` // Token is the bearer token for authentication to the kubernetes cluster. // +optional Token string `json:"token,omitempty" datapolicy:"token"` // TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence. // +optional TokenFile string `json:"tokenFile,omitempty"` // Impersonate is the username to act-as. // +optional Impersonate string `json:"act-as,omitempty"` // ImpersonateUID is the uid to impersonate. // +optional ImpersonateUID string `json:"act-as-uid,omitempty"` // ImpersonateGroups is the groups to impersonate. // +optional ImpersonateGroups []string `json:"act-as-groups,omitempty"` // ImpersonateUserExtra contains additional information for impersonated user. // +optional ImpersonateUserExtra map[string][]string `json:"act-as-user-extra,omitempty"` // Username is the username for basic authentication to the kubernetes cluster. // +optional Username string `json:"username,omitempty"` // Password is the password for basic authentication to the kubernetes cluster. // +optional Password string `json:"password,omitempty" datapolicy:"password"` // AuthProvider specifies a custom authentication plugin for the kubernetes cluster. // +optional AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"` // Exec specifies a custom exec-based authentication plugin for the kubernetes cluster. // +optional Exec *ExecConfig `json:"exec,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]runtime.Object `json:"extensions,omitempty"` } // Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with) type Context struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. // +k8s:conversion-gen=false LocationOfOrigin string `json:"-"` // Cluster is the name of the cluster for this context Cluster string `json:"cluster"` // AuthInfo is the name of the authInfo for this context AuthInfo string `json:"user"` // Namespace is the default namespace to use on unspecified requests // +optional Namespace string `json:"namespace,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]runtime.Object `json:"extensions,omitempty"` } // AuthProviderConfig holds the configuration for a specified auth provider. type AuthProviderConfig struct { Name string `json:"name"` // +optional Config map[string]string `json:"config,omitempty"` } var _ fmt.Stringer = new(AuthProviderConfig) var _ fmt.GoStringer = new(AuthProviderConfig) // GoString implements fmt.GoStringer and sanitizes sensitive fields of // AuthProviderConfig to prevent accidental leaking via logs. func (c AuthProviderConfig) GoString() string { return c.String() } // String implements fmt.Stringer and sanitizes sensitive fields of // AuthProviderConfig to prevent accidental leaking via logs. func (c AuthProviderConfig) String() string { cfg := "" if c.Config != nil { cfg = "--- REDACTED ---" } return fmt.Sprintf("api.AuthProviderConfig{Name: %q, Config: map[string]string{%s}}", c.Name, cfg) } // ExecConfig specifies a command to provide client credentials. The command is exec'd // and outputs structured stdout holding credentials. // // See the client.authentication.k8s.io API group for specifications of the exact input // and output format type ExecConfig struct { // Command to execute. Command string `json:"command"` // Arguments to pass to the command when executing it. // +optional Args []string `json:"args"` // Env defines additional environment variables to expose to the process. These // are unioned with the host's environment, as well as variables client-go uses // to pass argument to the plugin. // +optional Env []ExecEnvVar `json:"env"` // Preferred input version of the ExecInfo. The returned ExecCredentials MUST use // the same encoding version as the input. APIVersion string `json:"apiVersion,omitempty"` // This text is shown to the user when the executable doesn't seem to be // present. For example, `brew install foo-cli` might be a good InstallHint for // foo-cli on Mac OS systems. InstallHint string `json:"installHint,omitempty"` // ProvideClusterInfo determines whether or not to provide cluster information, // which could potentially contain very large CA data, to this exec plugin as a // part of the KUBERNETES_EXEC_INFO environment variable. By default, it is set // to false. Package k8s.io/client-go/tools/auth/exec provides helper methods for // reading this environment variable. ProvideClusterInfo bool `json:"provideClusterInfo"` // Config holds additional config data that is specific to the exec // plugin with regards to the cluster being authenticated to. // // This data is sourced from the clientcmd Cluster object's extensions[exec] field: // // clusters: // - name: my-cluster // cluster: // ... // extensions: // - name: client.authentication.k8s.io/exec # reserved extension name for per cluster exec config // extension: // audience: 06e3fbd18de8 # arbitrary config // // In some environments, the user config may be exactly the same across many clusters // (i.e. call this exec plugin) minus some details that are specific to each cluster // such as the audience. This field allows the per cluster config to be directly // specified with the cluster info. Using this field to store secret data is not // recommended as one of the prime benefits of exec plugins is that no secrets need // to be stored directly in the kubeconfig. // +k8s:conversion-gen=false Config runtime.Object `json:"-"` // InteractiveMode determines this plugin's relationship with standard input. Valid // values are "Never" (this exec plugin never uses standard input), "IfAvailable" (this // exec plugin wants to use standard input if it is available), or "Always" (this exec // plugin requires standard input to function). See ExecInteractiveMode values for more // details. // // If APIVersion is client.authentication.k8s.io/v1alpha1 or // client.authentication.k8s.io/v1beta1, then this field is optional and defaults // to "IfAvailable" when unset. Otherwise, this field is required. // +optional InteractiveMode ExecInteractiveMode `json:"interactiveMode,omitempty"` // StdinUnavailable indicates whether the exec authenticator can pass standard // input through to this exec plugin. For example, a higher level entity might be using // standard input for something else and therefore it would not be safe for the exec // plugin to use standard input. This is kept here in order to keep all of the exec configuration // together, but it is never serialized. // +k8s:conversion-gen=false StdinUnavailable bool `json:"-"` // StdinUnavailableMessage is an optional message to be displayed when the exec authenticator // cannot successfully run this exec plugin because it needs to use standard input and // StdinUnavailable is true. For example, a process that is already using standard input to // read user instructions might set this to "used by my-program to read user instructions". // +k8s:conversion-gen=false StdinUnavailableMessage string `json:"-"` } var _ fmt.Stringer = new(ExecConfig) var _ fmt.GoStringer = new(ExecConfig) // GoString implements fmt.GoStringer and sanitizes sensitive fields of // ExecConfig to prevent accidental leaking via logs. func (c ExecConfig) GoString() string { return c.String() } // String implements fmt.Stringer and sanitizes sensitive fields of ExecConfig // to prevent accidental leaking via logs. func (c ExecConfig) String() string { var args []string if len(c.Args) > 0 { args = []string{"--- REDACTED ---"} } env := "[]ExecEnvVar(nil)" if len(c.Env) > 0 { env = "[]ExecEnvVar{--- REDACTED ---}" } config := "runtime.Object(nil)" if c.Config != nil { config = "runtime.Object(--- REDACTED ---)" } return fmt.Sprintf("api.ExecConfig{Command: %q, Args: %#v, Env: %s, APIVersion: %q, ProvideClusterInfo: %t, Config: %s, StdinUnavailable: %t}", c.Command, args, env, c.APIVersion, c.ProvideClusterInfo, config, c.StdinUnavailable) } // ExecEnvVar is used for setting environment variables when executing an exec-based // credential plugin. type ExecEnvVar struct { Name string `json:"name"` Value string `json:"value"` } // ExecInteractiveMode is a string that describes an exec plugin's relationship with standard input. type ExecInteractiveMode string const ( // NeverExecInteractiveMode declares that this exec plugin never needs to use standard // input, and therefore the exec plugin will be run regardless of whether standard input is // available for user input. NeverExecInteractiveMode ExecInteractiveMode = "Never" // IfAvailableExecInteractiveMode declares that this exec plugin would like to use standard input // if it is available, but can still operate if standard input is not available. Therefore, the // exec plugin will be run regardless of whether stdin is available for user input. If standard // input is available for user input, then it will be provided to this exec plugin. IfAvailableExecInteractiveMode ExecInteractiveMode = "IfAvailable" // AlwaysExecInteractiveMode declares that this exec plugin requires standard input in order to // run, and therefore the exec plugin will only be run if standard input is available for user // input. If standard input is not available for user input, then the exec plugin will not be run // and an error will be returned by the exec plugin runner. AlwaysExecInteractiveMode ExecInteractiveMode = "Always" ) // NewConfig is a convenience function that returns a new Config object with non-nil maps func NewConfig() *Config { return &Config{ Preferences: *NewPreferences(), Clusters: make(map[string]*Cluster), AuthInfos: make(map[string]*AuthInfo), Contexts: make(map[string]*Context), Extensions: make(map[string]runtime.Object), } } // NewContext is a convenience function that returns a new Context // object with non-nil maps func NewContext() *Context { return &Context{Extensions: make(map[string]runtime.Object)} } // NewCluster is a convenience function that returns a new Cluster // object with non-nil maps func NewCluster() *Cluster { return &Cluster{Extensions: make(map[string]runtime.Object)} } // NewAuthInfo is a convenience function that returns a new AuthInfo // object with non-nil maps func NewAuthInfo() *AuthInfo { return &AuthInfo{ Extensions: make(map[string]runtime.Object), ImpersonateUserExtra: make(map[string][]string), } } // NewPreferences is a convenience function that returns a new // Preferences object with non-nil maps func NewPreferences() *Preferences { return &Preferences{Extensions: make(map[string]runtime.Object)} } kubernetes-client-go-a2dfcab/tools/clientcmd/api/types_test.go000066400000000000000000000067131472614177300250140ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package api import ( "fmt" "sigs.k8s.io/yaml" ) func Example_emptyConfig() { defaultConfig := NewConfig() output, err := yaml.Marshal(defaultConfig) if err != nil { fmt.Printf("Unexpected error: %v", err) } fmt.Printf("%v", string(output)) // Output: // clusters: {} // contexts: {} // current-context: "" // preferences: {} // users: {} } func Example_ofOptionsConfig() { defaultConfig := NewConfig() defaultConfig.Preferences.Colors = true defaultConfig.Clusters["alfa"] = &Cluster{ Server: "https://alfa.org:8080", InsecureSkipTLSVerify: true, CertificateAuthority: "path/to/my/cert-ca-filename", DisableCompression: true, } defaultConfig.Clusters["bravo"] = &Cluster{ Server: "https://bravo.org:8080", InsecureSkipTLSVerify: false, DisableCompression: false, } defaultConfig.AuthInfos["white-mage-via-cert"] = &AuthInfo{ ClientCertificate: "path/to/my/client-cert-filename", ClientKey: "path/to/my/client-key-filename", } defaultConfig.AuthInfos["red-mage-via-token"] = &AuthInfo{ Token: "my-secret-token", } defaultConfig.AuthInfos["black-mage-via-auth-provider"] = &AuthInfo{ AuthProvider: &AuthProviderConfig{ Name: "gcp", Config: map[string]string{ "foo": "bar", "token": "s3cr3t-t0k3n", }, }, } defaultConfig.Contexts["bravo-as-black-mage"] = &Context{ Cluster: "bravo", AuthInfo: "black-mage-via-auth-provider", Namespace: "yankee", } defaultConfig.Contexts["alfa-as-black-mage"] = &Context{ Cluster: "alfa", AuthInfo: "black-mage-via-auth-provider", Namespace: "zulu", } defaultConfig.Contexts["alfa-as-white-mage"] = &Context{ Cluster: "alfa", AuthInfo: "white-mage-via-cert", } defaultConfig.CurrentContext = "alfa-as-white-mage" output, err := yaml.Marshal(defaultConfig) if err != nil { fmt.Printf("Unexpected error: %v", err) } fmt.Printf("%v", string(output)) // Output: // clusters: // alfa: // certificate-authority: path/to/my/cert-ca-filename // disable-compression: true // insecure-skip-tls-verify: true // server: https://alfa.org:8080 // bravo: // server: https://bravo.org:8080 // contexts: // alfa-as-black-mage: // cluster: alfa // namespace: zulu // user: black-mage-via-auth-provider // alfa-as-white-mage: // cluster: alfa // user: white-mage-via-cert // bravo-as-black-mage: // cluster: bravo // namespace: yankee // user: black-mage-via-auth-provider // current-context: alfa-as-white-mage // preferences: // colors: true // users: // black-mage-via-auth-provider: // auth-provider: // config: // foo: bar // token: s3cr3t-t0k3n // name: gcp // red-mage-via-token: // token: my-secret-token // white-mage-via-cert: // client-certificate: path/to/my/client-cert-filename // client-key: path/to/my/client-key-filename } kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/000077500000000000000000000000001472614177300226015ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/conversion.go000066400000000000000000000127141472614177300253220ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "fmt" "sort" "k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/clientcmd/api" ) func Convert_Slice_v1_NamedCluster_To_Map_string_To_Pointer_api_Cluster(in *[]NamedCluster, out *map[string]*api.Cluster, s conversion.Scope) error { for _, curr := range *in { newCluster := api.NewCluster() if err := Convert_v1_Cluster_To_api_Cluster(&curr.Cluster, newCluster, s); err != nil { return err } if *out == nil { *out = make(map[string]*api.Cluster) } if (*out)[curr.Name] == nil { (*out)[curr.Name] = newCluster } else { return fmt.Errorf("error converting *[]NamedCluster into *map[string]*api.Cluster: duplicate name \"%v\" in list: %v", curr.Name, *in) } } return nil } func Convert_Map_string_To_Pointer_api_Cluster_To_Slice_v1_NamedCluster(in *map[string]*api.Cluster, out *[]NamedCluster, s conversion.Scope) error { allKeys := make([]string, 0, len(*in)) for key := range *in { allKeys = append(allKeys, key) } sort.Strings(allKeys) for _, key := range allKeys { newCluster := (*in)[key] oldCluster := Cluster{} if err := Convert_api_Cluster_To_v1_Cluster(newCluster, &oldCluster, s); err != nil { return err } namedCluster := NamedCluster{key, oldCluster} *out = append(*out, namedCluster) } return nil } func Convert_Slice_v1_NamedAuthInfo_To_Map_string_To_Pointer_api_AuthInfo(in *[]NamedAuthInfo, out *map[string]*api.AuthInfo, s conversion.Scope) error { for _, curr := range *in { newAuthInfo := api.NewAuthInfo() if err := Convert_v1_AuthInfo_To_api_AuthInfo(&curr.AuthInfo, newAuthInfo, s); err != nil { return err } if *out == nil { *out = make(map[string]*api.AuthInfo) } if (*out)[curr.Name] == nil { (*out)[curr.Name] = newAuthInfo } else { return fmt.Errorf("error converting *[]NamedAuthInfo into *map[string]*api.AuthInfo: duplicate name \"%v\" in list: %v", curr.Name, *in) } } return nil } func Convert_Map_string_To_Pointer_api_AuthInfo_To_Slice_v1_NamedAuthInfo(in *map[string]*api.AuthInfo, out *[]NamedAuthInfo, s conversion.Scope) error { allKeys := make([]string, 0, len(*in)) for key := range *in { allKeys = append(allKeys, key) } sort.Strings(allKeys) for _, key := range allKeys { newAuthInfo := (*in)[key] oldAuthInfo := AuthInfo{} if err := Convert_api_AuthInfo_To_v1_AuthInfo(newAuthInfo, &oldAuthInfo, s); err != nil { return err } namedAuthInfo := NamedAuthInfo{key, oldAuthInfo} *out = append(*out, namedAuthInfo) } return nil } func Convert_Slice_v1_NamedContext_To_Map_string_To_Pointer_api_Context(in *[]NamedContext, out *map[string]*api.Context, s conversion.Scope) error { for _, curr := range *in { newContext := api.NewContext() if err := Convert_v1_Context_To_api_Context(&curr.Context, newContext, s); err != nil { return err } if *out == nil { *out = make(map[string]*api.Context) } if (*out)[curr.Name] == nil { (*out)[curr.Name] = newContext } else { return fmt.Errorf("error converting *[]NamedContext into *map[string]*api.Context: duplicate name \"%v\" in list: %v", curr.Name, *in) } } return nil } func Convert_Map_string_To_Pointer_api_Context_To_Slice_v1_NamedContext(in *map[string]*api.Context, out *[]NamedContext, s conversion.Scope) error { allKeys := make([]string, 0, len(*in)) for key := range *in { allKeys = append(allKeys, key) } sort.Strings(allKeys) for _, key := range allKeys { newContext := (*in)[key] oldContext := Context{} if err := Convert_api_Context_To_v1_Context(newContext, &oldContext, s); err != nil { return err } namedContext := NamedContext{key, oldContext} *out = append(*out, namedContext) } return nil } func Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(in *[]NamedExtension, out *map[string]runtime.Object, s conversion.Scope) error { for _, curr := range *in { var newExtension runtime.Object if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&curr.Extension, &newExtension, s); err != nil { return err } if *out == nil { *out = make(map[string]runtime.Object) } if (*out)[curr.Name] == nil { (*out)[curr.Name] = newExtension } else { return fmt.Errorf("error converting *[]NamedExtension into *map[string]runtime.Object: duplicate name \"%v\" in list: %v", curr.Name, *in) } } return nil } func Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(in *map[string]runtime.Object, out *[]NamedExtension, s conversion.Scope) error { allKeys := make([]string, 0, len(*in)) for key := range *in { allKeys = append(allKeys, key) } sort.Strings(allKeys) for _, key := range allKeys { newExtension := (*in)[key] oldExtension := runtime.RawExtension{} if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&newExtension, &oldExtension, s); err != nil { return err } namedExtension := NamedExtension{key, oldExtension} *out = append(*out, namedExtension) } return nil } kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/defaults.go000066400000000000000000000022051472614177300247360ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "k8s.io/apimachinery/pkg/runtime" ) func addDefaultingFuncs(scheme *runtime.Scheme) error { return RegisterDefaults(scheme) } func SetDefaults_ExecConfig(exec *ExecConfig) { if len(exec.InteractiveMode) == 0 { switch exec.APIVersion { case "client.authentication.k8s.io/v1beta1", "client.authentication.k8s.io/v1alpha1": // default to IfAvailableExecInteractiveMode for backwards compatibility exec.InteractiveMode = IfAvailableExecInteractiveMode default: // require other versions to explicitly declare whether they want stdin or not } } } kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/defaults_test.go000066400000000000000000000046741472614177300260110ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "testing" "github.com/google/go-cmp/cmp" ) func TestSetDefaults_Config(t *testing.T) { tests := []struct { name string in, wantOut *ExecConfig }{ { name: "alpha exec API with empty interactive mode", in: &ExecConfig{APIVersion: "client.authentication.k8s.io/v1alpha1"}, wantOut: &ExecConfig{ APIVersion: "client.authentication.k8s.io/v1alpha1", InteractiveMode: IfAvailableExecInteractiveMode, }, }, { name: "beta exec API with empty interactive mode", in: &ExecConfig{APIVersion: "client.authentication.k8s.io/v1beta1"}, wantOut: &ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: IfAvailableExecInteractiveMode, }, }, { name: "alpha exec API with set interactive mode", in: &ExecConfig{ APIVersion: "client.authentication.k8s.io/v1alpha1", InteractiveMode: NeverExecInteractiveMode, }, wantOut: &ExecConfig{ APIVersion: "client.authentication.k8s.io/v1alpha1", InteractiveMode: NeverExecInteractiveMode, }, }, { name: "beta exec API with set interactive mode", in: &ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: NeverExecInteractiveMode, }, wantOut: &ExecConfig{ APIVersion: "client.authentication.k8s.io/v1beta1", InteractiveMode: NeverExecInteractiveMode, }, }, { name: "v1 exec API with empty interactive mode", in: &ExecConfig{APIVersion: "client.authentication.k8s.io/v1"}, wantOut: &ExecConfig{APIVersion: "client.authentication.k8s.io/v1"}, }, } for _, test := range tests { test := test t.Run(test.name, func(t *testing.T) { gotOut := test.in.DeepCopy() SetDefaults_ExecConfig(gotOut) if diff := cmp.Diff(test.wantOut, gotOut); diff != "" { t.Errorf("unexpected defaulting; -want, +got:\n %s", diff) } }) } } kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/doc.go000066400000000000000000000013571472614177300237030ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:conversion-gen=k8s.io/client-go/tools/clientcmd/api // +k8s:deepcopy-gen=package // +k8s:defaulter-gen=Kind package v1 // import "k8s.io/client-go/tools/clientcmd/api/v1" kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/register.go000066400000000000000000000035541472614177300247630ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // SchemeGroupVersion is group version used to register these objects // TODO this should be in the "kubeconfig" group var SchemeGroupVersion = schema.GroupVersion{Group: "", Version: "v1"} var ( // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. SchemeBuilder runtime.SchemeBuilder localSchemeBuilder = &SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. localSchemeBuilder.Register(addKnownTypes, addDefaultingFuncs) } func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &Config{}, ) return nil } func (obj *Config) GetObjectKind() schema.ObjectKind { return obj } func (obj *Config) SetGroupVersionKind(gvk schema.GroupVersionKind) { obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind() } func (obj *Config) GroupVersionKind() schema.GroupVersionKind { return schema.FromAPIVersionAndKind(obj.APIVersion, obj.Kind) } kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/types.go000066400000000000000000000310041472614177300242720ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "k8s.io/apimachinery/pkg/runtime" ) // Where possible, json tags match the cli argument names. // Top level config objects and all values required for proper functioning are not "omitempty". Any truly optional piece of config is allowed to be omitted. // Config holds the information needed to build connect to remote kubernetes clusters as a given user // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type Config struct { // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. // +k8s:conversion-gen=false // +optional Kind string `json:"kind,omitempty"` // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. // +k8s:conversion-gen=false // +optional APIVersion string `json:"apiVersion,omitempty"` // Preferences holds general information to be use for cli interactions Preferences Preferences `json:"preferences"` // Clusters is a map of referencable names to cluster configs Clusters []NamedCluster `json:"clusters"` // AuthInfos is a map of referencable names to user configs AuthInfos []NamedAuthInfo `json:"users"` // Contexts is a map of referencable names to context configs Contexts []NamedContext `json:"contexts"` // CurrentContext is the name of the context that you would like to use by default CurrentContext string `json:"current-context"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions []NamedExtension `json:"extensions,omitempty"` } type Preferences struct { // +optional Colors bool `json:"colors,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions []NamedExtension `json:"extensions,omitempty"` } // Cluster contains information about how to communicate with a kubernetes cluster type Cluster struct { // Server is the address of the kubernetes cluster (https://hostname:port). Server string `json:"server"` // TLSServerName is used to check server certificate. If TLSServerName is empty, the hostname used to contact the server is used. // +optional TLSServerName string `json:"tls-server-name,omitempty"` // InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure. // +optional InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"` // CertificateAuthority is the path to a cert file for the certificate authority. // +optional CertificateAuthority string `json:"certificate-authority,omitempty"` // CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority // +optional CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"` // ProxyURL is the URL to the proxy to be used for all requests made by this // client. URLs with "http", "https", and "socks5" schemes are supported. If // this configuration is not provided or the empty string, the client // attempts to construct a proxy configuration from http_proxy and // https_proxy environment variables. If these environment variables are not // set, the client does not attempt to proxy requests. // // socks5 proxying does not currently support spdy streaming endpoints (exec, // attach, port forward). // +optional ProxyURL string `json:"proxy-url,omitempty"` // DisableCompression allows client to opt-out of response compression for all requests to the server. This is useful // to speed up requests (specifically lists) when client-server network bandwidth is ample, by saving time on // compression (server-side) and decompression (client-side): https://github.com/kubernetes/kubernetes/issues/112296. // +optional DisableCompression bool `json:"disable-compression,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions []NamedExtension `json:"extensions,omitempty"` } // AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are. type AuthInfo struct { // ClientCertificate is the path to a client cert file for TLS. // +optional ClientCertificate string `json:"client-certificate,omitempty"` // ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate // +optional ClientCertificateData []byte `json:"client-certificate-data,omitempty"` // ClientKey is the path to a client key file for TLS. // +optional ClientKey string `json:"client-key,omitempty"` // ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey // +optional ClientKeyData []byte `json:"client-key-data,omitempty" datapolicy:"security-key"` // Token is the bearer token for authentication to the kubernetes cluster. // +optional Token string `json:"token,omitempty" datapolicy:"token"` // TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence. // +optional TokenFile string `json:"tokenFile,omitempty"` // Impersonate is the username to impersonate. The name matches the flag. // +optional Impersonate string `json:"as,omitempty"` // ImpersonateUID is the uid to impersonate. // +optional ImpersonateUID string `json:"as-uid,omitempty"` // ImpersonateGroups is the groups to impersonate. // +optional ImpersonateGroups []string `json:"as-groups,omitempty"` // ImpersonateUserExtra contains additional information for impersonated user. // +optional ImpersonateUserExtra map[string][]string `json:"as-user-extra,omitempty"` // Username is the username for basic authentication to the kubernetes cluster. // +optional Username string `json:"username,omitempty"` // Password is the password for basic authentication to the kubernetes cluster. // +optional Password string `json:"password,omitempty" datapolicy:"password"` // AuthProvider specifies a custom authentication plugin for the kubernetes cluster. // +optional AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"` // Exec specifies a custom exec-based authentication plugin for the kubernetes cluster. // +optional Exec *ExecConfig `json:"exec,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions []NamedExtension `json:"extensions,omitempty"` } // Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with) type Context struct { // Cluster is the name of the cluster for this context Cluster string `json:"cluster"` // AuthInfo is the name of the authInfo for this context AuthInfo string `json:"user"` // Namespace is the default namespace to use on unspecified requests // +optional Namespace string `json:"namespace,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions []NamedExtension `json:"extensions,omitempty"` } // NamedCluster relates nicknames to cluster information type NamedCluster struct { // Name is the nickname for this Cluster Name string `json:"name"` // Cluster holds the cluster information Cluster Cluster `json:"cluster"` } // NamedContext relates nicknames to context information type NamedContext struct { // Name is the nickname for this Context Name string `json:"name"` // Context holds the context information Context Context `json:"context"` } // NamedAuthInfo relates nicknames to auth information type NamedAuthInfo struct { // Name is the nickname for this AuthInfo Name string `json:"name"` // AuthInfo holds the auth information AuthInfo AuthInfo `json:"user"` } // NamedExtension relates nicknames to extension information type NamedExtension struct { // Name is the nickname for this Extension Name string `json:"name"` // Extension holds the extension information Extension runtime.RawExtension `json:"extension"` } // AuthProviderConfig holds the configuration for a specified auth provider. type AuthProviderConfig struct { Name string `json:"name"` Config map[string]string `json:"config"` } // ExecConfig specifies a command to provide client credentials. The command is exec'd // and outputs structured stdout holding credentials. // // See the client.authentication.k8s.io API group for specifications of the exact input // and output format type ExecConfig struct { // Command to execute. Command string `json:"command"` // Arguments to pass to the command when executing it. // +optional Args []string `json:"args"` // Env defines additional environment variables to expose to the process. These // are unioned with the host's environment, as well as variables client-go uses // to pass argument to the plugin. // +optional Env []ExecEnvVar `json:"env"` // Preferred input version of the ExecInfo. The returned ExecCredentials MUST use // the same encoding version as the input. APIVersion string `json:"apiVersion,omitempty"` // This text is shown to the user when the executable doesn't seem to be // present. For example, `brew install foo-cli` might be a good InstallHint for // foo-cli on Mac OS systems. InstallHint string `json:"installHint,omitempty"` // ProvideClusterInfo determines whether or not to provide cluster information, // which could potentially contain very large CA data, to this exec plugin as a // part of the KUBERNETES_EXEC_INFO environment variable. By default, it is set // to false. Package k8s.io/client-go/tools/auth/exec provides helper methods for // reading this environment variable. ProvideClusterInfo bool `json:"provideClusterInfo"` // InteractiveMode determines this plugin's relationship with standard input. Valid // values are "Never" (this exec plugin never uses standard input), "IfAvailable" (this // exec plugin wants to use standard input if it is available), or "Always" (this exec // plugin requires standard input to function). See ExecInteractiveMode values for more // details. // // If APIVersion is client.authentication.k8s.io/v1alpha1 or // client.authentication.k8s.io/v1beta1, then this field is optional and defaults // to "IfAvailable" when unset. Otherwise, this field is required. //+optional InteractiveMode ExecInteractiveMode `json:"interactiveMode,omitempty"` } // ExecEnvVar is used for setting environment variables when executing an exec-based // credential plugin. type ExecEnvVar struct { Name string `json:"name"` Value string `json:"value"` } // ExecInteractiveMode is a string that describes an exec plugin's relationship with standard input. type ExecInteractiveMode string const ( // NeverExecInteractiveMode declares that this exec plugin never needs to use standard // input, and therefore the exec plugin will be run regardless of whether standard input is // available for user input. NeverExecInteractiveMode ExecInteractiveMode = "Never" // IfAvailableExecInteractiveMode declares that this exec plugin would like to use standard input // if it is available, but can still operate if standard input is not available. Therefore, the // exec plugin will be run regardless of whether stdin is available for user input. If standard // input is available for user input, then it will be provided to this exec plugin. IfAvailableExecInteractiveMode ExecInteractiveMode = "IfAvailable" // AlwaysExecInteractiveMode declares that this exec plugin requires standard input in order to // run, and therefore the exec plugin will only be run if standard input is available for user // input. If standard input is not available for user input, then the exec plugin will not be run // and an error will be returned by the exec plugin runner. AlwaysExecInteractiveMode ExecInteractiveMode = "Always" ) kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/zz_generated.conversion.go000066400000000000000000000503361472614177300300040ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by conversion-gen. DO NOT EDIT. package v1 import ( unsafe "unsafe" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" api "k8s.io/client-go/tools/clientcmd/api" ) func init() { localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { if err := s.AddGeneratedConversionFunc((*AuthInfo)(nil), (*api.AuthInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_AuthInfo_To_api_AuthInfo(a.(*AuthInfo), b.(*api.AuthInfo), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*api.AuthInfo)(nil), (*AuthInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_AuthInfo_To_v1_AuthInfo(a.(*api.AuthInfo), b.(*AuthInfo), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*AuthProviderConfig)(nil), (*api.AuthProviderConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_AuthProviderConfig_To_api_AuthProviderConfig(a.(*AuthProviderConfig), b.(*api.AuthProviderConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*api.AuthProviderConfig)(nil), (*AuthProviderConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_AuthProviderConfig_To_v1_AuthProviderConfig(a.(*api.AuthProviderConfig), b.(*AuthProviderConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*api.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_Cluster_To_api_Cluster(a.(*Cluster), b.(*api.Cluster), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*api.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_Cluster_To_v1_Cluster(a.(*api.Cluster), b.(*Cluster), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*Config)(nil), (*api.Config)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_Config_To_api_Config(a.(*Config), b.(*api.Config), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*api.Config)(nil), (*Config)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_Config_To_v1_Config(a.(*api.Config), b.(*Config), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*Context)(nil), (*api.Context)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_Context_To_api_Context(a.(*Context), b.(*api.Context), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*api.Context)(nil), (*Context)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_Context_To_v1_Context(a.(*api.Context), b.(*Context), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*ExecConfig)(nil), (*api.ExecConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_ExecConfig_To_api_ExecConfig(a.(*ExecConfig), b.(*api.ExecConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*api.ExecConfig)(nil), (*ExecConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_ExecConfig_To_v1_ExecConfig(a.(*api.ExecConfig), b.(*ExecConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*ExecEnvVar)(nil), (*api.ExecEnvVar)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_ExecEnvVar_To_api_ExecEnvVar(a.(*ExecEnvVar), b.(*api.ExecEnvVar), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*api.ExecEnvVar)(nil), (*ExecEnvVar)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_ExecEnvVar_To_v1_ExecEnvVar(a.(*api.ExecEnvVar), b.(*ExecEnvVar), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*Preferences)(nil), (*api.Preferences)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_Preferences_To_api_Preferences(a.(*Preferences), b.(*api.Preferences), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*api.Preferences)(nil), (*Preferences)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_Preferences_To_v1_Preferences(a.(*api.Preferences), b.(*Preferences), scope) }); err != nil { return err } if err := s.AddConversionFunc((*map[string]*api.AuthInfo)(nil), (*[]NamedAuthInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_Map_string_To_Pointer_api_AuthInfo_To_Slice_v1_NamedAuthInfo(a.(*map[string]*api.AuthInfo), b.(*[]NamedAuthInfo), scope) }); err != nil { return err } if err := s.AddConversionFunc((*map[string]*api.Cluster)(nil), (*[]NamedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_Map_string_To_Pointer_api_Cluster_To_Slice_v1_NamedCluster(a.(*map[string]*api.Cluster), b.(*[]NamedCluster), scope) }); err != nil { return err } if err := s.AddConversionFunc((*map[string]*api.Context)(nil), (*[]NamedContext)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_Map_string_To_Pointer_api_Context_To_Slice_v1_NamedContext(a.(*map[string]*api.Context), b.(*[]NamedContext), scope) }); err != nil { return err } if err := s.AddConversionFunc((*map[string]runtime.Object)(nil), (*[]NamedExtension)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(a.(*map[string]runtime.Object), b.(*[]NamedExtension), scope) }); err != nil { return err } if err := s.AddConversionFunc((*[]NamedAuthInfo)(nil), (*map[string]*api.AuthInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_Slice_v1_NamedAuthInfo_To_Map_string_To_Pointer_api_AuthInfo(a.(*[]NamedAuthInfo), b.(*map[string]*api.AuthInfo), scope) }); err != nil { return err } if err := s.AddConversionFunc((*[]NamedCluster)(nil), (*map[string]*api.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_Slice_v1_NamedCluster_To_Map_string_To_Pointer_api_Cluster(a.(*[]NamedCluster), b.(*map[string]*api.Cluster), scope) }); err != nil { return err } if err := s.AddConversionFunc((*[]NamedContext)(nil), (*map[string]*api.Context)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_Slice_v1_NamedContext_To_Map_string_To_Pointer_api_Context(a.(*[]NamedContext), b.(*map[string]*api.Context), scope) }); err != nil { return err } if err := s.AddConversionFunc((*[]NamedExtension)(nil), (*map[string]runtime.Object)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(a.(*[]NamedExtension), b.(*map[string]runtime.Object), scope) }); err != nil { return err } return nil } func autoConvert_v1_AuthInfo_To_api_AuthInfo(in *AuthInfo, out *api.AuthInfo, s conversion.Scope) error { out.ClientCertificate = in.ClientCertificate out.ClientCertificateData = *(*[]byte)(unsafe.Pointer(&in.ClientCertificateData)) out.ClientKey = in.ClientKey out.ClientKeyData = *(*[]byte)(unsafe.Pointer(&in.ClientKeyData)) out.Token = in.Token out.TokenFile = in.TokenFile out.Impersonate = in.Impersonate out.ImpersonateUID = in.ImpersonateUID out.ImpersonateGroups = *(*[]string)(unsafe.Pointer(&in.ImpersonateGroups)) out.ImpersonateUserExtra = *(*map[string][]string)(unsafe.Pointer(&in.ImpersonateUserExtra)) out.Username = in.Username out.Password = in.Password out.AuthProvider = (*api.AuthProviderConfig)(unsafe.Pointer(in.AuthProvider)) if in.Exec != nil { in, out := &in.Exec, &out.Exec *out = new(api.ExecConfig) if err := Convert_v1_ExecConfig_To_api_ExecConfig(*in, *out, s); err != nil { return err } } else { out.Exec = nil } if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_v1_AuthInfo_To_api_AuthInfo is an autogenerated conversion function. func Convert_v1_AuthInfo_To_api_AuthInfo(in *AuthInfo, out *api.AuthInfo, s conversion.Scope) error { return autoConvert_v1_AuthInfo_To_api_AuthInfo(in, out, s) } func autoConvert_api_AuthInfo_To_v1_AuthInfo(in *api.AuthInfo, out *AuthInfo, s conversion.Scope) error { // INFO: in.LocationOfOrigin opted out of conversion generation out.ClientCertificate = in.ClientCertificate out.ClientCertificateData = *(*[]byte)(unsafe.Pointer(&in.ClientCertificateData)) out.ClientKey = in.ClientKey out.ClientKeyData = *(*[]byte)(unsafe.Pointer(&in.ClientKeyData)) out.Token = in.Token out.TokenFile = in.TokenFile out.Impersonate = in.Impersonate out.ImpersonateUID = in.ImpersonateUID out.ImpersonateGroups = *(*[]string)(unsafe.Pointer(&in.ImpersonateGroups)) out.ImpersonateUserExtra = *(*map[string][]string)(unsafe.Pointer(&in.ImpersonateUserExtra)) out.Username = in.Username out.Password = in.Password out.AuthProvider = (*AuthProviderConfig)(unsafe.Pointer(in.AuthProvider)) if in.Exec != nil { in, out := &in.Exec, &out.Exec *out = new(ExecConfig) if err := Convert_api_ExecConfig_To_v1_ExecConfig(*in, *out, s); err != nil { return err } } else { out.Exec = nil } if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_api_AuthInfo_To_v1_AuthInfo is an autogenerated conversion function. func Convert_api_AuthInfo_To_v1_AuthInfo(in *api.AuthInfo, out *AuthInfo, s conversion.Scope) error { return autoConvert_api_AuthInfo_To_v1_AuthInfo(in, out, s) } func autoConvert_v1_AuthProviderConfig_To_api_AuthProviderConfig(in *AuthProviderConfig, out *api.AuthProviderConfig, s conversion.Scope) error { out.Name = in.Name out.Config = *(*map[string]string)(unsafe.Pointer(&in.Config)) return nil } // Convert_v1_AuthProviderConfig_To_api_AuthProviderConfig is an autogenerated conversion function. func Convert_v1_AuthProviderConfig_To_api_AuthProviderConfig(in *AuthProviderConfig, out *api.AuthProviderConfig, s conversion.Scope) error { return autoConvert_v1_AuthProviderConfig_To_api_AuthProviderConfig(in, out, s) } func autoConvert_api_AuthProviderConfig_To_v1_AuthProviderConfig(in *api.AuthProviderConfig, out *AuthProviderConfig, s conversion.Scope) error { out.Name = in.Name out.Config = *(*map[string]string)(unsafe.Pointer(&in.Config)) return nil } // Convert_api_AuthProviderConfig_To_v1_AuthProviderConfig is an autogenerated conversion function. func Convert_api_AuthProviderConfig_To_v1_AuthProviderConfig(in *api.AuthProviderConfig, out *AuthProviderConfig, s conversion.Scope) error { return autoConvert_api_AuthProviderConfig_To_v1_AuthProviderConfig(in, out, s) } func autoConvert_v1_Cluster_To_api_Cluster(in *Cluster, out *api.Cluster, s conversion.Scope) error { out.Server = in.Server out.TLSServerName = in.TLSServerName out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify out.CertificateAuthority = in.CertificateAuthority out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) out.ProxyURL = in.ProxyURL out.DisableCompression = in.DisableCompression if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_v1_Cluster_To_api_Cluster is an autogenerated conversion function. func Convert_v1_Cluster_To_api_Cluster(in *Cluster, out *api.Cluster, s conversion.Scope) error { return autoConvert_v1_Cluster_To_api_Cluster(in, out, s) } func autoConvert_api_Cluster_To_v1_Cluster(in *api.Cluster, out *Cluster, s conversion.Scope) error { // INFO: in.LocationOfOrigin opted out of conversion generation out.Server = in.Server out.TLSServerName = in.TLSServerName out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify out.CertificateAuthority = in.CertificateAuthority out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) out.ProxyURL = in.ProxyURL out.DisableCompression = in.DisableCompression if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_api_Cluster_To_v1_Cluster is an autogenerated conversion function. func Convert_api_Cluster_To_v1_Cluster(in *api.Cluster, out *Cluster, s conversion.Scope) error { return autoConvert_api_Cluster_To_v1_Cluster(in, out, s) } func autoConvert_v1_Config_To_api_Config(in *Config, out *api.Config, s conversion.Scope) error { // INFO: in.Kind opted out of conversion generation // INFO: in.APIVersion opted out of conversion generation if err := Convert_v1_Preferences_To_api_Preferences(&in.Preferences, &out.Preferences, s); err != nil { return err } if err := Convert_Slice_v1_NamedCluster_To_Map_string_To_Pointer_api_Cluster(&in.Clusters, &out.Clusters, s); err != nil { return err } if err := Convert_Slice_v1_NamedAuthInfo_To_Map_string_To_Pointer_api_AuthInfo(&in.AuthInfos, &out.AuthInfos, s); err != nil { return err } if err := Convert_Slice_v1_NamedContext_To_Map_string_To_Pointer_api_Context(&in.Contexts, &out.Contexts, s); err != nil { return err } out.CurrentContext = in.CurrentContext if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_v1_Config_To_api_Config is an autogenerated conversion function. func Convert_v1_Config_To_api_Config(in *Config, out *api.Config, s conversion.Scope) error { return autoConvert_v1_Config_To_api_Config(in, out, s) } func autoConvert_api_Config_To_v1_Config(in *api.Config, out *Config, s conversion.Scope) error { // INFO: in.Kind opted out of conversion generation // INFO: in.APIVersion opted out of conversion generation if err := Convert_api_Preferences_To_v1_Preferences(&in.Preferences, &out.Preferences, s); err != nil { return err } if err := Convert_Map_string_To_Pointer_api_Cluster_To_Slice_v1_NamedCluster(&in.Clusters, &out.Clusters, s); err != nil { return err } if err := Convert_Map_string_To_Pointer_api_AuthInfo_To_Slice_v1_NamedAuthInfo(&in.AuthInfos, &out.AuthInfos, s); err != nil { return err } if err := Convert_Map_string_To_Pointer_api_Context_To_Slice_v1_NamedContext(&in.Contexts, &out.Contexts, s); err != nil { return err } out.CurrentContext = in.CurrentContext if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_api_Config_To_v1_Config is an autogenerated conversion function. func Convert_api_Config_To_v1_Config(in *api.Config, out *Config, s conversion.Scope) error { return autoConvert_api_Config_To_v1_Config(in, out, s) } func autoConvert_v1_Context_To_api_Context(in *Context, out *api.Context, s conversion.Scope) error { out.Cluster = in.Cluster out.AuthInfo = in.AuthInfo out.Namespace = in.Namespace if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_v1_Context_To_api_Context is an autogenerated conversion function. func Convert_v1_Context_To_api_Context(in *Context, out *api.Context, s conversion.Scope) error { return autoConvert_v1_Context_To_api_Context(in, out, s) } func autoConvert_api_Context_To_v1_Context(in *api.Context, out *Context, s conversion.Scope) error { // INFO: in.LocationOfOrigin opted out of conversion generation out.Cluster = in.Cluster out.AuthInfo = in.AuthInfo out.Namespace = in.Namespace if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_api_Context_To_v1_Context is an autogenerated conversion function. func Convert_api_Context_To_v1_Context(in *api.Context, out *Context, s conversion.Scope) error { return autoConvert_api_Context_To_v1_Context(in, out, s) } func autoConvert_v1_ExecConfig_To_api_ExecConfig(in *ExecConfig, out *api.ExecConfig, s conversion.Scope) error { out.Command = in.Command out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) out.Env = *(*[]api.ExecEnvVar)(unsafe.Pointer(&in.Env)) out.APIVersion = in.APIVersion out.InstallHint = in.InstallHint out.ProvideClusterInfo = in.ProvideClusterInfo out.InteractiveMode = api.ExecInteractiveMode(in.InteractiveMode) return nil } // Convert_v1_ExecConfig_To_api_ExecConfig is an autogenerated conversion function. func Convert_v1_ExecConfig_To_api_ExecConfig(in *ExecConfig, out *api.ExecConfig, s conversion.Scope) error { return autoConvert_v1_ExecConfig_To_api_ExecConfig(in, out, s) } func autoConvert_api_ExecConfig_To_v1_ExecConfig(in *api.ExecConfig, out *ExecConfig, s conversion.Scope) error { out.Command = in.Command out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) out.Env = *(*[]ExecEnvVar)(unsafe.Pointer(&in.Env)) out.APIVersion = in.APIVersion out.InstallHint = in.InstallHint out.ProvideClusterInfo = in.ProvideClusterInfo // INFO: in.Config opted out of conversion generation out.InteractiveMode = ExecInteractiveMode(in.InteractiveMode) // INFO: in.StdinUnavailable opted out of conversion generation // INFO: in.StdinUnavailableMessage opted out of conversion generation return nil } // Convert_api_ExecConfig_To_v1_ExecConfig is an autogenerated conversion function. func Convert_api_ExecConfig_To_v1_ExecConfig(in *api.ExecConfig, out *ExecConfig, s conversion.Scope) error { return autoConvert_api_ExecConfig_To_v1_ExecConfig(in, out, s) } func autoConvert_v1_ExecEnvVar_To_api_ExecEnvVar(in *ExecEnvVar, out *api.ExecEnvVar, s conversion.Scope) error { out.Name = in.Name out.Value = in.Value return nil } // Convert_v1_ExecEnvVar_To_api_ExecEnvVar is an autogenerated conversion function. func Convert_v1_ExecEnvVar_To_api_ExecEnvVar(in *ExecEnvVar, out *api.ExecEnvVar, s conversion.Scope) error { return autoConvert_v1_ExecEnvVar_To_api_ExecEnvVar(in, out, s) } func autoConvert_api_ExecEnvVar_To_v1_ExecEnvVar(in *api.ExecEnvVar, out *ExecEnvVar, s conversion.Scope) error { out.Name = in.Name out.Value = in.Value return nil } // Convert_api_ExecEnvVar_To_v1_ExecEnvVar is an autogenerated conversion function. func Convert_api_ExecEnvVar_To_v1_ExecEnvVar(in *api.ExecEnvVar, out *ExecEnvVar, s conversion.Scope) error { return autoConvert_api_ExecEnvVar_To_v1_ExecEnvVar(in, out, s) } func autoConvert_v1_Preferences_To_api_Preferences(in *Preferences, out *api.Preferences, s conversion.Scope) error { out.Colors = in.Colors if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_v1_Preferences_To_api_Preferences is an autogenerated conversion function. func Convert_v1_Preferences_To_api_Preferences(in *Preferences, out *api.Preferences, s conversion.Scope) error { return autoConvert_v1_Preferences_To_api_Preferences(in, out, s) } func autoConvert_api_Preferences_To_v1_Preferences(in *api.Preferences, out *Preferences, s conversion.Scope) error { out.Colors = in.Colors if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { return err } return nil } // Convert_api_Preferences_To_v1_Preferences is an autogenerated conversion function. func Convert_api_Preferences_To_v1_Preferences(in *api.Preferences, out *Preferences, s conversion.Scope) error { return autoConvert_api_Preferences_To_v1_Preferences(in, out, s) } kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/zz_generated.deepcopy.go000066400000000000000000000223551472614177300274270ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by deepcopy-gen. DO NOT EDIT. package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthInfo) DeepCopyInto(out *AuthInfo) { *out = *in if in.ClientCertificateData != nil { in, out := &in.ClientCertificateData, &out.ClientCertificateData *out = make([]byte, len(*in)) copy(*out, *in) } if in.ClientKeyData != nil { in, out := &in.ClientKeyData, &out.ClientKeyData *out = make([]byte, len(*in)) copy(*out, *in) } if in.ImpersonateGroups != nil { in, out := &in.ImpersonateGroups, &out.ImpersonateGroups *out = make([]string, len(*in)) copy(*out, *in) } if in.ImpersonateUserExtra != nil { in, out := &in.ImpersonateUserExtra, &out.ImpersonateUserExtra *out = make(map[string][]string, len(*in)) for key, val := range *in { var outVal []string if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal *out = make([]string, len(*in)) copy(*out, *in) } (*out)[key] = outVal } } if in.AuthProvider != nil { in, out := &in.AuthProvider, &out.AuthProvider *out = new(AuthProviderConfig) (*in).DeepCopyInto(*out) } if in.Exec != nil { in, out := &in.Exec, &out.Exec *out = new(ExecConfig) (*in).DeepCopyInto(*out) } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make([]NamedExtension, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthInfo. func (in *AuthInfo) DeepCopy() *AuthInfo { if in == nil { return nil } out := new(AuthInfo) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthProviderConfig) DeepCopyInto(out *AuthProviderConfig) { *out = *in if in.Config != nil { in, out := &in.Config, &out.Config *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthProviderConfig. func (in *AuthProviderConfig) DeepCopy() *AuthProviderConfig { if in == nil { return nil } out := new(AuthProviderConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in if in.CertificateAuthorityData != nil { in, out := &in.CertificateAuthorityData, &out.CertificateAuthorityData *out = make([]byte, len(*in)) copy(*out, *in) } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make([]NamedExtension, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. func (in *Cluster) DeepCopy() *Cluster { if in == nil { return nil } out := new(Cluster) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Config) DeepCopyInto(out *Config) { *out = *in in.Preferences.DeepCopyInto(&out.Preferences) if in.Clusters != nil { in, out := &in.Clusters, &out.Clusters *out = make([]NamedCluster, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.AuthInfos != nil { in, out := &in.AuthInfos, &out.AuthInfos *out = make([]NamedAuthInfo, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Contexts != nil { in, out := &in.Contexts, &out.Contexts *out = make([]NamedContext, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make([]NamedExtension, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config. func (in *Config) DeepCopy() *Config { if in == nil { return nil } out := new(Config) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *Config) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Context) DeepCopyInto(out *Context) { *out = *in if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make([]NamedExtension, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Context. func (in *Context) DeepCopy() *Context { if in == nil { return nil } out := new(Context) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecConfig) DeepCopyInto(out *ExecConfig) { *out = *in if in.Args != nil { in, out := &in.Args, &out.Args *out = make([]string, len(*in)) copy(*out, *in) } if in.Env != nil { in, out := &in.Env, &out.Env *out = make([]ExecEnvVar, len(*in)) copy(*out, *in) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecConfig. func (in *ExecConfig) DeepCopy() *ExecConfig { if in == nil { return nil } out := new(ExecConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { if in == nil { return nil } out := new(ExecEnvVar) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamedAuthInfo) DeepCopyInto(out *NamedAuthInfo) { *out = *in in.AuthInfo.DeepCopyInto(&out.AuthInfo) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedAuthInfo. func (in *NamedAuthInfo) DeepCopy() *NamedAuthInfo { if in == nil { return nil } out := new(NamedAuthInfo) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamedCluster) DeepCopyInto(out *NamedCluster) { *out = *in in.Cluster.DeepCopyInto(&out.Cluster) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedCluster. func (in *NamedCluster) DeepCopy() *NamedCluster { if in == nil { return nil } out := new(NamedCluster) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamedContext) DeepCopyInto(out *NamedContext) { *out = *in in.Context.DeepCopyInto(&out.Context) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedContext. func (in *NamedContext) DeepCopy() *NamedContext { if in == nil { return nil } out := new(NamedContext) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamedExtension) DeepCopyInto(out *NamedExtension) { *out = *in in.Extension.DeepCopyInto(&out.Extension) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedExtension. func (in *NamedExtension) DeepCopy() *NamedExtension { if in == nil { return nil } out := new(NamedExtension) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Preferences) DeepCopyInto(out *Preferences) { *out = *in if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make([]NamedExtension, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Preferences. func (in *Preferences) DeepCopy() *Preferences { if in == nil { return nil } out := new(Preferences) in.DeepCopyInto(out) return out } kubernetes-client-go-a2dfcab/tools/clientcmd/api/v1/zz_generated.defaults.go000066400000000000000000000024211472614177300274160ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by defaulter-gen. DO NOT EDIT. package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // RegisterDefaults adds defaulters functions to the given scheme. // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { scheme.AddTypeDefaultingFunc(&Config{}, func(obj interface{}) { SetObjectDefaults_Config(obj.(*Config)) }) return nil } func SetObjectDefaults_Config(in *Config) { for i := range in.AuthInfos { a := &in.AuthInfos[i] if a.AuthInfo.Exec != nil { SetDefaults_ExecConfig(a.AuthInfo.Exec) } } } kubernetes-client-go-a2dfcab/tools/clientcmd/api/zz_generated.deepcopy.go000066400000000000000000000203621472614177300270750ustar00rootroot00000000000000//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by deepcopy-gen. DO NOT EDIT. package api import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthInfo) DeepCopyInto(out *AuthInfo) { *out = *in if in.ClientCertificateData != nil { in, out := &in.ClientCertificateData, &out.ClientCertificateData *out = make([]byte, len(*in)) copy(*out, *in) } if in.ClientKeyData != nil { in, out := &in.ClientKeyData, &out.ClientKeyData *out = make([]byte, len(*in)) copy(*out, *in) } if in.ImpersonateGroups != nil { in, out := &in.ImpersonateGroups, &out.ImpersonateGroups *out = make([]string, len(*in)) copy(*out, *in) } if in.ImpersonateUserExtra != nil { in, out := &in.ImpersonateUserExtra, &out.ImpersonateUserExtra *out = make(map[string][]string, len(*in)) for key, val := range *in { var outVal []string if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal *out = make([]string, len(*in)) copy(*out, *in) } (*out)[key] = outVal } } if in.AuthProvider != nil { in, out := &in.AuthProvider, &out.AuthProvider *out = new(AuthProviderConfig) (*in).DeepCopyInto(*out) } if in.Exec != nil { in, out := &in.Exec, &out.Exec *out = new(ExecConfig) (*in).DeepCopyInto(*out) } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make(map[string]runtime.Object, len(*in)) for key, val := range *in { if val == nil { (*out)[key] = nil } else { (*out)[key] = val.DeepCopyObject() } } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthInfo. func (in *AuthInfo) DeepCopy() *AuthInfo { if in == nil { return nil } out := new(AuthInfo) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthProviderConfig) DeepCopyInto(out *AuthProviderConfig) { *out = *in if in.Config != nil { in, out := &in.Config, &out.Config *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthProviderConfig. func (in *AuthProviderConfig) DeepCopy() *AuthProviderConfig { if in == nil { return nil } out := new(AuthProviderConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in if in.CertificateAuthorityData != nil { in, out := &in.CertificateAuthorityData, &out.CertificateAuthorityData *out = make([]byte, len(*in)) copy(*out, *in) } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make(map[string]runtime.Object, len(*in)) for key, val := range *in { if val == nil { (*out)[key] = nil } else { (*out)[key] = val.DeepCopyObject() } } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. func (in *Cluster) DeepCopy() *Cluster { if in == nil { return nil } out := new(Cluster) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Config) DeepCopyInto(out *Config) { *out = *in in.Preferences.DeepCopyInto(&out.Preferences) if in.Clusters != nil { in, out := &in.Clusters, &out.Clusters *out = make(map[string]*Cluster, len(*in)) for key, val := range *in { var outVal *Cluster if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal *out = new(Cluster) (*in).DeepCopyInto(*out) } (*out)[key] = outVal } } if in.AuthInfos != nil { in, out := &in.AuthInfos, &out.AuthInfos *out = make(map[string]*AuthInfo, len(*in)) for key, val := range *in { var outVal *AuthInfo if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal *out = new(AuthInfo) (*in).DeepCopyInto(*out) } (*out)[key] = outVal } } if in.Contexts != nil { in, out := &in.Contexts, &out.Contexts *out = make(map[string]*Context, len(*in)) for key, val := range *in { var outVal *Context if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal *out = new(Context) (*in).DeepCopyInto(*out) } (*out)[key] = outVal } } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make(map[string]runtime.Object, len(*in)) for key, val := range *in { if val == nil { (*out)[key] = nil } else { (*out)[key] = val.DeepCopyObject() } } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config. func (in *Config) DeepCopy() *Config { if in == nil { return nil } out := new(Config) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *Config) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Context) DeepCopyInto(out *Context) { *out = *in if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make(map[string]runtime.Object, len(*in)) for key, val := range *in { if val == nil { (*out)[key] = nil } else { (*out)[key] = val.DeepCopyObject() } } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Context. func (in *Context) DeepCopy() *Context { if in == nil { return nil } out := new(Context) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecConfig) DeepCopyInto(out *ExecConfig) { *out = *in if in.Args != nil { in, out := &in.Args, &out.Args *out = make([]string, len(*in)) copy(*out, *in) } if in.Env != nil { in, out := &in.Env, &out.Env *out = make([]ExecEnvVar, len(*in)) copy(*out, *in) } if in.Config != nil { out.Config = in.Config.DeepCopyObject() } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecConfig. func (in *ExecConfig) DeepCopy() *ExecConfig { if in == nil { return nil } out := new(ExecConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { if in == nil { return nil } out := new(ExecEnvVar) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Preferences) DeepCopyInto(out *Preferences) { *out = *in if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make(map[string]runtime.Object, len(*in)) for key, val := range *in { if val == nil { (*out)[key] = nil } else { (*out)[key] = val.DeepCopyObject() } } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Preferences. func (in *Preferences) DeepCopy() *Preferences { if in == nil { return nil } out := new(Preferences) in.DeepCopyInto(out) return out } kubernetes-client-go-a2dfcab/tools/clientcmd/auth_loaders.go000066400000000000000000000061351472614177300245100ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "encoding/json" "fmt" "io" "os" "golang.org/x/term" clientauth "k8s.io/client-go/tools/auth" ) // AuthLoaders are used to build clientauth.Info objects. type AuthLoader interface { // LoadAuth takes a path to a config file and can then do anything it needs in order to return a valid clientauth.Info LoadAuth(path string) (*clientauth.Info, error) } // default implementation of an AuthLoader type defaultAuthLoader struct{} // LoadAuth for defaultAuthLoader simply delegates to clientauth.LoadFromFile func (*defaultAuthLoader) LoadAuth(path string) (*clientauth.Info, error) { return clientauth.LoadFromFile(path) } type PromptingAuthLoader struct { reader io.Reader } // LoadAuth parses an AuthInfo object from a file path. It prompts user and creates file if it doesn't exist. func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) { // Prompt for user/pass and write a file if none exists. if _, err := os.Stat(path); os.IsNotExist(err) { authPtr, err := a.Prompt() if err != nil { return nil, err } auth := *authPtr data, err := json.Marshal(auth) if err != nil { return &auth, err } err = os.WriteFile(path, data, 0600) return &auth, err } authPtr, err := clientauth.LoadFromFile(path) if err != nil { return nil, err } return authPtr, nil } // Prompt pulls the user and password from a reader func (a *PromptingAuthLoader) Prompt() (*clientauth.Info, error) { var err error auth := &clientauth.Info{} auth.User, err = promptForString("Username", a.reader, true) if err != nil { return nil, err } auth.Password, err = promptForString("Password", nil, false) if err != nil { return nil, err } return auth, nil } func promptForString(field string, r io.Reader, show bool) (result string, err error) { fmt.Printf("Please enter %s: ", field) if show { _, err = fmt.Fscan(r, &result) } else { var data []byte if term.IsTerminal(int(os.Stdin.Fd())) { data, err = term.ReadPassword(int(os.Stdin.Fd())) result = string(data) } else { return "", fmt.Errorf("error reading input for %s", field) } } return result, err } // NewPromptingAuthLoader is an AuthLoader that parses an AuthInfo object from a file path. It prompts user and creates file if it doesn't exist. func NewPromptingAuthLoader(reader io.Reader) *PromptingAuthLoader { return &PromptingAuthLoader{reader} } // NewDefaultAuthLoader returns a default implementation of an AuthLoader that only reads from a config file func NewDefaultAuthLoader() AuthLoader { return &defaultAuthLoader{} } kubernetes-client-go-a2dfcab/tools/clientcmd/client_config.go000066400000000000000000000657311472614177300246500ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "fmt" "io" "net/http" "net/url" "os" "strings" "unicode" restclient "k8s.io/client-go/rest" clientauth "k8s.io/client-go/tools/auth" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" "k8s.io/klog/v2" "github.com/imdario/mergo" ) const ( // clusterExtensionKey is reserved in the cluster extensions list for exec plugin config. clusterExtensionKey = "client.authentication.k8s.io/exec" ) var ( // ClusterDefaults has the same behavior as the old EnvVar and DefaultCluster fields // DEPRECATED will be replaced ClusterDefaults = clientcmdapi.Cluster{Server: getDefaultServer()} // DefaultClientConfig represents the legacy behavior of this package for defaulting // DEPRECATED will be replace DefaultClientConfig = DirectClientConfig{*clientcmdapi.NewConfig(), "", &ConfigOverrides{ ClusterDefaults: ClusterDefaults, }, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}} ) // getDefaultServer returns a default setting for DefaultClientConfig // DEPRECATED func getDefaultServer() string { if server := os.Getenv("KUBERNETES_MASTER"); len(server) > 0 { return server } return "http://localhost:8080" } // ClientConfig is used to make it easy to get an api server client type ClientConfig interface { // RawConfig returns the merged result of all overrides RawConfig() (clientcmdapi.Config, error) // ClientConfig returns a complete client config ClientConfig() (*restclient.Config, error) // Namespace returns the namespace resulting from the merged // result of all overrides and a boolean indicating if it was // overridden Namespace() (string, bool, error) // ConfigAccess returns the rules for loading/persisting the config. ConfigAccess() ConfigAccess } // OverridingClientConfig is used to enable overrriding the raw KubeConfig type OverridingClientConfig interface { ClientConfig // MergedRawConfig return the RawConfig merged with all overrides. MergedRawConfig() (clientcmdapi.Config, error) } type PersistAuthProviderConfigForUser func(user string) restclient.AuthProviderConfigPersister type promptedCredentials struct { username string password string `datapolicy:"password"` } // DirectClientConfig is a ClientConfig interface that is backed by a clientcmdapi.Config, options overrides, and an optional fallbackReader for auth information type DirectClientConfig struct { config clientcmdapi.Config contextName string overrides *ConfigOverrides fallbackReader io.Reader configAccess ConfigAccess // promptedCredentials store the credentials input by the user promptedCredentials promptedCredentials } // NewDefaultClientConfig creates a DirectClientConfig using the config.CurrentContext as the context name func NewDefaultClientConfig(config clientcmdapi.Config, overrides *ConfigOverrides) OverridingClientConfig { return &DirectClientConfig{config, config.CurrentContext, overrides, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}} } // NewNonInteractiveClientConfig creates a DirectClientConfig using the passed context name and does not have a fallback reader for auth information func NewNonInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, configAccess ConfigAccess) OverridingClientConfig { return &DirectClientConfig{config, contextName, overrides, nil, configAccess, promptedCredentials{}} } // NewInteractiveClientConfig creates a DirectClientConfig using the passed context name and a reader in case auth information is not provided via files or flags func NewInteractiveClientConfig(config clientcmdapi.Config, contextName string, overrides *ConfigOverrides, fallbackReader io.Reader, configAccess ConfigAccess) OverridingClientConfig { return &DirectClientConfig{config, contextName, overrides, fallbackReader, configAccess, promptedCredentials{}} } // NewClientConfigFromBytes takes your kubeconfig and gives you back a ClientConfig func NewClientConfigFromBytes(configBytes []byte) (OverridingClientConfig, error) { config, err := Load(configBytes) if err != nil { return nil, err } return &DirectClientConfig{*config, "", &ConfigOverrides{}, nil, nil, promptedCredentials{}}, nil } // RESTConfigFromKubeConfig is a convenience method to give back a restconfig from your kubeconfig bytes. // For programmatic access, this is what you want 80% of the time func RESTConfigFromKubeConfig(configBytes []byte) (*restclient.Config, error) { clientConfig, err := NewClientConfigFromBytes(configBytes) if err != nil { return nil, err } return clientConfig.ClientConfig() } func (config *DirectClientConfig) RawConfig() (clientcmdapi.Config, error) { return config.config, nil } // MergedRawConfig returns the raw kube config merged with the overrides func (config *DirectClientConfig) MergedRawConfig() (clientcmdapi.Config, error) { if err := config.ConfirmUsable(); err != nil { return clientcmdapi.Config{}, err } merged := config.config.DeepCopy() // set the AuthInfo merged with overrides in the merged config mergedAuthInfo, err := config.getAuthInfo() if err != nil { return clientcmdapi.Config{}, err } mergedAuthInfoName, _ := config.getAuthInfoName() merged.AuthInfos[mergedAuthInfoName] = &mergedAuthInfo // set the Context merged with overrides in the merged config mergedContext, err := config.getContext() if err != nil { return clientcmdapi.Config{}, err } mergedContextName, _ := config.getContextName() merged.Contexts[mergedContextName] = &mergedContext merged.CurrentContext = mergedContextName // set the Cluster merged with overrides in the merged config configClusterInfo, err := config.getCluster() if err != nil { return clientcmdapi.Config{}, err } configClusterName, _ := config.getClusterName() merged.Clusters[configClusterName] = &configClusterInfo return *merged, nil } // ClientConfig implements ClientConfig func (config *DirectClientConfig) ClientConfig() (*restclient.Config, error) { // check that getAuthInfo, getContext, and getCluster do not return an error. // Do this before checking if the current config is usable in the event that an // AuthInfo, Context, or Cluster config with user-defined names are not found. // This provides a user with the immediate cause for error if one is found configAuthInfo, err := config.getAuthInfo() if err != nil { return nil, err } _, err = config.getContext() if err != nil { return nil, err } configClusterInfo, err := config.getCluster() if err != nil { return nil, err } if err := config.ConfirmUsable(); err != nil { return nil, err } clientConfig := &restclient.Config{} clientConfig.Host = configClusterInfo.Server if configClusterInfo.ProxyURL != "" { u, err := parseProxyURL(configClusterInfo.ProxyURL) if err != nil { return nil, err } clientConfig.Proxy = http.ProxyURL(u) } clientConfig.DisableCompression = configClusterInfo.DisableCompression if config.overrides != nil && len(config.overrides.Timeout) > 0 { timeout, err := ParseTimeout(config.overrides.Timeout) if err != nil { return nil, err } clientConfig.Timeout = timeout } if u, err := url.ParseRequestURI(clientConfig.Host); err == nil && u.Opaque == "" && len(u.Path) > 1 { u.RawQuery = "" u.Fragment = "" clientConfig.Host = u.String() } if len(configAuthInfo.Impersonate) > 0 { clientConfig.Impersonate = restclient.ImpersonationConfig{ UserName: configAuthInfo.Impersonate, UID: configAuthInfo.ImpersonateUID, Groups: configAuthInfo.ImpersonateGroups, Extra: configAuthInfo.ImpersonateUserExtra, } } // only try to read the auth information if we are secure if restclient.IsConfigTransportTLS(*clientConfig) { var err error var persister restclient.AuthProviderConfigPersister if config.configAccess != nil { authInfoName, _ := config.getAuthInfoName() persister = PersisterForUser(config.configAccess, authInfoName) } userAuthPartialConfig, err := config.getUserIdentificationPartialConfig(configAuthInfo, config.fallbackReader, persister, configClusterInfo) if err != nil { return nil, err } mergo.Merge(clientConfig, userAuthPartialConfig, mergo.WithOverride) serverAuthPartialConfig, err := getServerIdentificationPartialConfig(configAuthInfo, configClusterInfo) if err != nil { return nil, err } mergo.Merge(clientConfig, serverAuthPartialConfig, mergo.WithOverride) } return clientConfig, nil } // clientauth.Info object contain both user identification and server identification. We want different precedence orders for // both, so we have to split the objects and merge them separately // we want this order of precedence for the server identification // 1. configClusterInfo (the final result of command line flags and merged .kubeconfig files) // 2. configAuthInfo.auth-path (this file can contain information that conflicts with #1, and we want #1 to win the priority) // 3. load the ~/.kubernetes_auth file as a default func getServerIdentificationPartialConfig(configAuthInfo clientcmdapi.AuthInfo, configClusterInfo clientcmdapi.Cluster) (*restclient.Config, error) { mergedConfig := &restclient.Config{} // configClusterInfo holds the information identify the server provided by .kubeconfig configClientConfig := &restclient.Config{} configClientConfig.CAFile = configClusterInfo.CertificateAuthority configClientConfig.CAData = configClusterInfo.CertificateAuthorityData configClientConfig.Insecure = configClusterInfo.InsecureSkipTLSVerify configClientConfig.ServerName = configClusterInfo.TLSServerName mergo.Merge(mergedConfig, configClientConfig, mergo.WithOverride) return mergedConfig, nil } // clientauth.Info object contain both user identification and server identification. We want different precedence orders for // both, so we have to split the objects and merge them separately // we want this order of precedence for user identification // 1. configAuthInfo minus auth-path (the final result of command line flags and merged .kubeconfig files) // 2. configAuthInfo.auth-path (this file can contain information that conflicts with #1, and we want #1 to win the priority) // 3. if there is not enough information to identify the user, load try the ~/.kubernetes_auth file // 4. if there is not enough information to identify the user, prompt if possible func (config *DirectClientConfig) getUserIdentificationPartialConfig(configAuthInfo clientcmdapi.AuthInfo, fallbackReader io.Reader, persistAuthConfig restclient.AuthProviderConfigPersister, configClusterInfo clientcmdapi.Cluster) (*restclient.Config, error) { mergedConfig := &restclient.Config{} // blindly overwrite existing values based on precedence if len(configAuthInfo.Token) > 0 { mergedConfig.BearerToken = configAuthInfo.Token mergedConfig.BearerTokenFile = configAuthInfo.TokenFile } else if len(configAuthInfo.TokenFile) > 0 { tokenBytes, err := os.ReadFile(configAuthInfo.TokenFile) if err != nil { return nil, err } mergedConfig.BearerToken = string(tokenBytes) mergedConfig.BearerTokenFile = configAuthInfo.TokenFile } if len(configAuthInfo.Impersonate) > 0 { mergedConfig.Impersonate = restclient.ImpersonationConfig{ UserName: configAuthInfo.Impersonate, UID: configAuthInfo.ImpersonateUID, Groups: configAuthInfo.ImpersonateGroups, Extra: configAuthInfo.ImpersonateUserExtra, } } if len(configAuthInfo.ClientCertificate) > 0 || len(configAuthInfo.ClientCertificateData) > 0 { mergedConfig.CertFile = configAuthInfo.ClientCertificate mergedConfig.CertData = configAuthInfo.ClientCertificateData mergedConfig.KeyFile = configAuthInfo.ClientKey mergedConfig.KeyData = configAuthInfo.ClientKeyData } if len(configAuthInfo.Username) > 0 || len(configAuthInfo.Password) > 0 { mergedConfig.Username = configAuthInfo.Username mergedConfig.Password = configAuthInfo.Password } if configAuthInfo.AuthProvider != nil { mergedConfig.AuthProvider = configAuthInfo.AuthProvider mergedConfig.AuthConfigPersister = persistAuthConfig } if configAuthInfo.Exec != nil { mergedConfig.ExecProvider = configAuthInfo.Exec mergedConfig.ExecProvider.InstallHint = cleanANSIEscapeCodes(mergedConfig.ExecProvider.InstallHint) mergedConfig.ExecProvider.Config = configClusterInfo.Extensions[clusterExtensionKey] } // if there still isn't enough information to authenticate the user, try prompting if !canIdentifyUser(*mergedConfig) && (fallbackReader != nil) { if len(config.promptedCredentials.username) > 0 && len(config.promptedCredentials.password) > 0 { mergedConfig.Username = config.promptedCredentials.username mergedConfig.Password = config.promptedCredentials.password return mergedConfig, nil } prompter := NewPromptingAuthLoader(fallbackReader) promptedAuthInfo, err := prompter.Prompt() if err != nil { return nil, err } promptedConfig := makeUserIdentificationConfig(*promptedAuthInfo) previouslyMergedConfig := mergedConfig mergedConfig = &restclient.Config{} mergo.Merge(mergedConfig, promptedConfig, mergo.WithOverride) mergo.Merge(mergedConfig, previouslyMergedConfig, mergo.WithOverride) config.promptedCredentials.username = mergedConfig.Username config.promptedCredentials.password = mergedConfig.Password } return mergedConfig, nil } // makeUserIdentificationFieldsConfig returns a client.Config capable of being merged using mergo for only user identification information func makeUserIdentificationConfig(info clientauth.Info) *restclient.Config { config := &restclient.Config{} config.Username = info.User config.Password = info.Password config.CertFile = info.CertFile config.KeyFile = info.KeyFile config.BearerToken = info.BearerToken return config } func canIdentifyUser(config restclient.Config) bool { return len(config.Username) > 0 || (len(config.CertFile) > 0 || len(config.CertData) > 0) || len(config.BearerToken) > 0 || config.AuthProvider != nil || config.ExecProvider != nil } // cleanANSIEscapeCodes takes an arbitrary string and ensures that there are no // ANSI escape sequences that could put the terminal in a weird state (e.g., // "\e[1m" bolds text) func cleanANSIEscapeCodes(s string) string { // spaceControlCharacters includes tab, new line, vertical tab, new page, and // carriage return. These are in the unicode.Cc category, but that category also // contains ESC (U+001B) which we don't want. spaceControlCharacters := unicode.RangeTable{ R16: []unicode.Range16{ {Lo: 0x0009, Hi: 0x000D, Stride: 1}, }, } // Why not make this deny-only (instead of allow-only)? Because unicode.C // contains newline and tab characters that we want. allowedRanges := []*unicode.RangeTable{ unicode.L, unicode.M, unicode.N, unicode.P, unicode.S, unicode.Z, &spaceControlCharacters, } builder := strings.Builder{} for _, roon := range s { if unicode.IsOneOf(allowedRanges, roon) { builder.WriteRune(roon) // returns nil error, per go doc } else { fmt.Fprintf(&builder, "%U", roon) } } return builder.String() } // Namespace implements ClientConfig func (config *DirectClientConfig) Namespace() (string, bool, error) { if config.overrides != nil && config.overrides.Context.Namespace != "" { // In the event we have an empty config but we do have a namespace override, we should return // the namespace override instead of having config.ConfirmUsable() return an error. This allows // things like in-cluster clients to execute `kubectl get pods --namespace=foo` and have the // --namespace flag honored instead of being ignored. return config.overrides.Context.Namespace, true, nil } if err := config.ConfirmUsable(); err != nil { return "", false, err } configContext, err := config.getContext() if err != nil { return "", false, err } if len(configContext.Namespace) == 0 { return "default", false, nil } return configContext.Namespace, false, nil } // ConfigAccess implements ClientConfig func (config *DirectClientConfig) ConfigAccess() ConfigAccess { return config.configAccess } // ConfirmUsable looks a particular context and determines if that particular part of the config is useable. There might still be errors in the config, // but no errors in the sections requested or referenced. It does not return early so that it can find as many errors as possible. func (config *DirectClientConfig) ConfirmUsable() error { validationErrors := make([]error, 0) var contextName string if len(config.contextName) != 0 { contextName = config.contextName } else { contextName = config.config.CurrentContext } if len(contextName) > 0 { _, exists := config.config.Contexts[contextName] if !exists { validationErrors = append(validationErrors, &errContextNotFound{contextName}) } } authInfoName, _ := config.getAuthInfoName() authInfo, _ := config.getAuthInfo() validationErrors = append(validationErrors, validateAuthInfo(authInfoName, authInfo)...) clusterName, _ := config.getClusterName() cluster, _ := config.getCluster() validationErrors = append(validationErrors, validateClusterInfo(clusterName, cluster)...) // when direct client config is specified, and our only error is that no server is defined, we should // return a standard "no config" error if len(validationErrors) == 1 && validationErrors[0] == ErrEmptyCluster { return newErrConfigurationInvalid([]error{ErrEmptyConfig}) } return newErrConfigurationInvalid(validationErrors) } // getContextName returns the default, or user-set context name, and a boolean that indicates // whether the default context name has been overwritten by a user-set flag, or left as its default value func (config *DirectClientConfig) getContextName() (string, bool) { if config.overrides != nil && len(config.overrides.CurrentContext) != 0 { return config.overrides.CurrentContext, true } if len(config.contextName) != 0 { return config.contextName, false } return config.config.CurrentContext, false } // getAuthInfoName returns a string containing the current authinfo name for the current context, // and a boolean indicating whether the default authInfo name is overwritten by a user-set flag, or // left as its default value func (config *DirectClientConfig) getAuthInfoName() (string, bool) { if config.overrides != nil && len(config.overrides.Context.AuthInfo) != 0 { return config.overrides.Context.AuthInfo, true } context, _ := config.getContext() return context.AuthInfo, false } // getClusterName returns a string containing the default, or user-set cluster name, and a boolean // indicating whether the default clusterName has been overwritten by a user-set flag, or left as // its default value func (config *DirectClientConfig) getClusterName() (string, bool) { if config.overrides != nil && len(config.overrides.Context.Cluster) != 0 { return config.overrides.Context.Cluster, true } context, _ := config.getContext() return context.Cluster, false } // getContext returns the clientcmdapi.Context, or an error if a required context is not found. func (config *DirectClientConfig) getContext() (clientcmdapi.Context, error) { contexts := config.config.Contexts contextName, required := config.getContextName() mergedContext := clientcmdapi.NewContext() if configContext, exists := contexts[contextName]; exists { mergo.Merge(mergedContext, configContext, mergo.WithOverride) } else if required { return clientcmdapi.Context{}, fmt.Errorf("context %q does not exist", contextName) } if config.overrides != nil { mergo.Merge(mergedContext, config.overrides.Context, mergo.WithOverride) } return *mergedContext, nil } // getAuthInfo returns the clientcmdapi.AuthInfo, or an error if a required auth info is not found. func (config *DirectClientConfig) getAuthInfo() (clientcmdapi.AuthInfo, error) { authInfos := config.config.AuthInfos authInfoName, required := config.getAuthInfoName() mergedAuthInfo := clientcmdapi.NewAuthInfo() if configAuthInfo, exists := authInfos[authInfoName]; exists { mergo.Merge(mergedAuthInfo, configAuthInfo, mergo.WithOverride) } else if required { return clientcmdapi.AuthInfo{}, fmt.Errorf("auth info %q does not exist", authInfoName) } if config.overrides != nil { mergo.Merge(mergedAuthInfo, config.overrides.AuthInfo, mergo.WithOverride) } return *mergedAuthInfo, nil } // getCluster returns the clientcmdapi.Cluster, or an error if a required cluster is not found. func (config *DirectClientConfig) getCluster() (clientcmdapi.Cluster, error) { clusterInfos := config.config.Clusters clusterInfoName, required := config.getClusterName() mergedClusterInfo := clientcmdapi.NewCluster() if config.overrides != nil { mergo.Merge(mergedClusterInfo, config.overrides.ClusterDefaults, mergo.WithOverride) } if configClusterInfo, exists := clusterInfos[clusterInfoName]; exists { mergo.Merge(mergedClusterInfo, configClusterInfo, mergo.WithOverride) } else if required { return clientcmdapi.Cluster{}, fmt.Errorf("cluster %q does not exist", clusterInfoName) } if config.overrides != nil { mergo.Merge(mergedClusterInfo, config.overrides.ClusterInfo, mergo.WithOverride) } // * An override of --insecure-skip-tls-verify=true and no accompanying CA/CA data should clear already-set CA/CA data // otherwise, a kubeconfig containing a CA reference would return an error that "CA and insecure-skip-tls-verify couldn't both be set". // * An override of --certificate-authority should also override TLS skip settings and CA data, otherwise existing CA data will take precedence. if config.overrides != nil { caLen := len(config.overrides.ClusterInfo.CertificateAuthority) caDataLen := len(config.overrides.ClusterInfo.CertificateAuthorityData) if config.overrides.ClusterInfo.InsecureSkipTLSVerify || caLen > 0 || caDataLen > 0 { mergedClusterInfo.InsecureSkipTLSVerify = config.overrides.ClusterInfo.InsecureSkipTLSVerify mergedClusterInfo.CertificateAuthority = config.overrides.ClusterInfo.CertificateAuthority mergedClusterInfo.CertificateAuthorityData = config.overrides.ClusterInfo.CertificateAuthorityData } // if the --tls-server-name has been set in overrides, use that value. // if the --server has been set in overrides, then use the value of --tls-server-name specified on the CLI too. This gives the property // that setting a --server will effectively clear the KUBECONFIG value of tls-server-name if it is specified on the command line which is // usually correct. if config.overrides.ClusterInfo.TLSServerName != "" || config.overrides.ClusterInfo.Server != "" { mergedClusterInfo.TLSServerName = config.overrides.ClusterInfo.TLSServerName } } return *mergedClusterInfo, nil } // inClusterClientConfig makes a config that will work from within a kubernetes cluster container environment. // Can take options overrides for flags explicitly provided to the command inside the cluster container. type inClusterClientConfig struct { overrides *ConfigOverrides inClusterConfigProvider func() (*restclient.Config, error) } var _ ClientConfig = &inClusterClientConfig{} func (config *inClusterClientConfig) RawConfig() (clientcmdapi.Config, error) { return clientcmdapi.Config{}, fmt.Errorf("inCluster environment config doesn't support multiple clusters") } func (config *inClusterClientConfig) ClientConfig() (*restclient.Config, error) { inClusterConfigProvider := config.inClusterConfigProvider if inClusterConfigProvider == nil { inClusterConfigProvider = restclient.InClusterConfig } icc, err := inClusterConfigProvider() if err != nil { return nil, err } // in-cluster configs only takes a host, token, or CA file // if any of them were individually provided, overwrite anything else if config.overrides != nil { if server := config.overrides.ClusterInfo.Server; len(server) > 0 { icc.Host = server } if len(config.overrides.AuthInfo.Token) > 0 || len(config.overrides.AuthInfo.TokenFile) > 0 { icc.BearerToken = config.overrides.AuthInfo.Token icc.BearerTokenFile = config.overrides.AuthInfo.TokenFile } if certificateAuthorityFile := config.overrides.ClusterInfo.CertificateAuthority; len(certificateAuthorityFile) > 0 { icc.TLSClientConfig.CAFile = certificateAuthorityFile } } return icc, nil } func (config *inClusterClientConfig) Namespace() (string, bool, error) { // This way assumes you've set the POD_NAMESPACE environment variable using the downward API. // This check has to be done first for backwards compatibility with the way InClusterConfig was originally set up if ns := os.Getenv("POD_NAMESPACE"); ns != "" { return ns, false, nil } // Fall back to the namespace associated with the service account token, if available if data, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil { if ns := strings.TrimSpace(string(data)); len(ns) > 0 { return ns, false, nil } } return "default", false, nil } func (config *inClusterClientConfig) ConfigAccess() ConfigAccess { return NewDefaultClientConfigLoadingRules() } // Possible returns true if loading an inside-kubernetes-cluster is possible. func (config *inClusterClientConfig) Possible() bool { fi, err := os.Stat("/var/run/secrets/kubernetes.io/serviceaccount/token") return os.Getenv("KUBERNETES_SERVICE_HOST") != "" && os.Getenv("KUBERNETES_SERVICE_PORT") != "" && err == nil && !fi.IsDir() } // BuildConfigFromFlags is a helper function that builds configs from a master // url or a kubeconfig filepath. These are passed in as command line flags for cluster // components. Warnings should reflect this usage. If neither masterUrl or kubeconfigPath // are passed in we fallback to inClusterConfig. If inClusterConfig fails, we fallback // to the default config. func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) { if kubeconfigPath == "" && masterUrl == "" { klog.Warning("Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.") kubeconfig, err := restclient.InClusterConfig() if err == nil { return kubeconfig, nil } klog.Warning("error creating inClusterConfig, falling back to default config: ", err) } return NewNonInteractiveDeferredLoadingClientConfig( &ClientConfigLoadingRules{ExplicitPath: kubeconfigPath}, &ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: masterUrl}}).ClientConfig() } // BuildConfigFromKubeconfigGetter is a helper function that builds configs from a master // url and a kubeconfigGetter. func BuildConfigFromKubeconfigGetter(masterUrl string, kubeconfigGetter KubeconfigGetter) (*restclient.Config, error) { // TODO: We do not need a DeferredLoader here. Refactor code and see if we can use DirectClientConfig here. cc := NewNonInteractiveDeferredLoadingClientConfig( &ClientConfigGetter{kubeconfigGetter: kubeconfigGetter}, &ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: masterUrl}}) return cc.ClientConfig() } kubernetes-client-go-a2dfcab/tools/clientcmd/client_config_test.go000066400000000000000000000732021472614177300256770ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "os" "reflect" "strings" "testing" utiltesting "k8s.io/client-go/util/testing" "github.com/imdario/mergo" "k8s.io/apimachinery/pkg/runtime" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) func TestMergoSemantics(t *testing.T) { type U struct { A string B int64 } type T struct { S []string X string Y int64 U U } var testDataStruct = []struct { dst T src T expected T }{ { dst: T{X: "one"}, src: T{X: "two"}, expected: T{X: "two"}, }, { dst: T{X: "one", Y: 5, U: U{A: "four", B: 6}}, src: T{X: "two", U: U{A: "three", B: 4}}, expected: T{X: "two", Y: 5, U: U{A: "three", B: 4}}, }, { dst: T{S: []string{"test3", "test4", "test5"}}, src: T{S: []string{"test1", "test2", "test3"}}, expected: T{S: []string{"test1", "test2", "test3"}}, }, } for _, data := range testDataStruct { err := mergo.Merge(&data.dst, &data.src, mergo.WithOverride) if err != nil { t.Errorf("error while merging: %s", err) } if !reflect.DeepEqual(data.dst, data.expected) { // The mergo library has previously changed in a an incompatible way. // example: // // https://github.com/imdario/mergo/commit/d304790b2ed594794496464fadd89d2bb266600a // // This test verifies that the semantics of the merge are what we expect. // If they are not, the mergo library may have been updated and broken // unexpectedly. t.Errorf("mergo.MergeWithOverwrite did not provide expected output: %+v doesn't match %+v", data.dst, data.expected) } } var testDataMap = []struct { dst map[string]int src map[string]int expected map[string]int }{ { dst: map[string]int{"rsc": 6543, "r": 2138, "gri": 1908, "adg": 912, "prt": 22}, src: map[string]int{"rsc": 3711, "r": 2138, "gri": 1908, "adg": 912}, expected: map[string]int{"rsc": 3711, "r": 2138, "gri": 1908, "adg": 912, "prt": 22}, }, } for _, data := range testDataMap { err := mergo.Merge(&data.dst, &data.src, mergo.WithOverride) if err != nil { t.Errorf("error while merging: %s", err) } if !reflect.DeepEqual(data.dst, data.expected) { // The mergo library has previously changed in a an incompatible way. // example: // // https://github.com/imdario/mergo/commit/d304790b2ed594794496464fadd89d2bb266600a // // This test verifies that the semantics of the merge are what we expect. // If they are not, the mergo library may have been updated and broken // unexpectedly. t.Errorf("mergo.MergeWithOverwrite did not provide expected output: %+v doesn't match %+v", data.dst, data.expected) } } } func createValidTestConfig() *clientcmdapi.Config { const ( server = "https://anything.com:8080" token = "the-token" ) config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: server, } config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ Token: token, } config.Contexts["clean"] = &clientcmdapi.Context{ Cluster: "clean", AuthInfo: "clean", } config.CurrentContext = "clean" return config } func createCAValidTestConfig() *clientcmdapi.Config { config := createValidTestConfig() config.Clusters["clean"].CertificateAuthorityData = []byte{0, 0} return config } func TestDisableCompression(t *testing.T) { config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ DisableCompression: true, }, }, nil) actualCfg, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchBoolArg(true, actualCfg.DisableCompression, t) } func TestInsecureOverridesCA(t *testing.T) { config := createCAValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ InsecureSkipTLSVerify: true, }, }, nil) actualCfg, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchBoolArg(true, actualCfg.Insecure, t) matchStringArg("", actualCfg.TLSClientConfig.CAFile, t) matchByteArg(nil, actualCfg.TLSClientConfig.CAData, t) } func TestCAOverridesCAData(t *testing.T) { file, err := os.CreateTemp("", "my.ca") if err != nil { t.Fatalf("could not create tempfile: %v", err) } defer utiltesting.CloseAndRemove(t, file) config := createCAValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ CertificateAuthority: file.Name(), }, }, nil) actualCfg, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchBoolArg(false, actualCfg.Insecure, t) matchStringArg(file.Name(), actualCfg.TLSClientConfig.CAFile, t) matchByteArg(nil, actualCfg.TLSClientConfig.CAData, t) } func TestTLSServerName(t *testing.T) { config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ TLSServerName: "overridden-server-name", }, }, nil) actualCfg, err := clientBuilder.ClientConfig() if err != nil { t.Errorf("Unexpected error: %v", err) } matchStringArg("overridden-server-name", actualCfg.ServerName, t) matchStringArg("", actualCfg.TLSClientConfig.CAFile, t) matchByteArg(nil, actualCfg.TLSClientConfig.CAData, t) } func TestTLSServerNameClearsWhenServerNameSet(t *testing.T) { config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: "http://something", }, }, nil) actualCfg, err := clientBuilder.ClientConfig() if err != nil { t.Errorf("Unexpected error: %v", err) } matchStringArg("", actualCfg.ServerName, t) } func TestFullImpersonateConfig(t *testing.T) { config := createValidTestConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "https://localhost:8443", } config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ Impersonate: "alice", ImpersonateUID: "abc123", ImpersonateGroups: []string{"group-1"}, ImpersonateUserExtra: map[string][]string{"some-key": {"some-value"}}, } config.Contexts["clean"] = &clientcmdapi.Context{ Cluster: "clean", AuthInfo: "clean", } config.CurrentContext = "clean" clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: "http://something", }, }, nil) actualCfg, err := clientBuilder.ClientConfig() if err != nil { t.Errorf("Unexpected error: %v", err) } matchStringArg("alice", actualCfg.Impersonate.UserName, t) matchStringArg("abc123", actualCfg.Impersonate.UID, t) matchIntArg(1, len(actualCfg.Impersonate.Groups), t) matchStringArg("group-1", actualCfg.Impersonate.Groups[0], t) matchIntArg(1, len(actualCfg.Impersonate.Extra), t) matchIntArg(1, len(actualCfg.Impersonate.Extra["some-key"]), t) matchStringArg("some-value", actualCfg.Impersonate.Extra["some-key"][0], t) } func TestMergeContext(t *testing.T) { const namespace = "overridden-namespace" config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) _, overridden, err := clientBuilder.Namespace() if err != nil { t.Errorf("Unexpected error: %v", err) } if overridden { t.Error("Expected namespace to not be overridden") } clientBuilder = NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ Context: clientcmdapi.Context{ Namespace: namespace, }, }, nil) actual, overridden, err := clientBuilder.Namespace() if err != nil { t.Errorf("Unexpected error: %v", err) } if !overridden { t.Error("Expected namespace to be overridden") } matchStringArg(namespace, actual, t) } func TestModifyContext(t *testing.T) { expectedCtx := map[string]bool{ "updated": true, "clean": true, } tempPath, err := os.CreateTemp("", "testclientcmd-") if err != nil { t.Fatalf("unexpected error: %v", err) } defer utiltesting.CloseAndRemove(t, tempPath) pathOptions := NewDefaultPathOptions() config := createValidTestConfig() pathOptions.GlobalFile = tempPath.Name() // define new context and assign it - our path options config config.Contexts["updated"] = &clientcmdapi.Context{ Cluster: "updated", AuthInfo: "updated", } config.CurrentContext = "updated" if err := ModifyConfig(pathOptions, *config, true); err != nil { t.Errorf("Unexpected error: %v", err) } startingConfig, err := pathOptions.GetStartingConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } // make sure the current context was updated matchStringArg("updated", startingConfig.CurrentContext, t) // there should now be two contexts if len(startingConfig.Contexts) != len(expectedCtx) { t.Fatalf("unexpected number of contexts, expecting %v, but found %v", len(expectedCtx), len(startingConfig.Contexts)) } for key := range startingConfig.Contexts { if !expectedCtx[key] { t.Fatalf("expected context %q to exist", key) } } } func TestCertificateData(t *testing.T) { caData := []byte("ca-data") certData := []byte("cert-data") keyData := []byte("key-data") config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "https://localhost:8443", CertificateAuthorityData: caData, } config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ ClientCertificateData: certData, ClientKeyData: keyData, } config.Contexts["clean"] = &clientcmdapi.Context{ Cluster: "clean", AuthInfo: "clean", } config.CurrentContext = "clean" clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } // Make sure cert data gets into config (will override file paths) matchByteArg(caData, clientConfig.TLSClientConfig.CAData, t) matchByteArg(certData, clientConfig.TLSClientConfig.CertData, t) matchByteArg(keyData, clientConfig.TLSClientConfig.KeyData, t) } func TestProxyURL(t *testing.T) { tests := []struct { desc string proxyURL string expectErr bool }{ { desc: "no proxy-url", }, { desc: "socks5 proxy-url", proxyURL: "socks5://example.com", }, { desc: "https proxy-url", proxyURL: "https://example.com", }, { desc: "http proxy-url", proxyURL: "http://example.com", }, { desc: "bad scheme proxy-url", proxyURL: "socks6://example.com", expectErr: true, }, { desc: "no scheme proxy-url", proxyURL: "example.com", expectErr: true, }, { desc: "not a url proxy-url", proxyURL: "chewbacca@example.com", expectErr: true, }, } for _, test := range tests { t.Run(test.proxyURL, func(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "https://localhost:8443", ProxyURL: test.proxyURL, } config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{} config.Contexts["clean"] = &clientcmdapi.Context{ Cluster: "clean", AuthInfo: "clean", } config.CurrentContext = "clean" clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) clientConfig, err := clientBuilder.ClientConfig() if test.expectErr { if err == nil { t.Fatal("Expected error constructing config") } return } if err != nil { t.Fatalf("Unexpected error constructing config: %v", err) } if test.proxyURL == "" { return } gotURL, err := clientConfig.Proxy(nil) if err != nil { t.Fatalf("Unexpected error from proxier: %v", err) } matchStringArg(test.proxyURL, gotURL.String(), t) }) } } func TestBasicAuthData(t *testing.T) { username := "myuser" password := "mypass" // Fake value for testing. config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "https://localhost:8443", } config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ Username: username, Password: password, } config.Contexts["clean"] = &clientcmdapi.Context{ Cluster: "clean", AuthInfo: "clean", } config.CurrentContext = "clean" clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } // Make sure basic auth data gets into config matchStringArg(username, clientConfig.Username, t) matchStringArg(password, clientConfig.Password, t) } func TestBasicTokenFile(t *testing.T) { token := "exampletoken" f, err := os.CreateTemp("", "tokenfile") if err != nil { t.Errorf("Unexpected error: %v", err) return } defer utiltesting.CloseAndRemove(t, f) if err := os.WriteFile(f.Name(), []byte(token), 0644); err != nil { t.Errorf("Unexpected error: %v", err) return } config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "https://localhost:8443", } config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ TokenFile: f.Name(), } config.Contexts["clean"] = &clientcmdapi.Context{ Cluster: "clean", AuthInfo: "clean", } config.CurrentContext = "clean" clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchStringArg(token, clientConfig.BearerToken, t) } func TestPrecedenceTokenFile(t *testing.T) { token := "exampletoken" f, err := os.CreateTemp("", "tokenfile") if err != nil { t.Errorf("Unexpected error: %v", err) return } defer utiltesting.CloseAndRemove(t, f) if err := os.WriteFile(f.Name(), []byte(token), 0644); err != nil { t.Errorf("Unexpected error: %v", err) return } config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "https://localhost:8443", } expectedToken := "expected" config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ Token: expectedToken, TokenFile: f.Name(), } config.Contexts["clean"] = &clientcmdapi.Context{ Cluster: "clean", AuthInfo: "clean", } config.CurrentContext = "clean" clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchStringArg(expectedToken, clientConfig.BearerToken, t) } func TestCreateClean(t *testing.T) { config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Errorf("Unexpected error: %v", err) } matchStringArg(config.Clusters["clean"].Server, clientConfig.Host, t) matchStringArg("", clientConfig.APIPath, t) matchBoolArg(config.Clusters["clean"].InsecureSkipTLSVerify, clientConfig.Insecure, t) matchStringArg(config.AuthInfos["clean"].Token, clientConfig.BearerToken, t) matchStringArg(config.Clusters["clean"].TLSServerName, clientConfig.ServerName, t) } func TestCreateCleanWithPrefix(t *testing.T) { tt := []struct { server string host string }{ {"https://anything.com:8080/foo/bar", "https://anything.com:8080/foo/bar"}, {"http://anything.com:8080/foo/bar", "http://anything.com:8080/foo/bar"}, {"http://anything.com:8080/foo/bar/", "http://anything.com:8080/foo/bar/"}, {"http://anything.com:8080/", "http://anything.com:8080/"}, {"http://anything.com:8080//", "http://anything.com:8080//"}, {"anything.com:8080/foo/bar", "anything.com:8080/foo/bar"}, {"anything.com:8080", "anything.com:8080"}, {"anything.com", "anything.com"}, {"anything", "anything"}, } tt = append(tt, struct{ server, host string }{"", "http://localhost:8080"}) for _, tc := range tt { config := createValidTestConfig() cleanConfig := config.Clusters["clean"] cleanConfig.Server = tc.server config.Clusters["clean"] = cleanConfig clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ ClusterDefaults: clientcmdapi.Cluster{Server: "http://localhost:8080"}, }, nil) clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchStringArg(tc.host, clientConfig.Host, t) } } func TestCreateCleanDefault(t *testing.T) { config := createValidTestConfig() clientBuilder := NewDefaultClientConfig(*config, &ConfigOverrides{}) clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchStringArg(config.Clusters["clean"].Server, clientConfig.Host, t) matchStringArg(config.Clusters["clean"].TLSServerName, clientConfig.ServerName, t) matchBoolArg(config.Clusters["clean"].InsecureSkipTLSVerify, clientConfig.Insecure, t) matchStringArg(config.AuthInfos["clean"].Token, clientConfig.BearerToken, t) } func TestCreateCleanDefaultCluster(t *testing.T) { config := createValidTestConfig() clientBuilder := NewDefaultClientConfig(*config, &ConfigOverrides{ ClusterDefaults: clientcmdapi.Cluster{Server: "http://localhost:8080"}, }) clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchStringArg(config.Clusters["clean"].Server, clientConfig.Host, t) matchStringArg(config.Clusters["clean"].TLSServerName, clientConfig.ServerName, t) matchBoolArg(config.Clusters["clean"].InsecureSkipTLSVerify, clientConfig.Insecure, t) matchStringArg(config.AuthInfos["clean"].Token, clientConfig.BearerToken, t) } func TestCreateMissingContextNoDefault(t *testing.T) { config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "not-present", &ConfigOverrides{}, nil) _, err := clientBuilder.ClientConfig() if err == nil { t.Fatalf("Unexpected error: %v", err) } } func TestCreateMissingContext(t *testing.T) { const expectedErrorContains = "context was not found for specified context: not-present" config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "not-present", &ConfigOverrides{ ClusterDefaults: clientcmdapi.Cluster{Server: "http://localhost:8080"}, }, nil) _, err := clientBuilder.ClientConfig() if err == nil { t.Fatalf("Expected error: %v", expectedErrorContains) } if !strings.Contains(err.Error(), expectedErrorContains) { t.Fatalf("Expected error: %v, but got %v", expectedErrorContains, err) } } func TestCreateAuthConfigExecInstallHintCleanup(t *testing.T) { config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{ AuthInfo: clientcmdapi.AuthInfo{ Exec: &clientcmdapi.ExecConfig{ APIVersion: "client.authentication.k8s.io/v1alpha1", Command: "some-command", InstallHint: "some install hint with \x1b[1mcontrol chars\x1b[0m\nand a newline", InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, }, }, nil) cleanedInstallHint := "some install hint with U+001B[1mcontrol charsU+001B[0m\nand a newline" clientConfig, err := clientBuilder.ClientConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } matchStringArg(cleanedInstallHint, clientConfig.ExecProvider.InstallHint, t) } func TestInClusterClientConfigPrecedence(t *testing.T) { tt := []struct { overrides *ConfigOverrides }{ { overrides: &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: "https://host-from-overrides.com", }, }, }, { overrides: &ConfigOverrides{ AuthInfo: clientcmdapi.AuthInfo{ Token: "https://host-from-overrides.com", }, }, }, { overrides: &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ CertificateAuthority: "/path/to/ca-from-overrides.crt", }, }, }, { overrides: &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: "https://host-from-overrides.com", }, AuthInfo: clientcmdapi.AuthInfo{ Token: "https://host-from-overrides.com", }, }, }, { overrides: &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: "https://host-from-overrides.com", CertificateAuthority: "/path/to/ca-from-overrides.crt", }, }, }, { overrides: &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ CertificateAuthority: "/path/to/ca-from-overrides.crt", }, AuthInfo: clientcmdapi.AuthInfo{ Token: "https://host-from-overrides.com", }, }, }, { overrides: &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: "https://host-from-overrides.com", CertificateAuthority: "/path/to/ca-from-overrides.crt", }, AuthInfo: clientcmdapi.AuthInfo{ Token: "https://host-from-overrides.com", }, }, }, { overrides: &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: "https://host-from-overrides.com", CertificateAuthority: "/path/to/ca-from-overrides.crt", }, AuthInfo: clientcmdapi.AuthInfo{ Token: "token-from-override", TokenFile: "tokenfile-from-override", }, }, }, { overrides: &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: "https://host-from-overrides.com", CertificateAuthority: "/path/to/ca-from-overrides.crt", }, AuthInfo: clientcmdapi.AuthInfo{ Token: "", TokenFile: "tokenfile-from-override", }, }, }, { overrides: &ConfigOverrides{}, }, } for _, tc := range tt { expectedServer := "https://host-from-cluster.com" expectedToken := "token-from-cluster" expectedTokenFile := "tokenfile-from-cluster" expectedCAFile := "/path/to/ca-from-cluster.crt" icc := &inClusterClientConfig{ inClusterConfigProvider: func() (*restclient.Config, error) { return &restclient.Config{ Host: expectedServer, BearerToken: expectedToken, BearerTokenFile: expectedTokenFile, TLSClientConfig: restclient.TLSClientConfig{ CAFile: expectedCAFile, }, }, nil }, overrides: tc.overrides, } clientConfig, err := icc.ClientConfig() if err != nil { t.Fatalf("Unxpected error: %v", err) } if overridenServer := tc.overrides.ClusterInfo.Server; len(overridenServer) > 0 { expectedServer = overridenServer } if len(tc.overrides.AuthInfo.Token) > 0 || len(tc.overrides.AuthInfo.TokenFile) > 0 { expectedToken = tc.overrides.AuthInfo.Token expectedTokenFile = tc.overrides.AuthInfo.TokenFile } if overridenCAFile := tc.overrides.ClusterInfo.CertificateAuthority; len(overridenCAFile) > 0 { expectedCAFile = overridenCAFile } if clientConfig.Host != expectedServer { t.Errorf("Expected server %v, got %v", expectedServer, clientConfig.Host) } if clientConfig.BearerToken != expectedToken { t.Errorf("Expected token %v, got %v", expectedToken, clientConfig.BearerToken) } if clientConfig.BearerTokenFile != expectedTokenFile { t.Errorf("Expected tokenfile %v, got %v", expectedTokenFile, clientConfig.BearerTokenFile) } if clientConfig.TLSClientConfig.CAFile != expectedCAFile { t.Errorf("Expected Certificate Authority %v, got %v", expectedCAFile, clientConfig.TLSClientConfig.CAFile) } } } func matchBoolArg(expected, got bool, t *testing.T) { if expected != got { t.Errorf("Expected %v, got %v", expected, got) } } func matchStringArg(expected, got string, t *testing.T) { if expected != got { t.Errorf("Expected %q, got %q", expected, got) } } func matchByteArg(expected, got []byte, t *testing.T) { if !reflect.DeepEqual(expected, got) { t.Errorf("Expected %v, got %v", expected, got) } } func matchIntArg(expected, got int, t *testing.T) { if expected != got { t.Errorf("Expected %d, got %d", expected, got) } } func TestNamespaceOverride(t *testing.T) { config := &DirectClientConfig{ overrides: &ConfigOverrides{ Context: clientcmdapi.Context{ Namespace: "foo", }, }, } ns, overridden, err := config.Namespace() if err != nil { t.Errorf("Unexpected error: %v", err) } if !overridden { t.Errorf("Expected overridden = true") } matchStringArg("foo", ns, t) } func TestAuthConfigMerge(t *testing.T) { content := ` apiVersion: v1 clusters: - cluster: server: https://localhost:8080 extensions: - name: client.authentication.k8s.io/exec extension: audience: foo other: bar name: foo-cluster contexts: - context: cluster: foo-cluster user: foo-user namespace: bar name: foo-context current-context: foo-context kind: Config users: - name: foo-user user: exec: apiVersion: client.authentication.k8s.io/v1alpha1 args: - arg-1 - arg-2 command: foo-command provideClusterInfo: true ` tmpfile, err := os.CreateTemp("", "kubeconfig") if err != nil { t.Error(err) } defer utiltesting.CloseAndRemove(t, tmpfile) if err := os.WriteFile(tmpfile.Name(), []byte(content), 0666); err != nil { t.Error(err) } config, err := BuildConfigFromFlags("", tmpfile.Name()) if err != nil { t.Error(err) } if !reflect.DeepEqual(config.ExecProvider.Args, []string{"arg-1", "arg-2"}) { t.Errorf("Got args %v when they should be %v\n", config.ExecProvider.Args, []string{"arg-1", "arg-2"}) } if !config.ExecProvider.ProvideClusterInfo { t.Error("Wanted provider cluster info to be true") } want := &runtime.Unknown{ Raw: []byte(`{"audience":"foo","other":"bar"}`), ContentType: "application/json", } if !reflect.DeepEqual(config.ExecProvider.Config, want) { t.Errorf("Got config %v when it should be %v\n", config.ExecProvider.Config, want) } } func TestCleanANSIEscapeCodes(t *testing.T) { tests := []struct { name string in, out string }{ { name: "DenyBoldCharacters", in: "\x1b[1mbold tuna\x1b[0m, fish, \x1b[1mbold marlin\x1b[0m", out: "U+001B[1mbold tunaU+001B[0m, fish, U+001B[1mbold marlinU+001B[0m", }, { name: "DenyCursorNavigation", in: "\x1b[2Aup up, \x1b[2Cright right", out: "U+001B[2Aup up, U+001B[2Cright right", }, { name: "DenyClearScreen", in: "clear: \x1b[2J", out: "clear: U+001B[2J", }, { name: "AllowSpaceCharactersUnchanged", in: "tuna\nfish\r\nmarlin\t\r\ntuna\vfish\fmarlin", }, { name: "AllowLetters", in: "alpha: \u03b1, beta: \u03b2, gamma: \u03b3", }, { name: "AllowMarks", in: "tu\u0301na with a mark over the u, fi\u0302sh with a mark over the i," + " ma\u030Arlin with a mark over the a", }, { name: "AllowNumbers", in: "t1na, f2sh, m3rlin, t12a, f34h, m56lin, t123, f456, m567n", }, { name: "AllowPunctuation", in: "\"here's a sentence; with! some...punctuation ;)\"", }, { name: "AllowSymbols", in: "the integral of f(x) from 0 to n approximately equals the sum of f(x)" + " from a = 0 to n, where a and n are natural numbers:" + "\u222b\u2081\u207F f(x) dx \u2248 \u2211\u2090\u208C\u2081\u207F f(x)," + " a \u2208 \u2115, n \u2208 \u2115", }, { name: "AllowSepatators", in: "here is a paragraph separator\u2029and here\u2003are\u2003some" + "\u2003em\u2003spaces", }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { if len(test.out) == 0 { test.out = test.in } if actualOut := cleanANSIEscapeCodes(test.in); test.out != actualOut { t.Errorf("expected %q, actual %q", test.out, actualOut) } }) } } func TestMergeRawConfigDoOverride(t *testing.T) { const ( server = "https://anything.com:8080" token = "the-token" modifiedServer = "http://localhost:8081" modifiedToken = "modified-token" ) config := createValidTestConfig() // add another context which to modify with overrides config.Clusters["modify"] = &clientcmdapi.Cluster{ Server: server, } config.AuthInfos["modify"] = &clientcmdapi.AuthInfo{ Token: token, } config.Contexts["modify"] = &clientcmdapi.Context{ Cluster: "modify", AuthInfo: "modify", Namespace: "modify", } // create overrides for the modify context overrides := &ConfigOverrides{ ClusterInfo: clientcmdapi.Cluster{ Server: modifiedServer, }, Context: clientcmdapi.Context{ Namespace: "foobar", Cluster: "modify", AuthInfo: "modify", }, AuthInfo: clientcmdapi.AuthInfo{ Token: modifiedToken, }, CurrentContext: "modify", } cut := NewDefaultClientConfig(*config, overrides) act, err := cut.MergedRawConfig() if err != nil { t.Fatalf("Unexpected error: %v", err) } // ensure overrides were applied to "modify" actContext := act.CurrentContext if actContext != "modify" { t.Errorf("Expected context %v, got %v", "modify", actContext) } if act.Clusters[actContext].Server != "http://localhost:8081" { t.Errorf("Expected server %v, got %v", "http://localhost:8081", act.Clusters[actContext].Server) } if act.Contexts[actContext].Namespace != "foobar" { t.Errorf("Expected namespace %v, got %v", "foobar", act.Contexts[actContext].Namespace) } // ensure context "clean" was not touched if act.Clusters["clean"].Server != config.Clusters["clean"].Server { t.Errorf("Expected server %v, got %v", config.Clusters["clean"].Server, act.Clusters["clean"].Server) } if act.Contexts["clean"].Namespace != config.Contexts["clean"].Namespace { t.Errorf("Expected namespace %v, got %v", config.Contexts["clean"].Namespace, act.Contexts["clean"].Namespace) } } kubernetes-client-go-a2dfcab/tools/clientcmd/config.go000066400000000000000000000357701472614177300233120ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "errors" "os" "path/filepath" "reflect" "sort" "k8s.io/klog/v2" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) // ConfigAccess is used by subcommands and methods in this package to load and modify the appropriate config files type ConfigAccess interface { // GetLoadingPrecedence returns the slice of files that should be used for loading and inspecting the config GetLoadingPrecedence() []string // GetStartingConfig returns the config that subcommands should being operating against. It may or may not be merged depending on loading rules GetStartingConfig() (*clientcmdapi.Config, error) // GetDefaultFilename returns the name of the file you should write into (create if necessary), if you're trying to create a new stanza as opposed to updating an existing one. GetDefaultFilename() string // IsExplicitFile indicates whether or not this command is interested in exactly one file. This implementation only ever does that via a flag, but implementations that handle local, global, and flags may have more IsExplicitFile() bool // GetExplicitFile returns the particular file this command is operating against. This implementation only ever has one, but implementations that handle local, global, and flags may have more GetExplicitFile() string } type PathOptions struct { // GlobalFile is the full path to the file to load as the global (final) option GlobalFile string // EnvVar is the env var name that points to the list of kubeconfig files to load EnvVar string // ExplicitFileFlag is the name of the flag to use for prompting for the kubeconfig file ExplicitFileFlag string // GlobalFileSubpath is an optional value used for displaying help GlobalFileSubpath string LoadingRules *ClientConfigLoadingRules } var ( // UseModifyConfigLock ensures that access to kubeconfig file using ModifyConfig method // is being guarded by a lock file. // This variable is intentionaly made public so other consumers of this library // can modify its default behavior, but be caution when disabling it since // this will make your code not threadsafe. UseModifyConfigLock = true ) func (o *PathOptions) GetEnvVarFiles() []string { if len(o.EnvVar) == 0 { return []string{} } envVarValue := os.Getenv(o.EnvVar) if len(envVarValue) == 0 { return []string{} } fileList := filepath.SplitList(envVarValue) // prevent the same path load multiple times return deduplicate(fileList) } func (o *PathOptions) GetLoadingPrecedence() []string { if o.IsExplicitFile() { return []string{o.GetExplicitFile()} } if envVarFiles := o.GetEnvVarFiles(); len(envVarFiles) > 0 { return envVarFiles } return []string{o.GlobalFile} } func (o *PathOptions) GetStartingConfig() (*clientcmdapi.Config, error) { // don't mutate the original loadingRules := *o.LoadingRules loadingRules.Precedence = o.GetLoadingPrecedence() clientConfig := NewNonInteractiveDeferredLoadingClientConfig(&loadingRules, &ConfigOverrides{}) rawConfig, err := clientConfig.RawConfig() if os.IsNotExist(err) { return clientcmdapi.NewConfig(), nil } if err != nil { return nil, err } return &rawConfig, nil } func (o *PathOptions) GetDefaultFilename() string { if o.IsExplicitFile() { return o.GetExplicitFile() } if envVarFiles := o.GetEnvVarFiles(); len(envVarFiles) > 0 { if len(envVarFiles) == 1 { return envVarFiles[0] } // if any of the envvar files already exists, return it for _, envVarFile := range envVarFiles { if _, err := os.Stat(envVarFile); err == nil { return envVarFile } } // otherwise, return the last one in the list return envVarFiles[len(envVarFiles)-1] } return o.GlobalFile } func (o *PathOptions) IsExplicitFile() bool { return len(o.LoadingRules.ExplicitPath) > 0 } func (o *PathOptions) GetExplicitFile() string { return o.LoadingRules.ExplicitPath } func NewDefaultPathOptions() *PathOptions { ret := &PathOptions{ GlobalFile: RecommendedHomeFile, EnvVar: RecommendedConfigPathEnvVar, ExplicitFileFlag: RecommendedConfigPathFlag, GlobalFileSubpath: filepath.Join(RecommendedHomeDir, RecommendedFileName), LoadingRules: NewDefaultClientConfigLoadingRules(), } ret.LoadingRules.DoNotResolvePaths = true return ret } // ModifyConfig takes a Config object, iterates through Clusters, AuthInfos, and Contexts, uses the LocationOfOrigin if specified or // uses the default destination file to write the results into. This results in multiple file reads, but it's very easy to follow. // Preferences and CurrentContext should always be set in the default destination file. Since we can't distinguish between empty and missing values // (no nil strings), we're forced have separate handling for them. In the kubeconfig cases, newConfig should have at most one difference, // that means that this code will only write into a single file. If you want to relativizePaths, you must provide a fully qualified path in any // modified element. func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, relativizePaths bool) error { if UseModifyConfigLock { possibleSources := configAccess.GetLoadingPrecedence() // sort the possible kubeconfig files so we always "lock" in the same order // to avoid deadlock (note: this can fail w/ symlinks, but... come on). sort.Strings(possibleSources) for _, filename := range possibleSources { if err := lockFile(filename); err != nil { return err } defer unlockFile(filename) } } startingConfig, err := configAccess.GetStartingConfig() if err != nil { return err } // We need to find all differences, locate their original files, read a partial config to modify only that stanza and write out the file. // Special case the test for current context and preferences since those always write to the default file. if reflect.DeepEqual(*startingConfig, newConfig) { // nothing to do return nil } if startingConfig.CurrentContext != newConfig.CurrentContext { if err := writeCurrentContext(configAccess, newConfig.CurrentContext); err != nil { return err } } if !reflect.DeepEqual(startingConfig.Preferences, newConfig.Preferences) { if err := writePreferences(configAccess, newConfig.Preferences); err != nil { return err } } // Search every cluster, authInfo, and context. First from new to old for differences, then from old to new for deletions for key, cluster := range newConfig.Clusters { startingCluster, exists := startingConfig.Clusters[key] if !reflect.DeepEqual(cluster, startingCluster) || !exists { destinationFile := cluster.LocationOfOrigin if len(destinationFile) == 0 { destinationFile = configAccess.GetDefaultFilename() } configToWrite, err := getConfigFromFile(destinationFile) if err != nil { return err } t := *cluster configToWrite.Clusters[key] = &t configToWrite.Clusters[key].LocationOfOrigin = destinationFile if relativizePaths { if err := RelativizeClusterLocalPaths(configToWrite.Clusters[key]); err != nil { return err } } if err := WriteToFile(*configToWrite, destinationFile); err != nil { return err } } } // seenConfigs stores a map of config source filenames to computed config objects seenConfigs := map[string]*clientcmdapi.Config{} for key, context := range newConfig.Contexts { startingContext, exists := startingConfig.Contexts[key] if !reflect.DeepEqual(context, startingContext) || !exists { destinationFile := context.LocationOfOrigin if len(destinationFile) == 0 { destinationFile = configAccess.GetDefaultFilename() } // we only obtain a fresh config object from its source file // if we have not seen it already - this prevents us from // reading and writing to the same number of files repeatedly // when multiple / all contexts share the same destination file. configToWrite, seen := seenConfigs[destinationFile] if !seen { var err error configToWrite, err = getConfigFromFile(destinationFile) if err != nil { return err } seenConfigs[destinationFile] = configToWrite } configToWrite.Contexts[key] = context } } // actually persist config object changes for destinationFile, configToWrite := range seenConfigs { if err := WriteToFile(*configToWrite, destinationFile); err != nil { return err } } for key, authInfo := range newConfig.AuthInfos { startingAuthInfo, exists := startingConfig.AuthInfos[key] if !reflect.DeepEqual(authInfo, startingAuthInfo) || !exists { destinationFile := authInfo.LocationOfOrigin if len(destinationFile) == 0 { destinationFile = configAccess.GetDefaultFilename() } configToWrite, err := getConfigFromFile(destinationFile) if err != nil { return err } t := *authInfo configToWrite.AuthInfos[key] = &t configToWrite.AuthInfos[key].LocationOfOrigin = destinationFile if relativizePaths { if err := RelativizeAuthInfoLocalPaths(configToWrite.AuthInfos[key]); err != nil { return err } } if err := WriteToFile(*configToWrite, destinationFile); err != nil { return err } } } for key, cluster := range startingConfig.Clusters { if _, exists := newConfig.Clusters[key]; !exists { destinationFile := cluster.LocationOfOrigin if len(destinationFile) == 0 { destinationFile = configAccess.GetDefaultFilename() } configToWrite, err := getConfigFromFile(destinationFile) if err != nil { return err } delete(configToWrite.Clusters, key) if err := WriteToFile(*configToWrite, destinationFile); err != nil { return err } } } for key, context := range startingConfig.Contexts { if _, exists := newConfig.Contexts[key]; !exists { destinationFile := context.LocationOfOrigin if len(destinationFile) == 0 { destinationFile = configAccess.GetDefaultFilename() } configToWrite, err := getConfigFromFile(destinationFile) if err != nil { return err } delete(configToWrite.Contexts, key) if err := WriteToFile(*configToWrite, destinationFile); err != nil { return err } } } for key, authInfo := range startingConfig.AuthInfos { if _, exists := newConfig.AuthInfos[key]; !exists { destinationFile := authInfo.LocationOfOrigin if len(destinationFile) == 0 { destinationFile = configAccess.GetDefaultFilename() } configToWrite, err := getConfigFromFile(destinationFile) if err != nil { return err } delete(configToWrite.AuthInfos, key) if err := WriteToFile(*configToWrite, destinationFile); err != nil { return err } } } return nil } func PersisterForUser(configAccess ConfigAccess, user string) restclient.AuthProviderConfigPersister { return &persister{configAccess, user} } type persister struct { configAccess ConfigAccess user string } func (p *persister) Persist(config map[string]string) error { newConfig, err := p.configAccess.GetStartingConfig() if err != nil { return err } authInfo, ok := newConfig.AuthInfos[p.user] if ok && authInfo.AuthProvider != nil { authInfo.AuthProvider.Config = config return ModifyConfig(p.configAccess, *newConfig, false) } return nil } // writeCurrentContext takes three possible paths. // If newCurrentContext is the same as the startingConfig's current context, then we exit. // If newCurrentContext has a value, then that value is written into the default destination file. // If newCurrentContext is empty, then we find the config file that is setting the CurrentContext and clear the value from that file func writeCurrentContext(configAccess ConfigAccess, newCurrentContext string) error { if startingConfig, err := configAccess.GetStartingConfig(); err != nil { return err } else if startingConfig.CurrentContext == newCurrentContext { return nil } if configAccess.IsExplicitFile() { file := configAccess.GetExplicitFile() currConfig, err := getConfigFromFile(file) if err != nil { return err } currConfig.CurrentContext = newCurrentContext if err := WriteToFile(*currConfig, file); err != nil { return err } return nil } if len(newCurrentContext) > 0 { destinationFile := configAccess.GetDefaultFilename() config, err := getConfigFromFile(destinationFile) if err != nil { return err } config.CurrentContext = newCurrentContext if err := WriteToFile(*config, destinationFile); err != nil { return err } return nil } // we're supposed to be clearing the current context. We need to find the first spot in the chain that is setting it and clear it for _, file := range configAccess.GetLoadingPrecedence() { if _, err := os.Stat(file); err == nil { currConfig, err := getConfigFromFile(file) if err != nil { return err } if len(currConfig.CurrentContext) > 0 { currConfig.CurrentContext = newCurrentContext if err := WriteToFile(*currConfig, file); err != nil { return err } return nil } } } return errors.New("no config found to write context") } func writePreferences(configAccess ConfigAccess, newPrefs clientcmdapi.Preferences) error { if startingConfig, err := configAccess.GetStartingConfig(); err != nil { return err } else if reflect.DeepEqual(startingConfig.Preferences, newPrefs) { return nil } if configAccess.IsExplicitFile() { file := configAccess.GetExplicitFile() currConfig, err := getConfigFromFile(file) if err != nil { return err } currConfig.Preferences = newPrefs if err := WriteToFile(*currConfig, file); err != nil { return err } return nil } for _, file := range configAccess.GetLoadingPrecedence() { currConfig, err := getConfigFromFile(file) if err != nil { return err } if !reflect.DeepEqual(currConfig.Preferences, newPrefs) { currConfig.Preferences = newPrefs if err := WriteToFile(*currConfig, file); err != nil { return err } return nil } } return errors.New("no config found to write preferences") } // getConfigFromFile tries to read a kubeconfig file and if it can't, returns an error. One exception, missing files result in empty configs, not an error. func getConfigFromFile(filename string) (*clientcmdapi.Config, error) { config, err := LoadFromFile(filename) if err != nil && !os.IsNotExist(err) { return nil, err } if config == nil { config = clientcmdapi.NewConfig() } return config, nil } // GetConfigFromFileOrDie tries to read a kubeconfig file and if it can't, it calls exit. One exception, missing files result in empty configs, not an exit func GetConfigFromFileOrDie(filename string) *clientcmdapi.Config { config, err := getConfigFromFile(filename) if err != nil { klog.FatalDepth(1, err) } return config } kubernetes-client-go-a2dfcab/tools/clientcmd/doc.go000066400000000000000000000026201472614177300225760ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Package clientcmd provides one stop shopping for building a working client from a fixed config, from a .kubeconfig file, from command line flags, or from any merged combination. Sample usage from merged .kubeconfig files (local directory, home directory) loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() // if you want to change the loading rules (which files in which order), you can do so here configOverrides := &clientcmd.ConfigOverrides{} // if you want to change override values or bind them to flags, there are methods to help you kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides) config, err := kubeConfig.ClientConfig() if err != nil { // Do something } client, err := metav1.New(config) // ... */ package clientcmd // import "k8s.io/client-go/tools/clientcmd" kubernetes-client-go-a2dfcab/tools/clientcmd/flag.go000066400000000000000000000025121472614177300227420ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd // transformingStringValue implements pflag.Value to store string values, // allowing transforming them while being set type transformingStringValue struct { target *string transformer func(string) (string, error) } func newTransformingStringValue(val string, target *string, transformer func(string) (string, error)) *transformingStringValue { *target = val return &transformingStringValue{ target: target, transformer: transformer, } } func (t *transformingStringValue) Set(val string) error { val, err := t.transformer(val) if err != nil { return err } *t.target = val return nil } func (t *transformingStringValue) Type() string { return "string" } func (t *transformingStringValue) String() string { return string(*t.target) } kubernetes-client-go-a2dfcab/tools/clientcmd/helpers.go000066400000000000000000000031011472614177300234660ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "fmt" "net/url" "strconv" "time" ) // ParseTimeout returns a parsed duration from a string // A duration string value must be a positive integer, optionally followed by a corresponding time unit (s|m|h). func ParseTimeout(duration string) (time.Duration, error) { if i, err := strconv.ParseInt(duration, 10, 64); err == nil && i >= 0 { return (time.Duration(i) * time.Second), nil } if requestTimeout, err := time.ParseDuration(duration); err == nil { return requestTimeout, nil } return 0, fmt.Errorf("Invalid timeout value. Timeout must be a single integer in seconds, or an integer followed by a corresponding time unit (e.g. 1s | 2m | 3h)") } func parseProxyURL(proxyURL string) (*url.URL, error) { u, err := url.Parse(proxyURL) if err != nil { return nil, fmt.Errorf("could not parse: %v", proxyURL) } switch u.Scheme { case "http", "https", "socks5": default: return nil, fmt.Errorf("unsupported scheme %q, must be http, https, or socks5", u.Scheme) } return u, nil } kubernetes-client-go-a2dfcab/tools/clientcmd/loader.go000066400000000000000000000516731472614177300233130ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "fmt" "os" "path/filepath" "reflect" goruntime "runtime" "strings" "github.com/imdario/mergo" "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" utilerrors "k8s.io/apimachinery/pkg/util/errors" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" clientcmdlatest "k8s.io/client-go/tools/clientcmd/api/latest" "k8s.io/client-go/util/homedir" ) const ( RecommendedConfigPathFlag = "kubeconfig" RecommendedConfigPathEnvVar = "KUBECONFIG" RecommendedHomeDir = ".kube" RecommendedFileName = "config" RecommendedSchemaName = "schema" ) var ( RecommendedConfigDir = filepath.Join(homedir.HomeDir(), RecommendedHomeDir) RecommendedHomeFile = filepath.Join(RecommendedConfigDir, RecommendedFileName) RecommendedSchemaFile = filepath.Join(RecommendedConfigDir, RecommendedSchemaName) ) // currentMigrationRules returns a map that holds the history of recommended home directories used in previous versions. // Any future changes to RecommendedHomeFile and related are expected to add a migration rule here, in order to make // sure existing config files are migrated to their new locations properly. func currentMigrationRules() map[string]string { var oldRecommendedHomeFileName string if goruntime.GOOS == "windows" { oldRecommendedHomeFileName = RecommendedFileName } else { oldRecommendedHomeFileName = ".kubeconfig" } return map[string]string{ RecommendedHomeFile: filepath.Join(os.Getenv("HOME"), RecommendedHomeDir, oldRecommendedHomeFileName), } } type ClientConfigLoader interface { ConfigAccess // IsDefaultConfig returns true if the returned config matches the defaults. IsDefaultConfig(*restclient.Config) bool // Load returns the latest config Load() (*clientcmdapi.Config, error) } type KubeconfigGetter func() (*clientcmdapi.Config, error) type ClientConfigGetter struct { kubeconfigGetter KubeconfigGetter } // ClientConfigGetter implements the ClientConfigLoader interface. var _ ClientConfigLoader = &ClientConfigGetter{} func (g *ClientConfigGetter) Load() (*clientcmdapi.Config, error) { return g.kubeconfigGetter() } func (g *ClientConfigGetter) GetLoadingPrecedence() []string { return nil } func (g *ClientConfigGetter) GetStartingConfig() (*clientcmdapi.Config, error) { return g.kubeconfigGetter() } func (g *ClientConfigGetter) GetDefaultFilename() string { return "" } func (g *ClientConfigGetter) IsExplicitFile() bool { return false } func (g *ClientConfigGetter) GetExplicitFile() string { return "" } func (g *ClientConfigGetter) IsDefaultConfig(config *restclient.Config) bool { return false } // ClientConfigLoadingRules is an ExplicitPath and string slice of specific locations that are used for merging together a Config // Callers can put the chain together however they want, but we'd recommend: // EnvVarPathFiles if set (a list of files if set) OR the HomeDirectoryPath // ExplicitPath is special, because if a user specifically requests a certain file be used and error is reported if this file is not present type ClientConfigLoadingRules struct { ExplicitPath string Precedence []string // MigrationRules is a map of destination files to source files. If a destination file is not present, then the source file is checked. // If the source file is present, then it is copied to the destination file BEFORE any further loading happens. MigrationRules map[string]string // DoNotResolvePaths indicates whether or not to resolve paths with respect to the originating files. This is phrased as a negative so // that a default object that doesn't set this will usually get the behavior it wants. DoNotResolvePaths bool // DefaultClientConfig is an optional field indicating what rules to use to calculate a default configuration. // This should match the overrides passed in to ClientConfig loader. DefaultClientConfig ClientConfig // WarnIfAllMissing indicates whether the configuration files pointed by KUBECONFIG environment variable are present or not. // In case of missing files, it warns the user about the missing files. WarnIfAllMissing bool // Warner is the warning log callback to use in case of missing files. Warner WarningHandler } // WarningHandler allows to set the logging function to use type WarningHandler func(error) func (handler WarningHandler) Warn(err error) { if handler == nil { klog.V(1).Info(err) } else { handler(err) } } type MissingConfigError struct { Missing []string } func (c MissingConfigError) Error() string { return fmt.Sprintf("Config not found: %s", strings.Join(c.Missing, ", ")) } // ClientConfigLoadingRules implements the ClientConfigLoader interface. var _ ClientConfigLoader = &ClientConfigLoadingRules{} // NewDefaultClientConfigLoadingRules returns a ClientConfigLoadingRules object with default fields filled in. You are not required to // use this constructor func NewDefaultClientConfigLoadingRules() *ClientConfigLoadingRules { chain := []string{} warnIfAllMissing := false envVarFiles := os.Getenv(RecommendedConfigPathEnvVar) if len(envVarFiles) != 0 { fileList := filepath.SplitList(envVarFiles) // prevent the same path load multiple times chain = append(chain, deduplicate(fileList)...) warnIfAllMissing = true } else { chain = append(chain, RecommendedHomeFile) } return &ClientConfigLoadingRules{ Precedence: chain, MigrationRules: currentMigrationRules(), WarnIfAllMissing: warnIfAllMissing, } } // Load starts by running the MigrationRules and then // takes the loading rules and returns a Config object based on following rules. // // if the ExplicitPath, return the unmerged explicit file // Otherwise, return a merged config based on the Precedence slice // // A missing ExplicitPath file produces an error. Empty filenames or other missing files are ignored. // Read errors or files with non-deserializable content produce errors. // The first file to set a particular map key wins and map key's value is never changed. // BUT, if you set a struct value that is NOT contained inside of map, the value WILL be changed. // This results in some odd looking logic to merge in one direction, merge in the other, and then merge the two. // It also means that if two files specify a "red-user", only values from the first file's red-user are used. Even // non-conflicting entries from the second file's "red-user" are discarded. // Relative paths inside of the .kubeconfig files are resolved against the .kubeconfig file's parent folder // and only absolute file paths are returned. func (rules *ClientConfigLoadingRules) Load() (*clientcmdapi.Config, error) { if err := rules.Migrate(); err != nil { return nil, err } errlist := []error{} missingList := []string{} kubeConfigFiles := []string{} // Make sure a file we were explicitly told to use exists if len(rules.ExplicitPath) > 0 { if _, err := os.Stat(rules.ExplicitPath); os.IsNotExist(err) { return nil, err } kubeConfigFiles = append(kubeConfigFiles, rules.ExplicitPath) } else { kubeConfigFiles = append(kubeConfigFiles, rules.Precedence...) } kubeconfigs := []*clientcmdapi.Config{} // read and cache the config files so that we only look at them once for _, filename := range kubeConfigFiles { if len(filename) == 0 { // no work to do continue } config, err := LoadFromFile(filename) if os.IsNotExist(err) { // skip missing files // Add to the missing list to produce a warning missingList = append(missingList, filename) continue } if err != nil { errlist = append(errlist, fmt.Errorf("error loading config file \"%s\": %v", filename, err)) continue } kubeconfigs = append(kubeconfigs, config) } if rules.WarnIfAllMissing && len(missingList) > 0 && len(kubeconfigs) == 0 { rules.Warner.Warn(MissingConfigError{Missing: missingList}) } // first merge all of our maps mapConfig := clientcmdapi.NewConfig() for _, kubeconfig := range kubeconfigs { mergo.Merge(mapConfig, kubeconfig, mergo.WithOverride) } // merge all of the struct values in the reverse order so that priority is given correctly // errors are not added to the list the second time nonMapConfig := clientcmdapi.NewConfig() for i := len(kubeconfigs) - 1; i >= 0; i-- { kubeconfig := kubeconfigs[i] mergo.Merge(nonMapConfig, kubeconfig, mergo.WithOverride) } // since values are overwritten, but maps values are not, we can merge the non-map config on top of the map config and // get the values we expect. config := clientcmdapi.NewConfig() mergo.Merge(config, mapConfig, mergo.WithOverride) mergo.Merge(config, nonMapConfig, mergo.WithOverride) if rules.ResolvePaths() { if err := ResolveLocalPaths(config); err != nil { errlist = append(errlist, err) } } return config, utilerrors.NewAggregate(errlist) } // Migrate uses the MigrationRules map. If a destination file is not present, then the source file is checked. // If the source file is present, then it is copied to the destination file BEFORE any further loading happens. func (rules *ClientConfigLoadingRules) Migrate() error { if rules.MigrationRules == nil { return nil } for destination, source := range rules.MigrationRules { if _, err := os.Stat(destination); err == nil { // if the destination already exists, do nothing continue } else if os.IsPermission(err) { // if we can't access the file, skip it continue } else if !os.IsNotExist(err) { // if we had an error other than non-existence, fail return err } if sourceInfo, err := os.Stat(source); err != nil { if os.IsNotExist(err) || os.IsPermission(err) { // if the source file doesn't exist or we can't access it, there's no work to do. continue } // if we had an error other than non-existence, fail return err } else if sourceInfo.IsDir() { return fmt.Errorf("cannot migrate %v to %v because it is a directory", source, destination) } data, err := os.ReadFile(source) if err != nil { return err } // destination is created with mode 0666 before umask err = os.WriteFile(destination, data, 0666) if err != nil { return err } } return nil } // GetLoadingPrecedence implements ConfigAccess func (rules *ClientConfigLoadingRules) GetLoadingPrecedence() []string { if len(rules.ExplicitPath) > 0 { return []string{rules.ExplicitPath} } return rules.Precedence } // GetStartingConfig implements ConfigAccess func (rules *ClientConfigLoadingRules) GetStartingConfig() (*clientcmdapi.Config, error) { clientConfig := NewNonInteractiveDeferredLoadingClientConfig(rules, &ConfigOverrides{}) rawConfig, err := clientConfig.RawConfig() if os.IsNotExist(err) { return clientcmdapi.NewConfig(), nil } if err != nil { return nil, err } return &rawConfig, nil } // GetDefaultFilename implements ConfigAccess func (rules *ClientConfigLoadingRules) GetDefaultFilename() string { // Explicit file if we have one. if rules.IsExplicitFile() { return rules.GetExplicitFile() } // Otherwise, first existing file from precedence. for _, filename := range rules.GetLoadingPrecedence() { if _, err := os.Stat(filename); err == nil { return filename } } // If none exists, use the first from precedence. if len(rules.Precedence) > 0 { return rules.Precedence[0] } return "" } // IsExplicitFile implements ConfigAccess func (rules *ClientConfigLoadingRules) IsExplicitFile() bool { return len(rules.ExplicitPath) > 0 } // GetExplicitFile implements ConfigAccess func (rules *ClientConfigLoadingRules) GetExplicitFile() string { return rules.ExplicitPath } // IsDefaultConfig returns true if the provided configuration matches the default func (rules *ClientConfigLoadingRules) IsDefaultConfig(config *restclient.Config) bool { if rules.DefaultClientConfig == nil { return false } defaultConfig, err := rules.DefaultClientConfig.ClientConfig() if err != nil { return false } return reflect.DeepEqual(config, defaultConfig) } // LoadFromFile takes a filename and deserializes the contents into Config object func LoadFromFile(filename string) (*clientcmdapi.Config, error) { kubeconfigBytes, err := os.ReadFile(filename) if err != nil { return nil, err } config, err := Load(kubeconfigBytes) if err != nil { return nil, err } klog.V(6).Infoln("Config loaded from file: ", filename) // set LocationOfOrigin on every Cluster, User, and Context for key, obj := range config.AuthInfos { obj.LocationOfOrigin = filename config.AuthInfos[key] = obj } for key, obj := range config.Clusters { obj.LocationOfOrigin = filename config.Clusters[key] = obj } for key, obj := range config.Contexts { obj.LocationOfOrigin = filename config.Contexts[key] = obj } if config.AuthInfos == nil { config.AuthInfos = map[string]*clientcmdapi.AuthInfo{} } if config.Clusters == nil { config.Clusters = map[string]*clientcmdapi.Cluster{} } if config.Contexts == nil { config.Contexts = map[string]*clientcmdapi.Context{} } return config, nil } // Load takes a byte slice and deserializes the contents into Config object. // Encapsulates deserialization without assuming the source is a file. func Load(data []byte) (*clientcmdapi.Config, error) { config := clientcmdapi.NewConfig() // if there's no data in a file, return the default object instead of failing (DecodeInto reject empty input) if len(data) == 0 { return config, nil } decoded, _, err := clientcmdlatest.Codec.Decode(data, &schema.GroupVersionKind{Version: clientcmdlatest.Version, Kind: "Config"}, config) if err != nil { return nil, err } return decoded.(*clientcmdapi.Config), nil } // WriteToFile serializes the config to yaml and writes it out to a file. If not present, it creates the file with the mode 0600. If it is present // it stomps the contents func WriteToFile(config clientcmdapi.Config, filename string) error { content, err := Write(config) if err != nil { return err } dir := filepath.Dir(filename) if _, err := os.Stat(dir); os.IsNotExist(err) { if err = os.MkdirAll(dir, 0755); err != nil { return err } } if err := os.WriteFile(filename, content, 0600); err != nil { return err } return nil } func lockFile(filename string) error { // TODO: find a way to do this with actual file locks. Will // probably need separate solution for windows and Linux. // Make sure the dir exists before we try to create a lock file. dir := filepath.Dir(filename) if _, err := os.Stat(dir); os.IsNotExist(err) { if err = os.MkdirAll(dir, 0755); err != nil { return err } } f, err := os.OpenFile(lockName(filename), os.O_CREATE|os.O_EXCL, 0) if err != nil { return err } f.Close() return nil } func unlockFile(filename string) error { return os.Remove(lockName(filename)) } func lockName(filename string) string { return filename + ".lock" } // Write serializes the config to yaml. // Encapsulates serialization without assuming the destination is a file. func Write(config clientcmdapi.Config) ([]byte, error) { return runtime.Encode(clientcmdlatest.Codec, &config) } func (rules ClientConfigLoadingRules) ResolvePaths() bool { return !rules.DoNotResolvePaths } // ResolveLocalPaths resolves all relative paths in the config object with respect to the stanza's LocationOfOrigin // this cannot be done directly inside of LoadFromFile because doing so there would make it impossible to load a file without // modification of its contents. func ResolveLocalPaths(config *clientcmdapi.Config) error { for _, cluster := range config.Clusters { if len(cluster.LocationOfOrigin) == 0 { continue } base, err := filepath.Abs(filepath.Dir(cluster.LocationOfOrigin)) if err != nil { return fmt.Errorf("could not determine the absolute path of config file %s: %v", cluster.LocationOfOrigin, err) } if err := ResolvePaths(GetClusterFileReferences(cluster), base); err != nil { return err } } for _, authInfo := range config.AuthInfos { if len(authInfo.LocationOfOrigin) == 0 { continue } base, err := filepath.Abs(filepath.Dir(authInfo.LocationOfOrigin)) if err != nil { return fmt.Errorf("could not determine the absolute path of config file %s: %v", authInfo.LocationOfOrigin, err) } if err := ResolvePaths(GetAuthInfoFileReferences(authInfo), base); err != nil { return err } } return nil } // RelativizeClusterLocalPaths first absolutizes the paths by calling ResolveLocalPaths. This assumes that any NEW path is already // absolute, but any existing path will be resolved relative to LocationOfOrigin func RelativizeClusterLocalPaths(cluster *clientcmdapi.Cluster) error { if len(cluster.LocationOfOrigin) == 0 { return fmt.Errorf("no location of origin for %s", cluster.Server) } base, err := filepath.Abs(filepath.Dir(cluster.LocationOfOrigin)) if err != nil { return fmt.Errorf("could not determine the absolute path of config file %s: %v", cluster.LocationOfOrigin, err) } if err := ResolvePaths(GetClusterFileReferences(cluster), base); err != nil { return err } if err := RelativizePathWithNoBacksteps(GetClusterFileReferences(cluster), base); err != nil { return err } return nil } // RelativizeAuthInfoLocalPaths first absolutizes the paths by calling ResolveLocalPaths. This assumes that any NEW path is already // absolute, but any existing path will be resolved relative to LocationOfOrigin func RelativizeAuthInfoLocalPaths(authInfo *clientcmdapi.AuthInfo) error { if len(authInfo.LocationOfOrigin) == 0 { return fmt.Errorf("no location of origin for %v", authInfo) } base, err := filepath.Abs(filepath.Dir(authInfo.LocationOfOrigin)) if err != nil { return fmt.Errorf("could not determine the absolute path of config file %s: %v", authInfo.LocationOfOrigin, err) } if err := ResolvePaths(GetAuthInfoFileReferences(authInfo), base); err != nil { return err } if err := RelativizePathWithNoBacksteps(GetAuthInfoFileReferences(authInfo), base); err != nil { return err } return nil } func RelativizeConfigPaths(config *clientcmdapi.Config, base string) error { return RelativizePathWithNoBacksteps(GetConfigFileReferences(config), base) } func ResolveConfigPaths(config *clientcmdapi.Config, base string) error { return ResolvePaths(GetConfigFileReferences(config), base) } func GetConfigFileReferences(config *clientcmdapi.Config) []*string { refs := []*string{} for _, cluster := range config.Clusters { refs = append(refs, GetClusterFileReferences(cluster)...) } for _, authInfo := range config.AuthInfos { refs = append(refs, GetAuthInfoFileReferences(authInfo)...) } return refs } func GetClusterFileReferences(cluster *clientcmdapi.Cluster) []*string { return []*string{&cluster.CertificateAuthority} } func GetAuthInfoFileReferences(authInfo *clientcmdapi.AuthInfo) []*string { s := []*string{&authInfo.ClientCertificate, &authInfo.ClientKey, &authInfo.TokenFile} // Only resolve exec command if it isn't PATH based. if authInfo.Exec != nil && strings.ContainsRune(authInfo.Exec.Command, filepath.Separator) { s = append(s, &authInfo.Exec.Command) } return s } // ResolvePaths updates the given refs to be absolute paths, relative to the given base directory func ResolvePaths(refs []*string, base string) error { for _, ref := range refs { // Don't resolve empty paths if len(*ref) > 0 { // Don't resolve absolute paths if !filepath.IsAbs(*ref) { *ref = filepath.Join(base, *ref) } } } return nil } // RelativizePathWithNoBacksteps updates the given refs to be relative paths, relative to the given base directory as long as they do not require backsteps. // Any path requiring a backstep is left as-is as long it is absolute. Any non-absolute path that can't be relativized produces an error func RelativizePathWithNoBacksteps(refs []*string, base string) error { for _, ref := range refs { // Don't relativize empty paths if len(*ref) > 0 { rel, err := MakeRelative(*ref, base) if err != nil { return err } // if we have a backstep, don't mess with the path if strings.HasPrefix(rel, "../") { if filepath.IsAbs(*ref) { continue } return fmt.Errorf("%v requires backsteps and is not absolute", *ref) } *ref = rel } } return nil } func MakeRelative(path, base string) (string, error) { if len(path) > 0 { rel, err := filepath.Rel(base, path) if err != nil { return path, err } return rel, nil } return path, nil } // deduplicate removes any duplicated values and returns a new slice, keeping the order unchanged func deduplicate(s []string) []string { encountered := map[string]bool{} ret := make([]string, 0) for i := range s { if encountered[s[i]] { continue } encountered[s[i]] = true ret = append(ret, s[i]) } return ret } kubernetes-client-go-a2dfcab/tools/clientcmd/loader_test.go000066400000000000000000000666071472614177300243550ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "bytes" "flag" "fmt" "os" "path/filepath" "reflect" "strings" "testing" utiltesting "k8s.io/client-go/util/testing" "github.com/google/go-cmp/cmp" "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" clientcmdlatest "k8s.io/client-go/tools/clientcmd/api/latest" "k8s.io/klog/v2" ) var ( testConfigAlfa = clientcmdapi.Config{ AuthInfos: map[string]*clientcmdapi.AuthInfo{ "red-user": {Token: "red-token"}}, Clusters: map[string]*clientcmdapi.Cluster{ "cow-cluster": {Server: "http://cow.org:8080"}}, Contexts: map[string]*clientcmdapi.Context{ "federal-context": {AuthInfo: "red-user", Cluster: "cow-cluster", Namespace: "hammer-ns"}}, } testConfigBravo = clientcmdapi.Config{ AuthInfos: map[string]*clientcmdapi.AuthInfo{ "black-user": {Token: "black-token"}}, Clusters: map[string]*clientcmdapi.Cluster{ "pig-cluster": {Server: "http://pig.org:8080"}}, Contexts: map[string]*clientcmdapi.Context{ "queen-anne-context": {AuthInfo: "black-user", Cluster: "pig-cluster", Namespace: "saw-ns"}}, } testConfigCharlie = clientcmdapi.Config{ AuthInfos: map[string]*clientcmdapi.AuthInfo{ "green-user": {Token: "green-token"}}, Clusters: map[string]*clientcmdapi.Cluster{ "horse-cluster": {Server: "http://horse.org:8080"}}, Contexts: map[string]*clientcmdapi.Context{ "shaker-context": {AuthInfo: "green-user", Cluster: "horse-cluster", Namespace: "chisel-ns"}}, } testConfigDelta = clientcmdapi.Config{ AuthInfos: map[string]*clientcmdapi.AuthInfo{ "blue-user": {Token: "blue-token"}}, Clusters: map[string]*clientcmdapi.Cluster{ "chicken-cluster": {Server: "http://chicken.org:8080"}}, Contexts: map[string]*clientcmdapi.Context{ "gothic-context": {AuthInfo: "blue-user", Cluster: "chicken-cluster", Namespace: "plane-ns"}}, } testConfigConflictAlfa = clientcmdapi.Config{ AuthInfos: map[string]*clientcmdapi.AuthInfo{ "red-user": {Token: "a-different-red-token"}, "yellow-user": {Token: "yellow-token"}}, Clusters: map[string]*clientcmdapi.Cluster{ "cow-cluster": {Server: "http://a-different-cow.org:8080", InsecureSkipTLSVerify: true, DisableCompression: true}, "donkey-cluster": {Server: "http://donkey.org:8080", InsecureSkipTLSVerify: true, DisableCompression: true}}, CurrentContext: "federal-context", } ) func TestNilOutMap(t *testing.T) { var fakeKubeconfigData = `apiVersion: v1 kind: Config clusters: - cluster: certificate-authority-data: UEhPTlkK server: https://1.1.1.1 name: production contexts: - context: cluster: production user: production name: production current-context: production users: - name: production user: auth-provider: name: gcp` _, _, err := clientcmdlatest.Codec.Decode([]byte(fakeKubeconfigData), nil, nil) if err != nil { t.Fatalf("unexpected error: %v", err) } } func TestNonExistentCommandLineFile(t *testing.T) { loadingRules := ClientConfigLoadingRules{ ExplicitPath: "bogus_file", } _, err := loadingRules.Load() if err == nil { t.Fatalf("Expected error for missing command-line file, got none") } if !strings.Contains(err.Error(), "bogus_file") { t.Fatalf("Expected error about 'bogus_file', got %s", err.Error()) } } func TestToleratingMissingFiles(t *testing.T) { envVarValue := "bogus" loadingRules := ClientConfigLoadingRules{ Precedence: []string{"bogus1", "bogus2", "bogus3"}, WarnIfAllMissing: true, Warner: func(err error) { klog.Warning(err) }, } buffer := &bytes.Buffer{} klog.LogToStderr(false) klog.SetOutput(buffer) _, err := loadingRules.Load() if err != nil { t.Fatalf("Unexpected error: %v", err) } klog.Flush() expectedLog := fmt.Sprintf("Config not found: %s", envVarValue) if !strings.Contains(buffer.String(), expectedLog) { t.Fatalf("expected log: \"%s\"", expectedLog) } } func TestWarningMissingFiles(t *testing.T) { envVarValue := "bogus" t.Setenv(RecommendedConfigPathEnvVar, envVarValue) loadingRules := NewDefaultClientConfigLoadingRules() buffer := &bytes.Buffer{} flags := &flag.FlagSet{} klog.InitFlags(flags) flags.Set("v", "1") klog.LogToStderr(false) klog.SetOutput(buffer) _, err := loadingRules.Load() if err != nil { t.Fatalf("Unexpected error: %v", err) } klog.Flush() expectedLog := fmt.Sprintf("Config not found: %s", envVarValue) if !strings.Contains(buffer.String(), expectedLog) { t.Fatalf("expected log: \"%s\"", expectedLog) } } func TestNoWarningMissingFiles(t *testing.T) { envVarValue := "bogus" t.Setenv(RecommendedConfigPathEnvVar, envVarValue) loadingRules := NewDefaultClientConfigLoadingRules() buffer := &bytes.Buffer{} flags := &flag.FlagSet{} klog.InitFlags(flags) flags.Set("v", "0") klog.LogToStderr(false) klog.SetOutput(buffer) _, err := loadingRules.Load() if err != nil { t.Fatalf("Unexpected error: %v", err) } klog.Flush() logNotExpected := fmt.Sprintf("Config not found: %s", envVarValue) if strings.Contains(buffer.String(), logNotExpected) { t.Fatalf("log not expected: \"%s\"", logNotExpected) } } func TestErrorReadingFile(t *testing.T) { commandLineFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, commandLineFile) if err := os.WriteFile(commandLineFile.Name(), []byte("bogus value"), 0644); err != nil { t.Fatalf("Error creating tempfile: %v", err) } loadingRules := ClientConfigLoadingRules{ ExplicitPath: commandLineFile.Name(), } _, err := loadingRules.Load() if err == nil { t.Fatalf("Expected error for unloadable file, got none") } if !strings.Contains(err.Error(), commandLineFile.Name()) { t.Fatalf("Expected error about '%s', got %s", commandLineFile.Name(), err.Error()) } } func TestErrorReadingNonFile(t *testing.T) { tmpdir, err := os.MkdirTemp("", "") if err != nil { t.Fatalf("Couldn't create tmpdir") } defer os.RemoveAll(tmpdir) loadingRules := ClientConfigLoadingRules{ ExplicitPath: tmpdir, } _, err = loadingRules.Load() if err == nil { t.Fatalf("Expected error for non-file, got none") } if !strings.Contains(err.Error(), tmpdir) { t.Fatalf("Expected error about '%s', got %s", tmpdir, err.Error()) } } func TestConflictingCurrentContext(t *testing.T) { commandLineFile, _ := os.CreateTemp("", "") envVarFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, commandLineFile, envVarFile) mockCommandLineConfig := clientcmdapi.Config{ CurrentContext: "any-context-value", } mockEnvVarConfig := clientcmdapi.Config{ CurrentContext: "a-different-context", } WriteToFile(mockCommandLineConfig, commandLineFile.Name()) WriteToFile(mockEnvVarConfig, envVarFile.Name()) loadingRules := ClientConfigLoadingRules{ ExplicitPath: commandLineFile.Name(), Precedence: []string{envVarFile.Name()}, } mergedConfig, err := loadingRules.Load() if err != nil { t.Errorf("Unexpected error: %v", err) } if mergedConfig.CurrentContext != mockCommandLineConfig.CurrentContext { t.Errorf("expected %v, got %v", mockCommandLineConfig.CurrentContext, mergedConfig.CurrentContext) } } func TestEncodeYAML(t *testing.T) { config := clientcmdapi.Config{ CurrentContext: "any-context-value", Contexts: map[string]*clientcmdapi.Context{ "433e40": { Cluster: "433e40", }, }, Clusters: map[string]*clientcmdapi.Cluster{ "0": { Server: "https://localhost:1234", }, "1": { Server: "https://localhost:1234", }, "433e40": { Server: "https://localhost:1234", }, }, } data, err := Write(config) if err != nil { t.Fatal(err) } expected := []byte(`apiVersion: v1 clusters: - cluster: server: https://localhost:1234 name: "0" - cluster: server: https://localhost:1234 name: "1" - cluster: server: https://localhost:1234 name: "433e40" contexts: - context: cluster: "433e40" user: "" name: "433e40" current-context: any-context-value kind: Config preferences: {} users: null `) if !bytes.Equal(expected, data) { t.Error(cmp.Diff(string(expected), string(data))) } } func TestLoadingEmptyMaps(t *testing.T) { configFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, configFile) mockConfig := clientcmdapi.Config{ CurrentContext: "any-context-value", } WriteToFile(mockConfig, configFile.Name()) config, err := LoadFromFile(configFile.Name()) if err != nil { t.Errorf("Unexpected error: %v", err) } if config.Clusters == nil { t.Error("expected config.Clusters to be non-nil") } if config.AuthInfos == nil { t.Error("expected config.AuthInfos to be non-nil") } if config.Contexts == nil { t.Error("expected config.Contexts to be non-nil") } } func TestDuplicateClusterName(t *testing.T) { configFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, configFile) err := os.WriteFile(configFile.Name(), []byte(` kind: Config apiVersion: v1 clusters: - cluster: api-version: v1 server: https://kubernetes.default.svc:443 certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt name: kubeconfig-cluster - cluster: api-version: v2 server: https://test.example.server:443 certificate-authority: /var/run/secrets/test.example.io/serviceaccount/ca.crt name: kubeconfig-cluster contexts: - context: cluster: kubeconfig-cluster namespace: default user: kubeconfig-user name: kubeconfig-context current-context: kubeconfig-context users: - name: kubeconfig-user user: tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token `), os.FileMode(0755)) if err != nil { t.Errorf("Unexpected error: %v", err) } _, err = LoadFromFile(configFile.Name()) if err == nil || !strings.Contains(err.Error(), "error converting *[]NamedCluster into *map[string]*api.Cluster: duplicate name \"kubeconfig-cluster\" in list") { t.Error("Expected error in loading duplicate cluster name, got none") } } func TestDuplicateContextName(t *testing.T) { configFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, configFile) err := os.WriteFile(configFile.Name(), []byte(` kind: Config apiVersion: v1 clusters: - cluster: api-version: v1 server: https://kubernetes.default.svc:443 certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt name: kubeconfig-cluster contexts: - context: cluster: kubeconfig-cluster namespace: default user: kubeconfig-user name: kubeconfig-context - context: cluster: test-example-cluster namespace: test-example user: test-example-user name: kubeconfig-context current-context: kubeconfig-context users: - name: kubeconfig-user user: tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token `), os.FileMode(0755)) if err != nil { t.Errorf("Unexpected error: %v", err) } _, err = LoadFromFile(configFile.Name()) if err == nil || !strings.Contains(err.Error(), "error converting *[]NamedContext into *map[string]*api.Context: duplicate name \"kubeconfig-context\" in list") { t.Error("Expected error in loading duplicate context name, got none") } } func TestDuplicateUserName(t *testing.T) { configFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, configFile) err := os.WriteFile(configFile.Name(), []byte(` kind: Config apiVersion: v1 clusters: - cluster: api-version: v1 server: https://kubernetes.default.svc:443 certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt name: kubeconfig-cluster contexts: - context: cluster: kubeconfig-cluster namespace: default user: kubeconfig-user name: kubeconfig-context current-context: kubeconfig-context users: - name: kubeconfig-user user: tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - name: kubeconfig-user user: tokenFile: /var/run/secrets/test.example.com/serviceaccount/token `), os.FileMode(0755)) if err != nil { t.Errorf("Unexpected error: %v", err) } _, err = LoadFromFile(configFile.Name()) if err == nil || !strings.Contains(err.Error(), "error converting *[]NamedAuthInfo into *map[string]*api.AuthInfo: duplicate name \"kubeconfig-user\" in list") { t.Error("Expected error in loading duplicate user name, got none") } } func TestDuplicateExtensionName(t *testing.T) { configFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, configFile) err := os.WriteFile(configFile.Name(), []byte(` kind: Config apiVersion: v1 clusters: - cluster: api-version: v1 server: https://kubernetes.default.svc:443 certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt name: kubeconfig-cluster contexts: - context: cluster: kubeconfig-cluster namespace: default user: kubeconfig-user name: kubeconfig-context current-context: kubeconfig-context users: - name: kubeconfig-user user: tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token extensions: - extension: bytes: test name: test-extension - extension: bytes: some-example name: test-extension `), os.FileMode(0755)) if err != nil { t.Errorf("Unexpected error: %v", err) } _, err = LoadFromFile(configFile.Name()) if err == nil || !strings.Contains(err.Error(), "error converting *[]NamedExtension into *map[string]runtime.Object: duplicate name \"test-extension\" in list") { t.Error("Expected error in loading duplicate extension name, got none") } } func TestResolveRelativePaths(t *testing.T) { pathResolutionConfig1 := clientcmdapi.Config{ AuthInfos: map[string]*clientcmdapi.AuthInfo{ "relative-user-1": {ClientCertificate: "relative/client/cert", ClientKey: "../relative/client/key"}, "absolute-user-1": {ClientCertificate: "/absolute/client/cert", ClientKey: "/absolute/client/key"}, "relative-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "../relative/client/cmd"}}, "absolute-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "/absolute/client/cmd"}}, "PATH-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "cmd"}}, }, Clusters: map[string]*clientcmdapi.Cluster{ "relative-server-1": {CertificateAuthority: "../relative/ca"}, "absolute-server-1": {CertificateAuthority: "/absolute/ca"}, }, } pathResolutionConfig2 := clientcmdapi.Config{ AuthInfos: map[string]*clientcmdapi.AuthInfo{ "relative-user-2": {ClientCertificate: "relative/client/cert2", ClientKey: "../relative/client/key2"}, "absolute-user-2": {ClientCertificate: "/absolute/client/cert2", ClientKey: "/absolute/client/key2"}, }, Clusters: map[string]*clientcmdapi.Cluster{ "relative-server-2": {CertificateAuthority: "../relative/ca2"}, "absolute-server-2": {CertificateAuthority: "/absolute/ca2"}, }, } configDir1, _ := os.MkdirTemp("", "") defer os.RemoveAll(configDir1) configFile1 := filepath.Join(configDir1, ".kubeconfig") configDir1, _ = filepath.Abs(configDir1) configDir2, _ := os.MkdirTemp("", "") defer os.RemoveAll(configDir2) configDir2, _ = os.MkdirTemp(configDir2, "") configFile2 := filepath.Join(configDir2, ".kubeconfig") configDir2, _ = filepath.Abs(configDir2) WriteToFile(pathResolutionConfig1, configFile1) WriteToFile(pathResolutionConfig2, configFile2) loadingRules := ClientConfigLoadingRules{ Precedence: []string{configFile1, configFile2}, } mergedConfig, err := loadingRules.Load() if err != nil { t.Errorf("Unexpected error: %v", err) } foundClusterCount := 0 for key, cluster := range mergedConfig.Clusters { if key == "relative-server-1" { foundClusterCount++ matchStringArg(filepath.Join(configDir1, pathResolutionConfig1.Clusters["relative-server-1"].CertificateAuthority), cluster.CertificateAuthority, t) } if key == "relative-server-2" { foundClusterCount++ matchStringArg(filepath.Join(configDir2, pathResolutionConfig2.Clusters["relative-server-2"].CertificateAuthority), cluster.CertificateAuthority, t) } if key == "absolute-server-1" { foundClusterCount++ matchStringArg(pathResolutionConfig1.Clusters["absolute-server-1"].CertificateAuthority, cluster.CertificateAuthority, t) } if key == "absolute-server-2" { foundClusterCount++ matchStringArg(pathResolutionConfig2.Clusters["absolute-server-2"].CertificateAuthority, cluster.CertificateAuthority, t) } } if foundClusterCount != 4 { t.Errorf("Expected 4 clusters, found %v: %v", foundClusterCount, mergedConfig.Clusters) } foundAuthInfoCount := 0 for key, authInfo := range mergedConfig.AuthInfos { if key == "relative-user-1" { foundAuthInfoCount++ matchStringArg(filepath.Join(configDir1, pathResolutionConfig1.AuthInfos["relative-user-1"].ClientCertificate), authInfo.ClientCertificate, t) matchStringArg(filepath.Join(configDir1, pathResolutionConfig1.AuthInfos["relative-user-1"].ClientKey), authInfo.ClientKey, t) } if key == "relative-user-2" { foundAuthInfoCount++ matchStringArg(filepath.Join(configDir2, pathResolutionConfig2.AuthInfos["relative-user-2"].ClientCertificate), authInfo.ClientCertificate, t) matchStringArg(filepath.Join(configDir2, pathResolutionConfig2.AuthInfos["relative-user-2"].ClientKey), authInfo.ClientKey, t) } if key == "absolute-user-1" { foundAuthInfoCount++ matchStringArg(pathResolutionConfig1.AuthInfos["absolute-user-1"].ClientCertificate, authInfo.ClientCertificate, t) matchStringArg(pathResolutionConfig1.AuthInfos["absolute-user-1"].ClientKey, authInfo.ClientKey, t) } if key == "absolute-user-2" { foundAuthInfoCount++ matchStringArg(pathResolutionConfig2.AuthInfos["absolute-user-2"].ClientCertificate, authInfo.ClientCertificate, t) matchStringArg(pathResolutionConfig2.AuthInfos["absolute-user-2"].ClientKey, authInfo.ClientKey, t) } if key == "relative-cmd-1" { foundAuthInfoCount++ matchStringArg(filepath.Join(configDir1, pathResolutionConfig1.AuthInfos[key].Exec.Command), authInfo.Exec.Command, t) } if key == "absolute-cmd-1" { foundAuthInfoCount++ matchStringArg(pathResolutionConfig1.AuthInfos[key].Exec.Command, authInfo.Exec.Command, t) } if key == "PATH-cmd-1" { foundAuthInfoCount++ matchStringArg(pathResolutionConfig1.AuthInfos[key].Exec.Command, authInfo.Exec.Command, t) } } if foundAuthInfoCount != 7 { t.Errorf("Expected 7 users, found %v: %v", foundAuthInfoCount, mergedConfig.AuthInfos) } } func TestMigratingFile(t *testing.T) { sourceFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, sourceFile) destinationFile, _ := os.CreateTemp("", "") // delete the file so that we'll write to it os.Remove(destinationFile.Name()) WriteToFile(testConfigAlfa, sourceFile.Name()) loadingRules := ClientConfigLoadingRules{ MigrationRules: map[string]string{destinationFile.Name(): sourceFile.Name()}, } if _, err := loadingRules.Load(); err != nil { t.Errorf("unexpected error %v", err) } // the load should have recreated this file defer utiltesting.CloseAndRemove(t, destinationFile) sourceContent, err := os.ReadFile(sourceFile.Name()) if err != nil { t.Errorf("unexpected error %v", err) } destinationContent, err := os.ReadFile(destinationFile.Name()) if err != nil { t.Errorf("unexpected error %v", err) } if !reflect.DeepEqual(sourceContent, destinationContent) { t.Errorf("source and destination do not match") } } func TestMigratingFileLeaveExistingFileAlone(t *testing.T) { sourceFile, _ := os.CreateTemp("", "") destinationFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, sourceFile, destinationFile) WriteToFile(testConfigAlfa, sourceFile.Name()) loadingRules := ClientConfigLoadingRules{ MigrationRules: map[string]string{destinationFile.Name(): sourceFile.Name()}, } if _, err := loadingRules.Load(); err != nil { t.Errorf("unexpected error %v", err) } destinationContent, err := os.ReadFile(destinationFile.Name()) if err != nil { t.Errorf("unexpected error %v", err) } if len(destinationContent) > 0 { t.Errorf("destination should not have been touched") } } func TestMigratingFileSourceMissingSkip(t *testing.T) { sourceFilename := "some-missing-file" destinationFile, _ := os.CreateTemp("", "") // delete the file so that we'll write to it utiltesting.CloseAndRemove(t, destinationFile) loadingRules := ClientConfigLoadingRules{ MigrationRules: map[string]string{destinationFile.Name(): sourceFilename}, } if _, err := loadingRules.Load(); err != nil { t.Errorf("unexpected error %v", err) } if _, err := os.Stat(destinationFile.Name()); !os.IsNotExist(err) { t.Errorf("destination should not exist") } } func TestFileLocking(t *testing.T) { f, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, f) err := lockFile(f.Name()) if err != nil { t.Errorf("unexpected error while locking file: %v", err) } defer unlockFile(f.Name()) err = lockFile(f.Name()) if err == nil { t.Error("expected error while locking file.") } } func Example_noMergingOnExplicitPaths() { commandLineFile, _ := os.CreateTemp("", "") envVarFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(&testing.T{}, commandLineFile, envVarFile) WriteToFile(testConfigAlfa, commandLineFile.Name()) WriteToFile(testConfigConflictAlfa, envVarFile.Name()) loadingRules := ClientConfigLoadingRules{ ExplicitPath: commandLineFile.Name(), Precedence: []string{envVarFile.Name()}, } mergedConfig, err := loadingRules.Load() if err != nil { fmt.Printf("Unexpected error: %v", err) } json, err := runtime.Encode(clientcmdlatest.Codec, mergedConfig) if err != nil { fmt.Printf("Unexpected error: %v", err) } output, err := yaml.JSONToYAML(json) if err != nil { fmt.Printf("Unexpected error: %v", err) } fmt.Printf("%v", string(output)) // Output: // apiVersion: v1 // clusters: // - cluster: // server: http://cow.org:8080 // name: cow-cluster // contexts: // - context: // cluster: cow-cluster // namespace: hammer-ns // user: red-user // name: federal-context // current-context: "" // kind: Config // preferences: {} // users: // - name: red-user // user: // token: red-token } func Example_mergingSomeWithConflict() { commandLineFile, _ := os.CreateTemp("", "") envVarFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(&testing.T{}, commandLineFile, envVarFile) WriteToFile(testConfigAlfa, commandLineFile.Name()) WriteToFile(testConfigConflictAlfa, envVarFile.Name()) loadingRules := ClientConfigLoadingRules{ Precedence: []string{commandLineFile.Name(), envVarFile.Name()}, } mergedConfig, err := loadingRules.Load() if err != nil { fmt.Printf("Unexpected error: %v", err) } json, err := runtime.Encode(clientcmdlatest.Codec, mergedConfig) if err != nil { fmt.Printf("Unexpected error: %v", err) } output, err := yaml.JSONToYAML(json) if err != nil { fmt.Printf("Unexpected error: %v", err) } fmt.Printf("%v", string(output)) // Output: // apiVersion: v1 // clusters: // - cluster: // server: http://cow.org:8080 // name: cow-cluster // - cluster: // disable-compression: true // insecure-skip-tls-verify: true // server: http://donkey.org:8080 // name: donkey-cluster // contexts: // - context: // cluster: cow-cluster // namespace: hammer-ns // user: red-user // name: federal-context // current-context: federal-context // kind: Config // preferences: {} // users: // - name: red-user // user: // token: red-token // - name: yellow-user // user: // token: yellow-token } func Example_mergingEverythingNoConflicts() { commandLineFile, _ := os.CreateTemp("", "") envVarFile, _ := os.CreateTemp("", "") currentDirFile, _ := os.CreateTemp("", "") homeDirFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(&testing.T{}, commandLineFile, envVarFile, currentDirFile, homeDirFile) WriteToFile(testConfigAlfa, commandLineFile.Name()) WriteToFile(testConfigBravo, envVarFile.Name()) WriteToFile(testConfigCharlie, currentDirFile.Name()) WriteToFile(testConfigDelta, homeDirFile.Name()) loadingRules := ClientConfigLoadingRules{ Precedence: []string{commandLineFile.Name(), envVarFile.Name(), currentDirFile.Name(), homeDirFile.Name()}, } mergedConfig, err := loadingRules.Load() if err != nil { fmt.Printf("Unexpected error: %v", err) } json, err := runtime.Encode(clientcmdlatest.Codec, mergedConfig) if err != nil { fmt.Printf("Unexpected error: %v", err) } output, err := yaml.JSONToYAML(json) if err != nil { fmt.Printf("Unexpected error: %v", err) } fmt.Printf("%v", string(output)) // Output: // apiVersion: v1 // clusters: // - cluster: // server: http://chicken.org:8080 // name: chicken-cluster // - cluster: // server: http://cow.org:8080 // name: cow-cluster // - cluster: // server: http://horse.org:8080 // name: horse-cluster // - cluster: // server: http://pig.org:8080 // name: pig-cluster // contexts: // - context: // cluster: cow-cluster // namespace: hammer-ns // user: red-user // name: federal-context // - context: // cluster: chicken-cluster // namespace: plane-ns // user: blue-user // name: gothic-context // - context: // cluster: pig-cluster // namespace: saw-ns // user: black-user // name: queen-anne-context // - context: // cluster: horse-cluster // namespace: chisel-ns // user: green-user // name: shaker-context // current-context: "" // kind: Config // preferences: {} // users: // - name: black-user // user: // token: black-token // - name: blue-user // user: // token: blue-token // - name: green-user // user: // token: green-token // - name: red-user // user: // token: red-token } func TestDeduplicate(t *testing.T) { testCases := []struct { src []string expect []string }{ { src: []string{"a", "b", "c", "d", "e", "f"}, expect: []string{"a", "b", "c", "d", "e", "f"}, }, { src: []string{"a", "b", "c", "b", "e", "f"}, expect: []string{"a", "b", "c", "e", "f"}, }, { src: []string{"a", "a", "b", "b", "c", "b"}, expect: []string{"a", "b", "c"}, }, } for _, testCase := range testCases { get := deduplicate(testCase.src) if !reflect.DeepEqual(get, testCase.expect) { t.Errorf("expect: %v, get: %v", testCase.expect, get) } } } func TestLoadingGetLoadingPrecedence(t *testing.T) { testCases := map[string]struct { rules *ClientConfigLoadingRules env string precedence []string }{ "default": { precedence: []string{filepath.Join(os.Getenv("HOME"), ".kube/config")}, }, "explicit": { rules: &ClientConfigLoadingRules{ ExplicitPath: "/explicit/kubeconfig", }, precedence: []string{"/explicit/kubeconfig"}, }, "envvar-single": { env: "/env/kubeconfig", precedence: []string{"/env/kubeconfig"}, }, "envvar-multiple": { env: "/env/kubeconfig:/other/kubeconfig", precedence: []string{"/env/kubeconfig", "/other/kubeconfig"}, }, } for name, test := range testCases { t.Run(name, func(t *testing.T) { t.Setenv("KUBECONFIG", test.env) rules := test.rules if rules == nil { rules = NewDefaultClientConfigLoadingRules() } actual := rules.GetLoadingPrecedence() if !reflect.DeepEqual(actual, test.precedence) { t.Errorf("expect %v, got %v", test.precedence, actual) } }) } } kubernetes-client-go-a2dfcab/tools/clientcmd/main_test.go000066400000000000000000000015451472614177300240210ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "os" "path/filepath" "testing" ) func TestMain(m *testing.M) { tmp, err := os.MkdirTemp("", "testkubeconfig") if err != nil { panic(err) } defer os.RemoveAll(tmp) os.Setenv("KUBECONFIG", filepath.Join(tmp, "dummy-nonexistent-kubeconfig")) os.Exit(m.Run()) } kubernetes-client-go-a2dfcab/tools/clientcmd/merged_client_builder.go000066400000000000000000000134111472614177300263400ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "io" "sync" "k8s.io/klog/v2" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) // DeferredLoadingClientConfig is a ClientConfig interface that is backed by a client config loader. // It is used in cases where the loading rules may change after you've instantiated them and you want to be sure that // the most recent rules are used. This is useful in cases where you bind flags to loading rule parameters before // the parse happens and you want your calling code to be ignorant of how the values are being mutated to avoid // passing extraneous information down a call stack type DeferredLoadingClientConfig struct { loader ClientConfigLoader overrides *ConfigOverrides fallbackReader io.Reader clientConfig ClientConfig loadingLock sync.Mutex // provided for testing icc InClusterConfig } // InClusterConfig abstracts details of whether the client is running in a cluster for testing. type InClusterConfig interface { ClientConfig Possible() bool } // NewNonInteractiveDeferredLoadingClientConfig creates a ClientConfig using the passed context name func NewNonInteractiveDeferredLoadingClientConfig(loader ClientConfigLoader, overrides *ConfigOverrides) ClientConfig { return &DeferredLoadingClientConfig{loader: loader, overrides: overrides, icc: &inClusterClientConfig{overrides: overrides}} } // NewInteractiveDeferredLoadingClientConfig creates a ClientConfig using the passed context name and the fallback auth reader func NewInteractiveDeferredLoadingClientConfig(loader ClientConfigLoader, overrides *ConfigOverrides, fallbackReader io.Reader) ClientConfig { return &DeferredLoadingClientConfig{loader: loader, overrides: overrides, icc: &inClusterClientConfig{overrides: overrides}, fallbackReader: fallbackReader} } func (config *DeferredLoadingClientConfig) createClientConfig() (ClientConfig, error) { config.loadingLock.Lock() defer config.loadingLock.Unlock() if config.clientConfig != nil { return config.clientConfig, nil } mergedConfig, err := config.loader.Load() if err != nil { return nil, err } var currentContext string if config.overrides != nil { currentContext = config.overrides.CurrentContext } if config.fallbackReader != nil { config.clientConfig = NewInteractiveClientConfig(*mergedConfig, currentContext, config.overrides, config.fallbackReader, config.loader) } else { config.clientConfig = NewNonInteractiveClientConfig(*mergedConfig, currentContext, config.overrides, config.loader) } return config.clientConfig, nil } func (config *DeferredLoadingClientConfig) RawConfig() (clientcmdapi.Config, error) { mergedConfig, err := config.createClientConfig() if err != nil { return clientcmdapi.Config{}, err } return mergedConfig.RawConfig() } // ClientConfig implements ClientConfig func (config *DeferredLoadingClientConfig) ClientConfig() (*restclient.Config, error) { mergedClientConfig, err := config.createClientConfig() if err != nil { return nil, err } // load the configuration and return on non-empty errors and if the // content differs from the default config mergedConfig, err := mergedClientConfig.ClientConfig() switch { case err != nil: if !IsEmptyConfig(err) { // return on any error except empty config return nil, err } case mergedConfig != nil: // the configuration is valid, but if this is equal to the defaults we should try // in-cluster configuration if !config.loader.IsDefaultConfig(mergedConfig) { return mergedConfig, nil } } // check for in-cluster configuration and use it if config.icc.Possible() { klog.V(4).Infof("Using in-cluster configuration") return config.icc.ClientConfig() } // return the result of the merged client config return mergedConfig, err } // Namespace implements KubeConfig func (config *DeferredLoadingClientConfig) Namespace() (string, bool, error) { mergedKubeConfig, err := config.createClientConfig() if err != nil { return "", false, err } ns, overridden, err := mergedKubeConfig.Namespace() // if we get an error and it is not empty config, or if the merged config defined an explicit namespace, or // if in-cluster config is not possible, return immediately if (err != nil && !IsEmptyConfig(err)) || overridden || !config.icc.Possible() { // return on any error except empty config return ns, overridden, err } if len(ns) > 0 { // if we got a non-default namespace from the kubeconfig, use it if ns != "default" { return ns, false, nil } // if we got a default namespace, determine whether it was explicit or implicit if raw, err := mergedKubeConfig.RawConfig(); err == nil { // determine the current context currentContext := raw.CurrentContext if config.overrides != nil && len(config.overrides.CurrentContext) > 0 { currentContext = config.overrides.CurrentContext } if context := raw.Contexts[currentContext]; context != nil && len(context.Namespace) > 0 { return ns, false, nil } } } klog.V(4).Infof("Using in-cluster namespace") // allow the namespace from the service account token directory to be used. return config.icc.Namespace() } // ConfigAccess implements ClientConfig func (config *DeferredLoadingClientConfig) ConfigAccess() ConfigAccess { return config.loader } kubernetes-client-go-a2dfcab/tools/clientcmd/merged_client_builder_test.go000066400000000000000000000213661472614177300274070ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "fmt" "testing" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) type testClientConfig struct { rawconfig *clientcmdapi.Config config *restclient.Config namespace string namespaceSpecified bool err error } func (c *testClientConfig) RawConfig() (clientcmdapi.Config, error) { if c.rawconfig == nil { return clientcmdapi.Config{}, fmt.Errorf("unexpected call") } return *c.rawconfig, nil } func (c *testClientConfig) ClientConfig() (*restclient.Config, error) { return c.config, c.err } func (c *testClientConfig) Namespace() (string, bool, error) { return c.namespace, c.namespaceSpecified, c.err } func (c *testClientConfig) ConfigAccess() ConfigAccess { return nil } type testICC struct { testClientConfig possible bool called bool } func (icc *testICC) Possible() bool { icc.called = true return icc.possible } func TestInClusterConfig(t *testing.T) { default1 := &DirectClientConfig{ config: *createValidTestConfig(), contextName: "clean", overrides: &ConfigOverrides{}, } invalidDefaultConfig := clientcmdapi.NewConfig() invalidDefaultConfig.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "http://localhost:8080", } invalidDefaultConfig.Contexts["other"] = &clientcmdapi.Context{ Cluster: "clean", } invalidDefaultConfig.CurrentContext = "clean" defaultInvalid := &DirectClientConfig{ config: *invalidDefaultConfig, overrides: &ConfigOverrides{}, } if _, err := defaultInvalid.ClientConfig(); err == nil || !IsConfigurationInvalid(err) { t.Fatal(err) } config1, err := default1.ClientConfig() if err != nil { t.Fatal(err) } config2 := &restclient.Config{Host: "config2"} err1 := fmt.Errorf("unique error") testCases := map[string]struct { clientConfig *testClientConfig icc *testICC defaultConfig *DirectClientConfig checkedICC bool result *restclient.Config err error }{ "in-cluster checked on other error": { clientConfig: &testClientConfig{err: ErrEmptyConfig}, icc: &testICC{}, checkedICC: true, result: nil, err: ErrEmptyConfig, }, "in-cluster not checked on non-empty error": { clientConfig: &testClientConfig{err: ErrEmptyCluster}, icc: &testICC{}, checkedICC: false, result: nil, err: ErrEmptyCluster, }, "in-cluster checked when config is default": { defaultConfig: default1, clientConfig: &testClientConfig{config: config1}, icc: &testICC{}, checkedICC: true, result: config1, err: nil, }, "in-cluster not checked when default config is invalid": { defaultConfig: defaultInvalid, clientConfig: &testClientConfig{config: config1}, icc: &testICC{}, checkedICC: false, result: config1, err: nil, }, "in-cluster not checked when config is not equal to default": { defaultConfig: default1, clientConfig: &testClientConfig{config: config2}, icc: &testICC{}, checkedICC: false, result: config2, err: nil, }, "in-cluster checked when config is not equal to default and error is empty": { clientConfig: &testClientConfig{config: config2, err: ErrEmptyConfig}, icc: &testICC{}, checkedICC: true, result: config2, err: ErrEmptyConfig, }, "in-cluster error returned when config is empty": { clientConfig: &testClientConfig{err: ErrEmptyConfig}, icc: &testICC{ possible: true, testClientConfig: testClientConfig{ err: err1, }, }, checkedICC: true, result: nil, err: err1, }, "in-cluster config returned when config is empty": { clientConfig: &testClientConfig{err: ErrEmptyConfig}, icc: &testICC{ possible: true, testClientConfig: testClientConfig{ config: config2, }, }, checkedICC: true, result: config2, err: nil, }, "in-cluster not checked when standard default is invalid": { defaultConfig: &DefaultClientConfig, clientConfig: &testClientConfig{config: config2}, icc: &testICC{}, checkedICC: false, result: config2, err: nil, }, } for name, test := range testCases { c := &DeferredLoadingClientConfig{icc: test.icc} c.loader = &ClientConfigLoadingRules{DefaultClientConfig: test.defaultConfig} c.clientConfig = test.clientConfig cfg, err := c.ClientConfig() if test.icc.called != test.checkedICC { t.Errorf("%s: unexpected in-cluster-config call %t", name, test.icc.called) } if err != test.err || cfg != test.result { t.Errorf("%s: unexpected result: %v %#v", name, err, cfg) } } } func TestInClusterConfigNamespace(t *testing.T) { err1 := fmt.Errorf("unique error") testCases := map[string]struct { clientConfig *testClientConfig icc *testICC overrides *ConfigOverrides checkedICC bool result string overridden bool err error }{ "in-cluster checked on empty error": { clientConfig: &testClientConfig{err: ErrEmptyConfig}, icc: &testICC{}, checkedICC: true, err: ErrEmptyConfig, }, "in-cluster not checked on non-empty error": { clientConfig: &testClientConfig{err: ErrEmptyCluster}, icc: &testICC{}, err: ErrEmptyCluster, }, "in-cluster checked when config is default": { clientConfig: &testClientConfig{}, icc: &testICC{}, checkedICC: true, }, "in-cluster not checked when config is not equal to default": { clientConfig: &testClientConfig{namespace: "test", namespaceSpecified: true}, icc: &testICC{}, result: "test", overridden: true, }, "in-cluster checked when namespace is not specified, but is defaulted": { clientConfig: &testClientConfig{namespace: "test", namespaceSpecified: false}, icc: &testICC{}, checkedICC: true, result: "test", overridden: false, }, "in-cluster error returned when config is empty": { clientConfig: &testClientConfig{err: ErrEmptyConfig}, icc: &testICC{ possible: true, testClientConfig: testClientConfig{ err: err1, }, }, checkedICC: true, err: err1, }, "in-cluster config returned when config is empty": { clientConfig: &testClientConfig{err: ErrEmptyConfig}, icc: &testICC{ possible: true, testClientConfig: testClientConfig{ namespace: "test", namespaceSpecified: true, }, }, checkedICC: true, result: "test", overridden: true, }, "in-cluster config returned when config is empty and namespace is defaulted but not explicitly set": { clientConfig: &testClientConfig{err: ErrEmptyConfig}, icc: &testICC{ possible: true, testClientConfig: testClientConfig{ namespace: "test", namespaceSpecified: false, }, }, checkedICC: true, result: "test", overridden: false, }, "overridden context used to verify explicit namespace in config": { clientConfig: &testClientConfig{ namespace: "default", namespaceSpecified: false, // a namespace that comes from a context is not considered overridden rawconfig: &clientcmdapi.Config{Contexts: map[string]*clientcmdapi.Context{"overridden-context": {Namespace: "default"}}}, }, overrides: &ConfigOverrides{CurrentContext: "overridden-context"}, icc: &testICC{ possible: true, testClientConfig: testClientConfig{ namespace: "icc", namespaceSpecified: false, // a namespace that comes from icc is not considered overridden }, }, checkedICC: true, result: "default", overridden: false, // a namespace that comes from a context is not considered overridden }, } for name, test := range testCases { t.Run(name, func(t *testing.T) { c := &DeferredLoadingClientConfig{icc: test.icc, overrides: test.overrides} c.clientConfig = test.clientConfig ns, overridden, err := c.Namespace() if test.icc.called != test.checkedICC { t.Errorf("%s: unexpected in-cluster-config call %t", name, test.icc.called) } if err != test.err || ns != test.result || overridden != test.overridden { t.Errorf("%s: unexpected result: %v %s %t", name, err, ns, overridden) } }) } } kubernetes-client-go-a2dfcab/tools/clientcmd/overrides.go000066400000000000000000000310451472614177300240360ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "strconv" "strings" "github.com/spf13/pflag" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) // ConfigOverrides holds values that should override whatever information is pulled from the actual Config object. You can't // simply use an actual Config object, because Configs hold maps, but overrides are restricted to "at most one" type ConfigOverrides struct { AuthInfo clientcmdapi.AuthInfo // ClusterDefaults are applied before the configured cluster info is loaded. ClusterDefaults clientcmdapi.Cluster ClusterInfo clientcmdapi.Cluster Context clientcmdapi.Context CurrentContext string Timeout string } // ConfigOverrideFlags holds the flag names to be used for binding command line flags. Notice that this structure tightly // corresponds to ConfigOverrides type ConfigOverrideFlags struct { AuthOverrideFlags AuthOverrideFlags ClusterOverrideFlags ClusterOverrideFlags ContextOverrideFlags ContextOverrideFlags CurrentContext FlagInfo Timeout FlagInfo } // AuthOverrideFlags holds the flag names to be used for binding command line flags for AuthInfo objects type AuthOverrideFlags struct { ClientCertificate FlagInfo ClientKey FlagInfo Token FlagInfo Impersonate FlagInfo ImpersonateUID FlagInfo ImpersonateGroups FlagInfo Username FlagInfo Password FlagInfo } // ContextOverrideFlags holds the flag names to be used for binding command line flags for Cluster objects type ContextOverrideFlags struct { ClusterName FlagInfo AuthInfoName FlagInfo Namespace FlagInfo } // ClusterOverride holds the flag names to be used for binding command line flags for Cluster objects type ClusterOverrideFlags struct { APIServer FlagInfo APIVersion FlagInfo CertificateAuthority FlagInfo InsecureSkipTLSVerify FlagInfo TLSServerName FlagInfo ProxyURL FlagInfo DisableCompression FlagInfo } // FlagInfo contains information about how to register a flag. This struct is useful if you want to provide a way for an extender to // get back a set of recommended flag names, descriptions, and defaults, but allow for customization by an extender. This makes for // coherent extension, without full prescription type FlagInfo struct { // LongName is the long string for a flag. If this is empty, then the flag will not be bound LongName string // ShortName is the single character for a flag. If this is empty, then there will be no short flag ShortName string // Default is the default value for the flag Default string // Description is the description for the flag Description string } // AddSecretAnnotation add secret flag to Annotation. func (f FlagInfo) AddSecretAnnotation(flags *pflag.FlagSet) FlagInfo { flags.SetAnnotation(f.LongName, "classified", []string{"true"}) return f } // BindStringFlag binds the flag based on the provided info. If LongName == "", nothing is registered func (f FlagInfo) BindStringFlag(flags *pflag.FlagSet, target *string) FlagInfo { // you can't register a flag without a long name if len(f.LongName) > 0 { flags.StringVarP(target, f.LongName, f.ShortName, f.Default, f.Description) } return f } // BindTransformingStringFlag binds the flag based on the provided info. If LongName == "", nothing is registered func (f FlagInfo) BindTransformingStringFlag(flags *pflag.FlagSet, target *string, transformer func(string) (string, error)) FlagInfo { // you can't register a flag without a long name if len(f.LongName) > 0 { flags.VarP(newTransformingStringValue(f.Default, target, transformer), f.LongName, f.ShortName, f.Description) } return f } // BindStringSliceFlag binds the flag based on the provided info. If LongName == "", nothing is registered func (f FlagInfo) BindStringArrayFlag(flags *pflag.FlagSet, target *[]string) FlagInfo { // you can't register a flag without a long name if len(f.LongName) > 0 { sliceVal := []string{} if len(f.Default) > 0 { sliceVal = []string{f.Default} } flags.StringArrayVarP(target, f.LongName, f.ShortName, sliceVal, f.Description) } return f } // BindBoolFlag binds the flag based on the provided info. If LongName == "", nothing is registered func (f FlagInfo) BindBoolFlag(flags *pflag.FlagSet, target *bool) FlagInfo { // you can't register a flag without a long name if len(f.LongName) > 0 { // try to parse Default as a bool. If it fails, assume false boolVal, err := strconv.ParseBool(f.Default) if err != nil { boolVal = false } flags.BoolVarP(target, f.LongName, f.ShortName, boolVal, f.Description) } return f } const ( FlagClusterName = "cluster" FlagAuthInfoName = "user" FlagContext = "context" FlagNamespace = "namespace" FlagAPIServer = "server" FlagTLSServerName = "tls-server-name" FlagInsecure = "insecure-skip-tls-verify" FlagCertFile = "client-certificate" FlagKeyFile = "client-key" FlagCAFile = "certificate-authority" FlagEmbedCerts = "embed-certs" FlagBearerToken = "token" FlagImpersonate = "as" FlagImpersonateUID = "as-uid" FlagImpersonateGroup = "as-group" FlagUsername = "username" FlagPassword = "password" FlagTimeout = "request-timeout" FlagProxyURL = "proxy-url" FlagDisableCompression = "disable-compression" ) // RecommendedConfigOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing func RecommendedConfigOverrideFlags(prefix string) ConfigOverrideFlags { return ConfigOverrideFlags{ AuthOverrideFlags: RecommendedAuthOverrideFlags(prefix), ClusterOverrideFlags: RecommendedClusterOverrideFlags(prefix), ContextOverrideFlags: RecommendedContextOverrideFlags(prefix), CurrentContext: FlagInfo{prefix + FlagContext, "", "", "The name of the kubeconfig context to use"}, Timeout: FlagInfo{prefix + FlagTimeout, "", "0", "The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests."}, } } // RecommendedAuthOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing func RecommendedAuthOverrideFlags(prefix string) AuthOverrideFlags { return AuthOverrideFlags{ ClientCertificate: FlagInfo{prefix + FlagCertFile, "", "", "Path to a client certificate file for TLS"}, ClientKey: FlagInfo{prefix + FlagKeyFile, "", "", "Path to a client key file for TLS"}, Token: FlagInfo{prefix + FlagBearerToken, "", "", "Bearer token for authentication to the API server"}, Impersonate: FlagInfo{prefix + FlagImpersonate, "", "", "Username to impersonate for the operation"}, ImpersonateUID: FlagInfo{prefix + FlagImpersonateUID, "", "", "UID to impersonate for the operation"}, ImpersonateGroups: FlagInfo{prefix + FlagImpersonateGroup, "", "", "Group to impersonate for the operation, this flag can be repeated to specify multiple groups."}, Username: FlagInfo{prefix + FlagUsername, "", "", "Username for basic authentication to the API server"}, Password: FlagInfo{prefix + FlagPassword, "", "", "Password for basic authentication to the API server"}, } } // RecommendedClusterOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing func RecommendedClusterOverrideFlags(prefix string) ClusterOverrideFlags { return ClusterOverrideFlags{ APIServer: FlagInfo{prefix + FlagAPIServer, "", "", "The address and port of the Kubernetes API server"}, CertificateAuthority: FlagInfo{prefix + FlagCAFile, "", "", "Path to a cert file for the certificate authority"}, InsecureSkipTLSVerify: FlagInfo{prefix + FlagInsecure, "", "false", "If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure"}, TLSServerName: FlagInfo{prefix + FlagTLSServerName, "", "", "If provided, this name will be used to validate server certificate. If this is not provided, hostname used to contact the server is used."}, ProxyURL: FlagInfo{prefix + FlagProxyURL, "", "", "If provided, this URL will be used to connect via proxy"}, DisableCompression: FlagInfo{prefix + FlagDisableCompression, "", "", "If true, opt-out of response compression for all requests to the server"}, } } // RecommendedContextOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing func RecommendedContextOverrideFlags(prefix string) ContextOverrideFlags { return ContextOverrideFlags{ ClusterName: FlagInfo{prefix + FlagClusterName, "", "", "The name of the kubeconfig cluster to use"}, AuthInfoName: FlagInfo{prefix + FlagAuthInfoName, "", "", "The name of the kubeconfig user to use"}, Namespace: FlagInfo{prefix + FlagNamespace, "n", "", "If present, the namespace scope for this CLI request"}, } } // BindOverrideFlags is a convenience method to bind the specified flags to their associated variables func BindOverrideFlags(overrides *ConfigOverrides, flags *pflag.FlagSet, flagNames ConfigOverrideFlags) { BindAuthInfoFlags(&overrides.AuthInfo, flags, flagNames.AuthOverrideFlags) BindClusterFlags(&overrides.ClusterInfo, flags, flagNames.ClusterOverrideFlags) BindContextFlags(&overrides.Context, flags, flagNames.ContextOverrideFlags) flagNames.CurrentContext.BindStringFlag(flags, &overrides.CurrentContext) flagNames.Timeout.BindStringFlag(flags, &overrides.Timeout) } // BindAuthInfoFlags is a convenience method to bind the specified flags to their associated variables func BindAuthInfoFlags(authInfo *clientcmdapi.AuthInfo, flags *pflag.FlagSet, flagNames AuthOverrideFlags) { flagNames.ClientCertificate.BindStringFlag(flags, &authInfo.ClientCertificate).AddSecretAnnotation(flags) flagNames.ClientKey.BindStringFlag(flags, &authInfo.ClientKey).AddSecretAnnotation(flags) flagNames.Token.BindStringFlag(flags, &authInfo.Token).AddSecretAnnotation(flags) flagNames.Impersonate.BindStringFlag(flags, &authInfo.Impersonate).AddSecretAnnotation(flags) flagNames.ImpersonateUID.BindStringFlag(flags, &authInfo.ImpersonateUID).AddSecretAnnotation(flags) flagNames.ImpersonateGroups.BindStringArrayFlag(flags, &authInfo.ImpersonateGroups).AddSecretAnnotation(flags) flagNames.Username.BindStringFlag(flags, &authInfo.Username).AddSecretAnnotation(flags) flagNames.Password.BindStringFlag(flags, &authInfo.Password).AddSecretAnnotation(flags) } // BindClusterFlags is a convenience method to bind the specified flags to their associated variables func BindClusterFlags(clusterInfo *clientcmdapi.Cluster, flags *pflag.FlagSet, flagNames ClusterOverrideFlags) { flagNames.APIServer.BindStringFlag(flags, &clusterInfo.Server) flagNames.CertificateAuthority.BindStringFlag(flags, &clusterInfo.CertificateAuthority) flagNames.InsecureSkipTLSVerify.BindBoolFlag(flags, &clusterInfo.InsecureSkipTLSVerify) flagNames.TLSServerName.BindStringFlag(flags, &clusterInfo.TLSServerName) flagNames.ProxyURL.BindStringFlag(flags, &clusterInfo.ProxyURL) flagNames.DisableCompression.BindBoolFlag(flags, &clusterInfo.DisableCompression) } // BindFlags is a convenience method to bind the specified flags to their associated variables func BindContextFlags(contextInfo *clientcmdapi.Context, flags *pflag.FlagSet, flagNames ContextOverrideFlags) { flagNames.ClusterName.BindStringFlag(flags, &contextInfo.Cluster) flagNames.AuthInfoName.BindStringFlag(flags, &contextInfo.AuthInfo) flagNames.Namespace.BindTransformingStringFlag(flags, &contextInfo.Namespace, RemoveNamespacesPrefix) } // RemoveNamespacesPrefix is a transformer that strips "ns/", "namespace/" and "namespaces/" prefixes case-insensitively func RemoveNamespacesPrefix(value string) (string, error) { for _, prefix := range []string{"namespaces/", "namespace/", "ns/"} { if len(value) > len(prefix) && strings.EqualFold(value[0:len(prefix)], prefix) { value = value[len(prefix):] break } } return value, nil } kubernetes-client-go-a2dfcab/tools/clientcmd/overrides_test.go000066400000000000000000000025341472614177300250760ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "testing" "github.com/spf13/pflag" ) func TestNamespacePrefixStrip(t *testing.T) { testData := map[string]string{ "namespaces/foo": "foo", "NAMESPACES/foo": "foo", "NameSpaces/foo": "foo", "namespace/foo": "foo", "NAMESPACE/foo": "foo", "nameSpace/foo": "foo", "ns/foo": "foo", "NS/foo": "foo", "namespaces/": "namespaces/", "namespace/": "namespace/", "ns/": "ns/", } for before, after := range testData { overrides := &ConfigOverrides{} fs := &pflag.FlagSet{} BindOverrideFlags(overrides, fs, RecommendedConfigOverrideFlags("")) fs.Parse([]string{"--namespace", before}) if overrides.Context.Namespace != after { t.Fatalf("Expected %s, got %s", after, overrides.Context.Namespace) } } } kubernetes-client-go-a2dfcab/tools/clientcmd/validation.go000066400000000000000000000326601472614177300241720ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "errors" "fmt" "os" "reflect" "strings" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/validation" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) var ( ErrNoContext = errors.New("no context chosen") ErrEmptyConfig = NewEmptyConfigError("no configuration has been provided, try setting KUBERNETES_MASTER environment variable") // message is for consistency with old behavior ErrEmptyCluster = errors.New("cluster has no server defined") ) // NewEmptyConfigError returns an error wrapping the given message which IsEmptyConfig() will recognize as an empty config error func NewEmptyConfigError(message string) error { return &errEmptyConfig{message} } type errEmptyConfig struct { message string } func (e *errEmptyConfig) Error() string { return e.message } type errContextNotFound struct { ContextName string } func (e *errContextNotFound) Error() string { return fmt.Sprintf("context was not found for specified context: %v", e.ContextName) } // IsContextNotFound returns a boolean indicating whether the error is known to // report that a context was not found func IsContextNotFound(err error) bool { if err == nil { return false } if _, ok := err.(*errContextNotFound); ok || err == ErrNoContext { return true } return strings.Contains(err.Error(), "context was not found for specified context") } // IsEmptyConfig returns true if the provided error indicates the provided configuration // is empty. func IsEmptyConfig(err error) bool { switch t := err.(type) { case errConfigurationInvalid: if len(t) != 1 { return false } _, ok := t[0].(*errEmptyConfig) return ok } _, ok := err.(*errEmptyConfig) return ok } // errConfigurationInvalid is a set of errors indicating the configuration is invalid. type errConfigurationInvalid []error // errConfigurationInvalid implements error and Aggregate var _ error = errConfigurationInvalid{} var _ utilerrors.Aggregate = errConfigurationInvalid{} func newErrConfigurationInvalid(errs []error) error { switch len(errs) { case 0: return nil default: return errConfigurationInvalid(errs) } } // Error implements the error interface func (e errConfigurationInvalid) Error() string { return fmt.Sprintf("invalid configuration: %v", utilerrors.NewAggregate(e).Error()) } // Errors implements the utilerrors.Aggregate interface func (e errConfigurationInvalid) Errors() []error { return e } // Is implements the utilerrors.Aggregate interface func (e errConfigurationInvalid) Is(target error) bool { return e.visit(func(err error) bool { return errors.Is(err, target) }) } func (e errConfigurationInvalid) visit(f func(err error) bool) bool { for _, err := range e { switch err := err.(type) { case errConfigurationInvalid: if match := err.visit(f); match { return match } case utilerrors.Aggregate: for _, nestedErr := range err.Errors() { if match := f(nestedErr); match { return match } } default: if match := f(err); match { return match } } } return false } // IsConfigurationInvalid returns true if the provided error indicates the configuration is invalid. func IsConfigurationInvalid(err error) bool { switch err.(type) { case *errContextNotFound, errConfigurationInvalid: return true } return IsContextNotFound(err) } // Validate checks for errors in the Config. It does not return early so that it can find as many errors as possible. func Validate(config clientcmdapi.Config) error { validationErrors := make([]error, 0) if clientcmdapi.IsConfigEmpty(&config) { return newErrConfigurationInvalid([]error{ErrEmptyConfig}) } if len(config.CurrentContext) != 0 { if _, exists := config.Contexts[config.CurrentContext]; !exists { validationErrors = append(validationErrors, &errContextNotFound{config.CurrentContext}) } } for contextName, context := range config.Contexts { validationErrors = append(validationErrors, validateContext(contextName, *context, config)...) } for authInfoName, authInfo := range config.AuthInfos { validationErrors = append(validationErrors, validateAuthInfo(authInfoName, *authInfo)...) } for clusterName, clusterInfo := range config.Clusters { validationErrors = append(validationErrors, validateClusterInfo(clusterName, *clusterInfo)...) } return newErrConfigurationInvalid(validationErrors) } // ConfirmUsable looks a particular context and determines if that particular part of the config is useable. There might still be errors in the config, // but no errors in the sections requested or referenced. It does not return early so that it can find as many errors as possible. func ConfirmUsable(config clientcmdapi.Config, passedContextName string) error { validationErrors := make([]error, 0) if clientcmdapi.IsConfigEmpty(&config) { return newErrConfigurationInvalid([]error{ErrEmptyConfig}) } var contextName string if len(passedContextName) != 0 { contextName = passedContextName } else { contextName = config.CurrentContext } if len(contextName) == 0 { return ErrNoContext } context, exists := config.Contexts[contextName] if !exists { validationErrors = append(validationErrors, &errContextNotFound{contextName}) } if exists { validationErrors = append(validationErrors, validateContext(contextName, *context, config)...) // Default to empty users and clusters and let the validation function report an error. authInfo := config.AuthInfos[context.AuthInfo] if authInfo == nil { authInfo = &clientcmdapi.AuthInfo{} } validationErrors = append(validationErrors, validateAuthInfo(context.AuthInfo, *authInfo)...) cluster := config.Clusters[context.Cluster] if cluster == nil { cluster = &clientcmdapi.Cluster{} } validationErrors = append(validationErrors, validateClusterInfo(context.Cluster, *cluster)...) } return newErrConfigurationInvalid(validationErrors) } // validateClusterInfo looks for conflicts and errors in the cluster info func validateClusterInfo(clusterName string, clusterInfo clientcmdapi.Cluster) []error { validationErrors := make([]error, 0) emptyCluster := clientcmdapi.NewCluster() if reflect.DeepEqual(*emptyCluster, clusterInfo) { return []error{ErrEmptyCluster} } if len(clusterInfo.Server) == 0 { if len(clusterName) == 0 { validationErrors = append(validationErrors, fmt.Errorf("default cluster has no server defined")) } else { validationErrors = append(validationErrors, fmt.Errorf("no server found for cluster %q", clusterName)) } } if proxyURL := clusterInfo.ProxyURL; proxyURL != "" { if _, err := parseProxyURL(proxyURL); err != nil { validationErrors = append(validationErrors, fmt.Errorf("invalid 'proxy-url' %q for cluster %q: %w", proxyURL, clusterName, err)) } } // Make sure CA data and CA file aren't both specified if len(clusterInfo.CertificateAuthority) != 0 && len(clusterInfo.CertificateAuthorityData) != 0 { validationErrors = append(validationErrors, fmt.Errorf("certificate-authority-data and certificate-authority are both specified for %v. certificate-authority-data will override.", clusterName)) } if len(clusterInfo.CertificateAuthority) != 0 { clientCertCA, err := os.Open(clusterInfo.CertificateAuthority) if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read certificate-authority %v for %v due to %w", clusterInfo.CertificateAuthority, clusterName, err)) } else { defer clientCertCA.Close() } } return validationErrors } // validateAuthInfo looks for conflicts and errors in the auth info func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []error { validationErrors := make([]error, 0) usingAuthPath := false methods := make([]string, 0, 3) if len(authInfo.Token) != 0 { methods = append(methods, "token") } if len(authInfo.Username) != 0 || len(authInfo.Password) != 0 { methods = append(methods, "basicAuth") } if len(authInfo.ClientCertificate) != 0 || len(authInfo.ClientCertificateData) != 0 { // Make sure cert data and file aren't both specified if len(authInfo.ClientCertificate) != 0 && len(authInfo.ClientCertificateData) != 0 { validationErrors = append(validationErrors, fmt.Errorf("client-cert-data and client-cert are both specified for %v. client-cert-data will override.", authInfoName)) } // Make sure key data and file aren't both specified if len(authInfo.ClientKey) != 0 && len(authInfo.ClientKeyData) != 0 { validationErrors = append(validationErrors, fmt.Errorf("client-key-data and client-key are both specified for %v; client-key-data will override", authInfoName)) } // Make sure a key is specified if len(authInfo.ClientKey) == 0 && len(authInfo.ClientKeyData) == 0 { validationErrors = append(validationErrors, fmt.Errorf("client-key-data or client-key must be specified for %v to use the clientCert authentication method.", authInfoName)) } if len(authInfo.ClientCertificate) != 0 { clientCertFile, err := os.Open(authInfo.ClientCertificate) if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read client-cert %v for %v due to %w", authInfo.ClientCertificate, authInfoName, err)) } else { defer clientCertFile.Close() } } if len(authInfo.ClientKey) != 0 { clientKeyFile, err := os.Open(authInfo.ClientKey) if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read client-key %v for %v due to %w", authInfo.ClientKey, authInfoName, err)) } else { defer clientKeyFile.Close() } } } if authInfo.Exec != nil { if authInfo.AuthProvider != nil { validationErrors = append(validationErrors, fmt.Errorf("authProvider cannot be provided in combination with an exec plugin for %s", authInfoName)) } if len(authInfo.Exec.Command) == 0 { validationErrors = append(validationErrors, fmt.Errorf("command must be specified for %v to use exec authentication plugin", authInfoName)) } if len(authInfo.Exec.APIVersion) == 0 { validationErrors = append(validationErrors, fmt.Errorf("apiVersion must be specified for %v to use exec authentication plugin", authInfoName)) } for _, v := range authInfo.Exec.Env { if len(v.Name) == 0 { validationErrors = append(validationErrors, fmt.Errorf("env variable name must be specified for %v to use exec authentication plugin", authInfoName)) } } switch authInfo.Exec.InteractiveMode { case "": validationErrors = append(validationErrors, fmt.Errorf("interactiveMode must be specified for %v to use exec authentication plugin", authInfoName)) case clientcmdapi.NeverExecInteractiveMode, clientcmdapi.IfAvailableExecInteractiveMode, clientcmdapi.AlwaysExecInteractiveMode: // These are valid default: validationErrors = append(validationErrors, fmt.Errorf("invalid interactiveMode for %v: %q", authInfoName, authInfo.Exec.InteractiveMode)) } } // authPath also provides information for the client to identify the server, so allow multiple auth methods in that case if (len(methods) > 1) && (!usingAuthPath) { validationErrors = append(validationErrors, fmt.Errorf("more than one authentication method found for %v; found %v, only one is allowed", authInfoName, methods)) } // ImpersonateUID, ImpersonateGroups or ImpersonateUserExtra should be requested with a user if (len(authInfo.ImpersonateUID) > 0 || len(authInfo.ImpersonateGroups) > 0 || len(authInfo.ImpersonateUserExtra) > 0) && (len(authInfo.Impersonate) == 0) { validationErrors = append(validationErrors, fmt.Errorf("requesting uid, groups or user-extra for %v without impersonating a user", authInfoName)) } return validationErrors } // validateContext looks for errors in the context. It is not transitive, so errors in the reference authInfo or cluster configs are not included in this return func validateContext(contextName string, context clientcmdapi.Context, config clientcmdapi.Config) []error { validationErrors := make([]error, 0) if len(contextName) == 0 { validationErrors = append(validationErrors, fmt.Errorf("empty context name for %#v is not allowed", context)) } if len(context.AuthInfo) == 0 { validationErrors = append(validationErrors, fmt.Errorf("user was not specified for context %q", contextName)) } else if _, exists := config.AuthInfos[context.AuthInfo]; !exists { validationErrors = append(validationErrors, fmt.Errorf("user %q was not found for context %q", context.AuthInfo, contextName)) } if len(context.Cluster) == 0 { validationErrors = append(validationErrors, fmt.Errorf("cluster was not specified for context %q", contextName)) } else if _, exists := config.Clusters[context.Cluster]; !exists { validationErrors = append(validationErrors, fmt.Errorf("cluster %q was not found for context %q", context.Cluster, contextName)) } if len(context.Namespace) != 0 { if len(validation.IsDNS1123Label(context.Namespace)) != 0 { validationErrors = append(validationErrors, fmt.Errorf("namespace %q for context %q does not conform to the kubernetes DNS_LABEL rules", context.Namespace, contextName)) } } return validationErrors } kubernetes-client-go-a2dfcab/tools/clientcmd/validation_test.go000066400000000000000000000542231472614177300252300ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package clientcmd import ( "errors" "fmt" "os" "strings" "testing" utiltesting "k8s.io/client-go/util/testing" utilerrors "k8s.io/apimachinery/pkg/util/errors" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) func TestConfirmUsableBadInfoButOkConfig(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["missing ca"] = &clientcmdapi.Cluster{ Server: "anything", CertificateAuthority: "missing", } config.AuthInfos["error"] = &clientcmdapi.AuthInfo{ Username: "anything", Token: "here", } config.Contexts["dirty"] = &clientcmdapi.Context{ Cluster: "missing ca", AuthInfo: "error", } config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "anything", } config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ Token: "here", } config.Contexts["clean"] = &clientcmdapi.Context{ Cluster: "clean", AuthInfo: "clean", } badValidation := configValidationTest{ config: config, expectedErrorSubstring: []string{"unable to read certificate-authority"}, } okTest := configValidationTest{ config: config, } okTest.testConfirmUsable("clean", t) badValidation.testConfig(t) } func TestConfirmUsableMissingObjects(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["kind-cluster"] = &clientcmdapi.Cluster{ Server: "anything", } config.AuthInfos["kind-user"] = &clientcmdapi.AuthInfo{ Token: "any-value", } config.Contexts["missing-user"] = &clientcmdapi.Context{ Cluster: "kind-cluster", AuthInfo: "garbage", } config.Contexts["missing-cluster"] = &clientcmdapi.Context{ Cluster: "garbage", AuthInfo: "kind-user", } missingUser := configValidationTest{ config: config, expectedErrorSubstring: []string{ `user "garbage" was not found for context "missing-user"`, }, } missingUser.testConfirmUsable("missing-user", t) missingUser.testConfig(t) missingCluster := configValidationTest{ config: config, expectedErrorSubstring: []string{ `cluster "garbage" was not found for context "missing-cluster"`, }, } missingCluster.testConfirmUsable("missing-cluster", t) missingCluster.testConfig(t) } func TestConfirmUsableBadInfoConfig(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["missing ca"] = &clientcmdapi.Cluster{ Server: "anything", CertificateAuthority: "missing", } config.AuthInfos["error"] = &clientcmdapi.AuthInfo{ Username: "anything", Token: "here", } config.Contexts["first"] = &clientcmdapi.Context{ Cluster: "missing ca", AuthInfo: "error", } test := configValidationTest{ config: config, expectedErrorSubstring: []string{"unable to read certificate-authority"}, } test.testConfirmUsable("first", t) } func TestConfirmUsableEmptyConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ config: config, expectedErrorSubstring: []string{"invalid configuration: no configuration has been provided"}, } test.testConfirmUsable("", t) } func TestConfirmUsableMissingConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ config: config, expectedErrorSubstring: []string{"invalid configuration: no configuration has been provided"}, } test.testConfirmUsable("not-here", t) } func TestValidateEmptyConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ config: config, expectedErrorSubstring: []string{"invalid configuration: no configuration has been provided"}, } test.testConfig(t) } func TestValidateMissingCurrentContextConfig(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" test := configValidationTest{ config: config, expectedErrorSubstring: []string{"context was not found for specified "}, } test.testConfig(t) } func TestIsContextNotFound(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" err := Validate(*config) if !IsContextNotFound(err) { t.Errorf("Expected context not found, but got %v", err) } if !IsConfigurationInvalid(err) { t.Errorf("Expected configuration invalid, but got %v", err) } } func TestIsEmptyConfig(t *testing.T) { config := clientcmdapi.NewConfig() err := Validate(*config) if !IsEmptyConfig(err) { t.Errorf("Expected context not found, but got %v", err) } if !IsConfigurationInvalid(err) { t.Errorf("Expected configuration invalid, but got %v", err) } } func TestIsConfigurationInvalid(t *testing.T) { if newErrConfigurationInvalid([]error{}) != nil { t.Errorf("unexpected error") } if newErrConfigurationInvalid([]error{ErrNoContext}) == ErrNoContext { t.Errorf("unexpected error") } if newErrConfigurationInvalid([]error{ErrNoContext, ErrNoContext}) == nil { t.Errorf("unexpected error") } if !IsConfigurationInvalid(newErrConfigurationInvalid([]error{ErrNoContext, ErrNoContext})) { t.Errorf("unexpected error") } } func TestValidateMissingReferencesConfig(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" config.Contexts["anything"] = &clientcmdapi.Context{Cluster: "missing", AuthInfo: "missing"} test := configValidationTest{ config: config, expectedErrorSubstring: []string{"user \"missing\" was not found for context \"anything\"", "cluster \"missing\" was not found for context \"anything\""}, } test.testContext("anything", t) test.testConfig(t) } func TestValidateEmptyContext(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" config.Contexts["anything"] = &clientcmdapi.Context{} test := configValidationTest{ config: config, expectedErrorSubstring: []string{"user was not specified for context \"anything\"", "cluster was not specified for context \"anything\""}, } test.testContext("anything", t) test.testConfig(t) } func TestValidateEmptyContextName(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" config.Contexts[""] = &clientcmdapi.Context{Cluster: "missing", AuthInfo: "missing"} test := configValidationTest{ config: config, expectedErrorSubstring: []string{"empty context name", "is not allowed"}, } test.testContext("", t) test.testConfig(t) } func TestValidateEmptyClusterInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["empty"] = clientcmdapi.NewCluster() test := configValidationTest{ config: config, expectedErrorSubstring: []string{"cluster has no server defined"}, } test.testCluster("empty", t) test.testConfig(t) } func TestValidateClusterInfoErrEmptyCluster(t *testing.T) { cluster := clientcmdapi.NewCluster() errs := validateClusterInfo("", *cluster) if len(errs) != 1 { t.Fatalf("unexpected errors: %v", errs) } if errs[0] != ErrEmptyCluster { t.Errorf("unexpected error: %v", errs[0]) } } func TestValidateMissingCAFileClusterInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["missing ca"] = &clientcmdapi.Cluster{ Server: "anything", CertificateAuthority: "missing", } test := configValidationTest{ config: config, expectedErrorSubstring: []string{"unable to read certificate-authority"}, } test.testCluster("missing ca", t) test.testConfig(t) } func TestValidateCleanClusterInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "anything", } test := configValidationTest{ config: config, } test.testCluster("clean", t) test.testConfig(t) } func TestValidateCleanWithCAClusterInfo(t *testing.T) { tempFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, tempFile) config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ Server: "anything", CertificateAuthority: tempFile.Name(), } test := configValidationTest{ config: config, } test.testCluster("clean", t) test.testConfig(t) } func TestValidateEmptyAuthInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["error"] = &clientcmdapi.AuthInfo{} test := configValidationTest{ config: config, } test.testAuthInfo("error", t) test.testConfig(t) } func TestValidateCertFilesNotFoundAuthInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["error"] = &clientcmdapi.AuthInfo{ ClientCertificate: "missing", ClientKey: "missing", } test := configValidationTest{ config: config, expectedErrorSubstring: []string{"unable to read client-cert", "unable to read client-key"}, } test.testAuthInfo("error", t) test.testConfig(t) } func TestValidateCertDataOverridesFiles(t *testing.T) { tempFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, tempFile) config := clientcmdapi.NewConfig() config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ ClientCertificate: tempFile.Name(), ClientCertificateData: []byte("certdata"), ClientKey: tempFile.Name(), ClientKeyData: []byte("keydata"), } test := configValidationTest{ config: config, expectedErrorSubstring: []string{"client-cert-data and client-cert are both specified", "client-key-data and client-key are both specified"}, } test.testAuthInfo("clean", t) test.testConfig(t) } func TestValidateCleanCertFilesAuthInfo(t *testing.T) { tempFile, _ := os.CreateTemp("", "") defer utiltesting.CloseAndRemove(t, tempFile) config := clientcmdapi.NewConfig() config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ ClientCertificate: tempFile.Name(), ClientKey: tempFile.Name(), } test := configValidationTest{ config: config, } test.testAuthInfo("clean", t) test.testConfig(t) } func TestValidateCleanTokenAuthInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ Token: "any-value", } test := configValidationTest{ config: config, } test.testAuthInfo("clean", t) test.testConfig(t) } func TestValidateMultipleMethodsAuthInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["error"] = &clientcmdapi.AuthInfo{ Token: "token", Username: "username", } test := configValidationTest{ config: config, expectedErrorSubstring: []string{"more than one authentication method", "token", "basicAuth"}, } test.testAuthInfo("error", t) test.testConfig(t) } func TestValidateAuthInfoExec(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ Exec: &clientcmdapi.ExecConfig{ Command: "/bin/example", APIVersion: "clientauthentication.k8s.io/v1alpha1", Args: []string{"hello", "world"}, Env: []clientcmdapi.ExecEnvVar{ {Name: "foo", Value: "bar"}, }, InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, } test := configValidationTest{ config: config, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoExecNoVersion(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ Exec: &clientcmdapi.ExecConfig{ Command: "/bin/example", InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, } test := configValidationTest{ config: config, expectedErrorSubstring: []string{ "apiVersion must be specified for user to use exec authentication plugin", }, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoExecNoCommand(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ Exec: &clientcmdapi.ExecConfig{ APIVersion: "clientauthentication.k8s.io/v1alpha1", InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, } test := configValidationTest{ config: config, expectedErrorSubstring: []string{ "command must be specified for user to use exec authentication plugin", }, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoExecWithAuthProvider(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ AuthProvider: &clientcmdapi.AuthProviderConfig{ Name: "oidc", }, Exec: &clientcmdapi.ExecConfig{ Command: "/bin/example", APIVersion: "clientauthentication.k8s.io/v1alpha1", InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, } test := configValidationTest{ config: config, expectedErrorSubstring: []string{ "authProvider cannot be provided in combination with an exec plugin for user", }, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoExecNoEnv(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ Exec: &clientcmdapi.ExecConfig{ Command: "/bin/example", APIVersion: "clientauthentication.k8s.io/v1alpha1", Env: []clientcmdapi.ExecEnvVar{ {Name: "foo", Value: ""}, }, InteractiveMode: clientcmdapi.IfAvailableExecInteractiveMode, }, } test := configValidationTest{ config: config, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoExecInteractiveModeMissing(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ Exec: &clientcmdapi.ExecConfig{ Command: "/bin/example", APIVersion: "clientauthentication.k8s.io/v1alpha1", }, } test := configValidationTest{ config: config, expectedErrorSubstring: []string{ "interactiveMode must be specified for user to use exec authentication plugin", }, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoExecInteractiveModeInvalid(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ Exec: &clientcmdapi.ExecConfig{ Command: "/bin/example", APIVersion: "clientauthentication.k8s.io/v1alpha1", InteractiveMode: "invalid", }, } test := configValidationTest{ config: config, expectedErrorSubstring: []string{ `invalid interactiveMode for user: "invalid"`, }, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoImpersonateUser(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ Impersonate: "user", } test := configValidationTest{ config: config, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoImpersonateEverything(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ Impersonate: "user", ImpersonateUID: "abc123", ImpersonateGroups: []string{"group-1", "group-2"}, ImpersonateUserExtra: map[string][]string{"key": {"val1", "val2"}}, } test := configValidationTest{ config: config, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoImpersonateGroupsWithoutUserInvalid(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ ImpersonateGroups: []string{"group-1", "group-2"}, } test := configValidationTest{ config: config, expectedErrorSubstring: []string{ `requesting uid, groups or user-extra for user without impersonating a user`, }, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoImpersonateExtraWithoutUserInvalid(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ ImpersonateUserExtra: map[string][]string{"key": {"val1", "val2"}}, } test := configValidationTest{ config: config, expectedErrorSubstring: []string{ `requesting uid, groups or user-extra for user without impersonating a user`, }, } test.testAuthInfo("user", t) test.testConfig(t) } func TestValidateAuthInfoImpersonateUIDWithoutUserInvalid(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ ImpersonateUID: "abc123", } test := configValidationTest{ config: config, expectedErrorSubstring: []string{ `requesting uid, groups or user-extra for user without impersonating a user`, }, } test.testAuthInfo("user", t) test.testConfig(t) } type configValidationTest struct { config *clientcmdapi.Config expectedErrorSubstring []string } func (c configValidationTest) testContext(contextName string, t *testing.T) { errs := validateContext(contextName, *c.config.Contexts[contextName], *c.config) if len(c.expectedErrorSubstring) != 0 { if len(errs) == 0 { t.Errorf("Expected error containing: %v", c.expectedErrorSubstring) } for _, curr := range c.expectedErrorSubstring { if len(errs) != 0 && !strings.Contains(utilerrors.NewAggregate(errs).Error(), curr) { t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, utilerrors.NewAggregate(errs)) } } } else { if len(errs) != 0 { t.Errorf("Unexpected error: %v", utilerrors.NewAggregate(errs)) } } } func (c configValidationTest) testConfirmUsable(contextName string, t *testing.T) { err := ConfirmUsable(*c.config, contextName) if len(c.expectedErrorSubstring) != 0 { if err == nil { t.Errorf("Expected error containing: %v", c.expectedErrorSubstring) } else { for _, curr := range c.expectedErrorSubstring { if err != nil && !strings.Contains(err.Error(), curr) { t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, err) } } } } else { if err != nil { t.Errorf("Unexpected error: %v", err) } } } func (c configValidationTest) testConfig(t *testing.T) { err := Validate(*c.config) if len(c.expectedErrorSubstring) != 0 { if err == nil { t.Errorf("Expected error containing: %v", c.expectedErrorSubstring) } else { for _, curr := range c.expectedErrorSubstring { if err != nil && !strings.Contains(err.Error(), curr) { t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, err) } } if !IsConfigurationInvalid(err) { t.Errorf("all errors should be configuration invalid: %v", err) } } } else { if err != nil { t.Errorf("Unexpected error: %v", err) } } } func (c configValidationTest) testCluster(clusterName string, t *testing.T) { errs := validateClusterInfo(clusterName, *c.config.Clusters[clusterName]) if len(c.expectedErrorSubstring) != 0 { if len(errs) == 0 { t.Errorf("Expected error containing: %v", c.expectedErrorSubstring) } for _, curr := range c.expectedErrorSubstring { if len(errs) != 0 && !strings.Contains(utilerrors.NewAggregate(errs).Error(), curr) { t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, utilerrors.NewAggregate(errs)) } } } else { if len(errs) != 0 { t.Errorf("Unexpected error: %v", utilerrors.NewAggregate(errs)) } } } func (c configValidationTest) testAuthInfo(authInfoName string, t *testing.T) { errs := validateAuthInfo(authInfoName, *c.config.AuthInfos[authInfoName]) if len(c.expectedErrorSubstring) != 0 { if len(errs) == 0 { t.Errorf("Expected error containing: %v", c.expectedErrorSubstring) } for _, curr := range c.expectedErrorSubstring { if len(errs) != 0 && !strings.Contains(utilerrors.NewAggregate(errs).Error(), curr) { t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, utilerrors.NewAggregate(errs)) } } } else { if len(errs) != 0 { t.Errorf("Unexpected error: %v", utilerrors.NewAggregate(errs)) } } } type alwaysMatchingError struct{} func (_ alwaysMatchingError) Error() string { return "error" } func (_ alwaysMatchingError) Is(_ error) bool { return true } type someError struct{ msg string } func (se someError) Error() string { if se.msg != "" { return se.msg } return "err" } func TestErrConfigurationInvalidWithErrorsIs(t *testing.T) { testCases := []struct { name string err error matchAgainst error expectMatch bool }{{ name: "no match", err: errConfigurationInvalid{errors.New("my-error"), errors.New("my-other-error")}, matchAgainst: fmt.Errorf("no entry %s", "here"), }, { name: "match via .Is()", err: errConfigurationInvalid{errors.New("forbidden"), alwaysMatchingError{}}, matchAgainst: errors.New("unauthorized"), expectMatch: true, }, { name: "match via equality", err: errConfigurationInvalid{errors.New("err"), someError{}}, matchAgainst: someError{}, expectMatch: true, }, { name: "match via nested aggregate", err: errConfigurationInvalid{errors.New("closed today"), errConfigurationInvalid{errConfigurationInvalid{someError{}}}}, matchAgainst: someError{}, expectMatch: true, }, { name: "match via wrapped aggregate", err: fmt.Errorf("wrap: %w", errConfigurationInvalid{errors.New("err"), someError{}}), matchAgainst: someError{}, expectMatch: true, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { result := errors.Is(tc.err, tc.matchAgainst) if result != tc.expectMatch { t.Errorf("expected match: %t, got match: %t", tc.expectMatch, result) } }) } } type accessTrackingError struct { wasAccessed bool } func (accessTrackingError) Error() string { return "err" } func (ate *accessTrackingError) Is(_ error) bool { ate.wasAccessed = true return true } var _ error = &accessTrackingError{} func TestErrConfigurationInvalidWithErrorsIsShortCircuitsOnFirstMatch(t *testing.T) { errC := errConfigurationInvalid{&accessTrackingError{}, &accessTrackingError{}} _ = errors.Is(errC, &accessTrackingError{}) var numAccessed int for _, err := range errC { if ate := err.(*accessTrackingError); ate.wasAccessed { numAccessed++ } } if numAccessed != 1 { t.Errorf("expected exactly one error to get accessed, got %d", numAccessed) } } kubernetes-client-go-a2dfcab/tools/events/000077500000000000000000000000001472614177300210445ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/events/OWNERS000066400000000000000000000003061472614177300220030ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-instrumentation-approvers - wojtek-t reviewers: - sig-instrumentation-reviewers - wojtek-t emeritus_approvers: - yastij kubernetes-client-go-a2dfcab/tools/events/doc.go000066400000000000000000000013371472614177300221440ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package events has all client logic for recording and reporting // "k8s.io/api/events/v1".Event events. package events // import "k8s.io/client-go/tools/events" kubernetes-client-go-a2dfcab/tools/events/event_broadcaster.go000066400000000000000000000414161472614177300250730ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package events import ( "context" "fmt" "os" "sync" "time" corev1 "k8s.io/api/core/v1" eventsv1 "k8s.io/api/events/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/json" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" typedv1core "k8s.io/client-go/kubernetes/typed/core/v1" typedeventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" "k8s.io/client-go/tools/record/util" "k8s.io/klog/v2" "k8s.io/utils/clock" ) const ( maxTriesPerEvent = 12 finishTime = 6 * time.Minute refreshTime = 30 * time.Minute maxQueuedEvents = 1000 ) var defaultSleepDuration = 10 * time.Second // TODO: validate impact of copying and investigate hashing type eventKey struct { eventType string action string reason string reportingController string reportingInstance string regarding corev1.ObjectReference related corev1.ObjectReference } type eventBroadcasterImpl struct { *watch.Broadcaster mu sync.Mutex eventCache map[eventKey]*eventsv1.Event sleepDuration time.Duration sink EventSink } // EventSinkImpl wraps EventsV1Interface to implement EventSink. // TODO: this makes it easier for testing purpose and masks the logic of performing API calls. // Note that rollbacking to raw clientset should also be transparent. type EventSinkImpl struct { Interface typedeventsv1.EventsV1Interface } // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. func (e *EventSinkImpl) Create(ctx context.Context, event *eventsv1.Event) (*eventsv1.Event, error) { if event.Namespace == "" { return nil, fmt.Errorf("can't create an event with empty namespace") } return e.Interface.Events(event.Namespace).Create(ctx, event, metav1.CreateOptions{}) } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. func (e *EventSinkImpl) Update(ctx context.Context, event *eventsv1.Event) (*eventsv1.Event, error) { if event.Namespace == "" { return nil, fmt.Errorf("can't update an event with empty namespace") } return e.Interface.Events(event.Namespace).Update(ctx, event, metav1.UpdateOptions{}) } // Patch applies the patch and returns the patched event, and an error, if there is any. func (e *EventSinkImpl) Patch(ctx context.Context, event *eventsv1.Event, data []byte) (*eventsv1.Event, error) { if event.Namespace == "" { return nil, fmt.Errorf("can't patch an event with empty namespace") } return e.Interface.Events(event.Namespace).Patch(ctx, event.Name, types.StrategicMergePatchType, data, metav1.PatchOptions{}) } // NewBroadcaster Creates a new event broadcaster. func NewBroadcaster(sink EventSink) EventBroadcaster { return newBroadcaster(sink, defaultSleepDuration, map[eventKey]*eventsv1.Event{}) } // NewBroadcasterForTest Creates a new event broadcaster for test purposes. func newBroadcaster(sink EventSink, sleepDuration time.Duration, eventCache map[eventKey]*eventsv1.Event) EventBroadcaster { return &eventBroadcasterImpl{ Broadcaster: watch.NewBroadcaster(maxQueuedEvents, watch.DropIfChannelFull), eventCache: eventCache, sleepDuration: sleepDuration, sink: sink, } } func (e *eventBroadcasterImpl) Shutdown() { e.Broadcaster.Shutdown() } // refreshExistingEventSeries refresh events TTL func (e *eventBroadcasterImpl) refreshExistingEventSeries(ctx context.Context) { // TODO: Investigate whether lock contention won't be a problem e.mu.Lock() defer e.mu.Unlock() for isomorphicKey, event := range e.eventCache { if event.Series != nil { if recordedEvent, retry := recordEvent(ctx, e.sink, event); !retry { if recordedEvent != nil { e.eventCache[isomorphicKey] = recordedEvent } } } } } // finishSeries checks if a series has ended and either: // - write final count to the apiserver // - delete a singleton event (i.e. series field is nil) from the cache func (e *eventBroadcasterImpl) finishSeries(ctx context.Context) { // TODO: Investigate whether lock contention won't be a problem e.mu.Lock() defer e.mu.Unlock() for isomorphicKey, event := range e.eventCache { eventSerie := event.Series if eventSerie != nil { if eventSerie.LastObservedTime.Time.Before(time.Now().Add(-finishTime)) { if _, retry := recordEvent(ctx, e.sink, event); !retry { delete(e.eventCache, isomorphicKey) } } } else if event.EventTime.Time.Before(time.Now().Add(-finishTime)) { delete(e.eventCache, isomorphicKey) } } } // NewRecorder returns an EventRecorder that records events with the given event source. func (e *eventBroadcasterImpl) NewRecorder(scheme *runtime.Scheme, reportingController string) EventRecorderLogger { hostname, _ := os.Hostname() reportingInstance := reportingController + "-" + hostname return &recorderImplLogger{recorderImpl: &recorderImpl{scheme, reportingController, reportingInstance, e.Broadcaster, clock.RealClock{}}, logger: klog.Background()} } func (e *eventBroadcasterImpl) recordToSink(ctx context.Context, event *eventsv1.Event, clock clock.Clock) { // Make a copy before modification, because there could be multiple listeners. eventCopy := event.DeepCopy() go func() { evToRecord := func() *eventsv1.Event { e.mu.Lock() defer e.mu.Unlock() eventKey := getKey(eventCopy) isomorphicEvent, isIsomorphic := e.eventCache[eventKey] if isIsomorphic { if isomorphicEvent.Series != nil { isomorphicEvent.Series.Count++ isomorphicEvent.Series.LastObservedTime = metav1.MicroTime{Time: clock.Now()} return nil } isomorphicEvent.Series = &eventsv1.EventSeries{ Count: 2, LastObservedTime: metav1.MicroTime{Time: clock.Now()}, } // Make a copy of the Event to make sure that recording it // doesn't mess with the object stored in cache. return isomorphicEvent.DeepCopy() } e.eventCache[eventKey] = eventCopy // Make a copy of the Event to make sure that recording it doesn't // mess with the object stored in cache. return eventCopy.DeepCopy() }() if evToRecord != nil { // TODO: Add a metric counting the number of recording attempts e.attemptRecording(ctx, evToRecord) // We don't want the new recorded Event to be reflected in the // client's cache because server-side mutations could mess with the // aggregation mechanism used by the client. } }() } func (e *eventBroadcasterImpl) attemptRecording(ctx context.Context, event *eventsv1.Event) { tries := 0 for { if _, retry := recordEvent(ctx, e.sink, event); !retry { return } tries++ if tries >= maxTriesPerEvent { klog.FromContext(ctx).Error(nil, "Unable to write event (retry limit exceeded!)", "event", event) return } // Randomize sleep so that various clients won't all be // synced up if the master goes down. Give up when // the context is canceled. select { case <-ctx.Done(): return case <-time.After(wait.Jitter(e.sleepDuration, 0.25)): } } } func recordEvent(ctx context.Context, sink EventSink, event *eventsv1.Event) (*eventsv1.Event, bool) { var newEvent *eventsv1.Event var err error isEventSeries := event.Series != nil if isEventSeries { patch, patchBytesErr := createPatchBytesForSeries(event) if patchBytesErr != nil { klog.FromContext(ctx).Error(patchBytesErr, "Unable to calculate diff, no merge is possible") return nil, false } newEvent, err = sink.Patch(ctx, event, patch) } // Update can fail because the event may have been removed and it no longer exists. if !isEventSeries || (isEventSeries && util.IsKeyNotFoundError(err)) { // Making sure that ResourceVersion is empty on creation event.ResourceVersion = "" newEvent, err = sink.Create(ctx, event) } if err == nil { return newEvent, false } // If we can't contact the server, then hold everything while we keep trying. // Otherwise, something about the event is malformed and we should abandon it. switch err.(type) { case *restclient.RequestConstructionError: // We will construct the request the same next time, so don't keep trying. klog.FromContext(ctx).Error(err, "Unable to construct event (will not retry!)", "event", event) return nil, false case *errors.StatusError: if errors.IsAlreadyExists(err) { // If we tried to create an Event from an EventSerie, it means that // the original Patch request failed because the Event we were // trying to patch didn't exist. If the creation failed because the // Event now exists, it is safe to retry. This occurs when a new // Event is emitted twice in a very short period of time. if isEventSeries { return nil, true } klog.FromContext(ctx).V(5).Info("Server rejected event (will not retry!)", "event", event, "err", err) } else { klog.FromContext(ctx).Error(err, "Server rejected event (will not retry!)", "event", event) } return nil, false case *errors.UnexpectedObjectError: // We don't expect this; it implies the server's response didn't match a // known pattern. Go ahead and retry. default: // This case includes actual http transport errors. Go ahead and retry. } klog.FromContext(ctx).Error(err, "Unable to write event (may retry after sleeping)") return nil, true } func createPatchBytesForSeries(event *eventsv1.Event) ([]byte, error) { oldEvent := event.DeepCopy() oldEvent.Series = nil oldData, err := json.Marshal(oldEvent) if err != nil { return nil, err } newData, err := json.Marshal(event) if err != nil { return nil, err } return strategicpatch.CreateTwoWayMergePatch(oldData, newData, eventsv1.Event{}) } func getKey(event *eventsv1.Event) eventKey { key := eventKey{ eventType: event.Type, action: event.Action, reason: event.Reason, reportingController: event.ReportingController, reportingInstance: event.ReportingInstance, regarding: event.Regarding, } if event.Related != nil { key.related = *event.Related } return key } // StartStructuredLogging starts sending events received from this EventBroadcaster to the structured logging function. // The return value can be ignored or used to stop recording, if desired. // TODO: this function should also return an error. // // Deprecated: use StartLogging instead. func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) func() { logger := klog.Background().V(int(verbosity)) stopWatcher, err := e.StartLogging(logger) if err != nil { logger.Error(err, "Failed to start event watcher") return func() {} } return stopWatcher } // StartLogging starts sending events received from this EventBroadcaster to the structured logger. // To adjust verbosity, use the logger's V method (i.e. pass `logger.V(3)` instead of `logger`). // The returned function can be ignored or used to stop recording, if desired. func (e *eventBroadcasterImpl) StartLogging(logger klog.Logger) (func(), error) { return e.StartEventWatcher( func(obj runtime.Object) { event, ok := obj.(*eventsv1.Event) if !ok { logger.Error(nil, "unexpected type, expected eventsv1.Event") return } logger.Info("Event occurred", "object", klog.KRef(event.Regarding.Namespace, event.Regarding.Name), "kind", event.Regarding.Kind, "apiVersion", event.Regarding.APIVersion, "type", event.Type, "reason", event.Reason, "action", event.Action, "note", event.Note) }) } // StartEventWatcher starts sending events received from this EventBroadcaster to the given event handler function. // The return value is used to stop recording func (e *eventBroadcasterImpl) StartEventWatcher(eventHandler func(event runtime.Object)) (func(), error) { watcher, err := e.Watch() if err != nil { return nil, err } go func() { defer utilruntime.HandleCrash() for { watchEvent, ok := <-watcher.ResultChan() if !ok { return } eventHandler(watchEvent.Object) } }() return watcher.Stop, nil } func (e *eventBroadcasterImpl) startRecordingEvents(ctx context.Context) error { eventHandler := func(obj runtime.Object) { event, ok := obj.(*eventsv1.Event) if !ok { klog.FromContext(ctx).Error(nil, "unexpected type, expected eventsv1.Event") return } e.recordToSink(ctx, event, clock.RealClock{}) } stopWatcher, err := e.StartEventWatcher(eventHandler) if err != nil { return err } go func() { <-ctx.Done() stopWatcher() }() return nil } // StartRecordingToSink starts sending events received from the specified eventBroadcaster to the given sink. // Deprecated: use StartRecordingToSinkWithContext instead. func (e *eventBroadcasterImpl) StartRecordingToSink(stopCh <-chan struct{}) { err := e.StartRecordingToSinkWithContext(wait.ContextForChannel(stopCh)) if err != nil { klog.Background().Error(err, "Failed to start recording to sink") } } // StartRecordingToSinkWithContext starts sending events received from the specified eventBroadcaster to the given sink. func (e *eventBroadcasterImpl) StartRecordingToSinkWithContext(ctx context.Context) error { go wait.UntilWithContext(ctx, e.refreshExistingEventSeries, refreshTime) go wait.UntilWithContext(ctx, e.finishSeries, finishTime) return e.startRecordingEvents(ctx) } type eventBroadcasterAdapterImpl struct { coreClient typedv1core.EventsGetter coreBroadcaster record.EventBroadcaster eventsv1Client typedeventsv1.EventsV1Interface eventsv1Broadcaster EventBroadcaster } // NewEventBroadcasterAdapter creates a wrapper around new and legacy broadcasters to simplify // migration of individual components to the new Event API. // //logcheck:context // NewEventBroadcasterAdapterWithContext should be used instead because record.NewBroadcaster is called and works better when a context is supplied (contextual logging, cancellation). func NewEventBroadcasterAdapter(client clientset.Interface) EventBroadcasterAdapter { return NewEventBroadcasterAdapterWithContext(context.Background(), client) } // NewEventBroadcasterAdapterWithContext creates a wrapper around new and legacy broadcasters to simplify // migration of individual components to the new Event API. func NewEventBroadcasterAdapterWithContext(ctx context.Context, client clientset.Interface) EventBroadcasterAdapter { eventClient := &eventBroadcasterAdapterImpl{} if _, err := client.Discovery().ServerResourcesForGroupVersion(eventsv1.SchemeGroupVersion.String()); err == nil { eventClient.eventsv1Client = client.EventsV1() eventClient.eventsv1Broadcaster = NewBroadcaster(&EventSinkImpl{Interface: eventClient.eventsv1Client}) } // Even though there can soon exist cases when coreBroadcaster won't really be needed, // we create it unconditionally because its overhead is minor and will simplify using usage // patterns of this library in all components. eventClient.coreClient = client.CoreV1() eventClient.coreBroadcaster = record.NewBroadcaster(record.WithContext(ctx)) return eventClient } // StartRecordingToSink starts sending events received from the specified eventBroadcaster to the given sink. func (e *eventBroadcasterAdapterImpl) StartRecordingToSink(stopCh <-chan struct{}) { if e.eventsv1Broadcaster != nil && e.eventsv1Client != nil { e.eventsv1Broadcaster.StartRecordingToSink(stopCh) } if e.coreBroadcaster != nil && e.coreClient != nil { e.coreBroadcaster.StartRecordingToSink(&typedv1core.EventSinkImpl{Interface: e.coreClient.Events("")}) } } func (e *eventBroadcasterAdapterImpl) NewRecorder(name string) EventRecorderLogger { if e.eventsv1Broadcaster != nil && e.eventsv1Client != nil { return e.eventsv1Broadcaster.NewRecorder(scheme.Scheme, name) } return record.NewEventRecorderAdapter(e.DeprecatedNewLegacyRecorder(name)) } func (e *eventBroadcasterAdapterImpl) DeprecatedNewLegacyRecorder(name string) record.EventRecorderLogger { return e.coreBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: name}) } func (e *eventBroadcasterAdapterImpl) Shutdown() { if e.coreBroadcaster != nil { e.coreBroadcaster.Shutdown() } if e.eventsv1Broadcaster != nil { e.eventsv1Broadcaster.Shutdown() } } kubernetes-client-go-a2dfcab/tools/events/event_broadcaster_test.go000066400000000000000000000056011472614177300261260ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package events import ( "context" "reflect" "testing" "github.com/google/go-cmp/cmp" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" "k8s.io/klog/v2/ktesting" ) func TestRecordEventToSink(t *testing.T) { nonIsomorphicEvent := eventsv1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: metav1.NamespaceDefault, }, Series: nil, } isomorphicEvent := *nonIsomorphicEvent.DeepCopy() isomorphicEvent.Series = &eventsv1.EventSeries{Count: 2} testCases := []struct { name string eventsToRecord []eventsv1.Event expectedRecordedEvent eventsv1.Event }{ { name: "record one Event", eventsToRecord: []eventsv1.Event{ nonIsomorphicEvent, }, expectedRecordedEvent: nonIsomorphicEvent, }, { name: "record one Event followed by an isomorphic one", eventsToRecord: []eventsv1.Event{ nonIsomorphicEvent, isomorphicEvent, }, expectedRecordedEvent: isomorphicEvent, }, { name: "record one isomorphic Event before the original", eventsToRecord: []eventsv1.Event{ isomorphicEvent, nonIsomorphicEvent, }, expectedRecordedEvent: isomorphicEvent, }, { name: "record one isomorphic Event without one already existing", eventsToRecord: []eventsv1.Event{ isomorphicEvent, }, expectedRecordedEvent: isomorphicEvent, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { _, ctx := ktesting.NewTestContext(t) kubeClient := fake.NewSimpleClientset() eventSink := &EventSinkImpl{Interface: kubeClient.EventsV1()} for _, ev := range tc.eventsToRecord { recordEvent(ctx, eventSink, &ev) } recordedEvents, err := kubeClient.EventsV1().Events(metav1.NamespaceDefault).List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Errorf("expected to be able to list Events from fake client") } if len(recordedEvents.Items) != 1 { t.Errorf("expected one Event to be recorded, found: %d", len(recordedEvents.Items)) } recordedEvent := recordedEvents.Items[0] if !reflect.DeepEqual(recordedEvent, tc.expectedRecordedEvent) { t.Errorf("expected to have recorded Event: %#+v, got: %#+v\n diff: %s", tc.expectedRecordedEvent, recordedEvent, cmp.Diff(tc.expectedRecordedEvent, recordedEvent)) } }) } } kubernetes-client-go-a2dfcab/tools/events/event_recorder.go000066400000000000000000000076401472614177300244100ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package events import ( "fmt" "time" v1 "k8s.io/api/core/v1" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/record/util" "k8s.io/client-go/tools/reference" "k8s.io/klog/v2" "k8s.io/utils/clock" ) type recorderImpl struct { scheme *runtime.Scheme reportingController string reportingInstance string *watch.Broadcaster clock clock.Clock } var _ EventRecorder = &recorderImpl{} func (recorder *recorderImpl) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) { recorder.eventf(klog.Background(), regarding, related, eventtype, reason, action, note, args...) } type recorderImplLogger struct { *recorderImpl logger klog.Logger } var _ EventRecorderLogger = &recorderImplLogger{} func (recorder *recorderImplLogger) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) { recorder.eventf(recorder.logger, regarding, related, eventtype, reason, action, note, args...) } func (recorder *recorderImplLogger) WithLogger(logger klog.Logger) EventRecorderLogger { return &recorderImplLogger{recorderImpl: recorder.recorderImpl, logger: logger} } func (recorder *recorderImpl) eventf(logger klog.Logger, regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) { timestamp := metav1.MicroTime{Time: time.Now()} message := fmt.Sprintf(note, args...) refRegarding, err := reference.GetReference(recorder.scheme, regarding) if err != nil { logger.Error(err, "Could not construct reference, will not report event", "object", regarding, "eventType", eventtype, "reason", reason, "message", message) return } var refRelated *v1.ObjectReference if related != nil { refRelated, err = reference.GetReference(recorder.scheme, related) if err != nil { logger.V(9).Info("Could not construct reference", "object", related, "err", err) } } if !util.ValidateEventType(eventtype) { logger.Error(nil, "Unsupported event type", "eventType", eventtype) return } event := recorder.makeEvent(refRegarding, refRelated, timestamp, eventtype, reason, message, recorder.reportingController, recorder.reportingInstance, action) go func() { defer utilruntime.HandleCrash() recorder.Action(watch.Added, event) }() } func (recorder *recorderImpl) makeEvent(refRegarding *v1.ObjectReference, refRelated *v1.ObjectReference, timestamp metav1.MicroTime, eventtype, reason, message string, reportingController string, reportingInstance string, action string) *eventsv1.Event { t := metav1.Time{Time: recorder.clock.Now()} namespace := refRegarding.Namespace if namespace == "" { namespace = metav1.NamespaceDefault } return &eventsv1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%v.%x", refRegarding.Name, t.UnixNano()), Namespace: namespace, }, EventTime: timestamp, Series: nil, ReportingController: reportingController, ReportingInstance: reportingInstance, Action: action, Reason: reason, Regarding: *refRegarding, Related: refRelated, Note: message, Type: eventtype, } } kubernetes-client-go-a2dfcab/tools/events/eventseries_test.go000066400000000000000000000331411472614177300247700ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package events import ( "context" "strconv" "testing" "time" "os" "strings" v1 "k8s.io/api/core/v1" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8sruntime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" fake "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/scheme" restclient "k8s.io/client-go/rest" ref "k8s.io/client-go/tools/reference" "k8s.io/klog/v2/ktesting" ) type testEventSeriesSink struct { OnCreate func(e *eventsv1.Event) (*eventsv1.Event, error) OnUpdate func(e *eventsv1.Event) (*eventsv1.Event, error) OnPatch func(e *eventsv1.Event, p []byte) (*eventsv1.Event, error) } // Create records the event for testing. func (t *testEventSeriesSink) Create(ctx context.Context, e *eventsv1.Event) (*eventsv1.Event, error) { if t.OnCreate != nil { return t.OnCreate(e) } return e, nil } // Update records the event for testing. func (t *testEventSeriesSink) Update(ctx context.Context, e *eventsv1.Event) (*eventsv1.Event, error) { if t.OnUpdate != nil { return t.OnUpdate(e) } return e, nil } // Patch records the event for testing. func (t *testEventSeriesSink) Patch(ctx context.Context, e *eventsv1.Event, p []byte) (*eventsv1.Event, error) { if t.OnPatch != nil { return t.OnPatch(e, p) } return e, nil } func TestEventSeriesf(t *testing.T) { hostname, _ := os.Hostname() testPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", UID: "bar", }, } regarding, err := ref.GetPartialReference(scheme.Scheme, testPod, ".spec.containers[1]") if err != nil { t.Fatal(err) } related, err := ref.GetPartialReference(scheme.Scheme, testPod, ".spec.containers[0]") if err != nil { t.Fatal(err) } expectedEvent := &eventsv1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, EventTime: metav1.MicroTime{Time: time.Now()}, ReportingController: "eventTest", ReportingInstance: "eventTest-" + hostname, Action: "started", Reason: "test", Regarding: *regarding, Related: related, Note: "some verbose message: 1", Type: v1.EventTypeNormal, } isomorphicEvent := expectedEvent.DeepCopy() nonIsomorphicEvent := expectedEvent.DeepCopy() nonIsomorphicEvent.Action = "stopped" expectedEvent.Series = &eventsv1.EventSeries{Count: 2} table := []struct { regarding k8sruntime.Object related k8sruntime.Object actual *eventsv1.Event elements []interface{} expect *eventsv1.Event expectUpdate bool }{ { regarding: regarding, related: related, actual: isomorphicEvent, elements: []interface{}{1}, expect: expectedEvent, expectUpdate: true, }, { regarding: regarding, related: related, actual: nonIsomorphicEvent, elements: []interface{}{1}, expect: nonIsomorphicEvent, expectUpdate: false, }, } _, ctx := ktesting.NewTestContext(t) ctx, cancel := context.WithCancel(ctx) defer cancel() createEvent := make(chan *eventsv1.Event) updateEvent := make(chan *eventsv1.Event) patchEvent := make(chan *eventsv1.Event) testEvents := testEventSeriesSink{ OnCreate: func(event *eventsv1.Event) (*eventsv1.Event, error) { createEvent <- event return event, nil }, OnUpdate: func(event *eventsv1.Event) (*eventsv1.Event, error) { updateEvent <- event return event, nil }, OnPatch: func(event *eventsv1.Event, patch []byte) (*eventsv1.Event, error) { // event we receive is already patched, usually the sink uses it only to retrieve the name and namespace, here // we'll use it directly patchEvent <- event return event, nil }, } eventBroadcaster := newBroadcaster(&testEvents, 0, map[eventKey]*eventsv1.Event{}) recorder := eventBroadcaster.NewRecorder(scheme.Scheme, "eventTest") broadcaster := eventBroadcaster.(*eventBroadcasterImpl) // Don't call StartRecordingToSink, as we don't need neither refreshing event // series nor finishing them in this tests and additional events updated would // race with our expected ones. err = broadcaster.startRecordingEvents(ctx) if err != nil { t.Fatal(err) } recorder.Eventf(regarding, related, isomorphicEvent.Type, isomorphicEvent.Reason, isomorphicEvent.Action, isomorphicEvent.Note, []interface{}{1}) // read from the chan as this was needed only to populate the cache <-createEvent for index, item := range table { actual := item.actual recorder.Eventf(item.regarding, item.related, actual.Type, actual.Reason, actual.Action, actual.Note, item.elements) // validate event if item.expectUpdate { actualEvent := <-patchEvent t.Logf("%v - validating event affected by patch request", index) validateEvent(strconv.Itoa(index), true, actualEvent, item.expect, t) } else { actualEvent := <-createEvent t.Logf("%v - validating event affected by a create request", index) validateEvent(strconv.Itoa(index), false, actualEvent, item.expect, t) } } } // TestEventSeriesWithEventSinkImplRace verifies that when Events are emitted to // an EventSink consecutively there is no data race. This test is meant to be // run with the `-race` option. func TestEventSeriesWithEventSinkImplRace(t *testing.T) { kubeClient := fake.NewSimpleClientset() eventSink := &EventSinkImpl{Interface: kubeClient.EventsV1()} eventBroadcaster := NewBroadcaster(eventSink) stopCh := make(chan struct{}) eventBroadcaster.StartRecordingToSink(stopCh) recorder := eventBroadcaster.NewRecorder(scheme.Scheme, "test") recorder.Eventf(&v1.ObjectReference{}, nil, v1.EventTypeNormal, "reason", "action", "", "") recorder.Eventf(&v1.ObjectReference{}, nil, v1.EventTypeNormal, "reason", "action", "", "") err := wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (done bool, err error) { events, err := kubeClient.EventsV1().Events(metav1.NamespaceDefault).List(context.TODO(), metav1.ListOptions{}) if err != nil { return false, err } if len(events.Items) != 1 { return false, nil } if events.Items[0].Series == nil { return false, nil } return true, nil }) if err != nil { t.Fatal("expected that 2 identical Eventf calls would result in the creation of an Event with a Serie") } } func validateEvent(messagePrefix string, expectedUpdate bool, actualEvent *eventsv1.Event, expectedEvent *eventsv1.Event, t *testing.T) { recvEvent := *actualEvent // Just check that the timestamp was set. if recvEvent.EventTime.IsZero() { t.Errorf("%v - timestamp wasn't set: %#v", messagePrefix, recvEvent) } if expectedUpdate { if recvEvent.Series == nil { t.Errorf("%v - Series was nil but expected: %#v", messagePrefix, recvEvent.Series) } else { if recvEvent.Series.Count != expectedEvent.Series.Count { t.Errorf("%v - Series mismatch actual was: %#v but expected: %#v", messagePrefix, recvEvent.Series, expectedEvent.Series) } } // Check that name has the right prefix. if n, en := recvEvent.Name, expectedEvent.Name; !strings.HasPrefix(n, en) { t.Errorf("%v - Name '%v' does not contain prefix '%v'", messagePrefix, n, en) } } else { if recvEvent.Series != nil { t.Errorf("%v - series was expected to be nil but was: %#v", messagePrefix, recvEvent.Series) } } } func TestFinishSeries(t *testing.T) { _, ctx := ktesting.NewTestContext(t) hostname, _ := os.Hostname() testPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", UID: "bar", }, } regarding, err := ref.GetPartialReference(scheme.Scheme, testPod, ".spec.containers[1]") if err != nil { t.Fatal(err) } related, err := ref.GetPartialReference(scheme.Scheme, testPod, ".spec.containers[0]") if err != nil { t.Fatal(err) } LastObservedTime := metav1.MicroTime{Time: time.Now().Add(-9 * time.Minute)} createEvent := make(chan *eventsv1.Event, 10) updateEvent := make(chan *eventsv1.Event, 10) patchEvent := make(chan *eventsv1.Event, 10) testEvents := testEventSeriesSink{ OnCreate: func(event *eventsv1.Event) (*eventsv1.Event, error) { createEvent <- event return event, nil }, OnUpdate: func(event *eventsv1.Event) (*eventsv1.Event, error) { updateEvent <- event return event, nil }, OnPatch: func(event *eventsv1.Event, patch []byte) (*eventsv1.Event, error) { // event we receive is already patched, usually the sink uses it // only to retrieve the name and namespace, here we'll use it directly patchEvent <- event return event, nil }, } cache := map[eventKey]*eventsv1.Event{} eventBroadcaster := newBroadcaster(&testEvents, 0, cache).(*eventBroadcasterImpl) recorder := eventBroadcaster.NewRecorder(scheme.Scheme, "k8s.io/kube-foo").(*recorderImplLogger) cachedEvent := recorder.makeEvent(regarding, related, metav1.MicroTime{Time: time.Now()}, v1.EventTypeNormal, "test", "some verbose message: 1", "eventTest", "eventTest-"+hostname, "started") nonFinishedEvent := cachedEvent.DeepCopy() nonFinishedEvent.ReportingController = "nonFinished-controller" cachedEvent.Series = &eventsv1.EventSeries{ Count: 10, LastObservedTime: LastObservedTime, } cache[getKey(cachedEvent)] = cachedEvent cache[getKey(nonFinishedEvent)] = nonFinishedEvent eventBroadcaster.finishSeries(ctx) select { case actualEvent := <-patchEvent: t.Logf("validating event affected by patch request") eventBroadcaster.mu.Lock() defer eventBroadcaster.mu.Unlock() if len(cache) != 1 { t.Errorf("cache should be empty, but instead got a size of %v", len(cache)) } if !actualEvent.Series.LastObservedTime.Equal(&cachedEvent.Series.LastObservedTime) { t.Errorf("series was expected be seen with LastObservedTime %v, but instead got %v ", cachedEvent.Series.LastObservedTime, actualEvent.Series.LastObservedTime) } // check that we emitted only one event if len(patchEvent) != 0 || len(createEvent) != 0 || len(updateEvent) != 0 { t.Errorf("exactly one event should be emitted, but got %v", len(patchEvent)) } case <-time.After(wait.ForeverTestTimeout): t.Fatalf("timeout after %v", wait.ForeverTestTimeout) } } func TestRefreshExistingEventSeries(t *testing.T) { _, ctx := ktesting.NewTestContext(t) hostname, _ := os.Hostname() testPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", UID: "bar", }, } regarding, err := ref.GetPartialReference(scheme.Scheme, testPod, ".spec.containers[1]") if err != nil { t.Fatal(err) } related, err := ref.GetPartialReference(scheme.Scheme, testPod, ".spec.containers[0]") if err != nil { t.Fatal(err) } LastObservedTime := metav1.MicroTime{Time: time.Now().Add(-9 * time.Minute)} createEvent := make(chan *eventsv1.Event, 10) updateEvent := make(chan *eventsv1.Event, 10) patchEvent := make(chan *eventsv1.Event, 10) table := []struct { patchFunc func(event *eventsv1.Event, patch []byte) (*eventsv1.Event, error) }{ { patchFunc: func(event *eventsv1.Event, patch []byte) (*eventsv1.Event, error) { // event we receive is already patched, usually the sink uses it //only to retrieve the name and namespace, here we'll use it directly. patchEvent <- event return event, nil }, }, { patchFunc: func(event *eventsv1.Event, patch []byte) (*eventsv1.Event, error) { // we simulate an apiserver error here patchEvent <- nil return nil, &restclient.RequestConstructionError{} }, }, } for _, item := range table { testEvents := testEventSeriesSink{ OnCreate: func(event *eventsv1.Event) (*eventsv1.Event, error) { createEvent <- event return event, nil }, OnUpdate: func(event *eventsv1.Event) (*eventsv1.Event, error) { updateEvent <- event return event, nil }, OnPatch: item.patchFunc, } cache := map[eventKey]*eventsv1.Event{} eventBroadcaster := newBroadcaster(&testEvents, 0, cache).(*eventBroadcasterImpl) recorder := eventBroadcaster.NewRecorder(scheme.Scheme, "k8s.io/kube-foo").(*recorderImplLogger) cachedEvent := recorder.makeEvent(regarding, related, metav1.MicroTime{Time: time.Now()}, v1.EventTypeNormal, "test", "some verbose message: 1", "eventTest", "eventTest-"+hostname, "started") cachedEvent.Series = &eventsv1.EventSeries{ Count: 10, LastObservedTime: LastObservedTime, } cacheKey := getKey(cachedEvent) cache[cacheKey] = cachedEvent eventBroadcaster.refreshExistingEventSeries(ctx) select { case <-patchEvent: t.Logf("validating event affected by patch request") eventBroadcaster.mu.Lock() defer eventBroadcaster.mu.Unlock() if len(cache) != 1 { t.Errorf("cache should be with same size, but instead got a size of %v", len(cache)) } // check that we emitted only one event if len(patchEvent) != 0 || len(createEvent) != 0 || len(updateEvent) != 0 { t.Errorf("exactly one event should be emitted, but got %v", len(patchEvent)) } cacheEvent, exists := cache[cacheKey] if cacheEvent == nil || !exists { t.Errorf("expected event to exist and not being nil, but instead event: %v and exists: %v", cacheEvent, exists) } case <-time.After(wait.ForeverTestTimeout): t.Fatalf("timeout after %v", wait.ForeverTestTimeout) } } } kubernetes-client-go-a2dfcab/tools/events/fake.go000066400000000000000000000027541472614177300223110ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package events import ( "fmt" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog/v2" ) // FakeRecorder is used as a fake during tests. It is thread safe. It is usable // when created manually and not by NewFakeRecorder, however all events may be // thrown away in this case. type FakeRecorder struct { Events chan string } var _ EventRecorderLogger = &FakeRecorder{} // Eventf emits an event func (f *FakeRecorder) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) { if f.Events != nil { f.Events <- fmt.Sprintf(eventtype+" "+reason+" "+note, args...) } } func (f *FakeRecorder) WithLogger(logger klog.Logger) EventRecorderLogger { return f } // NewFakeRecorder creates new fake event recorder with event channel with // buffer of given size. func NewFakeRecorder(bufferSize int) *FakeRecorder { return &FakeRecorder{ Events: make(chan string, bufferSize), } } kubernetes-client-go-a2dfcab/tools/events/helper.go000066400000000000000000000040221472614177300226500ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package events import ( "fmt" corev1 "k8s.io/api/core/v1" eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" ) var mapping = map[schema.GroupVersion]string{ eventsv1.SchemeGroupVersion: "regarding", eventsv1beta1.SchemeGroupVersion: "regarding", corev1.SchemeGroupVersion: "involvedObject", } // GetFieldSelector returns the appropriate field selector based on the API version being used to communicate with the server. // The returned field selector can be used with List and Watch to filter desired events. func GetFieldSelector(eventsGroupVersion schema.GroupVersion, regardingGroupVersionKind schema.GroupVersionKind, regardingName string, regardingUID types.UID) (fields.Selector, error) { field := fields.Set{} if _, ok := mapping[eventsGroupVersion]; !ok { return nil, fmt.Errorf("unknown version %v", eventsGroupVersion) } prefix := mapping[eventsGroupVersion] if len(regardingName) > 0 { field[prefix+".name"] = regardingName } if len(regardingGroupVersionKind.Kind) > 0 { field[prefix+".kind"] = regardingGroupVersionKind.Kind } regardingGroupVersion := regardingGroupVersionKind.GroupVersion() if !regardingGroupVersion.Empty() { field[prefix+".apiVersion"] = regardingGroupVersion.String() } if len(regardingUID) > 0 { field[prefix+".uid"] = string(regardingUID) } return field.AsSelector(), nil } kubernetes-client-go-a2dfcab/tools/events/helper_test.go000066400000000000000000000120001472614177300237020ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package events import ( "testing" corev1 "k8s.io/api/core/v1" eventsv1 "k8s.io/api/events/v1" eventsv1beta1 "k8s.io/api/events/v1beta1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" ) func TestGetFieldSelector(t *testing.T) { tests := []struct { desc string eventsGroupVersion schema.GroupVersion regardingName string regardingGroupVersionKind schema.GroupVersionKind regardingUID types.UID expected fields.Set expectedErr bool }{ { desc: "events.k8s.io/v1beta1 event with empty parameters", eventsGroupVersion: eventsv1beta1.SchemeGroupVersion, regardingName: "", regardingGroupVersionKind: schema.GroupVersionKind{}, regardingUID: "", expected: fields.Set{}, expectedErr: false, }, { desc: "events.k8s.io/v1beta1 event with non-empty parameters", eventsGroupVersion: eventsv1beta1.SchemeGroupVersion, regardingName: "test-deployment", regardingGroupVersionKind: schema.GroupVersionKind{ Kind: "Deployment", Group: "apps", Version: "v1", }, regardingUID: "2c55cad7-ee4e-11e9-abe1-525400e7bc6b", expected: fields.Set{ "regarding.name": "test-deployment", "regarding.kind": "Deployment", "regarding.apiVersion": "apps/v1", "regarding.uid": "2c55cad7-ee4e-11e9-abe1-525400e7bc6b", }, expectedErr: false, }, { desc: "events.k8s.io/v1 event with empty parameters", eventsGroupVersion: eventsv1.SchemeGroupVersion, regardingName: "", regardingGroupVersionKind: schema.GroupVersionKind{}, regardingUID: "", expected: fields.Set{}, expectedErr: false, }, { desc: "events.k8s.io/v1 event with non-empty parameters", eventsGroupVersion: eventsv1.SchemeGroupVersion, regardingName: "test-deployment", regardingGroupVersionKind: schema.GroupVersionKind{ Kind: "Deployment", Group: "apps", Version: "v1", }, regardingUID: "2c55cad7-ee4e-11e9-abe1-525400e7bc6b", expected: fields.Set{ "regarding.name": "test-deployment", "regarding.kind": "Deployment", "regarding.apiVersion": "apps/v1", "regarding.uid": "2c55cad7-ee4e-11e9-abe1-525400e7bc6b", }, expectedErr: false, }, { desc: "v1 event with non-empty parameters", eventsGroupVersion: corev1.SchemeGroupVersion, regardingName: "", regardingGroupVersionKind: schema.GroupVersionKind{}, regardingUID: "", expected: fields.Set{}, expectedErr: false, }, { desc: "v1 event with non-empty parameters", eventsGroupVersion: corev1.SchemeGroupVersion, regardingName: "test-deployment", regardingGroupVersionKind: schema.GroupVersionKind{ Kind: "Deployment", Group: "apps", Version: "v1", }, regardingUID: "2c55cad7-ee4e-11e9-abe1-525400e7bc6b", expected: fields.Set{ "involvedObject.name": "test-deployment", "involvedObject.kind": "Deployment", "involvedObject.apiVersion": "apps/v1", "involvedObject.uid": "2c55cad7-ee4e-11e9-abe1-525400e7bc6b", }, expectedErr: false, }, { desc: "unknown group version", eventsGroupVersion: schema.GroupVersion{Group: corev1.GroupName, Version: "v1alpha1"}, regardingName: "test-deployment", regardingGroupVersionKind: schema.GroupVersionKind{ Kind: "Deployment", Group: "apps", Version: "v1", }, regardingUID: "2c55cad7-ee4e-11e9-abe1-525400e7bc6b", expected: nil, expectedErr: true, }, } for _, test := range tests { result, err := GetFieldSelector(test.eventsGroupVersion, test.regardingGroupVersionKind, test.regardingName, test.regardingUID) if !test.expectedErr && err != nil { t.Errorf("Unable to get field selector with %v", err) } if test.expectedErr && err == nil { t.Errorf("Expect error but got nil") } if test.expected == nil && result != nil { t.Errorf("Test %s expected , but got %v", test.desc, result) } if result != nil && !result.Matches(test.expected) { t.Errorf("Test %s expected %v, but got %v", test.desc, test.expected.AsSelector(), result) } } } kubernetes-client-go-a2dfcab/tools/events/interfaces.go000066400000000000000000000076031472614177300235240ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package events import ( "context" eventsv1 "k8s.io/api/events/v1" "k8s.io/apimachinery/pkg/runtime" internalevents "k8s.io/client-go/tools/internal/events" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" ) type EventRecorder = internalevents.EventRecorder type EventRecorderLogger = internalevents.EventRecorderLogger // EventBroadcaster knows how to receive events and send them to any EventSink, watcher, or log. type EventBroadcaster interface { // StartRecordingToSink starts sending events received from the specified eventBroadcaster. // Deprecated: use StartRecordingToSinkWithContext instead. StartRecordingToSink(stopCh <-chan struct{}) // StartRecordingToSink starts sending events received from the specified eventBroadcaster. StartRecordingToSinkWithContext(ctx context.Context) error // NewRecorder returns an EventRecorder that can be used to send events to this EventBroadcaster // with the event source set to the given event source. NewRecorder(scheme *runtime.Scheme, reportingController string) EventRecorderLogger // StartEventWatcher enables you to watch for emitted events without usage // of StartRecordingToSink. This lets you also process events in a custom way (e.g. in tests). // NOTE: events received on your eventHandler should be copied before being used. // TODO: figure out if this can be removed. StartEventWatcher(eventHandler func(event runtime.Object)) (func(), error) // StartStructuredLogging starts sending events received from this EventBroadcaster to the structured // logging function. The return value can be ignored or used to stop recording, if desired. // Deprecated: use StartLogging instead. StartStructuredLogging(verbosity klog.Level) func() // StartLogging starts sending events received from this EventBroadcaster to the structured logger. // To adjust verbosity, use the logger's V method (i.e. pass `logger.V(3)` instead of `logger`). // The returned function can be ignored or used to stop recording, if desired. StartLogging(logger klog.Logger) (func(), error) // Shutdown shuts down the broadcaster Shutdown() } // EventSink knows how to store events (client-go implements it.) // EventSink must respect the namespace that will be embedded in 'event'. // It is assumed that EventSink will return the same sorts of errors as // client-go's REST client. type EventSink interface { Create(ctx context.Context, event *eventsv1.Event) (*eventsv1.Event, error) Update(ctx context.Context, event *eventsv1.Event) (*eventsv1.Event, error) Patch(ctx context.Context, oldEvent *eventsv1.Event, data []byte) (*eventsv1.Event, error) } // EventBroadcasterAdapter is a auxiliary interface to simplify migration to // the new events API. It is a wrapper around new and legacy broadcasters // that smartly chooses which one to use. // // Deprecated: This interface will be removed once migration is completed. type EventBroadcasterAdapter interface { // StartRecordingToSink starts sending events received from the specified eventBroadcaster. StartRecordingToSink(stopCh <-chan struct{}) // NewRecorder creates a new Event Recorder with specified name. NewRecorder(name string) EventRecorderLogger // DeprecatedNewLegacyRecorder creates a legacy Event Recorder with specific name. DeprecatedNewLegacyRecorder(name string) record.EventRecorderLogger // Shutdown shuts down the broadcaster. Shutdown() } kubernetes-client-go-a2dfcab/tools/internal/000077500000000000000000000000001472614177300213545ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/internal/events/000077500000000000000000000000001472614177300226605ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/internal/events/interfaces.go000066400000000000000000000055351472614177300253420ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package internal is needed to break an import cycle: record.EventRecorderAdapter // needs this interface definition to implement it, but event.NewEventBroadcasterAdapter // needs record.NewBroadcaster. Therefore this interface cannot be in event/interfaces.go. package internal import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog/v2" ) // EventRecorder knows how to record events on behalf of an EventSource. type EventRecorder interface { // Eventf constructs an event from the given information and puts it in the queue for sending. // 'regarding' is the object this event is about. Event will make a reference-- or you may also // pass a reference to the object directly. // 'related' is the secondary object for more complex actions. E.g. when regarding object triggers // a creation or deletion of related object. // 'type' of this event, and can be one of Normal, Warning. New types could be added in future // 'reason' is the reason this event is generated. 'reason' should be short and unique; it // should be in UpperCamelCase format (starting with a capital letter). "reason" will be used // to automate handling of events, so imagine people writing switch statements to handle them. // You want to make that easy. // 'action' explains what happened with regarding/what action did the ReportingController // (ReportingController is a type of a Controller reporting an Event, e.g. k8s.io/node-controller, k8s.io/kubelet.) // take in regarding's name; it should be in UpperCamelCase format (starting with a capital letter). // 'note' is intended to be human readable. Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) } // EventRecorderLogger extends EventRecorder such that a logger can // be set for methods in EventRecorder. Normally, those methods // uses the global default logger to record errors and debug messages. // If that is not desired, use WithLogger to provide a logger instance. type EventRecorderLogger interface { EventRecorder // WithLogger replaces the context used for logging. This is a cheap call // and meant to be used for contextual logging: // recorder := ... // logger := klog.FromContext(ctx) // recorder.WithLogger(logger).Eventf(...) WithLogger(logger klog.Logger) EventRecorderLogger } kubernetes-client-go-a2dfcab/tools/leaderelection/000077500000000000000000000000001472614177300225175ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/leaderelection/OWNERS000066400000000000000000000002621472614177300234570ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - mikedanese reviewers: - wojtek-t - deads2k - mikedanese - ingvagabund emeritus_approvers: - timothysc kubernetes-client-go-a2dfcab/tools/leaderelection/healthzadaptor.go000066400000000000000000000044301472614177300260610ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package leaderelection import ( "net/http" "sync" "time" ) // HealthzAdaptor associates the /healthz endpoint with the LeaderElection object. // It helps deal with the /healthz endpoint being set up prior to the LeaderElection. // This contains the code needed to act as an adaptor between the leader // election code the health check code. It allows us to provide health // status about the leader election. Most specifically about if the leader // has failed to renew without exiting the process. In that case we should // report not healthy and rely on the kubelet to take down the process. type HealthzAdaptor struct { pointerLock sync.Mutex le *LeaderElector timeout time.Duration } // Name returns the name of the health check we are implementing. func (l *HealthzAdaptor) Name() string { return "leaderElection" } // Check is called by the healthz endpoint handler. // It fails (returns an error) if we own the lease but had not been able to renew it. func (l *HealthzAdaptor) Check(req *http.Request) error { l.pointerLock.Lock() defer l.pointerLock.Unlock() if l.le == nil { return nil } return l.le.Check(l.timeout) } // SetLeaderElection ties a leader election object to a HealthzAdaptor func (l *HealthzAdaptor) SetLeaderElection(le *LeaderElector) { l.pointerLock.Lock() defer l.pointerLock.Unlock() l.le = le } // NewLeaderHealthzAdaptor creates a basic healthz adaptor to monitor a leader election. // timeout determines the time beyond the lease expiry to be allowed for timeout. // checks within the timeout period after the lease expires will still return healthy. func NewLeaderHealthzAdaptor(timeout time.Duration) *HealthzAdaptor { result := &HealthzAdaptor{ timeout: timeout, } return result } kubernetes-client-go-a2dfcab/tools/leaderelection/healthzadaptor_test.go000066400000000000000000000123001472614177300271130ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package leaderelection import ( "context" "fmt" "testing" "time" "net/http" rl "k8s.io/client-go/tools/leaderelection/resourcelock" testingclock "k8s.io/utils/clock/testing" ) type fakeLock struct { identity string } // Get is a dummy to allow us to have a fakeLock for testing. func (fl *fakeLock) Get(ctx context.Context) (ler *rl.LeaderElectionRecord, rawRecord []byte, err error) { return nil, nil, nil } // Create is a dummy to allow us to have a fakeLock for testing. func (fl *fakeLock) Create(ctx context.Context, ler rl.LeaderElectionRecord) error { return nil } // Update is a dummy to allow us to have a fakeLock for testing. func (fl *fakeLock) Update(ctx context.Context, ler rl.LeaderElectionRecord) error { return nil } // RecordEvent is a dummy to allow us to have a fakeLock for testing. func (fl *fakeLock) RecordEvent(string) {} // Identity is a dummy to allow us to have a fakeLock for testing. func (fl *fakeLock) Identity() string { return fl.identity } // Describe is a dummy to allow us to have a fakeLock for testing. func (fl *fakeLock) Describe() string { return "Dummy implementation of lock for testing" } // TestLeaderElectionHealthChecker tests that the healthcheck for leader election handles its edge cases. func TestLeaderElectionHealthChecker(t *testing.T) { current := time.Now() req := &http.Request{} tests := []struct { description string expected error adaptorTimeout time.Duration elector *LeaderElector }{ { description: "call check before leader elector initialized", expected: nil, adaptorTimeout: time.Second * 20, elector: nil, }, { description: "call check when the lease is far expired", expected: fmt.Errorf("failed election to renew leadership on lease %s", "foo"), adaptorTimeout: time.Second * 20, elector: &LeaderElector{ config: LeaderElectionConfig{ Lock: &fakeLock{identity: "healthTest"}, LeaseDuration: time.Minute, Name: "foo", }, observedRecord: rl.LeaderElectionRecord{ HolderIdentity: "healthTest", }, observedTime: current, clock: testingclock.NewFakeClock(current.Add(time.Hour)), }, }, { description: "call check when the lease is far expired but held by another server", expected: nil, adaptorTimeout: time.Second * 20, elector: &LeaderElector{ config: LeaderElectionConfig{ Lock: &fakeLock{identity: "healthTest"}, LeaseDuration: time.Minute, Name: "foo", }, observedRecord: rl.LeaderElectionRecord{ HolderIdentity: "otherServer", }, observedTime: current, clock: testingclock.NewFakeClock(current.Add(time.Hour)), }, }, { description: "call check when the lease is not expired", expected: nil, adaptorTimeout: time.Second * 20, elector: &LeaderElector{ config: LeaderElectionConfig{ Lock: &fakeLock{identity: "healthTest"}, LeaseDuration: time.Minute, Name: "foo", }, observedRecord: rl.LeaderElectionRecord{ HolderIdentity: "healthTest", }, observedTime: current, clock: testingclock.NewFakeClock(current), }, }, { description: "call check when the lease is expired but inside the timeout", expected: nil, adaptorTimeout: time.Second * 20, elector: &LeaderElector{ config: LeaderElectionConfig{ Lock: &fakeLock{identity: "healthTest"}, LeaseDuration: time.Minute, Name: "foo", }, observedRecord: rl.LeaderElectionRecord{ HolderIdentity: "healthTest", }, observedTime: current, clock: testingclock.NewFakeClock(current.Add(time.Minute).Add(time.Second)), }, }, } for _, test := range tests { adaptor := NewLeaderHealthzAdaptor(test.adaptorTimeout) if adaptor.le != nil { t.Errorf("[%s] leaderChecker started with a LeaderElector %v", test.description, adaptor.le) } if test.elector != nil { test.elector.config.WatchDog = adaptor adaptor.SetLeaderElection(test.elector) if adaptor.le == nil { t.Errorf("[%s] adaptor failed to set the LeaderElector", test.description) } } err := adaptor.Check(req) if test.expected == nil { if err == nil { continue } t.Errorf("[%s] called check, expected no error but received \"%v\"", test.description, err) } else { if err == nil { t.Errorf("[%s] called check and failed to received the expected error \"%v\"", test.description, test.expected) } if err.Error() != test.expected.Error() { t.Errorf("[%s] called check, expected %v, received %v", test.description, test.expected, err) } } } } kubernetes-client-go-a2dfcab/tools/leaderelection/leaderelection.go000066400000000000000000000456011472614177300260330ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package leaderelection implements leader election of a set of endpoints. // It uses an annotation in the endpoints object to store the record of the // election state. This implementation does not guarantee that only one // client is acting as a leader (a.k.a. fencing). // // A client only acts on timestamps captured locally to infer the state of the // leader election. The client does not consider timestamps in the leader // election record to be accurate because these timestamps may not have been // produced by a local clock. The implemention does not depend on their // accuracy and only uses their change to indicate that another client has // renewed the leader lease. Thus the implementation is tolerant to arbitrary // clock skew, but is not tolerant to arbitrary clock skew rate. // // However the level of tolerance to skew rate can be configured by setting // RenewDeadline and LeaseDuration appropriately. The tolerance expressed as a // maximum tolerated ratio of time passed on the fastest node to time passed on // the slowest node can be approximately achieved with a configuration that sets // the same ratio of LeaseDuration to RenewDeadline. For example if a user wanted // to tolerate some nodes progressing forward in time twice as fast as other nodes, // the user could set LeaseDuration to 60 seconds and RenewDeadline to 30 seconds. // // While not required, some method of clock synchronization between nodes in the // cluster is highly recommended. It's important to keep in mind when configuring // this client that the tolerance to skew rate varies inversely to master // availability. // // Larger clusters often have a more lenient SLA for API latency. This should be // taken into account when configuring the client. The rate of leader transitions // should be monitored and RetryPeriod and LeaseDuration should be increased // until the rate is stable and acceptably low. It's important to keep in mind // when configuring this client that the tolerance to API latency varies inversely // to master availability. // // DISCLAIMER: this is an alpha API. This library will likely change significantly // or even be removed entirely in subsequent releases. Depend on this API at // your own risk. package leaderelection import ( "bytes" "context" "fmt" "sync" "time" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" rl "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/klog/v2" "k8s.io/utils/clock" ) const ( JitterFactor = 1.2 ) // NewLeaderElector creates a LeaderElector from a LeaderElectionConfig func NewLeaderElector(lec LeaderElectionConfig) (*LeaderElector, error) { if lec.LeaseDuration <= lec.RenewDeadline { return nil, fmt.Errorf("leaseDuration must be greater than renewDeadline") } if lec.RenewDeadline <= time.Duration(JitterFactor*float64(lec.RetryPeriod)) { return nil, fmt.Errorf("renewDeadline must be greater than retryPeriod*JitterFactor") } if lec.LeaseDuration < 1 { return nil, fmt.Errorf("leaseDuration must be greater than zero") } if lec.RenewDeadline < 1 { return nil, fmt.Errorf("renewDeadline must be greater than zero") } if lec.RetryPeriod < 1 { return nil, fmt.Errorf("retryPeriod must be greater than zero") } if lec.Callbacks.OnStartedLeading == nil { return nil, fmt.Errorf("OnStartedLeading callback must not be nil") } if lec.Callbacks.OnStoppedLeading == nil { return nil, fmt.Errorf("OnStoppedLeading callback must not be nil") } if lec.Lock == nil { return nil, fmt.Errorf("Lock must not be nil.") } id := lec.Lock.Identity() if id == "" { return nil, fmt.Errorf("Lock identity is empty") } le := LeaderElector{ config: lec, clock: clock.RealClock{}, metrics: globalMetricsFactory.newLeaderMetrics(), } le.metrics.leaderOff(le.config.Name) return &le, nil } type LeaderElectionConfig struct { // Lock is the resource that will be used for locking Lock rl.Interface // LeaseDuration is the duration that non-leader candidates will // wait to force acquire leadership. This is measured against time of // last observed ack. // // A client needs to wait a full LeaseDuration without observing a change to // the record before it can attempt to take over. When all clients are // shutdown and a new set of clients are started with different names against // the same leader record, they must wait the full LeaseDuration before // attempting to acquire the lease. Thus LeaseDuration should be as short as // possible (within your tolerance for clock skew rate) to avoid a possible // long waits in the scenario. // // Core clients default this value to 15 seconds. LeaseDuration time.Duration // RenewDeadline is the duration that the acting master will retry // refreshing leadership before giving up. // // Core clients default this value to 10 seconds. RenewDeadline time.Duration // RetryPeriod is the duration the LeaderElector clients should wait // between tries of actions. // // Core clients default this value to 2 seconds. RetryPeriod time.Duration // Callbacks are callbacks that are triggered during certain lifecycle // events of the LeaderElector Callbacks LeaderCallbacks // WatchDog is the associated health checker // WatchDog may be null if it's not needed/configured. WatchDog *HealthzAdaptor // ReleaseOnCancel should be set true if the lock should be released // when the run context is cancelled. If you set this to true, you must // ensure all code guarded by this lease has successfully completed // prior to cancelling the context, or you may have two processes // simultaneously acting on the critical path. ReleaseOnCancel bool // Name is the name of the resource lock for debugging Name string // Coordinated will use the Coordinated Leader Election feature // WARNING: Coordinated leader election is ALPHA. Coordinated bool } // LeaderCallbacks are callbacks that are triggered during certain // lifecycle events of the LeaderElector. These are invoked asynchronously. // // possible future callbacks: // - OnChallenge() type LeaderCallbacks struct { // OnStartedLeading is called when a LeaderElector client starts leading OnStartedLeading func(context.Context) // OnStoppedLeading is called when a LeaderElector client stops leading OnStoppedLeading func() // OnNewLeader is called when the client observes a leader that is // not the previously observed leader. This includes the first observed // leader when the client starts. OnNewLeader func(identity string) } // LeaderElector is a leader election client. type LeaderElector struct { config LeaderElectionConfig // internal bookkeeping observedRecord rl.LeaderElectionRecord observedRawRecord []byte observedTime time.Time // used to implement OnNewLeader(), may lag slightly from the // value observedRecord.HolderIdentity if the transition has // not yet been reported. reportedLeader string // clock is wrapper around time to allow for less flaky testing clock clock.Clock // used to lock the observedRecord observedRecordLock sync.Mutex metrics leaderMetricsAdapter } // Run starts the leader election loop. Run will not return // before leader election loop is stopped by ctx or it has // stopped holding the leader lease func (le *LeaderElector) Run(ctx context.Context) { defer runtime.HandleCrash() defer le.config.Callbacks.OnStoppedLeading() if !le.acquire(ctx) { return // ctx signalled done } ctx, cancel := context.WithCancel(ctx) defer cancel() go le.config.Callbacks.OnStartedLeading(ctx) le.renew(ctx) } // RunOrDie starts a client with the provided config or panics if the config // fails to validate. RunOrDie blocks until leader election loop is // stopped by ctx or it has stopped holding the leader lease func RunOrDie(ctx context.Context, lec LeaderElectionConfig) { le, err := NewLeaderElector(lec) if err != nil { panic(err) } if lec.WatchDog != nil { lec.WatchDog.SetLeaderElection(le) } le.Run(ctx) } // GetLeader returns the identity of the last observed leader or returns the empty string if // no leader has yet been observed. // This function is for informational purposes. (e.g. monitoring, logs, etc.) func (le *LeaderElector) GetLeader() string { return le.getObservedRecord().HolderIdentity } // IsLeader returns true if the last observed leader was this client else returns false. func (le *LeaderElector) IsLeader() bool { return le.getObservedRecord().HolderIdentity == le.config.Lock.Identity() } // acquire loops calling tryAcquireOrRenew and returns true immediately when tryAcquireOrRenew succeeds. // Returns false if ctx signals done. func (le *LeaderElector) acquire(ctx context.Context) bool { ctx, cancel := context.WithCancel(ctx) defer cancel() succeeded := false desc := le.config.Lock.Describe() klog.Infof("attempting to acquire leader lease %v...", desc) wait.JitterUntil(func() { if !le.config.Coordinated { succeeded = le.tryAcquireOrRenew(ctx) } else { succeeded = le.tryCoordinatedRenew(ctx) } le.maybeReportTransition() if !succeeded { klog.V(4).Infof("failed to acquire lease %v", desc) return } le.config.Lock.RecordEvent("became leader") le.metrics.leaderOn(le.config.Name) klog.Infof("successfully acquired lease %v", desc) cancel() }, le.config.RetryPeriod, JitterFactor, true, ctx.Done()) return succeeded } // renew loops calling tryAcquireOrRenew and returns immediately when tryAcquireOrRenew fails or ctx signals done. func (le *LeaderElector) renew(ctx context.Context) { defer le.config.Lock.RecordEvent("stopped leading") ctx, cancel := context.WithCancel(ctx) defer cancel() wait.Until(func() { timeoutCtx, timeoutCancel := context.WithTimeout(ctx, le.config.RenewDeadline) defer timeoutCancel() err := wait.PollImmediateUntil(le.config.RetryPeriod, func() (bool, error) { if !le.config.Coordinated { return le.tryAcquireOrRenew(timeoutCtx), nil } else { return le.tryCoordinatedRenew(timeoutCtx), nil } }, timeoutCtx.Done()) le.maybeReportTransition() desc := le.config.Lock.Describe() if err == nil { klog.V(5).Infof("successfully renewed lease %v", desc) return } le.metrics.leaderOff(le.config.Name) klog.Infof("failed to renew lease %v: %v", desc, err) cancel() }, le.config.RetryPeriod, ctx.Done()) // if we hold the lease, give it up if le.config.ReleaseOnCancel { le.release() } } // release attempts to release the leader lease if we have acquired it. func (le *LeaderElector) release() bool { if !le.IsLeader() { return true } now := metav1.NewTime(le.clock.Now()) leaderElectionRecord := rl.LeaderElectionRecord{ LeaderTransitions: le.observedRecord.LeaderTransitions, LeaseDurationSeconds: 1, RenewTime: now, AcquireTime: now, } timeoutCtx, timeoutCancel := context.WithTimeout(context.Background(), le.config.RenewDeadline) defer timeoutCancel() if err := le.config.Lock.Update(timeoutCtx, leaderElectionRecord); err != nil { klog.Errorf("Failed to release lock: %v", err) return false } le.setObservedRecord(&leaderElectionRecord) return true } // tryCoordinatedRenew checks if it acquired a lease and tries to renew the // lease if it has already been acquired. Returns true on success else returns // false. func (le *LeaderElector) tryCoordinatedRenew(ctx context.Context) bool { now := metav1.NewTime(le.clock.Now()) leaderElectionRecord := rl.LeaderElectionRecord{ HolderIdentity: le.config.Lock.Identity(), LeaseDurationSeconds: int(le.config.LeaseDuration / time.Second), RenewTime: now, AcquireTime: now, } // 1. obtain the electionRecord oldLeaderElectionRecord, oldLeaderElectionRawRecord, err := le.config.Lock.Get(ctx) if err != nil { if !errors.IsNotFound(err) { klog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err) return false } klog.Infof("lease lock not found: %v", le.config.Lock.Describe()) return false } // 2. Record obtained, check the Identity & Time if !bytes.Equal(le.observedRawRecord, oldLeaderElectionRawRecord) { le.setObservedRecord(oldLeaderElectionRecord) le.observedRawRecord = oldLeaderElectionRawRecord } hasExpired := le.observedTime.Add(time.Second * time.Duration(oldLeaderElectionRecord.LeaseDurationSeconds)).Before(now.Time) if hasExpired { klog.Infof("lock has expired: %v", le.config.Lock.Describe()) return false } if !le.IsLeader() { klog.V(6).Infof("lock is held by %v and has not yet expired: %v", oldLeaderElectionRecord.HolderIdentity, le.config.Lock.Describe()) return false } // 2b. If the lease has been marked as "end of term", don't renew it if le.IsLeader() && oldLeaderElectionRecord.PreferredHolder != "" { klog.V(4).Infof("lock is marked as 'end of term': %v", le.config.Lock.Describe()) // TODO: Instead of letting lease expire, the holder may deleted it directly // This will not be compatible with all controllers, so it needs to be opt-in behavior. // We must ensure all code guarded by this lease has successfully completed // prior to releasing or there may be two processes // simultaneously acting on the critical path. // Usually once this returns false, the process is terminated.. // xref: OnStoppedLeading return false } // 3. We're going to try to update. The leaderElectionRecord is set to it's default // here. Let's correct it before updating. if le.IsLeader() { leaderElectionRecord.AcquireTime = oldLeaderElectionRecord.AcquireTime leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions leaderElectionRecord.Strategy = oldLeaderElectionRecord.Strategy le.metrics.slowpathExercised(le.config.Name) } else { leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions + 1 } // update the lock itself if err = le.config.Lock.Update(ctx, leaderElectionRecord); err != nil { klog.Errorf("Failed to update lock: %v", err) return false } le.setObservedRecord(&leaderElectionRecord) return true } // tryAcquireOrRenew tries to acquire a leader lease if it is not already acquired, // else it tries to renew the lease if it has already been acquired. Returns true // on success else returns false. func (le *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool { now := metav1.NewTime(le.clock.Now()) leaderElectionRecord := rl.LeaderElectionRecord{ HolderIdentity: le.config.Lock.Identity(), LeaseDurationSeconds: int(le.config.LeaseDuration / time.Second), RenewTime: now, AcquireTime: now, } // 1. fast path for the leader to update optimistically assuming that the record observed // last time is the current version. if le.IsLeader() && le.isLeaseValid(now.Time) { oldObservedRecord := le.getObservedRecord() leaderElectionRecord.AcquireTime = oldObservedRecord.AcquireTime leaderElectionRecord.LeaderTransitions = oldObservedRecord.LeaderTransitions err := le.config.Lock.Update(ctx, leaderElectionRecord) if err == nil { le.setObservedRecord(&leaderElectionRecord) return true } klog.Errorf("Failed to update lock optimitically: %v, falling back to slow path", err) } // 2. obtain or create the ElectionRecord oldLeaderElectionRecord, oldLeaderElectionRawRecord, err := le.config.Lock.Get(ctx) if err != nil { if !errors.IsNotFound(err) { klog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err) return false } if err = le.config.Lock.Create(ctx, leaderElectionRecord); err != nil { klog.Errorf("error initially creating leader election record: %v", err) return false } le.setObservedRecord(&leaderElectionRecord) return true } // 3. Record obtained, check the Identity & Time if !bytes.Equal(le.observedRawRecord, oldLeaderElectionRawRecord) { le.setObservedRecord(oldLeaderElectionRecord) le.observedRawRecord = oldLeaderElectionRawRecord } if len(oldLeaderElectionRecord.HolderIdentity) > 0 && le.isLeaseValid(now.Time) && !le.IsLeader() { klog.V(4).Infof("lock is held by %v and has not yet expired", oldLeaderElectionRecord.HolderIdentity) return false } // 4. We're going to try to update. The leaderElectionRecord is set to it's default // here. Let's correct it before updating. if le.IsLeader() { leaderElectionRecord.AcquireTime = oldLeaderElectionRecord.AcquireTime leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions le.metrics.slowpathExercised(le.config.Name) } else { leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions + 1 } // update the lock itself if err = le.config.Lock.Update(ctx, leaderElectionRecord); err != nil { klog.Errorf("Failed to update lock: %v", err) return false } le.setObservedRecord(&leaderElectionRecord) return true } func (le *LeaderElector) maybeReportTransition() { if le.observedRecord.HolderIdentity == le.reportedLeader { return } le.reportedLeader = le.observedRecord.HolderIdentity if le.config.Callbacks.OnNewLeader != nil { go le.config.Callbacks.OnNewLeader(le.reportedLeader) } } // Check will determine if the current lease is expired by more than timeout. func (le *LeaderElector) Check(maxTolerableExpiredLease time.Duration) error { if !le.IsLeader() { // Currently not concerned with the case that we are hot standby return nil } // If we are more than timeout seconds after the lease duration that is past the timeout // on the lease renew. Time to start reporting ourselves as unhealthy. We should have // died but conditions like deadlock can prevent this. (See #70819) if le.clock.Since(le.observedTime) > le.config.LeaseDuration+maxTolerableExpiredLease { return fmt.Errorf("failed election to renew leadership on lease %s", le.config.Name) } return nil } func (le *LeaderElector) isLeaseValid(now time.Time) bool { return le.observedTime.Add(time.Second * time.Duration(le.getObservedRecord().LeaseDurationSeconds)).After(now) } // setObservedRecord will set a new observedRecord and update observedTime to the current time. // Protect critical sections with lock. func (le *LeaderElector) setObservedRecord(observedRecord *rl.LeaderElectionRecord) { le.observedRecordLock.Lock() defer le.observedRecordLock.Unlock() le.observedRecord = *observedRecord le.observedTime = le.clock.Now() } // getObservedRecord returns observersRecord. // Protect critical sections with lock. func (le *LeaderElector) getObservedRecord() rl.LeaderElectionRecord { le.observedRecordLock.Lock() defer le.observedRecordLock.Unlock() return le.observedRecord } kubernetes-client-go-a2dfcab/tools/leaderelection/leaderelection_test.go000066400000000000000000001021071472614177300270650ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package leaderelection import ( "context" "encoding/json" "fmt" "sync" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" coordinationv1 "k8s.io/api/coordination/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes/fake" fakeclient "k8s.io/client-go/testing" rl "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/client-go/tools/record" "k8s.io/utils/clock" ) func createLockObject(t *testing.T, objectType, namespace, name string, record *rl.LeaderElectionRecord) (obj runtime.Object) { objectMeta := metav1.ObjectMeta{ Namespace: namespace, Name: name, } if record != nil { recordBytes, _ := json.Marshal(record) objectMeta.Annotations = map[string]string{ rl.LeaderElectionRecordAnnotationKey: string(recordBytes), } } switch objectType { case "endpoints": obj = &corev1.Endpoints{ObjectMeta: objectMeta} case "configmaps": obj = &corev1.ConfigMap{ObjectMeta: objectMeta} case "leases": var spec coordinationv1.LeaseSpec if record != nil { spec = rl.LeaderElectionRecordToLeaseSpec(record) } obj = &coordinationv1.Lease{ObjectMeta: objectMeta, Spec: spec} default: t.Fatal("unexpected objType:" + objectType) } return } type Reactor struct { verb string objectType string reaction fakeclient.ReactionFunc } func testTryAcquireOrRenew(t *testing.T, objectType string) { clock := clock.RealClock{} future := clock.Now().Add(1000 * time.Hour) past := clock.Now().Add(-1000 * time.Hour) tests := []struct { name string observedRecord rl.LeaderElectionRecord observedTime time.Time retryAfter time.Duration reactors []Reactor expectedEvents []string expectSuccess bool transitionLeader bool outHolder string }{ { name: "acquire from no object", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName()) }, }, { verb: "create", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, }, expectSuccess: true, outHolder: "baz", }, { name: "acquire from object without annotations", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), nil), nil }, }, { verb: "update", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, }, expectSuccess: true, transitionLeader: true, outHolder: "baz", }, { name: "acquire from led object with the lease duration seconds", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "bing", LeaseDurationSeconds: 3}), nil }, }, { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "bing", LeaseDurationSeconds: 3}), nil }, }, { verb: "update", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, }, retryAfter: 3 * time.Second, expectSuccess: true, transitionLeader: true, outHolder: "baz", }, { name: "acquire from unled object", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{}), nil }, }, { verb: "update", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, }, expectSuccess: true, transitionLeader: true, outHolder: "baz", }, { name: "acquire from led, unacked object", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "bing"}), nil }, }, { verb: "update", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, }, observedRecord: rl.LeaderElectionRecord{HolderIdentity: "bing"}, observedTime: past, expectSuccess: true, transitionLeader: true, outHolder: "baz", }, { name: "acquire from empty led, acked object", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: ""}), nil }, }, { verb: "update", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, }, observedTime: future, expectSuccess: true, transitionLeader: true, outHolder: "baz", }, { name: "don't acquire from led, acked object", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "bing"}), nil }, }, }, observedTime: future, expectSuccess: false, outHolder: "bing", }, { name: "renew already acquired object", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "baz"}), nil }, }, { verb: "update", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, }, observedTime: future, observedRecord: rl.LeaderElectionRecord{HolderIdentity: "baz"}, expectSuccess: true, outHolder: "baz", }, } for i := range tests { test := &tests[i] t.Run(test.name, func(t *testing.T) { // OnNewLeader is called async so we have to wait for it. var wg sync.WaitGroup wg.Add(1) var reportedLeader string var lock rl.Interface objectMeta := metav1.ObjectMeta{Namespace: "foo", Name: "bar"} recorder := record.NewFakeRecorder(100) resourceLockConfig := rl.ResourceLockConfig{ Identity: "baz", EventRecorder: recorder, } c := &fake.Clientset{} for _, reactor := range test.reactors { c.AddReactor(reactor.verb, objectType, reactor.reaction) } c.AddReactor("*", "*", func(action fakeclient.Action) (bool, runtime.Object, error) { t.Errorf("unreachable action. testclient called too many times: %+v", action) return true, nil, fmt.Errorf("unreachable action") }) switch objectType { case "leases": lock = &rl.LeaseLock{ LeaseMeta: objectMeta, LockConfig: resourceLockConfig, Client: c.CoordinationV1(), } default: t.Fatalf("Unknown objectType: %v", objectType) } lec := LeaderElectionConfig{ Lock: lock, LeaseDuration: 10 * time.Second, Callbacks: LeaderCallbacks{ OnNewLeader: func(l string) { defer wg.Done() reportedLeader = l }, }, } observedRawRecord := GetRawRecordOrDie(t, objectType, test.observedRecord) le := &LeaderElector{ config: lec, observedRecord: test.observedRecord, observedRawRecord: observedRawRecord, observedTime: test.observedTime, clock: clock, metrics: globalMetricsFactory.newLeaderMetrics(), } if test.expectSuccess != le.tryAcquireOrRenew(context.Background()) { if test.retryAfter != 0 { time.Sleep(test.retryAfter) if test.expectSuccess != le.tryAcquireOrRenew(context.Background()) { t.Errorf("unexpected result of tryAcquireOrRenew: [succeeded=%v]", !test.expectSuccess) } } else { t.Errorf("unexpected result of tryAcquireOrRenew: [succeeded=%v]", !test.expectSuccess) } } le.observedRecord.AcquireTime = metav1.Time{} le.observedRecord.RenewTime = metav1.Time{} if le.observedRecord.HolderIdentity != test.outHolder { t.Errorf("expected holder:\n\t%+v\ngot:\n\t%+v", test.outHolder, le.observedRecord.HolderIdentity) } if len(test.reactors) != len(c.Actions()) { t.Errorf("wrong number of api interactions") } if test.transitionLeader && le.observedRecord.LeaderTransitions != 1 { t.Errorf("leader should have transitioned but did not") } if !test.transitionLeader && le.observedRecord.LeaderTransitions != 0 { t.Errorf("leader should not have transitioned but did") } le.maybeReportTransition() wg.Wait() if reportedLeader != test.outHolder { t.Errorf("reported leader was not the new leader. expected %q, got %q", test.outHolder, reportedLeader) } assertEqualEvents(t, test.expectedEvents, recorder.Events) }) } } func TestTryCoordinatedRenew(t *testing.T) { objectType := "leases" clock := clock.RealClock{} future := clock.Now().Add(1000 * time.Hour) tests := []struct { name string observedRecord rl.LeaderElectionRecord observedTime time.Time retryAfter time.Duration reactors []Reactor expectedEvents []string expectSuccess bool transitionLeader bool outHolder string }{ { name: "don't acquire from led, acked object", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "bing"}), nil }, }, }, observedTime: future, expectSuccess: false, outHolder: "bing", }, { name: "renew already acquired object", reactors: []Reactor{ { verb: "get", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "baz"}), nil }, }, { verb: "update", reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, }, observedTime: future, observedRecord: rl.LeaderElectionRecord{HolderIdentity: "baz"}, expectSuccess: true, outHolder: "baz", }, } for i := range tests { test := &tests[i] t.Run(test.name, func(t *testing.T) { // OnNewLeader is called async so we have to wait for it. var wg sync.WaitGroup wg.Add(1) var reportedLeader string var lock rl.Interface objectMeta := metav1.ObjectMeta{Namespace: "foo", Name: "bar"} recorder := record.NewFakeRecorder(100) resourceLockConfig := rl.ResourceLockConfig{ Identity: "baz", EventRecorder: recorder, } c := &fake.Clientset{} for _, reactor := range test.reactors { c.AddReactor(reactor.verb, objectType, reactor.reaction) } c.AddReactor("*", "*", func(action fakeclient.Action) (bool, runtime.Object, error) { t.Errorf("unreachable action. testclient called too many times: %+v", action) return true, nil, fmt.Errorf("unreachable action") }) lock = &rl.LeaseLock{ LeaseMeta: objectMeta, LockConfig: resourceLockConfig, Client: c.CoordinationV1(), } lec := LeaderElectionConfig{ Lock: lock, LeaseDuration: 10 * time.Second, Callbacks: LeaderCallbacks{ OnNewLeader: func(l string) { defer wg.Done() reportedLeader = l }, }, Coordinated: true, } observedRawRecord := GetRawRecordOrDie(t, objectType, test.observedRecord) le := &LeaderElector{ config: lec, observedRecord: test.observedRecord, observedRawRecord: observedRawRecord, observedTime: test.observedTime, clock: clock, metrics: globalMetricsFactory.newLeaderMetrics(), } if test.expectSuccess != le.tryCoordinatedRenew(context.Background()) { if test.retryAfter != 0 { time.Sleep(test.retryAfter) if test.expectSuccess != le.tryCoordinatedRenew(context.Background()) { t.Errorf("unexpected result of tryCoordinatedRenew: [succeeded=%v]", !test.expectSuccess) } } else { t.Errorf("unexpected result of gryCoordinatedRenew: [succeeded=%v]", !test.expectSuccess) } } le.observedRecord.AcquireTime = metav1.Time{} le.observedRecord.RenewTime = metav1.Time{} if le.observedRecord.HolderIdentity != test.outHolder { t.Errorf("expected holder:\n\t%+v\ngot:\n\t%+v", test.outHolder, le.observedRecord.HolderIdentity) } if len(test.reactors) != len(c.Actions()) { t.Errorf("wrong number of api interactions") } if test.transitionLeader && le.observedRecord.LeaderTransitions != 1 { t.Errorf("leader should have transitioned but did not") } if !test.transitionLeader && le.observedRecord.LeaderTransitions != 0 { t.Errorf("leader should not have transitioned but did") } le.maybeReportTransition() wg.Wait() if reportedLeader != test.outHolder { t.Errorf("reported leader was not the new leader. expected %q, got %q", test.outHolder, reportedLeader) } assertEqualEvents(t, test.expectedEvents, recorder.Events) }) } } // Will test leader election using lease as the resource func TestTryAcquireOrRenewLeases(t *testing.T) { testTryAcquireOrRenew(t, "leases") } func TestLeaseSpecToLeaderElectionRecordRoundTrip(t *testing.T) { holderIdentity := "foo" leaseDurationSeconds := int32(10) leaseTransitions := int32(1) oldSpec := coordinationv1.LeaseSpec{ HolderIdentity: &holderIdentity, LeaseDurationSeconds: &leaseDurationSeconds, AcquireTime: &metav1.MicroTime{Time: time.Now()}, RenewTime: &metav1.MicroTime{Time: time.Now()}, LeaseTransitions: &leaseTransitions, } oldRecord := rl.LeaseSpecToLeaderElectionRecord(&oldSpec) newSpec := rl.LeaderElectionRecordToLeaseSpec(oldRecord) if !equality.Semantic.DeepEqual(oldSpec, newSpec) { t.Errorf("diff: %v", cmp.Diff(oldSpec, newSpec)) } newRecord := rl.LeaseSpecToLeaderElectionRecord(&newSpec) if !equality.Semantic.DeepEqual(oldRecord, newRecord) { t.Errorf("diff: %v", cmp.Diff(oldRecord, newRecord)) } } func GetRawRecordOrDie(t *testing.T, objectType string, ler rl.LeaderElectionRecord) (ret []byte) { var err error switch objectType { case "leases": ret, err = json.Marshal(ler) if err != nil { t.Fatalf("lock %s get raw record %v failed: %v", objectType, ler, err) } default: t.Fatal("unexpected objType:" + objectType) } return } func testReleaseLease(t *testing.T, objectType string) { tests := []struct { name string observedRecord rl.LeaderElectionRecord observedTime time.Time reactors []Reactor expectedEvents []string expectSuccess bool transitionLeader bool outHolder string }{ { name: "release acquired lock from no object", reactors: []Reactor{ { verb: "get", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName()) }, }, { verb: "create", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.CreateAction).GetObject(), nil }, }, { verb: "update", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { return true, action.(fakeclient.UpdateAction).GetObject(), nil }, }, }, expectSuccess: true, outHolder: "", }, } for i := range tests { test := &tests[i] t.Run(test.name, func(t *testing.T) { // OnNewLeader is called async so we have to wait for it. var wg sync.WaitGroup wg.Add(1) var reportedLeader string var lock rl.Interface objectMeta := metav1.ObjectMeta{Namespace: "foo", Name: "bar"} recorder := record.NewFakeRecorder(100) resourceLockConfig := rl.ResourceLockConfig{ Identity: "baz", EventRecorder: recorder, } c := &fake.Clientset{} for _, reactor := range test.reactors { c.AddReactor(reactor.verb, objectType, reactor.reaction) } c.AddReactor("*", "*", func(action fakeclient.Action) (bool, runtime.Object, error) { t.Errorf("unreachable action. testclient called too many times: %+v", action) return true, nil, fmt.Errorf("unreachable action") }) switch objectType { case "leases": lock = &rl.LeaseLock{ LeaseMeta: objectMeta, LockConfig: resourceLockConfig, Client: c.CoordinationV1(), } default: t.Fatalf("Unknown objectType: %v", objectType) } lec := LeaderElectionConfig{ Lock: lock, LeaseDuration: 10 * time.Second, Callbacks: LeaderCallbacks{ OnNewLeader: func(l string) { defer wg.Done() reportedLeader = l }, }, } observedRawRecord := GetRawRecordOrDie(t, objectType, test.observedRecord) le := &LeaderElector{ config: lec, observedRecord: test.observedRecord, observedRawRecord: observedRawRecord, observedTime: test.observedTime, clock: clock.RealClock{}, metrics: globalMetricsFactory.newLeaderMetrics(), } if !le.tryAcquireOrRenew(context.Background()) { t.Errorf("unexpected result of tryAcquireOrRenew: [succeeded=%v]", true) } le.maybeReportTransition() // Wait for a response to the leader transition, and add 1 so that we can track the final transition. wg.Wait() wg.Add(1) if test.expectSuccess != le.release() { t.Errorf("unexpected result of release: [succeeded=%v]", !test.expectSuccess) } le.observedRecord.AcquireTime = metav1.Time{} le.observedRecord.RenewTime = metav1.Time{} if le.observedRecord.HolderIdentity != test.outHolder { t.Errorf("expected holder:\n\t%+v\ngot:\n\t%+v", test.outHolder, le.observedRecord.HolderIdentity) } if len(test.reactors) != len(c.Actions()) { t.Errorf("wrong number of api interactions") } if test.transitionLeader && le.observedRecord.LeaderTransitions != 1 { t.Errorf("leader should have transitioned but did not") } if !test.transitionLeader && le.observedRecord.LeaderTransitions != 0 { t.Errorf("leader should not have transitioned but did") } le.maybeReportTransition() wg.Wait() if reportedLeader != test.outHolder { t.Errorf("reported leader was not the new leader. expected %q, got %q", test.outHolder, reportedLeader) } assertEqualEvents(t, test.expectedEvents, recorder.Events) }) } } // Will test leader election using endpoints as the resource func TestReleaseLeaseLeases(t *testing.T) { testReleaseLease(t, "leases") } func TestReleaseOnCancellation_Leases(t *testing.T) { testReleaseOnCancellation(t, "leases") } func testReleaseOnCancellation(t *testing.T, objectType string) { var ( onNewLeader = make(chan struct{}) onRenewCalled = make(chan struct{}) onRenewResume = make(chan struct{}) onRelease = make(chan struct{}) lockObj runtime.Object gets int updates int wg sync.WaitGroup ) resetVars := func() { onNewLeader = make(chan struct{}) onRenewCalled = make(chan struct{}) onRenewResume = make(chan struct{}) onRelease = make(chan struct{}) lockObj = nil gets = 0 updates = 0 } lec := LeaderElectionConfig{ LeaseDuration: 15 * time.Second, RenewDeadline: 2 * time.Second, RetryPeriod: 1 * time.Second, // This is what we're testing ReleaseOnCancel: true, Callbacks: LeaderCallbacks{ OnNewLeader: func(identity string) {}, OnStoppedLeading: func() {}, OnStartedLeading: func(context.Context) { close(onNewLeader) }, }, } tests := []struct { name string reactors []Reactor expectedEvents []string }{ { name: "release acquired lock on cancellation of update", reactors: []Reactor{ { verb: "get", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { gets++ if lockObj != nil { return true, lockObj, nil } return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName()) }, }, { verb: "create", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { lockObj = action.(fakeclient.CreateAction).GetObject() return true, lockObj, nil }, }, { verb: "update", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { updates++ // Skip initial two fast path renews if updates%2 == 1 && updates < 5 { return true, nil, context.Canceled } // Second update (first renew) should return our canceled error // FakeClient doesn't do anything with the context so we're doing this ourselves if updates == 4 { close(onRenewCalled) <-onRenewResume return true, nil, context.Canceled } else if updates == 5 { // We update the lock after the cancellation to release it // This wg is to avoid the data race on lockObj defer wg.Done() close(onRelease) } lockObj = action.(fakeclient.UpdateAction).GetObject() return true, lockObj, nil }, }, }, expectedEvents: []string{ "Normal LeaderElection baz became leader", "Normal LeaderElection baz stopped leading", }, }, { name: "release acquired lock on cancellation of get", reactors: []Reactor{ { verb: "get", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { gets++ if lockObj != nil { // Third and more get (first create, second renew) should return our canceled error // FakeClient doesn't do anything with the context so we're doing this ourselves if gets >= 3 { close(onRenewCalled) <-onRenewResume return true, nil, context.Canceled } return true, lockObj, nil } return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName()) }, }, { verb: "create", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { lockObj = action.(fakeclient.CreateAction).GetObject() return true, lockObj, nil }, }, { verb: "update", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { updates++ // Always skip fast path renew if updates%2 == 1 { return true, nil, context.Canceled } // Second update (first renew) should release the lock if updates == 4 { // We update the lock after the cancellation to release it // This wg is to avoid the data race on lockObj defer wg.Done() close(onRelease) } lockObj = action.(fakeclient.UpdateAction).GetObject() return true, lockObj, nil }, }, }, expectedEvents: []string{ "Normal LeaderElection baz became leader", "Normal LeaderElection baz stopped leading", }, }, } for i := range tests { test := &tests[i] t.Run(test.name, func(t *testing.T) { wg.Add(1) resetVars() recorder := record.NewFakeRecorder(100) resourceLockConfig := rl.ResourceLockConfig{ Identity: "baz", EventRecorder: recorder, } c := &fake.Clientset{} for _, reactor := range test.reactors { c.AddReactor(reactor.verb, objectType, reactor.reaction) } c.AddReactor("*", "*", func(action fakeclient.Action) (bool, runtime.Object, error) { t.Errorf("unreachable action. testclient called too many times: %+v", action) return true, nil, fmt.Errorf("unreachable action") }) lock, err := rl.New(objectType, "foo", "bar", c.CoreV1(), c.CoordinationV1(), resourceLockConfig) if err != nil { t.Fatal("resourcelock.New() = ", err) } lec.Lock = lock elector, err := NewLeaderElector(lec) if err != nil { t.Fatal("Failed to create leader elector: ", err) } ctx, cancel := context.WithCancel(context.Background()) go elector.Run(ctx) // Wait for us to become the leader select { case <-onNewLeader: case <-time.After(10 * time.Second): t.Fatal("failed to become the leader") } // Wait for renew (update) to be invoked select { case <-onRenewCalled: case <-time.After(10 * time.Second): t.Fatal("the elector failed to renew the lock") } // Cancel the context - stopping the elector while // it's running cancel() // Resume the tryAcquireOrRenew call to return the cancellation // which should trigger the release flow close(onRenewResume) select { case <-onRelease: case <-time.After(10 * time.Second): t.Fatal("the lock was not released") } wg.Wait() assertEqualEvents(t, test.expectedEvents, recorder.Events) }) } } func TestLeaderElectionConfigValidation(t *testing.T) { resourceLockConfig := rl.ResourceLockConfig{ Identity: "baz", } lock := &rl.LeaseLock{ LockConfig: resourceLockConfig, } lec := LeaderElectionConfig{ Lock: lock, LeaseDuration: 15 * time.Second, RenewDeadline: 2 * time.Second, RetryPeriod: 1 * time.Second, ReleaseOnCancel: true, Callbacks: LeaderCallbacks{ OnNewLeader: func(identity string) {}, OnStoppedLeading: func() {}, OnStartedLeading: func(context.Context) {}, }, } _, err := NewLeaderElector(lec) assert.NoError(t, err) // Invalid lock identity resourceLockConfig.Identity = "" lock.LockConfig = resourceLockConfig lec.Lock = lock _, err = NewLeaderElector(lec) assert.Error(t, err, fmt.Errorf("Lock identity is empty")) } func assertEqualEvents(t *testing.T, expected []string, actual <-chan string) { c := time.After(wait.ForeverTestTimeout) for _, e := range expected { select { case a := <-actual: if e != a { t.Errorf("Expected event %q, got %q", e, a) return } case <-c: t.Errorf("Expected event %q, got nothing", e) // continue iterating to print all expected events } } for { select { case a := <-actual: t.Errorf("Unexpected event: %q", a) default: return // No more events, as expected. } } } func TestFastPathLeaderElection(t *testing.T) { objectType := "leases" var ( lockObj runtime.Object updates int lockOps []string cancelFunc func() ) resetVars := func() { lockObj = nil updates = 0 lockOps = []string{} cancelFunc = nil } lec := LeaderElectionConfig{ LeaseDuration: 15 * time.Second, RenewDeadline: 2 * time.Second, RetryPeriod: 1 * time.Second, Callbacks: LeaderCallbacks{ OnNewLeader: func(identity string) {}, OnStoppedLeading: func() {}, OnStartedLeading: func(context.Context) { }, }, } tests := []struct { name string reactors []Reactor expectedLockOps []string }{ { name: "Exercise fast path after lock acquired", reactors: []Reactor{ { verb: "get", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { lockOps = append(lockOps, "get") if lockObj != nil { return true, lockObj, nil } return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName()) }, }, { verb: "create", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { lockOps = append(lockOps, "create") lockObj = action.(fakeclient.CreateAction).GetObject() return true, lockObj, nil }, }, { verb: "update", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { updates++ lockOps = append(lockOps, "update") if updates == 2 { cancelFunc() } lockObj = action.(fakeclient.UpdateAction).GetObject() return true, lockObj, nil }, }, }, expectedLockOps: []string{"get", "create", "update", "update"}, }, { name: "Fallback to slow path after fast path fails", reactors: []Reactor{ { verb: "get", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { lockOps = append(lockOps, "get") if lockObj != nil { return true, lockObj, nil } return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName()) }, }, { verb: "create", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { lockOps = append(lockOps, "create") lockObj = action.(fakeclient.CreateAction).GetObject() return true, lockObj, nil }, }, { verb: "update", objectType: objectType, reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { updates++ lockOps = append(lockOps, "update") switch updates { case 2: return true, nil, errors.NewConflict(action.(fakeclient.UpdateAction).GetResource().GroupResource(), "fake conflict", nil) case 4: cancelFunc() } lockObj = action.(fakeclient.UpdateAction).GetObject() return true, lockObj, nil }, }, }, expectedLockOps: []string{"get", "create", "update", "update", "get", "update", "update"}, }, } for i := range tests { test := &tests[i] t.Run(test.name, func(t *testing.T) { resetVars() recorder := record.NewFakeRecorder(100) resourceLockConfig := rl.ResourceLockConfig{ Identity: "baz", EventRecorder: recorder, } c := &fake.Clientset{} for _, reactor := range test.reactors { c.AddReactor(reactor.verb, objectType, reactor.reaction) } c.AddReactor("*", "*", func(action fakeclient.Action) (bool, runtime.Object, error) { t.Errorf("unreachable action. testclient called too many times: %+v", action) return true, nil, fmt.Errorf("unreachable action") }) lock, err := rl.New("leases", "foo", "bar", c.CoreV1(), c.CoordinationV1(), resourceLockConfig) if err != nil { t.Fatal("resourcelock.New() = ", err) } lec.Lock = lock elector, err := NewLeaderElector(lec) if err != nil { t.Fatal("Failed to create leader elector: ", err) } ctx, cancel := context.WithCancel(context.Background()) cancelFunc = cancel elector.Run(ctx) assert.Equal(t, test.expectedLockOps, lockOps, "Expected lock ops %q, got %q", test.expectedLockOps, lockOps) }) } } kubernetes-client-go-a2dfcab/tools/leaderelection/leasecandidate.go000066400000000000000000000143011472614177300257730ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package leaderelection import ( "context" "reflect" "time" v1 "k8s.io/api/coordination/v1" v1alpha1 "k8s.io/api/coordination/v1alpha1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" coordinationv1alpha1client "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" "k8s.io/klog/v2" "k8s.io/utils/clock" ) const requeueInterval = 5 * time.Minute type CacheSyncWaiter interface { WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool } type LeaseCandidate struct { leaseClient coordinationv1alpha1client.LeaseCandidateInterface leaseCandidateInformer cache.SharedIndexInformer informerFactory informers.SharedInformerFactory hasSynced cache.InformerSynced // At most there will be one item in this Queue (since we only watch one item) queue workqueue.TypedRateLimitingInterface[int] name string namespace string // controller lease leaseName string clock clock.Clock binaryVersion, emulationVersion string preferredStrategies []v1.CoordinatedLeaseStrategy } // NewCandidate creates new LeaseCandidate controller that creates a // LeaseCandidate object if it does not exist and watches changes // to the corresponding object and renews if PingTime is set. // WARNING: This is an ALPHA feature. Ensure that the CoordinatedLeaderElection // feature gate is on. func NewCandidate(clientset kubernetes.Interface, candidateNamespace string, candidateName string, targetLease string, binaryVersion, emulationVersion string, preferredStrategies []v1.CoordinatedLeaseStrategy, ) (*LeaseCandidate, CacheSyncWaiter, error) { fieldSelector := fields.OneTermEqualSelector("metadata.name", candidateName).String() // A separate informer factory is required because this must start before informerFactories // are started for leader elected components informerFactory := informers.NewSharedInformerFactoryWithOptions( clientset, 5*time.Minute, informers.WithTweakListOptions(func(options *metav1.ListOptions) { options.FieldSelector = fieldSelector }), ) leaseCandidateInformer := informerFactory.Coordination().V1alpha1().LeaseCandidates().Informer() lc := &LeaseCandidate{ leaseClient: clientset.CoordinationV1alpha1().LeaseCandidates(candidateNamespace), leaseCandidateInformer: leaseCandidateInformer, informerFactory: informerFactory, name: candidateName, namespace: candidateNamespace, leaseName: targetLease, clock: clock.RealClock{}, binaryVersion: binaryVersion, emulationVersion: emulationVersion, preferredStrategies: preferredStrategies, } lc.queue = workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[int](), workqueue.TypedRateLimitingQueueConfig[int]{Name: "leasecandidate"}) h, err := leaseCandidateInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ UpdateFunc: func(oldObj, newObj interface{}) { if leasecandidate, ok := newObj.(*v1alpha1.LeaseCandidate); ok { if leasecandidate.Spec.PingTime != nil && leasecandidate.Spec.PingTime.After(leasecandidate.Spec.RenewTime.Time) { lc.enqueueLease() } } }, }) if err != nil { return nil, nil, err } lc.hasSynced = h.HasSynced return lc, informerFactory, nil } func (c *LeaseCandidate) Run(ctx context.Context) { defer c.queue.ShutDown() c.informerFactory.Start(ctx.Done()) if !cache.WaitForNamedCacheSync("leasecandidateclient", ctx.Done(), c.hasSynced) { return } c.enqueueLease() go c.runWorker(ctx) <-ctx.Done() } func (c *LeaseCandidate) runWorker(ctx context.Context) { for c.processNextWorkItem(ctx) { } } func (c *LeaseCandidate) processNextWorkItem(ctx context.Context) bool { key, shutdown := c.queue.Get() if shutdown { return false } defer c.queue.Done(key) err := c.ensureLease(ctx) if err == nil { c.queue.AddAfter(key, requeueInterval) return true } utilruntime.HandleError(err) c.queue.AddRateLimited(key) return true } func (c *LeaseCandidate) enqueueLease() { c.queue.Add(0) } // ensureLease creates the lease if it does not exist and renew it if it exists. Returns the lease and // a bool (true if this call created the lease), or any error that occurs. func (c *LeaseCandidate) ensureLease(ctx context.Context) error { lease, err := c.leaseClient.Get(ctx, c.name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { klog.V(2).Infof("Creating lease candidate") // lease does not exist, create it. leaseToCreate := c.newLeaseCandidate() if _, err := c.leaseClient.Create(ctx, leaseToCreate, metav1.CreateOptions{}); err != nil { return err } klog.V(2).Infof("Created lease candidate") return nil } else if err != nil { return err } klog.V(2).Infof("lease candidate exists. Renewing.") clone := lease.DeepCopy() clone.Spec.RenewTime = &metav1.MicroTime{Time: c.clock.Now()} _, err = c.leaseClient.Update(ctx, clone, metav1.UpdateOptions{}) if err != nil { return err } return nil } func (c *LeaseCandidate) newLeaseCandidate() *v1alpha1.LeaseCandidate { lc := &v1alpha1.LeaseCandidate{ ObjectMeta: metav1.ObjectMeta{ Name: c.name, Namespace: c.namespace, }, Spec: v1alpha1.LeaseCandidateSpec{ LeaseName: c.leaseName, BinaryVersion: c.binaryVersion, EmulationVersion: c.emulationVersion, PreferredStrategies: c.preferredStrategies, }, } lc.Spec.RenewTime = &metav1.MicroTime{Time: c.clock.Now()} return lc } kubernetes-client-go-a2dfcab/tools/leaderelection/leasecandidate_test.go000066400000000000000000000074031472614177300270370ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package leaderelection import ( "context" "testing" "time" v1 "k8s.io/api/coordination/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes/fake" ) type testcase struct { candidateName, candidateNamespace, leaseName string binaryVersion, emulationVersion string } func TestLeaseCandidateCreation(t *testing.T) { tc := testcase{ candidateName: "foo", candidateNamespace: "default", leaseName: "lease", binaryVersion: "1.30.0", emulationVersion: "1.30.0", } ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() client := fake.NewSimpleClientset() candidate, _, err := NewCandidate( client, tc.candidateNamespace, tc.candidateName, tc.leaseName, tc.binaryVersion, tc.emulationVersion, []v1.CoordinatedLeaseStrategy{v1.OldestEmulationVersion}, ) if err != nil { t.Fatal(err) } go candidate.Run(ctx) err = pollForLease(ctx, tc, client, nil) if err != nil { t.Fatal(err) } } func TestLeaseCandidateAck(t *testing.T) { tc := testcase{ candidateName: "foo", candidateNamespace: "default", leaseName: "lease", binaryVersion: "1.30.0", emulationVersion: "1.30.0", } ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() client := fake.NewSimpleClientset() candidate, _, err := NewCandidate( client, tc.candidateNamespace, tc.candidateName, tc.leaseName, tc.binaryVersion, tc.emulationVersion, []v1.CoordinatedLeaseStrategy{v1.OldestEmulationVersion}, ) if err != nil { t.Fatal(err) } go candidate.Run(ctx) err = pollForLease(ctx, tc, client, nil) if err != nil { t.Fatal(err) } // Update PingTime and verify that the client renews ensureAfter := &metav1.MicroTime{Time: time.Now()} lc, err := client.CoordinationV1alpha1().LeaseCandidates(tc.candidateNamespace).Get(ctx, tc.candidateName, metav1.GetOptions{}) if err == nil { if lc.Spec.PingTime == nil { c := lc.DeepCopy() c.Spec.PingTime = &metav1.MicroTime{Time: time.Now()} _, err = client.CoordinationV1alpha1().LeaseCandidates(tc.candidateNamespace).Update(ctx, c, metav1.UpdateOptions{}) if err != nil { t.Error(err) } } } err = pollForLease(ctx, tc, client, ensureAfter) if err != nil { t.Fatal(err) } } func pollForLease(ctx context.Context, tc testcase, client *fake.Clientset, t *metav1.MicroTime) error { return wait.PollUntilContextTimeout(ctx, 100*time.Millisecond, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { lc, err := client.CoordinationV1alpha1().LeaseCandidates(tc.candidateNamespace).Get(ctx, tc.candidateName, metav1.GetOptions{}) if err != nil { if errors.IsNotFound(err) { return false, nil } return true, err } if lc.Spec.BinaryVersion == tc.binaryVersion && lc.Spec.EmulationVersion == tc.emulationVersion && lc.Spec.LeaseName == tc.leaseName && lc.Spec.RenewTime != nil { // Ensure that if a time is provided, the renewTime occurred after the provided time. if t != nil && t.After(lc.Spec.RenewTime.Time) { return false, nil } return true, nil } return false, nil }) } kubernetes-client-go-a2dfcab/tools/leaderelection/metrics.go000066400000000000000000000055601472614177300245220ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package leaderelection import ( "sync" ) // This file provides abstractions for setting the provider (e.g., prometheus) // of metrics. type leaderMetricsAdapter interface { leaderOn(name string) leaderOff(name string) slowpathExercised(name string) } // LeaderMetric instruments metrics used in leader election. type LeaderMetric interface { On(name string) Off(name string) SlowpathExercised(name string) } type noopMetric struct{} func (noopMetric) On(name string) {} func (noopMetric) Off(name string) {} func (noopMetric) SlowpathExercised(name string) {} // defaultLeaderMetrics expects the caller to lock before setting any metrics. type defaultLeaderMetrics struct { // leader's value indicates if the current process is the owner of name lease leader LeaderMetric } func (m *defaultLeaderMetrics) leaderOn(name string) { if m == nil { return } m.leader.On(name) } func (m *defaultLeaderMetrics) leaderOff(name string) { if m == nil { return } m.leader.Off(name) } func (m *defaultLeaderMetrics) slowpathExercised(name string) { if m == nil { return } m.leader.SlowpathExercised(name) } type noMetrics struct{} func (noMetrics) leaderOn(name string) {} func (noMetrics) leaderOff(name string) {} func (noMetrics) slowpathExercised(name string) {} // MetricsProvider generates various metrics used by the leader election. type MetricsProvider interface { NewLeaderMetric() LeaderMetric } type noopMetricsProvider struct{} func (noopMetricsProvider) NewLeaderMetric() LeaderMetric { return noopMetric{} } var globalMetricsFactory = leaderMetricsFactory{ metricsProvider: noopMetricsProvider{}, } type leaderMetricsFactory struct { metricsProvider MetricsProvider onlyOnce sync.Once } func (f *leaderMetricsFactory) setProvider(mp MetricsProvider) { f.onlyOnce.Do(func() { f.metricsProvider = mp }) } func (f *leaderMetricsFactory) newLeaderMetrics() leaderMetricsAdapter { mp := f.metricsProvider if mp == (noopMetricsProvider{}) { return noMetrics{} } return &defaultLeaderMetrics{ leader: mp.NewLeaderMetric(), } } // SetProvider sets the metrics provider for all subsequently created work // queues. Only the first call has an effect. func SetProvider(metricsProvider MetricsProvider) { globalMetricsFactory.setProvider(metricsProvider) } kubernetes-client-go-a2dfcab/tools/leaderelection/resourcelock/000077500000000000000000000000001472614177300252175ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/leaderelection/resourcelock/interface.go000066400000000000000000000174241472614177300275160ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package resourcelock import ( "context" "fmt" "time" v1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" clientset "k8s.io/client-go/kubernetes" coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" restclient "k8s.io/client-go/rest" ) const ( LeaderElectionRecordAnnotationKey = "control-plane.alpha.kubernetes.io/leader" endpointsResourceLock = "endpoints" configMapsResourceLock = "configmaps" LeasesResourceLock = "leases" // When using endpointsLeasesResourceLock, you need to ensure that // API Priority & Fairness is configured with non-default flow-schema // that will catch the necessary operations on leader-election related // endpoint objects. // // The example of such flow scheme could look like this: // apiVersion: flowcontrol.apiserver.k8s.io/v1beta2 // kind: FlowSchema // metadata: // name: my-leader-election // spec: // distinguisherMethod: // type: ByUser // matchingPrecedence: 200 // priorityLevelConfiguration: // name: leader-election # reference the PL // rules: // - resourceRules: // - apiGroups: // - "" // namespaces: // - '*' // resources: // - endpoints // verbs: // - get // - create // - update // subjects: // - kind: ServiceAccount // serviceAccount: // name: '*' // namespace: kube-system endpointsLeasesResourceLock = "endpointsleases" // When using configMapsLeasesResourceLock, you need to ensure that // API Priority & Fairness is configured with non-default flow-schema // that will catch the necessary operations on leader-election related // configmap objects. // // The example of such flow scheme could look like this: // apiVersion: flowcontrol.apiserver.k8s.io/v1beta2 // kind: FlowSchema // metadata: // name: my-leader-election // spec: // distinguisherMethod: // type: ByUser // matchingPrecedence: 200 // priorityLevelConfiguration: // name: leader-election # reference the PL // rules: // - resourceRules: // - apiGroups: // - "" // namespaces: // - '*' // resources: // - configmaps // verbs: // - get // - create // - update // subjects: // - kind: ServiceAccount // serviceAccount: // name: '*' // namespace: kube-system configMapsLeasesResourceLock = "configmapsleases" ) // LeaderElectionRecord is the record that is stored in the leader election annotation. // This information should be used for observational purposes only and could be replaced // with a random string (e.g. UUID) with only slight modification of this code. // TODO(mikedanese): this should potentially be versioned type LeaderElectionRecord struct { // HolderIdentity is the ID that owns the lease. If empty, no one owns this lease and // all callers may acquire. Versions of this library prior to Kubernetes 1.14 will not // attempt to acquire leases with empty identities and will wait for the full lease // interval to expire before attempting to reacquire. This value is set to empty when // a client voluntarily steps down. HolderIdentity string `json:"holderIdentity"` LeaseDurationSeconds int `json:"leaseDurationSeconds"` AcquireTime metav1.Time `json:"acquireTime"` RenewTime metav1.Time `json:"renewTime"` LeaderTransitions int `json:"leaderTransitions"` Strategy v1.CoordinatedLeaseStrategy `json:"strategy"` PreferredHolder string `json:"preferredHolder"` } // EventRecorder records a change in the ResourceLock. type EventRecorder interface { Eventf(obj runtime.Object, eventType, reason, message string, args ...interface{}) } // ResourceLockConfig common data that exists across different // resource locks type ResourceLockConfig struct { // Identity is the unique string identifying a lease holder across // all participants in an election. Identity string // EventRecorder is optional. EventRecorder EventRecorder } // Interface offers a common interface for locking on arbitrary // resources used in leader election. The Interface is used // to hide the details on specific implementations in order to allow // them to change over time. This interface is strictly for use // by the leaderelection code. type Interface interface { // Get returns the LeaderElectionRecord Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) // Create attempts to create a LeaderElectionRecord Create(ctx context.Context, ler LeaderElectionRecord) error // Update will update and existing LeaderElectionRecord Update(ctx context.Context, ler LeaderElectionRecord) error // RecordEvent is used to record events RecordEvent(string) // Identity will return the locks Identity Identity() string // Describe is used to convert details on current resource lock // into a string Describe() string } // Manufacture will create a lock of a given type according to the input parameters func New(lockType string, ns string, name string, coreClient corev1.CoreV1Interface, coordinationClient coordinationv1.CoordinationV1Interface, rlc ResourceLockConfig) (Interface, error) { leaseLock := &LeaseLock{ LeaseMeta: metav1.ObjectMeta{ Namespace: ns, Name: name, }, Client: coordinationClient, LockConfig: rlc, } switch lockType { case endpointsResourceLock: return nil, fmt.Errorf("endpoints lock is removed, migrate to %s (using version v0.27.x)", endpointsLeasesResourceLock) case configMapsResourceLock: return nil, fmt.Errorf("configmaps lock is removed, migrate to %s (using version v0.27.x)", configMapsLeasesResourceLock) case LeasesResourceLock: return leaseLock, nil case endpointsLeasesResourceLock: return nil, fmt.Errorf("endpointsleases lock is removed, migrate to %s", LeasesResourceLock) case configMapsLeasesResourceLock: return nil, fmt.Errorf("configmapsleases lock is removed, migrated to %s", LeasesResourceLock) default: return nil, fmt.Errorf("Invalid lock-type %s", lockType) } } // NewFromKubeconfig will create a lock of a given type according to the input parameters. // Timeout set for a client used to contact to Kubernetes should be lower than // RenewDeadline to keep a single hung request from forcing a leader loss. // Setting it to max(time.Second, RenewDeadline/2) as a reasonable heuristic. func NewFromKubeconfig(lockType string, ns string, name string, rlc ResourceLockConfig, kubeconfig *restclient.Config, renewDeadline time.Duration) (Interface, error) { // shallow copy, do not modify the kubeconfig config := *kubeconfig timeout := renewDeadline / 2 if timeout < time.Second { timeout = time.Second } config.Timeout = timeout leaderElectionClient := clientset.NewForConfigOrDie(restclient.AddUserAgent(&config, "leader-election")) return New(lockType, ns, name, leaderElectionClient.CoreV1(), leaderElectionClient.CoordinationV1(), rlc) } kubernetes-client-go-a2dfcab/tools/leaderelection/resourcelock/leaselock.go000066400000000000000000000112121472614177300275050ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package resourcelock import ( "context" "encoding/json" "errors" "fmt" coordinationv1 "k8s.io/api/coordination/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" coordinationv1client "k8s.io/client-go/kubernetes/typed/coordination/v1" ) type LeaseLock struct { // LeaseMeta should contain a Name and a Namespace of a // LeaseMeta object that the LeaderElector will attempt to lead. LeaseMeta metav1.ObjectMeta Client coordinationv1client.LeasesGetter LockConfig ResourceLockConfig lease *coordinationv1.Lease } // Get returns the election record from a Lease spec func (ll *LeaseLock) Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) { lease, err := ll.Client.Leases(ll.LeaseMeta.Namespace).Get(ctx, ll.LeaseMeta.Name, metav1.GetOptions{}) if err != nil { return nil, nil, err } ll.lease = lease record := LeaseSpecToLeaderElectionRecord(&ll.lease.Spec) recordByte, err := json.Marshal(*record) if err != nil { return nil, nil, err } return record, recordByte, nil } // Create attempts to create a Lease func (ll *LeaseLock) Create(ctx context.Context, ler LeaderElectionRecord) error { var err error ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Create(ctx, &coordinationv1.Lease{ ObjectMeta: metav1.ObjectMeta{ Name: ll.LeaseMeta.Name, Namespace: ll.LeaseMeta.Namespace, }, Spec: LeaderElectionRecordToLeaseSpec(&ler), }, metav1.CreateOptions{}) return err } // Update will update an existing Lease spec. func (ll *LeaseLock) Update(ctx context.Context, ler LeaderElectionRecord) error { if ll.lease == nil { return errors.New("lease not initialized, call get or create first") } ll.lease.Spec = LeaderElectionRecordToLeaseSpec(&ler) lease, err := ll.Client.Leases(ll.LeaseMeta.Namespace).Update(ctx, ll.lease, metav1.UpdateOptions{}) if err != nil { return err } ll.lease = lease return nil } // RecordEvent in leader election while adding meta-data func (ll *LeaseLock) RecordEvent(s string) { if ll.LockConfig.EventRecorder == nil { return } events := fmt.Sprintf("%v %v", ll.LockConfig.Identity, s) subject := &coordinationv1.Lease{ObjectMeta: ll.lease.ObjectMeta} // Populate the type meta, so we don't have to get it from the schema subject.Kind = "Lease" subject.APIVersion = coordinationv1.SchemeGroupVersion.String() ll.LockConfig.EventRecorder.Eventf(subject, corev1.EventTypeNormal, "LeaderElection", events) } // Describe is used to convert details on current resource lock // into a string func (ll *LeaseLock) Describe() string { return fmt.Sprintf("%v/%v", ll.LeaseMeta.Namespace, ll.LeaseMeta.Name) } // Identity returns the Identity of the lock func (ll *LeaseLock) Identity() string { return ll.LockConfig.Identity } func LeaseSpecToLeaderElectionRecord(spec *coordinationv1.LeaseSpec) *LeaderElectionRecord { var r LeaderElectionRecord if spec.HolderIdentity != nil { r.HolderIdentity = *spec.HolderIdentity } if spec.LeaseDurationSeconds != nil { r.LeaseDurationSeconds = int(*spec.LeaseDurationSeconds) } if spec.LeaseTransitions != nil { r.LeaderTransitions = int(*spec.LeaseTransitions) } if spec.AcquireTime != nil { r.AcquireTime = metav1.Time{Time: spec.AcquireTime.Time} } if spec.RenewTime != nil { r.RenewTime = metav1.Time{Time: spec.RenewTime.Time} } if spec.PreferredHolder != nil { r.PreferredHolder = *spec.PreferredHolder } if spec.Strategy != nil { r.Strategy = *spec.Strategy } return &r } func LeaderElectionRecordToLeaseSpec(ler *LeaderElectionRecord) coordinationv1.LeaseSpec { leaseDurationSeconds := int32(ler.LeaseDurationSeconds) leaseTransitions := int32(ler.LeaderTransitions) spec := coordinationv1.LeaseSpec{ HolderIdentity: &ler.HolderIdentity, LeaseDurationSeconds: &leaseDurationSeconds, AcquireTime: &metav1.MicroTime{Time: ler.AcquireTime.Time}, RenewTime: &metav1.MicroTime{Time: ler.RenewTime.Time}, LeaseTransitions: &leaseTransitions, } if ler.PreferredHolder != "" { spec.PreferredHolder = &ler.PreferredHolder } if ler.Strategy != "" { spec.Strategy = &ler.Strategy } return spec } kubernetes-client-go-a2dfcab/tools/leaderelection/resourcelock/multilock.go000066400000000000000000000054341472614177300275570ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package resourcelock import ( "bytes" "context" "encoding/json" apierrors "k8s.io/apimachinery/pkg/api/errors" ) const ( UnknownLeader = "leaderelection.k8s.io/unknown" ) // MultiLock is used for lock's migration type MultiLock struct { Primary Interface Secondary Interface } // Get returns the older election record of the lock func (ml *MultiLock) Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) { primary, primaryRaw, err := ml.Primary.Get(ctx) if err != nil { return nil, nil, err } secondary, secondaryRaw, err := ml.Secondary.Get(ctx) if err != nil { // Lock is held by old client if apierrors.IsNotFound(err) && primary.HolderIdentity != ml.Identity() { return primary, primaryRaw, nil } return nil, nil, err } if primary.HolderIdentity != secondary.HolderIdentity { primary.HolderIdentity = UnknownLeader primaryRaw, err = json.Marshal(primary) if err != nil { return nil, nil, err } } return primary, ConcatRawRecord(primaryRaw, secondaryRaw), nil } // Create attempts to create both primary lock and secondary lock func (ml *MultiLock) Create(ctx context.Context, ler LeaderElectionRecord) error { err := ml.Primary.Create(ctx, ler) if err != nil && !apierrors.IsAlreadyExists(err) { return err } return ml.Secondary.Create(ctx, ler) } // Update will update and existing annotation on both two resources. func (ml *MultiLock) Update(ctx context.Context, ler LeaderElectionRecord) error { err := ml.Primary.Update(ctx, ler) if err != nil { return err } _, _, err = ml.Secondary.Get(ctx) if err != nil && apierrors.IsNotFound(err) { return ml.Secondary.Create(ctx, ler) } return ml.Secondary.Update(ctx, ler) } // RecordEvent in leader election while adding meta-data func (ml *MultiLock) RecordEvent(s string) { ml.Primary.RecordEvent(s) ml.Secondary.RecordEvent(s) } // Describe is used to convert details on current resource lock // into a string func (ml *MultiLock) Describe() string { return ml.Primary.Describe() } // Identity returns the Identity of the lock func (ml *MultiLock) Identity() string { return ml.Primary.Identity() } func ConcatRawRecord(primaryRaw, secondaryRaw []byte) []byte { return bytes.Join([][]byte{primaryRaw, secondaryRaw}, []byte(",")) } kubernetes-client-go-a2dfcab/tools/metrics/000077500000000000000000000000001472614177300212065ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/metrics/OWNERS000066400000000000000000000001321472614177300221420ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners reviewers: - wojtek-t - jayunit100 kubernetes-client-go-a2dfcab/tools/metrics/metrics.go000066400000000000000000000150461472614177300232110ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package metrics provides abstractions for registering which metrics // to record. package metrics import ( "context" "net/url" "sync" "time" ) var registerMetrics sync.Once // DurationMetric is a measurement of some amount of time. type DurationMetric interface { Observe(duration time.Duration) } // ExpiryMetric sets some time of expiry. If nil, assume not relevant. type ExpiryMetric interface { Set(expiry *time.Time) } // LatencyMetric observes client latency partitioned by verb and url. type LatencyMetric interface { Observe(ctx context.Context, verb string, u url.URL, latency time.Duration) } type ResolverLatencyMetric interface { Observe(ctx context.Context, host string, latency time.Duration) } // SizeMetric observes client response size partitioned by verb and host. type SizeMetric interface { Observe(ctx context.Context, verb string, host string, size float64) } // ResultMetric counts response codes partitioned by method and host. type ResultMetric interface { Increment(ctx context.Context, code string, method string, host string) } // CallsMetric counts calls that take place for a specific exec plugin. type CallsMetric interface { // Increment increments a counter per exitCode and callStatus. Increment(exitCode int, callStatus string) } // RetryMetric counts the number of retries sent to the server // partitioned by code, method, and host. type RetryMetric interface { IncrementRetry(ctx context.Context, code string, method string, host string) } // TransportCacheMetric shows the number of entries in the internal transport cache type TransportCacheMetric interface { Observe(value int) } // TransportCreateCallsMetric counts the number of times a transport is created // partitioned by the result of the cache: hit, miss, uncacheable type TransportCreateCallsMetric interface { Increment(result string) } var ( // ClientCertExpiry is the expiry time of a client certificate ClientCertExpiry ExpiryMetric = noopExpiry{} // ClientCertRotationAge is the age of a certificate that has just been rotated. ClientCertRotationAge DurationMetric = noopDuration{} // RequestLatency is the latency metric that rest clients will update. RequestLatency LatencyMetric = noopLatency{} // ResolverLatency is the latency metric that DNS resolver will update ResolverLatency ResolverLatencyMetric = noopResolverLatency{} // RequestSize is the request size metric that rest clients will update. RequestSize SizeMetric = noopSize{} // ResponseSize is the response size metric that rest clients will update. ResponseSize SizeMetric = noopSize{} // RateLimiterLatency is the client side rate limiter latency metric. RateLimiterLatency LatencyMetric = noopLatency{} // RequestResult is the result metric that rest clients will update. RequestResult ResultMetric = noopResult{} // ExecPluginCalls is the number of calls made to an exec plugin, partitioned by // exit code and call status. ExecPluginCalls CallsMetric = noopCalls{} // RequestRetry is the retry metric that tracks the number of // retries sent to the server. RequestRetry RetryMetric = noopRetry{} // TransportCacheEntries is the metric that tracks the number of entries in the // internal transport cache. TransportCacheEntries TransportCacheMetric = noopTransportCache{} // TransportCreateCalls is the metric that counts the number of times a new transport // is created TransportCreateCalls TransportCreateCallsMetric = noopTransportCreateCalls{} ) // RegisterOpts contains all the metrics to register. Metrics may be nil. type RegisterOpts struct { ClientCertExpiry ExpiryMetric ClientCertRotationAge DurationMetric RequestLatency LatencyMetric ResolverLatency ResolverLatencyMetric RequestSize SizeMetric ResponseSize SizeMetric RateLimiterLatency LatencyMetric RequestResult ResultMetric ExecPluginCalls CallsMetric RequestRetry RetryMetric TransportCacheEntries TransportCacheMetric TransportCreateCalls TransportCreateCallsMetric } // Register registers metrics for the rest client to use. This can // only be called once. func Register(opts RegisterOpts) { registerMetrics.Do(func() { if opts.ClientCertExpiry != nil { ClientCertExpiry = opts.ClientCertExpiry } if opts.ClientCertRotationAge != nil { ClientCertRotationAge = opts.ClientCertRotationAge } if opts.RequestLatency != nil { RequestLatency = opts.RequestLatency } if opts.ResolverLatency != nil { ResolverLatency = opts.ResolverLatency } if opts.RequestSize != nil { RequestSize = opts.RequestSize } if opts.ResponseSize != nil { ResponseSize = opts.ResponseSize } if opts.RateLimiterLatency != nil { RateLimiterLatency = opts.RateLimiterLatency } if opts.RequestResult != nil { RequestResult = opts.RequestResult } if opts.ExecPluginCalls != nil { ExecPluginCalls = opts.ExecPluginCalls } if opts.RequestRetry != nil { RequestRetry = opts.RequestRetry } if opts.TransportCacheEntries != nil { TransportCacheEntries = opts.TransportCacheEntries } if opts.TransportCreateCalls != nil { TransportCreateCalls = opts.TransportCreateCalls } }) } type noopDuration struct{} func (noopDuration) Observe(time.Duration) {} type noopExpiry struct{} func (noopExpiry) Set(*time.Time) {} type noopLatency struct{} func (noopLatency) Observe(context.Context, string, url.URL, time.Duration) {} type noopResolverLatency struct{} func (n noopResolverLatency) Observe(ctx context.Context, host string, latency time.Duration) { } type noopSize struct{} func (noopSize) Observe(context.Context, string, string, float64) {} type noopResult struct{} func (noopResult) Increment(context.Context, string, string, string) {} type noopCalls struct{} func (noopCalls) Increment(int, string) {} type noopRetry struct{} func (noopRetry) IncrementRetry(context.Context, string, string, string) {} type noopTransportCache struct{} func (noopTransportCache) Observe(int) {} type noopTransportCreateCalls struct{} func (noopTransportCreateCalls) Increment(string) {} kubernetes-client-go-a2dfcab/tools/pager/000077500000000000000000000000001472614177300206365ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/pager/pager.go000066400000000000000000000260571472614177300222750ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pager import ( "context" "fmt" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) const defaultPageSize = 500 const defaultPageBufferSize = 10 // ListPageFunc returns a list object for the given list options. type ListPageFunc func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) // SimplePageFunc adapts a context-less list function into one that accepts a context. func SimplePageFunc(fn func(opts metav1.ListOptions) (runtime.Object, error)) ListPageFunc { return func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) { return fn(opts) } } // ListPager assists client code in breaking large list queries into multiple // smaller chunks of PageSize or smaller. PageFn is expected to accept a // metav1.ListOptions that supports paging and return a list. The pager does // not alter the field or label selectors on the initial options list. type ListPager struct { PageSize int64 PageFn ListPageFunc FullListIfExpired bool // Number of pages to buffer PageBufferSize int32 } // New creates a new pager from the provided pager function using the default // options. It will fall back to a full list if an expiration error is encountered // as a last resort. func New(fn ListPageFunc) *ListPager { return &ListPager{ PageSize: defaultPageSize, PageFn: fn, FullListIfExpired: true, PageBufferSize: defaultPageBufferSize, } } // TODO: introduce other types of paging functions - such as those that retrieve from a list // of namespaces. // List returns a single list object, but attempts to retrieve smaller chunks from the // server to reduce the impact on the server. If the chunk attempt fails, it will load // the full list instead. The Limit field on options, if unset, will default to the page size. // // If items in the returned list are retained for different durations, and you want to avoid // retaining the whole slice returned by p.PageFn as long as any item is referenced, // use ListWithAlloc instead. func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runtime.Object, bool, error) { return p.list(ctx, options, false) } // ListWithAlloc works like List, but avoids retaining references to the items slice returned by p.PageFn. // It does this by making a shallow copy of non-pointer items in the slice returned by p.PageFn. // // If the items in the returned list are not retained, or are retained for the same duration, use List instead for memory efficiency. func (p *ListPager) ListWithAlloc(ctx context.Context, options metav1.ListOptions) (runtime.Object, bool, error) { return p.list(ctx, options, true) } func (p *ListPager) list(ctx context.Context, options metav1.ListOptions, allocNew bool) (runtime.Object, bool, error) { if options.Limit == 0 { options.Limit = p.PageSize } requestedResourceVersion := options.ResourceVersion requestedResourceVersionMatch := options.ResourceVersionMatch var list *metainternalversion.List paginatedResult := false for { select { case <-ctx.Done(): return nil, paginatedResult, ctx.Err() default: } obj, err := p.PageFn(ctx, options) if err != nil { // Only fallback to full list if an "Expired" errors is returned, FullListIfExpired is true, and // the "Expired" error occurred in page 2 or later (since full list is intended to prevent a pager.List from // failing when the resource versions is established by the first page request falls out of the compaction // during the subsequent list requests). if !errors.IsResourceExpired(err) || !p.FullListIfExpired || options.Continue == "" { return nil, paginatedResult, err } // the list expired while we were processing, fall back to a full list at // the requested ResourceVersion. options.Limit = 0 options.Continue = "" options.ResourceVersion = requestedResourceVersion options.ResourceVersionMatch = requestedResourceVersionMatch result, err := p.PageFn(ctx, options) return result, paginatedResult, err } m, err := meta.ListAccessor(obj) if err != nil { return nil, paginatedResult, fmt.Errorf("returned object must be a list: %v", err) } // exit early and return the object we got if we haven't processed any pages if len(m.GetContinue()) == 0 && list == nil { return obj, paginatedResult, nil } // initialize the list and fill its contents if list == nil { list = &metainternalversion.List{Items: make([]runtime.Object, 0, options.Limit+1)} list.ResourceVersion = m.GetResourceVersion() list.SelfLink = m.GetSelfLink() } eachListItemFunc := meta.EachListItem if allocNew { eachListItemFunc = meta.EachListItemWithAlloc } if err := eachListItemFunc(obj, func(obj runtime.Object) error { list.Items = append(list.Items, obj) return nil }); err != nil { return nil, paginatedResult, err } // if we have no more items, return the list if len(m.GetContinue()) == 0 { return list, paginatedResult, nil } // set the next loop up options.Continue = m.GetContinue() // Clear the ResourceVersion(Match) on the subsequent List calls to avoid the // `specifying resource version is not allowed when using continue` error. // See https://github.com/kubernetes/kubernetes/issues/85221#issuecomment-553748143. options.ResourceVersion = "" options.ResourceVersionMatch = "" // At this point, result is already paginated. paginatedResult = true } } // EachListItem fetches runtime.Object items using this ListPager and invokes fn on each item. If // fn returns an error, processing stops and that error is returned. If fn does not return an error, // any error encountered while retrieving the list from the server is returned. If the context // cancels or times out, the context error is returned. Since the list is retrieved in paginated // chunks, an "Expired" error (metav1.StatusReasonExpired) may be returned if the pagination list // requests exceed the expiration limit of the apiserver being called. // // Items are retrieved in chunks from the server to reduce the impact on the server with up to // ListPager.PageBufferSize chunks buffered concurrently in the background. // // If items passed to fn are retained for different durations, and you want to avoid // retaining the whole slice returned by p.PageFn as long as any item is referenced, // use EachListItemWithAlloc instead. func (p *ListPager) EachListItem(ctx context.Context, options metav1.ListOptions, fn func(obj runtime.Object) error) error { return p.eachListChunkBuffered(ctx, options, func(obj runtime.Object) error { return meta.EachListItem(obj, fn) }) } // EachListItemWithAlloc works like EachListItem, but avoids retaining references to the items slice returned by p.PageFn. // It does this by making a shallow copy of non-pointer items in the slice returned by p.PageFn. // // If the items passed to fn are not retained, or are retained for the same duration, use EachListItem instead for memory efficiency. func (p *ListPager) EachListItemWithAlloc(ctx context.Context, options metav1.ListOptions, fn func(obj runtime.Object) error) error { return p.eachListChunkBuffered(ctx, options, func(obj runtime.Object) error { return meta.EachListItemWithAlloc(obj, fn) }) } // eachListChunkBuffered fetches runtimeObject list chunks using this ListPager and invokes fn on // each list chunk. If fn returns an error, processing stops and that error is returned. If fn does // not return an error, any error encountered while retrieving the list from the server is // returned. If the context cancels or times out, the context error is returned. Since the list is // retrieved in paginated chunks, an "Expired" error (metav1.StatusReasonExpired) may be returned if // the pagination list requests exceed the expiration limit of the apiserver being called. // // Up to ListPager.PageBufferSize chunks are buffered concurrently in the background. func (p *ListPager) eachListChunkBuffered(ctx context.Context, options metav1.ListOptions, fn func(obj runtime.Object) error) error { if p.PageBufferSize < 0 { return fmt.Errorf("ListPager.PageBufferSize must be >= 0, got %d", p.PageBufferSize) } // Ensure background goroutine is stopped if this call exits before all list items are // processed. Cancelation error from this deferred cancel call is never returned to caller; // either the list result has already been sent to bgResultC or the fn error is returned and // the cancelation error is discarded. ctx, cancel := context.WithCancel(ctx) defer cancel() chunkC := make(chan runtime.Object, p.PageBufferSize) bgResultC := make(chan error, 1) go func() { defer utilruntime.HandleCrash() var err error defer func() { close(chunkC) bgResultC <- err }() err = p.eachListChunk(ctx, options, func(chunk runtime.Object) error { select { case chunkC <- chunk: // buffer the chunk, this can block case <-ctx.Done(): return ctx.Err() } return nil }) }() for o := range chunkC { select { case <-ctx.Done(): return ctx.Err() default: } err := fn(o) if err != nil { return err // any fn error should be returned immediately } } // promote the results of our background goroutine to the foreground return <-bgResultC } // eachListChunk fetches runtimeObject list chunks using this ListPager and invokes fn on each list // chunk. If fn returns an error, processing stops and that error is returned. If fn does not return // an error, any error encountered while retrieving the list from the server is returned. If the // context cancels or times out, the context error is returned. Since the list is retrieved in // paginated chunks, an "Expired" error (metav1.StatusReasonExpired) may be returned if the // pagination list requests exceed the expiration limit of the apiserver being called. func (p *ListPager) eachListChunk(ctx context.Context, options metav1.ListOptions, fn func(obj runtime.Object) error) error { if options.Limit == 0 { options.Limit = p.PageSize } for { select { case <-ctx.Done(): return ctx.Err() default: } obj, err := p.PageFn(ctx, options) if err != nil { return err } m, err := meta.ListAccessor(obj) if err != nil { return fmt.Errorf("returned object must be a list: %v", err) } if err := fn(obj); err != nil { return err } // if we have no more items, return. if len(m.GetContinue()) == 0 { return nil } // set the next loop up options.Continue = m.GetContinue() } } kubernetes-client-go-a2dfcab/tools/pager/pager_test.go000066400000000000000000000337141472614177300233320ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package pager import ( "context" "fmt" "reflect" "testing" "time" "k8s.io/apimachinery/pkg/api/errors" metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" ) func list(count int, rv string) *metainternalversion.List { var list metainternalversion.List for i := 0; i < count; i++ { list.Items = append(list.Items, &metav1beta1.PartialObjectMetadata{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%d", i), }, }) } list.ResourceVersion = rv return &list } type testPager struct { t *testing.T rv string index int remaining int last int continuing bool done bool expectPage int64 } func (p *testPager) reset() { p.continuing = false p.remaining += p.index p.index = 0 p.last = 0 p.done = false } func (p *testPager) PagedList(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { if p.done { p.t.Errorf("did not expect additional call to paged list") return nil, fmt.Errorf("unexpected list call") } expectedContinue := fmt.Sprintf("%s:%d", p.rv, p.last) if options.Limit != p.expectPage || (p.continuing && options.Continue != expectedContinue) { p.t.Errorf("invariant violated, expected limit %d and continue %s, got %#v", p.expectPage, expectedContinue, options) return nil, fmt.Errorf("invariant violated") } if options.Continue != "" && options.ResourceVersion != "" { p.t.Errorf("invariant violated, specifying resource version (%s) is not allowed when using continue (%s).", options.ResourceVersion, options.Continue) return nil, fmt.Errorf("invariant violated") } if options.Continue != "" && options.ResourceVersionMatch != "" { p.t.Errorf("invariant violated, specifying resource version match type (%s) is not allowed when using continue (%s).", options.ResourceVersionMatch, options.Continue) return nil, fmt.Errorf("invariant violated") } var list metainternalversion.List total := options.Limit if total == 0 { total = int64(p.remaining) } for i := int64(0); i < total; i++ { if p.remaining <= 0 { break } list.Items = append(list.Items, &metav1beta1.PartialObjectMetadata{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%d", p.index), }, }) p.remaining-- p.index++ } p.last = p.index if p.remaining > 0 { list.Continue = fmt.Sprintf("%s:%d", p.rv, p.last) p.continuing = true } else { p.done = true } list.ResourceVersion = p.rv return &list, nil } func (p *testPager) ExpiresOnSecondPage(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { if p.continuing { p.done = true return nil, errors.NewResourceExpired("this list has expired") } return p.PagedList(ctx, options) } func (p *testPager) ExpiresOnSecondPageThenFullList(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { if p.continuing { p.reset() p.expectPage = 0 return nil, errors.NewResourceExpired("this list has expired") } return p.PagedList(ctx, options) } func TestListPager_List(t *testing.T) { type fields struct { PageSize int64 PageFn ListPageFunc FullListIfExpired bool } type args struct { ctx context.Context options metav1.ListOptions } tests := []struct { name string fields fields args args want runtime.Object wantPaged bool wantErr bool isExpired bool }{ { name: "empty page", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 0, rv: "rv:20"}).PagedList}, args: args{}, want: list(0, "rv:20"), wantPaged: false, }, { name: "one page", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 9, rv: "rv:20"}).PagedList}, args: args{}, want: list(9, "rv:20"), wantPaged: false, }, { name: "one full page", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 10, rv: "rv:20"}).PagedList}, args: args{}, want: list(10, "rv:20"), wantPaged: false, }, { name: "two pages", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 11, rv: "rv:20"}).PagedList}, args: args{}, want: list(11, "rv:20"), wantPaged: true, }, { name: "three pages", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 21, rv: "rv:20"}).PagedList}, args: args{}, want: list(21, "rv:20"), wantPaged: true, }, { name: "expires on second page", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 21, rv: "rv:20"}).ExpiresOnSecondPage}, args: args{}, wantPaged: true, wantErr: true, isExpired: true, }, { name: "expires on second page and then lists", fields: fields{ FullListIfExpired: true, PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 21, rv: "rv:20"}).ExpiresOnSecondPageThenFullList, }, args: args{}, want: list(21, "rv:20"), wantPaged: true, }, { name: "two pages with resourceVersion", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 11, rv: "rv:20"}).PagedList}, args: args{options: metav1.ListOptions{ResourceVersion: "rv:10"}}, want: list(11, "rv:20"), wantPaged: true, }, { name: "two pages with resourceVersion and resourceVersionMatch", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 11, rv: "rv:20"}).PagedList}, args: args{options: metav1.ListOptions{ResourceVersion: "rv:10", ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan}}, want: list(11, "rv:20"), wantPaged: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { p := &ListPager{ PageSize: tt.fields.PageSize, PageFn: tt.fields.PageFn, FullListIfExpired: tt.fields.FullListIfExpired, } ctx := tt.args.ctx if ctx == nil { ctx = context.Background() } got, paginatedResult, err := p.List(ctx, tt.args.options) if (err != nil) != tt.wantErr { t.Errorf("ListPager.List() error = %v, wantErr %v", err, tt.wantErr) return } if tt.isExpired != errors.IsResourceExpired(err) { t.Errorf("ListPager.List() error = %v, isExpired %v", err, tt.isExpired) return } if tt.wantPaged != paginatedResult { t.Errorf("paginatedResult = %t, want %t", paginatedResult, tt.wantPaged) } if !reflect.DeepEqual(got, tt.want) { t.Errorf("ListPager.List() = %v, want %v", got, tt.want) } }) } } func TestListPager_EachListItem(t *testing.T) { type fields struct { PageSize int64 PageFn ListPageFunc } tests := []struct { name string fields fields want runtime.Object wantErr bool wantPanic bool isExpired bool processorErrorOnItem int processorPanicOnItem int cancelContextOnItem int }{ { name: "empty page", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 0, rv: "rv:20"}).PagedList}, want: list(0, "rv:20"), }, { name: "one page", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 9, rv: "rv:20"}).PagedList}, want: list(9, "rv:20"), }, { name: "one full page", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 10, rv: "rv:20"}).PagedList}, want: list(10, "rv:20"), }, { name: "two pages", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 11, rv: "rv:20"}).PagedList}, want: list(11, "rv:20"), }, { name: "three pages", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 21, rv: "rv:20"}).PagedList}, want: list(21, "rv:20"), }, { name: "expires on second page", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 21, rv: "rv:20"}).ExpiresOnSecondPage}, want: list(10, "rv:20"), // all items on the first page should have been visited wantErr: true, isExpired: true, }, { name: "error processing item", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 51, rv: "rv:20"}).PagedList}, want: list(3, "rv:20"), // all the items <= the one the processor returned an error on should have been visited wantPanic: true, processorPanicOnItem: 3, }, { name: "cancel context while processing", fields: fields{PageSize: 10, PageFn: (&testPager{t: t, expectPage: 10, remaining: 51, rv: "rv:20"}).PagedList}, want: list(10, "rv:20"), // The whole PageSize worth of items got returned. wantErr: true, cancelContextOnItem: 3, }, } processorErr := fmt.Errorf("processor error") for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) p := &ListPager{ PageSize: tt.fields.PageSize, PageFn: tt.fields.PageFn, } var items []runtime.Object fn := func(obj runtime.Object) error { items = append(items, obj) if tt.processorErrorOnItem > 0 && len(items) == tt.processorErrorOnItem { return processorErr } if tt.processorPanicOnItem > 0 && len(items) == tt.processorPanicOnItem { panic(processorErr) } if tt.cancelContextOnItem > 0 && len(items) == tt.cancelContextOnItem { cancel() } return nil } var err error var panic interface{} func() { defer func() { panic = recover() }() err = p.EachListItem(ctx, metav1.ListOptions{}, fn) }() if (panic != nil) && !tt.wantPanic { t.Errorf(".EachListItem() panic = %v, wantPanic %v", panic, tt.wantPanic) return } if (err != nil) != tt.wantErr { t.Errorf("ListPager.EachListItem() error = %v, wantErr %v", err, tt.wantErr) return } if tt.isExpired != errors.IsResourceExpired(err) { t.Errorf("ListPager.EachListItem() error = %v, isExpired %v", err, tt.isExpired) return } if tt.processorErrorOnItem > 0 && err != processorErr { t.Errorf("ListPager.EachListItem() error = %v, processorErrorOnItem %d", err, tt.processorErrorOnItem) return } l := tt.want.(*metainternalversion.List) if !reflect.DeepEqual(items, l.Items) { t.Errorf("ListPager.EachListItem() = %v, want %v", items, l.Items) } }) } } func TestListPager_eachListPageBuffered(t *testing.T) { tests := []struct { name string totalPages int pagesProcessed int wantPageLists int pageBufferSize int32 pageSize int }{ { name: "no buffer, one total page", totalPages: 1, pagesProcessed: 1, wantPageLists: 1, pageBufferSize: 0, }, { name: "no buffer, 1/5 pages processed", totalPages: 5, pagesProcessed: 1, wantPageLists: 2, // 1 received for processing, 1 listed pageBufferSize: 0, }, { name: "no buffer, 2/5 pages processed", totalPages: 5, pagesProcessed: 2, wantPageLists: 3, pageBufferSize: 0, }, { name: "no buffer, 5/5 pages processed", totalPages: 5, pagesProcessed: 5, wantPageLists: 5, pageBufferSize: 0, }, { name: "size 1 buffer, 1/5 pages processed", totalPages: 5, pagesProcessed: 1, wantPageLists: 3, pageBufferSize: 1, }, { name: "size 1 buffer, 5/5 pages processed", totalPages: 5, pagesProcessed: 5, wantPageLists: 5, pageBufferSize: 1, }, { name: "size 10 buffer, 1/5 page processed", totalPages: 5, pagesProcessed: 1, wantPageLists: 5, pageBufferSize: 10, // buffer is larger than list }, } processorErr := fmt.Errorf("processor error") pageSize := 10 for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { pgr := &testPager{t: t, expectPage: int64(pageSize), remaining: tt.totalPages * pageSize, rv: "rv:20"} pageLists := 0 wantedPageListsDone := make(chan struct{}) listFn := func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { pageLists++ if pageLists == tt.wantPageLists { close(wantedPageListsDone) } return pgr.PagedList(ctx, options) } p := &ListPager{ PageSize: int64(pageSize), PageBufferSize: tt.pageBufferSize, PageFn: listFn, } pagesProcessed := 0 fn := func(obj runtime.Object) error { pagesProcessed++ if tt.pagesProcessed == pagesProcessed && tt.wantPageLists > 0 { // wait for buffering to catch up select { case <-time.After(time.Second): return fmt.Errorf("Timed out waiting for %d page lists", tt.wantPageLists) case <-wantedPageListsDone: } return processorErr } return nil } err := p.eachListChunkBuffered(context.Background(), metav1.ListOptions{}, fn) if tt.pagesProcessed > 0 && err == processorErr { // expected } else if err != nil { t.Fatal(err) } if tt.wantPageLists > 0 && pageLists != tt.wantPageLists { t.Errorf("expected %d page lists, got %d", tt.wantPageLists, pageLists) } if pagesProcessed != tt.pagesProcessed { t.Errorf("expected %d pages processed, got %d", tt.pagesProcessed, pagesProcessed) } }) } } kubernetes-client-go-a2dfcab/tools/portforward/000077500000000000000000000000001472614177300221115ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/portforward/OWNERS000066400000000000000000000002131472614177300230450ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - aojea - liggitt - seans3 reviewers: - aojea - liggitt - seans3 kubernetes-client-go-a2dfcab/tools/portforward/doc.go000066400000000000000000000013651472614177300232120ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package portforward adds support for SSH-like port forwarding from the client's // local host to remote containers. package portforward // import "k8s.io/client-go/tools/portforward" kubernetes-client-go-a2dfcab/tools/portforward/fallback_dialer.go000066400000000000000000000041221472614177300255160ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package portforward import ( "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/klog/v2" ) var _ httpstream.Dialer = &FallbackDialer{} // FallbackDialer encapsulates a primary and secondary dialer, including // the boolean function to determine if the primary dialer failed. Implements // the httpstream.Dialer interface. type FallbackDialer struct { primary httpstream.Dialer secondary httpstream.Dialer shouldFallback func(error) bool } // NewFallbackDialer creates the FallbackDialer with the primary and secondary dialers, // as well as the boolean function to determine if the primary dialer failed. func NewFallbackDialer(primary, secondary httpstream.Dialer, shouldFallback func(error) bool) httpstream.Dialer { return &FallbackDialer{ primary: primary, secondary: secondary, shouldFallback: shouldFallback, } } // Dial is the single function necessary to implement the "httpstream.Dialer" interface. // It takes the protocol version strings to request, returning an the upgraded // httstream.Connection and the negotiated protocol version accepted. If the initial // primary dialer fails, this function attempts the secondary dialer. Returns an error // if one occurs. func (f *FallbackDialer) Dial(protocols ...string) (httpstream.Connection, string, error) { conn, version, err := f.primary.Dial(protocols...) if err != nil && f.shouldFallback(err) { klog.V(4).Infof("fallback to secondary dialer from primary dialer err: %v", err) return f.secondary.Dial(protocols...) } return conn, version, err } kubernetes-client-go-a2dfcab/tools/portforward/fallback_dialer_test.go000066400000000000000000000074031472614177300265620ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package portforward import ( "errors" "fmt" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/httpstream" ) func TestFallbackDialer(t *testing.T) { primaryProtocol := "primary.fake.protocol" secondaryProtocol := "secondary.fake.protocol" protocols := []string{primaryProtocol, secondaryProtocol} // If primary dialer error is nil, then no fallback and primary negotiated protocol returned. primary := &fakeDialer{dialed: false, negotiatedProtocol: primaryProtocol} secondary := &fakeDialer{dialed: false, negotiatedProtocol: secondaryProtocol} fallbackDialer := NewFallbackDialer(primary, secondary, notCalled) _, negotiated, err := fallbackDialer.Dial(protocols...) assert.True(t, primary.dialed, "no fallback; primary should have dialed") assert.False(t, secondary.dialed, "no fallback; secondary should *not* have dialed") assert.Equal(t, primaryProtocol, negotiated, "primary negotiated protocol returned") require.NoError(t, err, "error from primary dialer should be nil") // If primary dialer error is upgrade error, then fallback returning secondary dial response. primary = &fakeDialer{dialed: false, negotiatedProtocol: primaryProtocol, err: &httpstream.UpgradeFailureError{}} secondary = &fakeDialer{dialed: false, negotiatedProtocol: secondaryProtocol} fallbackDialer = NewFallbackDialer(primary, secondary, httpstream.IsUpgradeFailure) _, negotiated, err = fallbackDialer.Dial(protocols...) assert.True(t, primary.dialed, "fallback; primary should have dialed") assert.True(t, secondary.dialed, "fallback; secondary should have dialed") assert.Equal(t, secondaryProtocol, negotiated, "negotiated protocol is from secondary dialer") require.NoError(t, err, "error from secondary dialer should be nil") // If primary dialer error is https proxy dialing error, then fallback returning secondary dial response. primary = &fakeDialer{negotiatedProtocol: primaryProtocol, err: errors.New("proxy: unknown scheme: https")} secondary = &fakeDialer{negotiatedProtocol: secondaryProtocol} fallbackDialer = NewFallbackDialer(primary, secondary, func(err error) bool { return httpstream.IsUpgradeFailure(err) || httpstream.IsHTTPSProxyError(err) }) _, negotiated, err = fallbackDialer.Dial(protocols...) assert.True(t, primary.dialed, "fallback; primary should have dialed") assert.True(t, secondary.dialed, "fallback; secondary should have dialed") assert.Equal(t, secondaryProtocol, negotiated, "negotiated protocol is from secondary dialer") require.NoError(t, err, "error from secondary dialer should be nil") // If primary dialer returns non-upgrade error, then primary error is returned. nonUpgradeErr := fmt.Errorf("This is a non-upgrade error") primary = &fakeDialer{dialed: false, err: nonUpgradeErr} secondary = &fakeDialer{dialed: false} fallbackDialer = NewFallbackDialer(primary, secondary, httpstream.IsUpgradeFailure) _, _, err = fallbackDialer.Dial(protocols...) assert.True(t, primary.dialed, "no fallback; primary should have dialed") assert.False(t, secondary.dialed, "no fallback; secondary should *not* have dialed") assert.Equal(t, nonUpgradeErr, err, "error is from primary dialer") } func notCalled(err error) bool { return false } kubernetes-client-go-a2dfcab/tools/portforward/portforward.go000066400000000000000000000326741472614177300250250ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package portforward import ( "errors" "fmt" "io" "net" "net/http" "sort" "strconv" "strings" "sync" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/runtime" netutils "k8s.io/utils/net" ) // PortForwardProtocolV1Name is the subprotocol used for port forwarding. // TODO move to API machinery and re-unify with kubelet/server/portfoward const PortForwardProtocolV1Name = "portforward.k8s.io" var ErrLostConnectionToPod = errors.New("lost connection to pod") // PortForwarder knows how to listen for local connections and forward them to // a remote pod via an upgraded HTTP request. type PortForwarder struct { addresses []listenAddress ports []ForwardedPort stopChan <-chan struct{} dialer httpstream.Dialer streamConn httpstream.Connection listeners []io.Closer Ready chan struct{} requestIDLock sync.Mutex requestID int out io.Writer errOut io.Writer } // ForwardedPort contains a Local:Remote port pairing. type ForwardedPort struct { Local uint16 Remote uint16 } /* valid port specifications: 5000 - forwards from localhost:5000 to pod:5000 8888:5000 - forwards from localhost:8888 to pod:5000 0:5000 :5000 - selects a random available local port, forwards from localhost: to pod:5000 */ func parsePorts(ports []string) ([]ForwardedPort, error) { var forwards []ForwardedPort for _, portString := range ports { parts := strings.Split(portString, ":") var localString, remoteString string if len(parts) == 1 { localString = parts[0] remoteString = parts[0] } else if len(parts) == 2 { localString = parts[0] if localString == "" { // support :5000 localString = "0" } remoteString = parts[1] } else { return nil, fmt.Errorf("invalid port format '%s'", portString) } localPort, err := strconv.ParseUint(localString, 10, 16) if err != nil { return nil, fmt.Errorf("error parsing local port '%s': %s", localString, err) } remotePort, err := strconv.ParseUint(remoteString, 10, 16) if err != nil { return nil, fmt.Errorf("error parsing remote port '%s': %s", remoteString, err) } if remotePort == 0 { return nil, fmt.Errorf("remote port must be > 0") } forwards = append(forwards, ForwardedPort{uint16(localPort), uint16(remotePort)}) } return forwards, nil } type listenAddress struct { address string protocol string failureMode string } func parseAddresses(addressesToParse []string) ([]listenAddress, error) { var addresses []listenAddress parsed := make(map[string]listenAddress) for _, address := range addressesToParse { if address == "localhost" { if _, exists := parsed["127.0.0.1"]; !exists { ip := listenAddress{address: "127.0.0.1", protocol: "tcp4", failureMode: "all"} parsed[ip.address] = ip } if _, exists := parsed["::1"]; !exists { ip := listenAddress{address: "::1", protocol: "tcp6", failureMode: "all"} parsed[ip.address] = ip } } else if netutils.ParseIPSloppy(address).To4() != nil { parsed[address] = listenAddress{address: address, protocol: "tcp4", failureMode: "any"} } else if netutils.ParseIPSloppy(address) != nil { parsed[address] = listenAddress{address: address, protocol: "tcp6", failureMode: "any"} } else { return nil, fmt.Errorf("%s is not a valid IP", address) } } addresses = make([]listenAddress, len(parsed)) id := 0 for _, v := range parsed { addresses[id] = v id++ } // Sort addresses before returning to get a stable order sort.Slice(addresses, func(i, j int) bool { return addresses[i].address < addresses[j].address }) return addresses, nil } // New creates a new PortForwarder with localhost listen addresses. func New(dialer httpstream.Dialer, ports []string, stopChan <-chan struct{}, readyChan chan struct{}, out, errOut io.Writer) (*PortForwarder, error) { return NewOnAddresses(dialer, []string{"localhost"}, ports, stopChan, readyChan, out, errOut) } // NewOnAddresses creates a new PortForwarder with custom listen addresses. func NewOnAddresses(dialer httpstream.Dialer, addresses []string, ports []string, stopChan <-chan struct{}, readyChan chan struct{}, out, errOut io.Writer) (*PortForwarder, error) { if len(addresses) == 0 { return nil, errors.New("you must specify at least 1 address") } parsedAddresses, err := parseAddresses(addresses) if err != nil { return nil, err } if len(ports) == 0 { return nil, errors.New("you must specify at least 1 port") } parsedPorts, err := parsePorts(ports) if err != nil { return nil, err } return &PortForwarder{ dialer: dialer, addresses: parsedAddresses, ports: parsedPorts, stopChan: stopChan, Ready: readyChan, out: out, errOut: errOut, }, nil } // ForwardPorts formats and executes a port forwarding request. The connection will remain // open until stopChan is closed. func (pf *PortForwarder) ForwardPorts() error { defer pf.Close() var err error var protocol string pf.streamConn, protocol, err = pf.dialer.Dial(PortForwardProtocolV1Name) if err != nil { return fmt.Errorf("error upgrading connection: %s", err) } defer pf.streamConn.Close() if protocol != PortForwardProtocolV1Name { return fmt.Errorf("unable to negotiate protocol: client supports %q, server returned %q", PortForwardProtocolV1Name, protocol) } return pf.forward() } // forward dials the remote host specific in req, upgrades the request, starts // listeners for each port specified in ports, and forwards local connections // to the remote host via streams. func (pf *PortForwarder) forward() error { var err error listenSuccess := false for i := range pf.ports { port := &pf.ports[i] err = pf.listenOnPort(port) switch { case err == nil: listenSuccess = true default: if pf.errOut != nil { fmt.Fprintf(pf.errOut, "Unable to listen on port %d: %v\n", port.Local, err) } } } if !listenSuccess { return fmt.Errorf("unable to listen on any of the requested ports: %v", pf.ports) } if pf.Ready != nil { close(pf.Ready) } // wait for interrupt or conn closure select { case <-pf.stopChan: case <-pf.streamConn.CloseChan(): return ErrLostConnectionToPod } return nil } // listenOnPort delegates listener creation and waits for connections on requested bind addresses. // An error is raised based on address groups (default and localhost) and their failure modes func (pf *PortForwarder) listenOnPort(port *ForwardedPort) error { var errors []error failCounters := make(map[string]int, 2) successCounters := make(map[string]int, 2) for _, addr := range pf.addresses { err := pf.listenOnPortAndAddress(port, addr.protocol, addr.address) if err != nil { errors = append(errors, err) failCounters[addr.failureMode]++ } else { successCounters[addr.failureMode]++ } } if successCounters["all"] == 0 && failCounters["all"] > 0 { return fmt.Errorf("%s: %v", "Listeners failed to create with the following errors", errors) } if failCounters["any"] > 0 { return fmt.Errorf("%s: %v", "Listeners failed to create with the following errors", errors) } return nil } // listenOnPortAndAddress delegates listener creation and waits for new connections // in the background f func (pf *PortForwarder) listenOnPortAndAddress(port *ForwardedPort, protocol string, address string) error { listener, err := pf.getListener(protocol, address, port) if err != nil { return err } pf.listeners = append(pf.listeners, listener) go pf.waitForConnection(listener, *port) return nil } // getListener creates a listener on the interface targeted by the given hostname on the given port with // the given protocol. protocol is in net.Listen style which basically admits values like tcp, tcp4, tcp6 func (pf *PortForwarder) getListener(protocol string, hostname string, port *ForwardedPort) (net.Listener, error) { listener, err := net.Listen(protocol, net.JoinHostPort(hostname, strconv.Itoa(int(port.Local)))) if err != nil { return nil, fmt.Errorf("unable to create listener: Error %s", err) } listenerAddress := listener.Addr().String() host, localPort, _ := net.SplitHostPort(listenerAddress) localPortUInt, err := strconv.ParseUint(localPort, 10, 16) if err != nil { fmt.Fprintf(pf.out, "Failed to forward from %s:%d -> %d\n", hostname, localPortUInt, port.Remote) return nil, fmt.Errorf("error parsing local port: %s from %s (%s)", err, listenerAddress, host) } port.Local = uint16(localPortUInt) if pf.out != nil { fmt.Fprintf(pf.out, "Forwarding from %s -> %d\n", net.JoinHostPort(hostname, strconv.Itoa(int(localPortUInt))), port.Remote) } return listener, nil } // waitForConnection waits for new connections to listener and handles them in // the background. func (pf *PortForwarder) waitForConnection(listener net.Listener, port ForwardedPort) { for { select { case <-pf.streamConn.CloseChan(): return default: conn, err := listener.Accept() if err != nil { // TODO consider using something like https://github.com/hydrogen18/stoppableListener? if !strings.Contains(strings.ToLower(err.Error()), "use of closed network connection") { runtime.HandleError(fmt.Errorf("error accepting connection on port %d: %v", port.Local, err)) } return } go pf.handleConnection(conn, port) } } } func (pf *PortForwarder) nextRequestID() int { pf.requestIDLock.Lock() defer pf.requestIDLock.Unlock() id := pf.requestID pf.requestID++ return id } // handleConnection copies data between the local connection and the stream to // the remote server. func (pf *PortForwarder) handleConnection(conn net.Conn, port ForwardedPort) { defer conn.Close() if pf.out != nil { fmt.Fprintf(pf.out, "Handling connection for %d\n", port.Local) } requestID := pf.nextRequestID() // create error stream headers := http.Header{} headers.Set(v1.StreamType, v1.StreamTypeError) headers.Set(v1.PortHeader, fmt.Sprintf("%d", port.Remote)) headers.Set(v1.PortForwardRequestIDHeader, strconv.Itoa(requestID)) errorStream, err := pf.streamConn.CreateStream(headers) if err != nil { runtime.HandleError(fmt.Errorf("error creating error stream for port %d -> %d: %v", port.Local, port.Remote, err)) return } // we're not writing to this stream errorStream.Close() defer pf.streamConn.RemoveStreams(errorStream) errorChan := make(chan error) go func() { message, err := io.ReadAll(errorStream) switch { case err != nil: errorChan <- fmt.Errorf("error reading from error stream for port %d -> %d: %v", port.Local, port.Remote, err) case len(message) > 0: errorChan <- fmt.Errorf("an error occurred forwarding %d -> %d: %v", port.Local, port.Remote, string(message)) } close(errorChan) }() // create data stream headers.Set(v1.StreamType, v1.StreamTypeData) dataStream, err := pf.streamConn.CreateStream(headers) if err != nil { runtime.HandleError(fmt.Errorf("error creating forwarding stream for port %d -> %d: %v", port.Local, port.Remote, err)) return } defer pf.streamConn.RemoveStreams(dataStream) localError := make(chan struct{}) remoteDone := make(chan struct{}) go func() { // Copy from the remote side to the local port. if _, err := io.Copy(conn, dataStream); err != nil && !strings.Contains(err.Error(), "use of closed network connection") { runtime.HandleError(fmt.Errorf("error copying from remote stream to local connection: %v", err)) } // inform the select below that the remote copy is done close(remoteDone) }() go func() { // inform server we're not sending any more data after copy unblocks defer dataStream.Close() // Copy from the local port to the remote side. if _, err := io.Copy(dataStream, conn); err != nil && !strings.Contains(err.Error(), "use of closed network connection") { runtime.HandleError(fmt.Errorf("error copying from local connection to remote stream: %v", err)) // break out of the select below without waiting for the other copy to finish close(localError) } }() // wait for either a local->remote error or for copying from remote->local to finish select { case <-remoteDone: case <-localError: } // always expect something on errorChan (it may be nil) err = <-errorChan if err != nil { runtime.HandleError(err) pf.streamConn.Close() } } // Close stops all listeners of PortForwarder. func (pf *PortForwarder) Close() { // stop all listeners for _, l := range pf.listeners { if err := l.Close(); err != nil { runtime.HandleError(fmt.Errorf("error closing listener: %v", err)) } } } // GetPorts will return the ports that were forwarded; this can be used to // retrieve the locally-bound port in cases where the input was port 0. This // function will signal an error if the Ready channel is nil or if the // listeners are not ready yet; this function will succeed after the Ready // channel has been closed. func (pf *PortForwarder) GetPorts() ([]ForwardedPort, error) { if pf.Ready == nil { return nil, fmt.Errorf("no Ready channel provided") } select { case <-pf.Ready: return pf.ports, nil default: return nil, fmt.Errorf("listeners not ready") } } kubernetes-client-go-a2dfcab/tools/portforward/portforward_test.go000066400000000000000000000464121472614177300260570ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package portforward import ( "bytes" "fmt" "net" "net/http" "os" "reflect" "sort" "strings" "testing" "time" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/httpstream" ) type fakeDialer struct { dialed bool conn httpstream.Connection err error negotiatedProtocol string } func (d *fakeDialer) Dial(protocols ...string) (httpstream.Connection, string, error) { d.dialed = true return d.conn, d.negotiatedProtocol, d.err } type fakeConnection struct { closed bool closeChan chan bool dataStream *fakeStream errorStream *fakeStream streamCount int } func newFakeConnection() *fakeConnection { return &fakeConnection{ closeChan: make(chan bool), dataStream: &fakeStream{}, errorStream: &fakeStream{}, } } func (c *fakeConnection) CreateStream(headers http.Header) (httpstream.Stream, error) { switch headers.Get(v1.StreamType) { case v1.StreamTypeData: c.streamCount++ return c.dataStream, nil case v1.StreamTypeError: c.streamCount++ return c.errorStream, nil default: return nil, fmt.Errorf("fakeStream creation not supported for stream type %s", headers.Get(v1.StreamType)) } } func (c *fakeConnection) Close() error { if !c.closed { c.closed = true close(c.closeChan) } return nil } func (c *fakeConnection) CloseChan() <-chan bool { return c.closeChan } func (c *fakeConnection) RemoveStreams(streams ...httpstream.Stream) { for range streams { c.streamCount-- } } func (c *fakeConnection) SetIdleTimeout(timeout time.Duration) { // no-op } type fakeListener struct { net.Listener closeChan chan bool } func newFakeListener() fakeListener { return fakeListener{ closeChan: make(chan bool), } } func (l *fakeListener) Accept() (net.Conn, error) { select { case <-l.closeChan: return nil, fmt.Errorf("listener closed") } } func (l *fakeListener) Close() error { close(l.closeChan) return nil } func (l *fakeListener) Addr() net.Addr { return fakeAddr{} } type fakeAddr struct{} func (fakeAddr) Network() string { return "fake" } func (fakeAddr) String() string { return "fake" } type fakeStream struct { headers http.Header readFunc func(p []byte) (int, error) writeFunc func(p []byte) (int, error) } func (s *fakeStream) Read(p []byte) (n int, err error) { return s.readFunc(p) } func (s *fakeStream) Write(p []byte) (n int, err error) { return s.writeFunc(p) } func (*fakeStream) Close() error { return nil } func (*fakeStream) Reset() error { return nil } func (s *fakeStream) Headers() http.Header { return s.headers } func (*fakeStream) Identifier() uint32 { return 0 } type fakeConn struct { sendBuffer *bytes.Buffer receiveBuffer *bytes.Buffer } func (f fakeConn) Read(p []byte) (int, error) { return f.sendBuffer.Read(p) } func (f fakeConn) Write(p []byte) (int, error) { return f.receiveBuffer.Write(p) } func (fakeConn) Close() error { return nil } func (fakeConn) LocalAddr() net.Addr { return nil } func (fakeConn) RemoteAddr() net.Addr { return nil } func (fakeConn) SetDeadline(t time.Time) error { return nil } func (fakeConn) SetReadDeadline(t time.Time) error { return nil } func (fakeConn) SetWriteDeadline(t time.Time) error { return nil } func TestParsePortsAndNew(t *testing.T) { tests := []struct { input []string addresses []string expectedPorts []ForwardedPort expectedAddresses []listenAddress expectPortParseError bool expectAddressParseError bool expectNewError bool }{ {input: []string{}, expectNewError: true}, {input: []string{"a"}, expectPortParseError: true, expectAddressParseError: false, expectNewError: true}, {input: []string{":a"}, expectPortParseError: true, expectAddressParseError: false, expectNewError: true}, {input: []string{"-1"}, expectPortParseError: true, expectAddressParseError: false, expectNewError: true}, {input: []string{"65536"}, expectPortParseError: true, expectAddressParseError: false, expectNewError: true}, {input: []string{"0"}, expectPortParseError: true, expectAddressParseError: false, expectNewError: true}, {input: []string{"0:0"}, expectPortParseError: true, expectAddressParseError: false, expectNewError: true}, {input: []string{"a:5000"}, expectPortParseError: true, expectAddressParseError: false, expectNewError: true}, {input: []string{"5000:a"}, expectPortParseError: true, expectAddressParseError: false, expectNewError: true}, {input: []string{"5000:5000"}, addresses: []string{"127.0.0.257"}, expectPortParseError: false, expectAddressParseError: true, expectNewError: true}, {input: []string{"5000:5000"}, addresses: []string{"::g"}, expectPortParseError: false, expectAddressParseError: true, expectNewError: true}, {input: []string{"5000:5000"}, addresses: []string{"domain.invalid"}, expectPortParseError: false, expectAddressParseError: true, expectNewError: true}, { input: []string{"5000:5000"}, addresses: []string{"localhost"}, expectedPorts: []ForwardedPort{ {5000, 5000}, }, expectedAddresses: []listenAddress{ {protocol: "tcp4", address: "127.0.0.1", failureMode: "all"}, {protocol: "tcp6", address: "::1", failureMode: "all"}, }, }, { input: []string{"5000:5000"}, addresses: []string{"localhost", "127.0.0.1"}, expectedPorts: []ForwardedPort{ {5000, 5000}, }, expectedAddresses: []listenAddress{ {protocol: "tcp4", address: "127.0.0.1", failureMode: "any"}, {protocol: "tcp6", address: "::1", failureMode: "all"}, }, }, { input: []string{"5000:5000"}, addresses: []string{"localhost", "::1"}, expectedPorts: []ForwardedPort{ {5000, 5000}, }, expectedAddresses: []listenAddress{ {protocol: "tcp4", address: "127.0.0.1", failureMode: "all"}, {protocol: "tcp6", address: "::1", failureMode: "any"}, }, }, { input: []string{"5000:5000"}, addresses: []string{"localhost", "127.0.0.1", "::1"}, expectedPorts: []ForwardedPort{ {5000, 5000}, }, expectedAddresses: []listenAddress{ {protocol: "tcp4", address: "127.0.0.1", failureMode: "any"}, {protocol: "tcp6", address: "::1", failureMode: "any"}, }, }, { input: []string{"5000:5000"}, addresses: []string{"localhost", "127.0.0.1", "10.10.10.1"}, expectedPorts: []ForwardedPort{ {5000, 5000}, }, expectedAddresses: []listenAddress{ {protocol: "tcp4", address: "127.0.0.1", failureMode: "any"}, {protocol: "tcp6", address: "::1", failureMode: "all"}, {protocol: "tcp4", address: "10.10.10.1", failureMode: "any"}, }, }, { input: []string{"5000:5000"}, addresses: []string{"127.0.0.1", "::1", "localhost"}, expectedPorts: []ForwardedPort{ {5000, 5000}, }, expectedAddresses: []listenAddress{ {protocol: "tcp4", address: "127.0.0.1", failureMode: "any"}, {protocol: "tcp6", address: "::1", failureMode: "any"}, }, }, { input: []string{"5000:5000"}, addresses: []string{"10.0.0.1", "127.0.0.1"}, expectedPorts: []ForwardedPort{ {5000, 5000}, }, expectedAddresses: []listenAddress{ {protocol: "tcp4", address: "10.0.0.1", failureMode: "any"}, {protocol: "tcp4", address: "127.0.0.1", failureMode: "any"}, }, }, { input: []string{"5000", "5000:5000", "8888:5000", "5000:8888", ":5000", "0:5000"}, addresses: []string{"127.0.0.1", "::1"}, expectedPorts: []ForwardedPort{ {5000, 5000}, {5000, 5000}, {8888, 5000}, {5000, 8888}, {0, 5000}, {0, 5000}, }, expectedAddresses: []listenAddress{ {protocol: "tcp4", address: "127.0.0.1", failureMode: "any"}, {protocol: "tcp6", address: "::1", failureMode: "any"}, }, }, } for i, test := range tests { parsedPorts, err := parsePorts(test.input) haveError := err != nil if e, a := test.expectPortParseError, haveError; e != a { t.Fatalf("%d: parsePorts: error expected=%t, got %t: %s", i, e, a, err) } // default to localhost if len(test.addresses) == 0 && len(test.expectedAddresses) == 0 { test.addresses = []string{"localhost"} test.expectedAddresses = []listenAddress{{protocol: "tcp4", address: "127.0.0.1"}, {protocol: "tcp6", address: "::1"}} } // assert address parser parsedAddresses, err := parseAddresses(test.addresses) haveError = err != nil if e, a := test.expectAddressParseError, haveError; e != a { t.Fatalf("%d: parseAddresses: error expected=%t, got %t: %s", i, e, a, err) } dialer := &fakeDialer{} expectedStopChan := make(chan struct{}) readyChan := make(chan struct{}) var pf *PortForwarder if len(test.addresses) > 0 { pf, err = NewOnAddresses(dialer, test.addresses, test.input, expectedStopChan, readyChan, os.Stdout, os.Stderr) } else { pf, err = New(dialer, test.input, expectedStopChan, readyChan, os.Stdout, os.Stderr) } haveError = err != nil if e, a := test.expectNewError, haveError; e != a { t.Fatalf("%d: New: error expected=%t, got %t: %s", i, e, a, err) } if test.expectPortParseError || test.expectAddressParseError || test.expectNewError { continue } sort.Slice(test.expectedAddresses, func(i, j int) bool { return test.expectedAddresses[i].address < test.expectedAddresses[j].address }) sort.Slice(parsedAddresses, func(i, j int) bool { return parsedAddresses[i].address < parsedAddresses[j].address }) if !reflect.DeepEqual(test.expectedAddresses, parsedAddresses) { t.Fatalf("%d: expectedAddresses: %v, got: %v", i, test.expectedAddresses, parsedAddresses) } for pi, expectedPort := range test.expectedPorts { if e, a := expectedPort.Local, parsedPorts[pi].Local; e != a { t.Fatalf("%d: local expected: %d, got: %d", i, e, a) } if e, a := expectedPort.Remote, parsedPorts[pi].Remote; e != a { t.Fatalf("%d: remote expected: %d, got: %d", i, e, a) } } if dialer.dialed { t.Fatalf("%d: expected not dialed", i) } if _, portErr := pf.GetPorts(); portErr == nil { t.Fatalf("%d: GetPorts: error expected but got nil", i) } // mock-signal the Ready channel close(readyChan) if ports, portErr := pf.GetPorts(); portErr != nil { t.Fatalf("%d: GetPorts: unable to retrieve ports: %s", i, portErr) } else if !reflect.DeepEqual(test.expectedPorts, ports) { t.Fatalf("%d: ports: expected %#v, got %#v", i, test.expectedPorts, ports) } if e, a := expectedStopChan, pf.stopChan; e != a { t.Fatalf("%d: stopChan: expected %#v, got %#v", i, e, a) } if pf.Ready == nil { t.Fatalf("%d: Ready should be non-nil", i) } } } type GetListenerTestCase struct { Hostname string Protocol string ShouldRaiseError bool ExpectedListenerAddress string } func TestGetListener(t *testing.T) { var pf PortForwarder testCases := []GetListenerTestCase{ { Hostname: "localhost", Protocol: "tcp4", ShouldRaiseError: false, ExpectedListenerAddress: "127.0.0.1", }, { Hostname: "127.0.0.1", Protocol: "tcp4", ShouldRaiseError: false, ExpectedListenerAddress: "127.0.0.1", }, { Hostname: "::1", Protocol: "tcp6", ShouldRaiseError: false, ExpectedListenerAddress: "::1", }, { Hostname: "::1", Protocol: "tcp4", ShouldRaiseError: true, }, { Hostname: "127.0.0.1", Protocol: "tcp6", ShouldRaiseError: true, }, } for i, testCase := range testCases { forwardedPort := &ForwardedPort{Local: 0, Remote: 12345} listener, err := pf.getListener(testCase.Protocol, testCase.Hostname, forwardedPort) if err != nil && strings.Contains(err.Error(), "cannot assign requested address") { t.Logf("Can't test #%d: %v", i, err) continue } expectedListenerPort := fmt.Sprintf("%d", forwardedPort.Local) errorRaised := err != nil if testCase.ShouldRaiseError != errorRaised { t.Errorf("Test case #%d failed: Data %v an error has been raised(%t) where it should not (or reciprocally): %v", i, testCase, testCase.ShouldRaiseError, err) continue } if errorRaised { continue } if listener == nil { t.Errorf("Test case #%d did not raise an error but failed in initializing listener", i) continue } host, port, _ := net.SplitHostPort(listener.Addr().String()) t.Logf("Asked a %s forward for: %s:0, got listener %s:%s, expected: %s", testCase.Protocol, testCase.Hostname, host, port, expectedListenerPort) if host != testCase.ExpectedListenerAddress { t.Errorf("Test case #%d failed: Listener does not listen on expected address: asked '%v' got '%v'", i, testCase.ExpectedListenerAddress, host) } if port != expectedListenerPort { t.Errorf("Test case #%d failed: Listener does not listen on expected port: asked %v got %v", i, expectedListenerPort, port) } listener.Close() } } func TestGetPortsReturnsDynamicallyAssignedLocalPort(t *testing.T) { dialer := &fakeDialer{ conn: newFakeConnection(), negotiatedProtocol: PortForwardProtocolV1Name, } stopChan := make(chan struct{}) readyChan := make(chan struct{}) errChan := make(chan error) defer func() { close(stopChan) forwardErr := <-errChan if forwardErr != nil { t.Fatalf("ForwardPorts returned error: %s", forwardErr) } }() pf, err := New(dialer, []string{":5000"}, stopChan, readyChan, os.Stdout, os.Stderr) if err != nil { t.Fatalf("error while calling New: %s", err) } go func() { errChan <- pf.ForwardPorts() close(errChan) }() <-pf.Ready ports, err := pf.GetPorts() if err != nil { t.Fatalf("Failed to get ports. error: %v", err) } if len(ports) != 1 { t.Fatalf("expected 1 port, got %d", len(ports)) } port := ports[0] if port.Local == 0 { t.Fatalf("local port is 0, expected != 0") } } func TestHandleConnection(t *testing.T) { out := bytes.NewBufferString("") pf, err := New(&fakeDialer{}, []string{":2222"}, nil, nil, out, nil) if err != nil { t.Fatalf("error while calling New: %s", err) } // Setup fake local connection localConnection := &fakeConn{ sendBuffer: bytes.NewBufferString("test data from local"), receiveBuffer: bytes.NewBufferString(""), } // Setup fake remote connection to send data on the data stream after it receives data from the local connection remoteDataToSend := bytes.NewBufferString("test data from remote") remoteDataReceived := bytes.NewBufferString("") remoteErrorToSend := bytes.NewBufferString("") blockRemoteSend := make(chan struct{}) remoteConnection := newFakeConnection() remoteConnection.dataStream.readFunc = func(p []byte) (int, error) { <-blockRemoteSend // Wait for the expected data to be received before responding return remoteDataToSend.Read(p) } remoteConnection.dataStream.writeFunc = func(p []byte) (int, error) { n, err := remoteDataReceived.Write(p) if remoteDataReceived.String() == "test data from local" { close(blockRemoteSend) } return n, err } remoteConnection.errorStream.readFunc = remoteErrorToSend.Read pf.streamConn = remoteConnection // Test handleConnection pf.handleConnection(localConnection, ForwardedPort{Local: 1111, Remote: 2222}) assert.Equal(t, 0, remoteConnection.streamCount, "stream count should be zero") assert.Equal(t, "test data from local", remoteDataReceived.String()) assert.Equal(t, "test data from remote", localConnection.receiveBuffer.String()) assert.Equal(t, "Handling connection for 1111\n", out.String()) } func TestHandleConnectionSendsRemoteError(t *testing.T) { out := bytes.NewBufferString("") errOut := bytes.NewBufferString("") pf, err := New(&fakeDialer{}, []string{":2222"}, nil, nil, out, errOut) if err != nil { t.Fatalf("error while calling New: %s", err) } // Setup fake local connection localConnection := &fakeConn{ sendBuffer: bytes.NewBufferString(""), receiveBuffer: bytes.NewBufferString(""), } // Setup fake remote connection to return an error message on the error stream remoteDataToSend := bytes.NewBufferString("") remoteDataReceived := bytes.NewBufferString("") remoteErrorToSend := bytes.NewBufferString("error") remoteConnection := newFakeConnection() remoteConnection.dataStream.readFunc = remoteDataToSend.Read remoteConnection.dataStream.writeFunc = remoteDataReceived.Write remoteConnection.errorStream.readFunc = remoteErrorToSend.Read pf.streamConn = remoteConnection // Test handleConnection, using go-routine because it needs to be able to write to unbuffered pf.errorChan pf.handleConnection(localConnection, ForwardedPort{Local: 1111, Remote: 2222}) assert.Equal(t, 0, remoteConnection.streamCount, "stream count should be zero") assert.Equal(t, "", remoteDataReceived.String()) assert.Equal(t, "", localConnection.receiveBuffer.String()) assert.Equal(t, "Handling connection for 1111\n", out.String()) } func TestWaitForConnectionExitsOnStreamConnClosed(t *testing.T) { out := bytes.NewBufferString("") errOut := bytes.NewBufferString("") pf, err := New(&fakeDialer{}, []string{":2222"}, nil, nil, out, errOut) if err != nil { t.Fatalf("error while calling New: %s", err) } listener := newFakeListener() pf.streamConn = newFakeConnection() pf.streamConn.Close() port := ForwardedPort{} pf.waitForConnection(&listener, port) } func TestForwardPortsReturnsErrorWhenConnectionIsLost(t *testing.T) { dialer := &fakeDialer{ conn: newFakeConnection(), negotiatedProtocol: PortForwardProtocolV1Name, } stopChan := make(chan struct{}) readyChan := make(chan struct{}) errChan := make(chan error) pf, err := New(dialer, []string{":5000"}, stopChan, readyChan, os.Stdout, os.Stderr) if err != nil { t.Fatalf("failed to create new PortForwarder: %s", err) } go func() { errChan <- pf.ForwardPorts() }() <-pf.Ready // Simulate lost pod connection by closing streamConn, which should result in pf.ForwardPorts() returning an error. pf.streamConn.Close() err = <-errChan if err == nil { t.Fatalf("unexpected non-error from pf.ForwardPorts()") } else if err != ErrLostConnectionToPod { t.Fatalf("unexpected error from pf.ForwardPorts(): %s", err) } } func TestForwardPortsReturnsNilWhenStopChanIsClosed(t *testing.T) { dialer := &fakeDialer{ conn: newFakeConnection(), negotiatedProtocol: PortForwardProtocolV1Name, } stopChan := make(chan struct{}) readyChan := make(chan struct{}) errChan := make(chan error) pf, err := New(dialer, []string{":5000"}, stopChan, readyChan, os.Stdout, os.Stderr) if err != nil { t.Fatalf("failed to create new PortForwarder: %s", err) } go func() { errChan <- pf.ForwardPorts() }() <-pf.Ready // Closing (or sending to) stopChan indicates a stop request by the caller, which should result in pf.ForwardPorts() // returning nil. close(stopChan) err = <-errChan if err != nil { t.Fatalf("unexpected error from pf.ForwardPorts(): %s", err) } } kubernetes-client-go-a2dfcab/tools/portforward/tunneling_connection.go000066400000000000000000000123021472614177300266600ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package portforward import ( "errors" "fmt" "io" "net" "sync" "time" gwebsocket "github.com/gorilla/websocket" "k8s.io/klog/v2" ) var _ net.Conn = &TunnelingConnection{} // TunnelingConnection implements the "httpstream.Connection" interface, wrapping // a websocket connection that tunnels SPDY. type TunnelingConnection struct { name string conn *gwebsocket.Conn inProgressMessage io.Reader closeOnce sync.Once } // NewTunnelingConnection wraps the passed gorilla/websockets connection // with the TunnelingConnection struct (implementing net.Conn). func NewTunnelingConnection(name string, conn *gwebsocket.Conn) *TunnelingConnection { return &TunnelingConnection{ name: name, conn: conn, } } // Read implements "io.Reader" interface, reading from the stored connection // into the passed buffer "p". Returns the number of bytes read and an error. // Can keep track of the "inProgress" messsage from the tunneled connection. func (c *TunnelingConnection) Read(p []byte) (int, error) { klog.V(7).Infof("%s: tunneling connection read...", c.name) defer klog.V(7).Infof("%s: tunneling connection read...complete", c.name) for { if c.inProgressMessage == nil { klog.V(8).Infof("%s: tunneling connection read before NextReader()...", c.name) messageType, nextReader, err := c.conn.NextReader() if err != nil { closeError := &gwebsocket.CloseError{} if errors.As(err, &closeError) && closeError.Code == gwebsocket.CloseNormalClosure { return 0, io.EOF } klog.V(4).Infof("%s:tunneling connection NextReader() error: %v", c.name, err) return 0, err } if messageType != gwebsocket.BinaryMessage { return 0, fmt.Errorf("invalid message type received") } c.inProgressMessage = nextReader } klog.V(8).Infof("%s: tunneling connection read in progress message...", c.name) i, err := c.inProgressMessage.Read(p) if i == 0 && err == io.EOF { c.inProgressMessage = nil } else { klog.V(8).Infof("%s: read %d bytes, error=%v, bytes=% X", c.name, i, err, p[:i]) return i, err } } } // Write implements "io.Writer" interface, copying the data in the passed // byte array "p" into the stored tunneled connection. Returns the number // of bytes written and an error. func (c *TunnelingConnection) Write(p []byte) (n int, err error) { klog.V(7).Infof("%s: write: %d bytes, bytes=% X", c.name, len(p), p) defer klog.V(7).Infof("%s: tunneling connection write...complete", c.name) w, err := c.conn.NextWriter(gwebsocket.BinaryMessage) if err != nil { return 0, err } defer func() { // close, which flushes the message closeErr := w.Close() if closeErr != nil && err == nil { // if closing/flushing errored and we weren't already returning an error, return the close error err = closeErr } }() n, err = w.Write(p) return } // Close implements "io.Closer" interface, signaling the other tunneled connection // endpoint, and closing the tunneled connection only once. func (c *TunnelingConnection) Close() error { var err error c.closeOnce.Do(func() { klog.V(7).Infof("%s: tunneling connection Close()...", c.name) // Signal other endpoint that websocket connection is closing; ignore error. normalCloseMsg := gwebsocket.FormatCloseMessage(gwebsocket.CloseNormalClosure, "") writeControlErr := c.conn.WriteControl(gwebsocket.CloseMessage, normalCloseMsg, time.Now().Add(time.Second)) closeErr := c.conn.Close() if closeErr != nil { err = closeErr } else if writeControlErr != nil { err = writeControlErr } }) return err } // LocalAddr implements part of the "net.Conn" interface, returning the local // endpoint network address of the tunneled connection. func (c *TunnelingConnection) LocalAddr() net.Addr { return c.conn.LocalAddr() } // LocalAddr implements part of the "net.Conn" interface, returning the remote // endpoint network address of the tunneled connection. func (c *TunnelingConnection) RemoteAddr() net.Addr { return c.conn.RemoteAddr() } // SetDeadline sets the *absolute* time in the future for both // read and write deadlines. Returns an error if one occurs. func (c *TunnelingConnection) SetDeadline(t time.Time) error { rerr := c.SetReadDeadline(t) werr := c.SetWriteDeadline(t) return errors.Join(rerr, werr) } // SetDeadline sets the *absolute* time in the future for the // read deadlines. Returns an error if one occurs. func (c *TunnelingConnection) SetReadDeadline(t time.Time) error { return c.conn.SetReadDeadline(t) } // SetDeadline sets the *absolute* time in the future for the // write deadlines. Returns an error if one occurs. func (c *TunnelingConnection) SetWriteDeadline(t time.Time) error { return c.conn.SetWriteDeadline(t) } kubernetes-client-go-a2dfcab/tools/portforward/tunneling_connection_test.go000066400000000000000000000171721472614177300277310ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package portforward import ( "io" "net" "net/http" "net/http/httptest" "net/url" "strings" "testing" "time" gwebsocket "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/spdy" constants "k8s.io/apimachinery/pkg/util/portforward" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" "k8s.io/client-go/transport/websocket" ) func TestTunnelingConnection_ReadWriteClose(t *testing.T) { // Stream channel that will receive streams created on upstream SPDY server. streamChan := make(chan httpstream.Stream) defer close(streamChan) stopServerChan := make(chan struct{}) defer close(stopServerChan) // Create tunneling connection server endpoint with fake upstream SPDY server. tunnelingServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var upgrader = gwebsocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true }, Subprotocols: []string{constants.WebsocketsSPDYTunnelingPortForwardV1}, } conn, err := upgrader.Upgrade(w, req, nil) require.NoError(t, err) defer conn.Close() //nolint:errcheck require.Equal(t, constants.WebsocketsSPDYTunnelingPortForwardV1, conn.Subprotocol()) tunnelingConn := NewTunnelingConnection("server", conn) spdyConn, err := spdy.NewServerConnection(tunnelingConn, justQueueStream(streamChan)) require.NoError(t, err) defer spdyConn.Close() //nolint:errcheck <-stopServerChan })) defer tunnelingServer.Close() // Dial the client tunneling connection to the tunneling server. url, err := url.Parse(tunnelingServer.URL) require.NoError(t, err) dialer, err := NewSPDYOverWebsocketDialer(url, &rest.Config{Host: url.Host}) require.NoError(t, err) spdyClient, protocol, err := dialer.Dial(constants.PortForwardV1Name) require.NoError(t, err) assert.Equal(t, constants.PortForwardV1Name, protocol) defer spdyClient.Close() //nolint:errcheck // Create a SPDY client stream, which will queue a SPDY server stream // on the stream creation channel. Send data on the client stream // reading off the SPDY server stream, and validating it was tunneled. expected := "This is a test tunneling SPDY data through websockets." var actual []byte go func() { clientStream, err := spdyClient.CreateStream(http.Header{}) require.NoError(t, err) _, err = io.Copy(clientStream, strings.NewReader(expected)) require.NoError(t, err) clientStream.Close() //nolint:errcheck }() select { case serverStream := <-streamChan: actual, err = io.ReadAll(serverStream) require.NoError(t, err) defer serverStream.Close() //nolint:errcheck case <-time.After(wait.ForeverTestTimeout): t.Fatalf("timeout waiting for spdy stream to arrive on channel.") } assert.Equal(t, expected, string(actual), "error validating tunneled string") } func TestTunnelingConnection_LocalRemoteAddress(t *testing.T) { stopServerChan := make(chan struct{}) defer close(stopServerChan) tunnelingServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var upgrader = gwebsocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true }, Subprotocols: []string{constants.WebsocketsSPDYTunnelingPortForwardV1}, } conn, err := upgrader.Upgrade(w, req, nil) require.NoError(t, err) defer conn.Close() //nolint:errcheck require.Equal(t, constants.WebsocketsSPDYTunnelingPortForwardV1, conn.Subprotocol()) <-stopServerChan })) defer tunnelingServer.Close() // Create the client side tunneling connection. url, err := url.Parse(tunnelingServer.URL) require.NoError(t, err) tConn, err := dialForTunnelingConnection(url) require.NoError(t, err, "error creating client tunneling connection") defer tConn.Close() //nolint:errcheck // Validate "LocalAddr()" and "RemoteAddr()" localAddr := tConn.LocalAddr() remoteAddr := tConn.RemoteAddr() assert.Equal(t, "tcp", localAddr.Network(), "tunneling connection must be TCP") assert.Equal(t, "tcp", remoteAddr.Network(), "tunneling connection must be TCP") _, err = net.ResolveTCPAddr("tcp", localAddr.String()) assert.NoError(t, err, "tunneling connection local addr should parse") _, err = net.ResolveTCPAddr("tcp", remoteAddr.String()) assert.NoError(t, err, "tunneling connection remote addr should parse") } func TestTunnelingConnection_ReadWriteDeadlines(t *testing.T) { stopServerChan := make(chan struct{}) defer close(stopServerChan) tunnelingServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var upgrader = gwebsocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true }, Subprotocols: []string{constants.WebsocketsSPDYTunnelingPortForwardV1}, } conn, err := upgrader.Upgrade(w, req, nil) require.NoError(t, err) defer conn.Close() //nolint:errcheck require.Equal(t, constants.WebsocketsSPDYTunnelingPortForwardV1, conn.Subprotocol()) <-stopServerChan })) defer tunnelingServer.Close() // Create the client side tunneling connection. url, err := url.Parse(tunnelingServer.URL) require.NoError(t, err) tConn, err := dialForTunnelingConnection(url) require.NoError(t, err, "error creating client tunneling connection") defer tConn.Close() //nolint:errcheck // Validate the read and write deadlines. err = tConn.SetReadDeadline(time.Time{}) assert.NoError(t, err, "setting zero deadline should always succeed; turns off deadline") err = tConn.SetWriteDeadline(time.Time{}) assert.NoError(t, err, "setting zero deadline should always succeed; turns off deadline") err = tConn.SetDeadline(time.Time{}) assert.NoError(t, err, "setting zero deadline should always succeed; turns off deadline") err = tConn.SetReadDeadline(time.Now().AddDate(10, 0, 0)) assert.NoError(t, err, "setting deadline 10 year from now succeeds") err = tConn.SetWriteDeadline(time.Now().AddDate(10, 0, 0)) assert.NoError(t, err, "setting deadline 10 year from now succeeds") err = tConn.SetDeadline(time.Now().AddDate(10, 0, 0)) assert.NoError(t, err, "setting deadline 10 year from now succeeds") } // dialForTunnelingConnection upgrades a request at the passed "url", creating // a websocket connection. Returns the TunnelingConnection injected with the // websocket connection or an error if one occurs. func dialForTunnelingConnection(url *url.URL) (*TunnelingConnection, error) { req, err := http.NewRequest("GET", url.String(), nil) if err != nil { return nil, err } // Tunneling must initiate a websocket upgrade connection, using tunneling portforward protocol. tunnelingProtocols := []string{constants.WebsocketsSPDYTunnelingPortForwardV1} transport, holder, err := websocket.RoundTripperFor(&rest.Config{Host: url.Host}) if err != nil { return nil, err } conn, err := websocket.Negotiate(transport, holder, req, tunnelingProtocols...) if err != nil { return nil, err } return NewTunnelingConnection("client", conn), nil } func justQueueStream(streams chan httpstream.Stream) func(httpstream.Stream, <-chan struct{}) error { return func(stream httpstream.Stream, replySent <-chan struct{}) error { streams <- stream return nil } } kubernetes-client-go-a2dfcab/tools/portforward/tunneling_dialer.go000066400000000000000000000063551472614177300257740ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package portforward import ( "fmt" "net/http" "net/url" "strings" "time" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/spdy" constants "k8s.io/apimachinery/pkg/util/portforward" restclient "k8s.io/client-go/rest" "k8s.io/client-go/transport/websocket" "k8s.io/klog/v2" ) const PingPeriod = 10 * time.Second // tunnelingDialer implements "httpstream.Dial" interface type tunnelingDialer struct { url *url.URL transport http.RoundTripper holder websocket.ConnectionHolder } // NewTunnelingDialer creates and returns the tunnelingDialer structure which implemements the "httpstream.Dialer" // interface. The dialer can upgrade a websocket request, creating a websocket connection. This function // returns an error if one occurs. func NewSPDYOverWebsocketDialer(url *url.URL, config *restclient.Config) (httpstream.Dialer, error) { transport, holder, err := websocket.RoundTripperFor(config) if err != nil { return nil, err } return &tunnelingDialer{ url: url, transport: transport, holder: holder, }, nil } // Dial upgrades to a tunneling streaming connection, returning a SPDY connection // containing a WebSockets connection (which implements "net.Conn"). Also // returns the protocol negotiated, or an error. func (d *tunnelingDialer) Dial(protocols ...string) (httpstream.Connection, string, error) { // There is no passed context, so skip the context when creating request for now. // Websockets requires "GET" method: RFC 6455 Sec. 4.1 (page 17). req, err := http.NewRequest("GET", d.url.String(), nil) if err != nil { return nil, "", err } // Add the spdy tunneling prefix to the requested protocols. The tunneling // handler will know how to negotiate these protocols. tunnelingProtocols := []string{} for _, protocol := range protocols { tunnelingProtocol := constants.WebsocketsSPDYTunnelingPrefix + protocol tunnelingProtocols = append(tunnelingProtocols, tunnelingProtocol) } klog.V(4).Infoln("Before WebSocket Upgrade Connection...") conn, err := websocket.Negotiate(d.transport, d.holder, req, tunnelingProtocols...) if err != nil { return nil, "", err } if conn == nil { return nil, "", fmt.Errorf("negotiated websocket connection is nil") } protocol := conn.Subprotocol() protocol = strings.TrimPrefix(protocol, constants.WebsocketsSPDYTunnelingPrefix) klog.V(4).Infof("negotiated protocol: %s", protocol) // Wrap the websocket connection which implements "net.Conn". tConn := NewTunnelingConnection("client", conn) // Create SPDY connection injecting the previously created tunneling connection. spdyConn, err := spdy.NewClientConnectionWithPings(tConn, PingPeriod) return spdyConn, protocol, err } kubernetes-client-go-a2dfcab/tools/record/000077500000000000000000000000001472614177300210165ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/record/OWNERS000066400000000000000000000002151472614177300217540ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners reviewers: - sig-instrumentation-reviewers approvers: - sig-instrumentation-approvers kubernetes-client-go-a2dfcab/tools/record/doc.go000066400000000000000000000013351472614177300221140ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package record has all client logic for recording and reporting // "k8s.io/api/core/v1".Event events. package record // import "k8s.io/client-go/tools/record" kubernetes-client-go-a2dfcab/tools/record/event.go000066400000000000000000000512021472614177300224660ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package record import ( "context" "fmt" "math/rand" "time" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/watch" restclient "k8s.io/client-go/rest" internalevents "k8s.io/client-go/tools/internal/events" "k8s.io/client-go/tools/record/util" ref "k8s.io/client-go/tools/reference" "k8s.io/klog/v2" "k8s.io/utils/clock" ) const maxTriesPerEvent = 12 var defaultSleepDuration = 10 * time.Second const maxQueuedEvents = 1000 // EventSink knows how to store events (client.Client implements it.) // EventSink must respect the namespace that will be embedded in 'event'. // It is assumed that EventSink will return the same sorts of errors as // pkg/client's REST client. type EventSink interface { Create(event *v1.Event) (*v1.Event, error) Update(event *v1.Event) (*v1.Event, error) Patch(oldEvent *v1.Event, data []byte) (*v1.Event, error) } // CorrelatorOptions allows you to change the default of the EventSourceObjectSpamFilter // and EventAggregator in EventCorrelator type CorrelatorOptions struct { // The lru cache size used for both EventSourceObjectSpamFilter and the EventAggregator // If not specified (zero value), the default specified in events_cache.go will be picked // This means that the LRUCacheSize has to be greater than 0. LRUCacheSize int // The burst size used by the token bucket rate filtering in EventSourceObjectSpamFilter // If not specified (zero value), the default specified in events_cache.go will be picked // This means that the BurstSize has to be greater than 0. BurstSize int // The fill rate of the token bucket in queries per second in EventSourceObjectSpamFilter // If not specified (zero value), the default specified in events_cache.go will be picked // This means that the QPS has to be greater than 0. QPS float32 // The func used by the EventAggregator to group event keys for aggregation // If not specified (zero value), EventAggregatorByReasonFunc will be used KeyFunc EventAggregatorKeyFunc // The func used by the EventAggregator to produced aggregated message // If not specified (zero value), EventAggregatorByReasonMessageFunc will be used MessageFunc EventAggregatorMessageFunc // The number of events in an interval before aggregation happens by the EventAggregator // If not specified (zero value), the default specified in events_cache.go will be picked // This means that the MaxEvents has to be greater than 0 MaxEvents int // The amount of time in seconds that must transpire since the last occurrence of a similar event before it is considered new by the EventAggregator // If not specified (zero value), the default specified in events_cache.go will be picked // This means that the MaxIntervalInSeconds has to be greater than 0 MaxIntervalInSeconds int // The clock used by the EventAggregator to allow for testing // If not specified (zero value), clock.RealClock{} will be used Clock clock.PassiveClock // The func used by EventFilterFunc, which returns a key for given event, based on which filtering will take place // If not specified (zero value), getSpamKey will be used SpamKeyFunc EventSpamKeyFunc } // EventRecorder knows how to record events on behalf of an EventSource. type EventRecorder interface { // Event constructs an event from the given information and puts it in the queue for sending. // 'object' is the object this event is about. Event will make a reference-- or you may also // pass a reference to the object directly. // 'eventtype' of this event, and can be one of Normal, Warning. New types could be added in future // 'reason' is the reason this event is generated. 'reason' should be short and unique; it // should be in UpperCamelCase format (starting with a capital letter). "reason" will be used // to automate handling of events, so imagine people writing switch statements to handle them. // You want to make that easy. // 'message' is intended to be human readable. // // The resulting event will be created in the same namespace as the reference object. Event(object runtime.Object, eventtype, reason, message string) // Eventf is just like Event, but with Sprintf for the message field. Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) // AnnotatedEventf is just like eventf, but with annotations attached AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) } // EventRecorderLogger extends EventRecorder such that a logger can // be set for methods in EventRecorder. Normally, those methods // uses the global default logger to record errors and debug messages. // If that is not desired, use WithLogger to provide a logger instance. type EventRecorderLogger interface { EventRecorder // WithLogger replaces the context used for logging. This is a cheap call // and meant to be used for contextual logging: // recorder := ... // logger := klog.FromContext(ctx) // recorder.WithLogger(logger).Eventf(...) WithLogger(logger klog.Logger) EventRecorderLogger } // EventBroadcaster knows how to receive events and send them to any EventSink, watcher, or log. type EventBroadcaster interface { // StartEventWatcher starts sending events received from this EventBroadcaster to the given // event handler function. The return value can be ignored or used to stop recording, if // desired. StartEventWatcher(eventHandler func(*v1.Event)) watch.Interface // StartRecordingToSink starts sending events received from this EventBroadcaster to the given // sink. The return value can be ignored or used to stop recording, if desired. StartRecordingToSink(sink EventSink) watch.Interface // StartLogging starts sending events received from this EventBroadcaster to the given logging // function. The return value can be ignored or used to stop recording, if desired. StartLogging(logf func(format string, args ...interface{})) watch.Interface // StartStructuredLogging starts sending events received from this EventBroadcaster to the structured // logging function. The return value can be ignored or used to stop recording, if desired. StartStructuredLogging(verbosity klog.Level) watch.Interface // NewRecorder returns an EventRecorder that can be used to send events to this EventBroadcaster // with the event source set to the given event source. NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorderLogger // Shutdown shuts down the broadcaster. Once the broadcaster is shut // down, it will only try to record an event in a sink once before // giving up on it with an error message. Shutdown() } // EventRecorderAdapter is a wrapper around a "k8s.io/client-go/tools/record".EventRecorder // implementing the new "k8s.io/client-go/tools/events".EventRecorder interface. type EventRecorderAdapter struct { recorder EventRecorderLogger } var _ internalevents.EventRecorder = &EventRecorderAdapter{} // NewEventRecorderAdapter returns an adapter implementing the new // "k8s.io/client-go/tools/events".EventRecorder interface. func NewEventRecorderAdapter(recorder EventRecorderLogger) *EventRecorderAdapter { return &EventRecorderAdapter{ recorder: recorder, } } // Eventf is a wrapper around v1 Eventf func (a *EventRecorderAdapter) Eventf(regarding, _ runtime.Object, eventtype, reason, action, note string, args ...interface{}) { a.recorder.Eventf(regarding, eventtype, reason, note, args...) } func (a *EventRecorderAdapter) WithLogger(logger klog.Logger) internalevents.EventRecorderLogger { return &EventRecorderAdapter{ recorder: a.recorder.WithLogger(logger), } } // Creates a new event broadcaster. func NewBroadcaster(opts ...BroadcasterOption) EventBroadcaster { c := config{ sleepDuration: defaultSleepDuration, } for _, opt := range opts { opt(&c) } eventBroadcaster := &eventBroadcasterImpl{ Broadcaster: watch.NewLongQueueBroadcaster(maxQueuedEvents, watch.DropIfChannelFull), sleepDuration: c.sleepDuration, options: c.CorrelatorOptions, } ctx := c.Context if ctx == nil { ctx = context.Background() } // The are two scenarios where it makes no sense to wait for context cancelation: // - The context was nil. // - The context was context.Background() to begin with. // // Both cases get checked here: we have cancelation if (and only if) there is a channel. haveCtxCancelation := ctx.Done() != nil eventBroadcaster.cancelationCtx, eventBroadcaster.cancel = context.WithCancel(ctx) if haveCtxCancelation { // Calling Shutdown is not required when a context was provided: // when the context is canceled, this goroutine will shut down // the broadcaster. // // If Shutdown is called first, then this goroutine will // also stop. go func() { <-eventBroadcaster.cancelationCtx.Done() eventBroadcaster.Broadcaster.Shutdown() }() } return eventBroadcaster } func NewBroadcasterForTests(sleepDuration time.Duration) EventBroadcaster { return NewBroadcaster(WithSleepDuration(sleepDuration)) } func NewBroadcasterWithCorrelatorOptions(options CorrelatorOptions) EventBroadcaster { return NewBroadcaster(WithCorrelatorOptions(options)) } func WithCorrelatorOptions(options CorrelatorOptions) BroadcasterOption { return func(c *config) { c.CorrelatorOptions = options } } // WithContext sets a context for the broadcaster. Canceling the context will // shut down the broadcaster, Shutdown doesn't need to be called. The context // can also be used to provide a logger. func WithContext(ctx context.Context) BroadcasterOption { return func(c *config) { c.Context = ctx } } func WithSleepDuration(sleepDuration time.Duration) BroadcasterOption { return func(c *config) { c.sleepDuration = sleepDuration } } type BroadcasterOption func(*config) type config struct { CorrelatorOptions context.Context sleepDuration time.Duration } type eventBroadcasterImpl struct { *watch.Broadcaster sleepDuration time.Duration options CorrelatorOptions cancelationCtx context.Context cancel func() } // StartRecordingToSink starts sending events received from the specified eventBroadcaster to the given sink. // The return value can be ignored or used to stop recording, if desired. // TODO: make me an object with parameterizable queue length and retry interval func (e *eventBroadcasterImpl) StartRecordingToSink(sink EventSink) watch.Interface { eventCorrelator := NewEventCorrelatorWithOptions(e.options) return e.StartEventWatcher( func(event *v1.Event) { e.recordToSink(sink, event, eventCorrelator) }) } func (e *eventBroadcasterImpl) Shutdown() { e.Broadcaster.Shutdown() e.cancel() } func (e *eventBroadcasterImpl) recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrelator) { // Make a copy before modification, because there could be multiple listeners. // Events are safe to copy like this. eventCopy := *event event = &eventCopy result, err := eventCorrelator.EventCorrelate(event) if err != nil { utilruntime.HandleError(err) } if result.Skip { return } tries := 0 for { if recordEvent(e.cancelationCtx, sink, result.Event, result.Patch, result.Event.Count > 1, eventCorrelator) { break } tries++ if tries >= maxTriesPerEvent { klog.FromContext(e.cancelationCtx).Error(nil, "Unable to write event (retry limit exceeded!)", "event", event) break } // Randomize the first sleep so that various clients won't all be // synced up if the master goes down. delay := e.sleepDuration if tries == 1 { delay = time.Duration(float64(delay) * rand.Float64()) } select { case <-e.cancelationCtx.Done(): klog.FromContext(e.cancelationCtx).Error(nil, "Unable to write event (broadcaster is shut down)", "event", event) return case <-time.After(delay): } } } // recordEvent attempts to write event to a sink. It returns true if the event // was successfully recorded or discarded, false if it should be retried. // If updateExistingEvent is false, it creates a new event, otherwise it updates // existing event. func recordEvent(ctx context.Context, sink EventSink, event *v1.Event, patch []byte, updateExistingEvent bool, eventCorrelator *EventCorrelator) bool { var newEvent *v1.Event var err error if updateExistingEvent { newEvent, err = sink.Patch(event, patch) } // Update can fail because the event may have been removed and it no longer exists. if !updateExistingEvent || (updateExistingEvent && util.IsKeyNotFoundError(err)) { // Making sure that ResourceVersion is empty on creation event.ResourceVersion = "" newEvent, err = sink.Create(event) } if err == nil { // we need to update our event correlator with the server returned state to handle name/resourceversion eventCorrelator.UpdateState(newEvent) return true } // If we can't contact the server, then hold everything while we keep trying. // Otherwise, something about the event is malformed and we should abandon it. switch err.(type) { case *restclient.RequestConstructionError: // We will construct the request the same next time, so don't keep trying. klog.FromContext(ctx).Error(err, "Unable to construct event (will not retry!)", "event", event) return true case *errors.StatusError: if errors.IsAlreadyExists(err) || errors.HasStatusCause(err, v1.NamespaceTerminatingCause) { klog.FromContext(ctx).V(5).Info("Server rejected event (will not retry!)", "event", event, "err", err) } else { klog.FromContext(ctx).Error(err, "Server rejected event (will not retry!)", "event", event) } return true case *errors.UnexpectedObjectError: // We don't expect this; it implies the server's response didn't match a // known pattern. Go ahead and retry. default: // This case includes actual http transport errors. Go ahead and retry. } klog.FromContext(ctx).Error(err, "Unable to write event (may retry after sleeping)", "event", event) return false } // StartLogging starts sending events received from this EventBroadcaster to the given logging function. // The return value can be ignored or used to stop recording, if desired. func (e *eventBroadcasterImpl) StartLogging(logf func(format string, args ...interface{})) watch.Interface { return e.StartEventWatcher( func(e *v1.Event) { logf("Event(%#v): type: '%v' reason: '%v' %v", e.InvolvedObject, e.Type, e.Reason, e.Message) }) } // StartStructuredLogging starts sending events received from this EventBroadcaster to a structured logger. // The logger is retrieved from a context if the broadcaster was constructed with a context, otherwise // the global default is used. // The return value can be ignored or used to stop recording, if desired. func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) watch.Interface { loggerV := klog.FromContext(e.cancelationCtx).V(int(verbosity)) return e.StartEventWatcher( func(e *v1.Event) { loggerV.Info("Event occurred", "object", klog.KRef(e.InvolvedObject.Namespace, e.InvolvedObject.Name), "fieldPath", e.InvolvedObject.FieldPath, "kind", e.InvolvedObject.Kind, "apiVersion", e.InvolvedObject.APIVersion, "type", e.Type, "reason", e.Reason, "message", e.Message) }) } // StartEventWatcher starts sending events received from this EventBroadcaster to the given event handler function. // The return value can be ignored or used to stop recording, if desired. func (e *eventBroadcasterImpl) StartEventWatcher(eventHandler func(*v1.Event)) watch.Interface { watcher, err := e.Watch() if err != nil { // This function traditionally returns no error even though it can fail. // Instead, it logs the error and returns an empty watch. The empty // watch ensures that callers don't crash when calling Stop. klog.FromContext(e.cancelationCtx).Error(err, "Unable start event watcher (will not retry!)") return watch.NewEmptyWatch() } go func() { defer utilruntime.HandleCrash() for { select { case <-e.cancelationCtx.Done(): watcher.Stop() return case watchEvent := <-watcher.ResultChan(): event, ok := watchEvent.Object.(*v1.Event) if !ok { // This is all local, so there's no reason this should // ever happen. continue } eventHandler(event) } } }() return watcher } // NewRecorder returns an EventRecorder that records events with the given event source. func (e *eventBroadcasterImpl) NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorderLogger { return &recorderImplLogger{recorderImpl: &recorderImpl{scheme, source, e.Broadcaster, clock.RealClock{}}, logger: klog.Background()} } type recorderImpl struct { scheme *runtime.Scheme source v1.EventSource *watch.Broadcaster clock clock.PassiveClock } var _ EventRecorder = &recorderImpl{} func (recorder *recorderImpl) generateEvent(logger klog.Logger, object runtime.Object, annotations map[string]string, eventtype, reason, message string) { ref, err := ref.GetReference(recorder.scheme, object) if err != nil { logger.Error(err, "Could not construct reference, will not report event", "object", object, "eventType", eventtype, "reason", reason, "message", message) return } if !util.ValidateEventType(eventtype) { logger.Error(nil, "Unsupported event type", "eventType", eventtype) return } event := recorder.makeEvent(ref, annotations, eventtype, reason, message) event.Source = recorder.source event.ReportingInstance = recorder.source.Host event.ReportingController = recorder.source.Component // NOTE: events should be a non-blocking operation, but we also need to not // put this in a goroutine, otherwise we'll race to write to a closed channel // when we go to shut down this broadcaster. Just drop events if we get overloaded, // and log an error if that happens (we've configured the broadcaster to drop // outgoing events anyway). sent, err := recorder.ActionOrDrop(watch.Added, event) if err != nil { logger.Error(err, "Unable to record event (will not retry!)") return } if !sent { logger.Error(nil, "Unable to record event: too many queued events, dropped event", "event", event) } } func (recorder *recorderImpl) Event(object runtime.Object, eventtype, reason, message string) { recorder.generateEvent(klog.Background(), object, nil, eventtype, reason, message) } func (recorder *recorderImpl) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) { recorder.Event(object, eventtype, reason, fmt.Sprintf(messageFmt, args...)) } func (recorder *recorderImpl) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { recorder.generateEvent(klog.Background(), object, annotations, eventtype, reason, fmt.Sprintf(messageFmt, args...)) } func (recorder *recorderImpl) makeEvent(ref *v1.ObjectReference, annotations map[string]string, eventtype, reason, message string) *v1.Event { t := metav1.Time{Time: recorder.clock.Now()} namespace := ref.Namespace if namespace == "" { namespace = metav1.NamespaceDefault } return &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%v.%x", ref.Name, t.UnixNano()), Namespace: namespace, Annotations: annotations, }, InvolvedObject: *ref, Reason: reason, Message: message, FirstTimestamp: t, LastTimestamp: t, Count: 1, Type: eventtype, } } type recorderImplLogger struct { *recorderImpl logger klog.Logger } var _ EventRecorderLogger = &recorderImplLogger{} func (recorder recorderImplLogger) Event(object runtime.Object, eventtype, reason, message string) { recorder.recorderImpl.generateEvent(recorder.logger, object, nil, eventtype, reason, message) } func (recorder recorderImplLogger) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) { recorder.Event(object, eventtype, reason, fmt.Sprintf(messageFmt, args...)) } func (recorder recorderImplLogger) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { recorder.generateEvent(recorder.logger, object, annotations, eventtype, reason, fmt.Sprintf(messageFmt, args...)) } func (recorder recorderImplLogger) WithLogger(logger klog.Logger) EventRecorderLogger { return recorderImplLogger{recorderImpl: recorder.recorderImpl, logger: logger} } kubernetes-client-go-a2dfcab/tools/record/event_test.go000066400000000000000000001024271472614177300235330ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package record import ( "context" "encoding/json" stderrors "errors" "fmt" "net/http" "strconv" "sync" "testing" "time" "github.com/stretchr/testify/assert" "go.uber.org/goleak" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8sruntime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/client-go/kubernetes/scheme" restclient "k8s.io/client-go/rest" ref "k8s.io/client-go/tools/reference" "k8s.io/klog/v2" "k8s.io/klog/v2/ktesting" "k8s.io/utils/clock" testclocks "k8s.io/utils/clock/testing" ) type testEventSink struct { OnCreate func(e *v1.Event) (*v1.Event, error) OnUpdate func(e *v1.Event) (*v1.Event, error) OnPatch func(e *v1.Event, p []byte) (*v1.Event, error) } // CreateEvent records the event for testing. func (t *testEventSink) Create(e *v1.Event) (*v1.Event, error) { if t.OnCreate != nil { return t.OnCreate(e) } return e, nil } // UpdateEvent records the event for testing. func (t *testEventSink) Update(e *v1.Event) (*v1.Event, error) { if t.OnUpdate != nil { return t.OnUpdate(e) } return e, nil } // PatchEvent records the event for testing. func (t *testEventSink) Patch(e *v1.Event, p []byte) (*v1.Event, error) { if t.OnPatch != nil { return t.OnPatch(e, p) } return e, nil } type OnCreateFunc func(*v1.Event) (*v1.Event, error) func OnCreateFactory(testCache map[string]*v1.Event, createEvent chan<- *v1.Event) OnCreateFunc { return func(event *v1.Event) (*v1.Event, error) { testCache[getEventKey(event)] = event createEvent <- event return event, nil } } type OnPatchFunc func(*v1.Event, []byte) (*v1.Event, error) func OnPatchFactory(testCache map[string]*v1.Event, patchEvent chan<- *v1.Event) OnPatchFunc { return func(event *v1.Event, patch []byte) (*v1.Event, error) { cachedEvent, found := testCache[getEventKey(event)] if !found { return nil, fmt.Errorf("unexpected error: couldn't find Event in testCache.") } originalData, err := json.Marshal(cachedEvent) if err != nil { return nil, fmt.Errorf("unexpected error: %v", err) } patched, err := strategicpatch.StrategicMergePatch(originalData, patch, event) if err != nil { return nil, fmt.Errorf("unexpected error: %v", err) } patchedObj := &v1.Event{} err = json.Unmarshal(patched, patchedObj) if err != nil { return nil, fmt.Errorf("unexpected error: %v", err) } patchEvent <- patchedObj return patchedObj, nil } } // newBroadcasterForTests creates a new broadcaster which produces per-test log // output if StartStructuredLogging is used. Will be shut down automatically // after the test. func newBroadcasterForTests(tb testing.TB) EventBroadcaster { _, ctx := ktesting.NewTestContext(tb) caster := NewBroadcaster(WithSleepDuration(0), WithContext(ctx)) tb.Cleanup(caster.Shutdown) return caster } func TestBroadcasterShutdown(t *testing.T) { _, ctx := ktesting.NewTestContext(t) ctx, cancel := context.WithCancelCause(ctx) // Start a broadcaster with background activity. caster := NewBroadcaster(WithContext(ctx)) caster.StartStructuredLogging(0) // Stop it. cancel(stderrors.New("time to stop")) // Ensure that the broadcaster goroutine is not left running. goleak.VerifyNone(t) } func TestNonRacyShutdown(t *testing.T) { // Attempt to simulate previously racy conditions, and ensure that no race // occurs: Nominally, calling "Eventf" *followed by* shutdown from the same // thread should be a safe operation, but it's not if we launch recorder.Action // in a goroutine. caster := newBroadcasterForTests(t) clock := testclocks.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(t, v1.EventSource{Component: "eventTest"}, caster, clock) var wg sync.WaitGroup wg.Add(100) for i := 0; i < 100; i++ { go func() { defer wg.Done() recorder.Eventf(&v1.ObjectReference{}, v1.EventTypeNormal, "Started", "blah") }() } wg.Wait() caster.Shutdown() } func TestEventf(t *testing.T) { testPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", UID: "bar", }, } testPod2 := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", UID: "differentUid", }, } testRef, err := ref.GetPartialReference(scheme.Scheme, testPod, "spec.containers[2]") if err != nil { t.Fatal(err) } testRef2, err := ref.GetPartialReference(scheme.Scheme, testPod2, "spec.containers[3]") if err != nil { t.Fatal(err) } table := []struct { obj k8sruntime.Object eventtype string reason string messageFmt string elements []interface{} expect *v1.Event expectLog string expectStructuredLog string expectUpdate bool }{ { obj: testRef, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "bar", APIVersion: "v1", FieldPath: "spec.containers[2]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[2]" kind="Pod" apiVersion="v1" type="Normal" reason="Started" message="some verbose message: 1" `, expectUpdate: false, }, { obj: testPod, eventtype: v1.EventTypeNormal, reason: "Killed", messageFmt: "some other verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "bar", APIVersion: "v1", }, Reason: "Killed", Message: "some other verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:""}): type: 'Normal' reason: 'Killed' some other verbose message: 1`, expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="" kind="Pod" apiVersion="v1" type="Normal" reason="Killed" message="some other verbose message: 1" `, expectUpdate: false, }, { obj: testRef, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "bar", APIVersion: "v1", FieldPath: "spec.containers[2]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 2, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[2]" kind="Pod" apiVersion="v1" type="Normal" reason="Started" message="some verbose message: 1" `, expectUpdate: true, }, { obj: testRef2, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "differentUid", APIVersion: "v1", FieldPath: "spec.containers[3]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[3]" kind="Pod" apiVersion="v1" type="Normal" reason="Started" message="some verbose message: 1" `, expectUpdate: false, }, { obj: testRef, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "bar", APIVersion: "v1", FieldPath: "spec.containers[2]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 3, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[2]" kind="Pod" apiVersion="v1" type="Normal" reason="Started" message="some verbose message: 1" `, expectUpdate: true, }, { obj: testRef2, eventtype: v1.EventTypeNormal, reason: "Stopped", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "differentUid", APIVersion: "v1", FieldPath: "spec.containers[3]", }, Reason: "Stopped", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Stopped' some verbose message: 1`, expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[3]" kind="Pod" apiVersion="v1" type="Normal" reason="Stopped" message="some verbose message: 1" `, expectUpdate: false, }, { obj: testRef2, eventtype: v1.EventTypeNormal, reason: "Stopped", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "differentUid", APIVersion: "v1", FieldPath: "spec.containers[3]", }, Reason: "Stopped", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 2, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Stopped' some verbose message: 1`, expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[3]" kind="Pod" apiVersion="v1" type="Normal" reason="Stopped" message="some verbose message: 1" `, expectUpdate: true, }, } testCache := map[string]*v1.Event{} logCalled := make(chan struct{}) createEvent := make(chan *v1.Event) updateEvent := make(chan *v1.Event) patchEvent := make(chan *v1.Event) testEvents := testEventSink{ OnCreate: OnCreateFactory(testCache, createEvent), OnUpdate: func(event *v1.Event) (*v1.Event, error) { updateEvent <- event return event, nil }, OnPatch: OnPatchFactory(testCache, patchEvent), } logger := ktesting.NewLogger(t, ktesting.NewConfig(ktesting.BufferLogs(true))) logSink := logger.GetSink().(ktesting.Underlier) ctx := klog.NewContext(context.Background(), logger) eventBroadcaster := NewBroadcaster(WithSleepDuration(0), WithContext(ctx)) defer eventBroadcaster.Shutdown() sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) clock := testclocks.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(t, v1.EventSource{Component: "eventTest"}, eventBroadcaster, clock) for index, item := range table { clock.Step(1 * time.Second) //nolint:logcheck // Intentionally testing StartLogging here. logWatcher := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) { if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a { t.Errorf("Expected '%v', got '%v'", e, a) } logCalled <- struct{}{} }) oldEnd := len(logSink.GetBuffer().String()) structuredLogWatcher := eventBroadcaster.StartStructuredLogging(0) recorder.Eventf(item.obj, item.eventtype, item.reason, item.messageFmt, item.elements...) <-logCalled // We don't get notified by the structured test logger directly. // Instead, we periodically check what new output it has produced. assert.EventuallyWithT(t, func(t *assert.CollectT) { assert.Equal(t, item.expectStructuredLog, logSink.GetBuffer().String()[oldEnd:], "new structured log output") }, time.Minute, time.Millisecond) // validate event if item.expectUpdate { actualEvent := <-patchEvent validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } else { actualEvent := <-createEvent validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } logWatcher.Stop() structuredLogWatcher.Stop() } sinkWatcher.Stop() } func recorderWithFakeClock(t *testing.T, eventSource v1.EventSource, eventBroadcaster EventBroadcaster, clock clock.Clock) EventRecorder { return &recorderImpl{scheme.Scheme, eventSource, eventBroadcaster.(*eventBroadcasterImpl).Broadcaster, clock} } func TestWriteEventError(t *testing.T) { type entry struct { timesToSendError int attemptsWanted int err error } table := map[string]*entry{ "giveUp1": { timesToSendError: 1000, attemptsWanted: 1, err: &restclient.RequestConstructionError{}, }, "giveUp2": { timesToSendError: 1000, attemptsWanted: 1, err: &errors.StatusError{}, }, "retry1": { timesToSendError: 1000, attemptsWanted: 12, err: &errors.UnexpectedObjectError{}, }, "retry2": { timesToSendError: 1000, attemptsWanted: 12, err: fmt.Errorf("A weird error"), }, "succeedEventually": { timesToSendError: 2, attemptsWanted: 2, err: fmt.Errorf("A weird error"), }, } clock := testclocks.SimpleIntervalClock{Time: time.Now(), Duration: time.Second} eventCorrelator := NewEventCorrelator(&clock) for caseName, ent := range table { attempts := 0 sink := &testEventSink{ OnCreate: func(event *v1.Event) (*v1.Event, error) { attempts++ if attempts < ent.timesToSendError { return nil, ent.err } return event, nil }, } ev := &v1.Event{} ctx, cancel := context.WithCancel(context.Background()) defer cancel() e := eventBroadcasterImpl{ cancelationCtx: ctx, } e.recordToSink(sink, ev, eventCorrelator) if attempts != ent.attemptsWanted { t.Errorf("case %v: wanted %d, got %d attempts", caseName, ent.attemptsWanted, attempts) } } } func TestUpdateExpiredEvent(t *testing.T) { clock := testclocks.SimpleIntervalClock{Time: time.Now(), Duration: time.Second} eventCorrelator := NewEventCorrelator(&clock) var createdEvent *v1.Event sink := &testEventSink{ OnPatch: func(*v1.Event, []byte) (*v1.Event, error) { return nil, &errors.StatusError{ ErrStatus: metav1.Status{ Code: http.StatusNotFound, Reason: metav1.StatusReasonNotFound, }} }, OnCreate: func(event *v1.Event) (*v1.Event, error) { createdEvent = event return event, nil }, } ev := &v1.Event{} ev.ResourceVersion = "updated-resource-version" ev.Count = 2 ctx, cancel := context.WithCancel(context.Background()) defer cancel() e := eventBroadcasterImpl{ cancelationCtx: ctx, } e.recordToSink(sink, ev, eventCorrelator) if createdEvent == nil { t.Error("Event did not get created after patch failed") return } if createdEvent.ResourceVersion != "" { t.Errorf("Event did not have its resource version cleared, was %s", createdEvent.ResourceVersion) } } func TestCancelEvent(t *testing.T) { clock := testclocks.SimpleIntervalClock{Time: time.Now(), Duration: time.Second} eventCorrelator := NewEventCorrelator(&clock) attempts := 0 sink := &testEventSink{ OnCreate: func(event *v1.Event) (*v1.Event, error) { attempts++ return nil, &errors.UnexpectedObjectError{} }, } ev := &v1.Event{} // Cancel before even calling recordToSink. ctx, cancel := context.WithCancel(context.Background()) cancel() e := eventBroadcasterImpl{ cancelationCtx: ctx, sleepDuration: time.Second, } e.recordToSink(sink, ev, eventCorrelator) if attempts != 1 { t.Errorf("recordToSink should have tried once, then given up immediately. Instead it tried %d times.", attempts) } } func TestLotsOfEvents(t *testing.T) { recorderCalled := make(chan struct{}) loggerCalled := make(chan struct{}) // Fail each event a few times to ensure there's some load on the tested code. var counts [1000]int testEvents := testEventSink{ OnCreate: func(event *v1.Event) (*v1.Event, error) { num, err := strconv.Atoi(event.Message) if err != nil { t.Error(err) return event, nil } counts[num]++ if counts[num] < 5 { return nil, fmt.Errorf("fake error") } recorderCalled <- struct{}{} return event, nil }, } eventBroadcaster := newBroadcasterForTests(t) sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) //nolint:logcheck // Intentionally using StartLogging here to get notified. logWatcher := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) { loggerCalled <- struct{}{} }) recorder := eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "eventTest"}) for i := 0; i < maxQueuedEvents; i++ { // we want a unique object to stop spam filtering ref := &v1.ObjectReference{ Kind: "Pod", Name: fmt.Sprintf("foo-%v", i), Namespace: "baz", UID: "bar", APIVersion: "version", } // we need to vary the reason to prevent aggregation go recorder.Eventf(ref, v1.EventTypeNormal, "Reason-"+strconv.Itoa(i), strconv.Itoa(i)) } // Make sure no events were dropped by either of the listeners. for i := 0; i < maxQueuedEvents; i++ { <-recorderCalled <-loggerCalled } // Make sure that every event was attempted 5 times for i := 0; i < maxQueuedEvents; i++ { if counts[i] < 5 { t.Errorf("Only attempted to record event '%d' %d times.", i, counts[i]) } } sinkWatcher.Stop() logWatcher.Stop() } func TestEventfNoNamespace(t *testing.T) { testPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", UID: "bar", }, } testRef, err := ref.GetPartialReference(scheme.Scheme, testPod, "spec.containers[2]") if err != nil { t.Fatal(err) } table := []struct { obj k8sruntime.Object eventtype string reason string messageFmt string elements []interface{} expect *v1.Event expectLog string expectUpdate bool }{ { obj: testRef, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "default", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "", UID: "bar", APIVersion: "v1", FieldPath: "spec.containers[2]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectUpdate: false, }, } testCache := map[string]*v1.Event{} logCalled := make(chan struct{}) createEvent := make(chan *v1.Event) updateEvent := make(chan *v1.Event) patchEvent := make(chan *v1.Event) testEvents := testEventSink{ OnCreate: OnCreateFactory(testCache, createEvent), OnUpdate: func(event *v1.Event) (*v1.Event, error) { updateEvent <- event return event, nil }, OnPatch: OnPatchFactory(testCache, patchEvent), } eventBroadcaster := newBroadcasterForTests(t) sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) clock := testclocks.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(t, v1.EventSource{Component: "eventTest"}, eventBroadcaster, clock) for index, item := range table { clock.Step(1 * time.Second) logWatcher := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) { if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a { t.Errorf("Expected '%v', got '%v'", e, a) } logCalled <- struct{}{} }) recorder.Eventf(item.obj, item.eventtype, item.reason, item.messageFmt, item.elements...) <-logCalled // validate event if item.expectUpdate { actualEvent := <-patchEvent validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } else { actualEvent := <-createEvent validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } logWatcher.Stop() } sinkWatcher.Stop() } func TestMultiSinkCache(t *testing.T) { testPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", UID: "bar", }, } testPod2 := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", UID: "differentUid", }, } testRef, err := ref.GetPartialReference(scheme.Scheme, testPod, "spec.containers[2]") if err != nil { t.Fatal(err) } testRef2, err := ref.GetPartialReference(scheme.Scheme, testPod2, "spec.containers[3]") if err != nil { t.Fatal(err) } table := []struct { obj k8sruntime.Object eventtype string reason string messageFmt string elements []interface{} expect *v1.Event expectLog string expectUpdate bool }{ { obj: testRef, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "bar", APIVersion: "v1", FieldPath: "spec.containers[2]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectUpdate: false, }, { obj: testPod, eventtype: v1.EventTypeNormal, reason: "Killed", messageFmt: "some other verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "bar", APIVersion: "v1", }, Reason: "Killed", Message: "some other verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:""}): type: 'Normal' reason: 'Killed' some other verbose message: 1`, expectUpdate: false, }, { obj: testRef, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "bar", APIVersion: "v1", FieldPath: "spec.containers[2]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 2, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectUpdate: true, }, { obj: testRef2, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "differentUid", APIVersion: "v1", FieldPath: "spec.containers[3]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectUpdate: false, }, { obj: testRef, eventtype: v1.EventTypeNormal, reason: "Started", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "bar", APIVersion: "v1", FieldPath: "spec.containers[2]", }, Reason: "Started", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 3, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, expectUpdate: true, }, { obj: testRef2, eventtype: v1.EventTypeNormal, reason: "Stopped", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "differentUid", APIVersion: "v1", FieldPath: "spec.containers[3]", }, Reason: "Stopped", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 1, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Stopped' some verbose message: 1`, expectUpdate: false, }, { obj: testRef2, eventtype: v1.EventTypeNormal, reason: "Stopped", messageFmt: "some verbose message: %v", elements: []interface{}{1}, expect: &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "baz", }, InvolvedObject: v1.ObjectReference{ Kind: "Pod", Name: "foo", Namespace: "baz", UID: "differentUid", APIVersion: "v1", FieldPath: "spec.containers[3]", }, Reason: "Stopped", Message: "some verbose message: 1", Source: v1.EventSource{Component: "eventTest"}, ReportingController: "eventTest", Count: 2, Type: v1.EventTypeNormal, }, expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Stopped' some verbose message: 1`, expectUpdate: true, }, } testCache := map[string]*v1.Event{} createEvent := make(chan *v1.Event) updateEvent := make(chan *v1.Event) patchEvent := make(chan *v1.Event) testEvents := testEventSink{ OnCreate: OnCreateFactory(testCache, createEvent), OnUpdate: func(event *v1.Event) (*v1.Event, error) { updateEvent <- event return event, nil }, OnPatch: OnPatchFactory(testCache, patchEvent), } testCache2 := map[string]*v1.Event{} createEvent2 := make(chan *v1.Event) updateEvent2 := make(chan *v1.Event) patchEvent2 := make(chan *v1.Event) testEvents2 := testEventSink{ OnCreate: OnCreateFactory(testCache2, createEvent2), OnUpdate: func(event *v1.Event) (*v1.Event, error) { updateEvent2 <- event return event, nil }, OnPatch: OnPatchFactory(testCache2, patchEvent2), } eventBroadcaster := newBroadcasterForTests(t) clock := testclocks.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(t, v1.EventSource{Component: "eventTest"}, eventBroadcaster, clock) sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) for index, item := range table { clock.Step(1 * time.Second) recorder.Eventf(item.obj, item.eventtype, item.reason, item.messageFmt, item.elements...) // validate event if item.expectUpdate { actualEvent := <-patchEvent validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } else { actualEvent := <-createEvent validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } } // Stop before creating more events, otherwise the On* callbacks above // get stuck writing to the channel that we don't read from anymore. sinkWatcher.Stop() // Another StartRecordingToSink call should start to record events with new clean cache. sinkWatcher2 := eventBroadcaster.StartRecordingToSink(&testEvents2) for index, item := range table { clock.Step(1 * time.Second) recorder.Eventf(item.obj, item.eventtype, item.reason, item.messageFmt, item.elements...) // validate event if item.expectUpdate { actualEvent := <-patchEvent2 validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } else { actualEvent := <-createEvent2 validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } } sinkWatcher2.Stop() } kubernetes-client-go-a2dfcab/tools/record/events_cache.go000066400000000000000000000421021472614177300237730ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package record import ( "encoding/json" "fmt" "strings" "sync" "time" "github.com/golang/groupcache/lru" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/client-go/util/flowcontrol" "k8s.io/utils/clock" ) const ( maxLruCacheEntries = 4096 // if we see the same event that varies only by message // more than 10 times in a 10 minute period, aggregate the event defaultAggregateMaxEvents = 10 defaultAggregateIntervalInSeconds = 600 // by default, allow a source to send 25 events about an object // but control the refill rate to 1 new event every 5 minutes // this helps control the long-tail of events for things that are always // unhealthy defaultSpamBurst = 25 defaultSpamQPS = 1. / 300. ) // getEventKey builds unique event key based on source, involvedObject, reason, message func getEventKey(event *v1.Event) string { return strings.Join([]string{ event.Source.Component, event.Source.Host, event.InvolvedObject.Kind, event.InvolvedObject.Namespace, event.InvolvedObject.Name, event.InvolvedObject.FieldPath, string(event.InvolvedObject.UID), event.InvolvedObject.APIVersion, event.Type, event.Reason, event.Message, }, "") } // getSpamKey builds unique event key based on source, involvedObject func getSpamKey(event *v1.Event) string { return strings.Join([]string{ event.Source.Component, event.Source.Host, event.InvolvedObject.Kind, event.InvolvedObject.Namespace, event.InvolvedObject.Name, string(event.InvolvedObject.UID), event.InvolvedObject.APIVersion, }, "") } // EventSpamKeyFunc is a function that returns unique key based on provided event type EventSpamKeyFunc func(event *v1.Event) string // EventFilterFunc is a function that returns true if the event should be skipped type EventFilterFunc func(event *v1.Event) bool // EventSourceObjectSpamFilter is responsible for throttling // the amount of events a source and object can produce. type EventSourceObjectSpamFilter struct { sync.RWMutex // the cache that manages last synced state cache *lru.Cache // burst is the amount of events we allow per source + object burst int // qps is the refill rate of the token bucket in queries per second qps float32 // clock is used to allow for testing over a time interval clock clock.PassiveClock // spamKeyFunc is a func used to create a key based on an event, which is later used to filter spam events. spamKeyFunc EventSpamKeyFunc } // NewEventSourceObjectSpamFilter allows burst events from a source about an object with the specified qps refill. func NewEventSourceObjectSpamFilter(lruCacheSize, burst int, qps float32, clock clock.PassiveClock, spamKeyFunc EventSpamKeyFunc) *EventSourceObjectSpamFilter { return &EventSourceObjectSpamFilter{ cache: lru.New(lruCacheSize), burst: burst, qps: qps, clock: clock, spamKeyFunc: spamKeyFunc, } } // spamRecord holds data used to perform spam filtering decisions. type spamRecord struct { // rateLimiter controls the rate of events about this object rateLimiter flowcontrol.PassiveRateLimiter } // Filter controls that a given source+object are not exceeding the allowed rate. func (f *EventSourceObjectSpamFilter) Filter(event *v1.Event) bool { var record spamRecord // controls our cached information about this event eventKey := f.spamKeyFunc(event) // do we have a record of similar events in our cache? f.Lock() defer f.Unlock() value, found := f.cache.Get(eventKey) if found { record = value.(spamRecord) } // verify we have a rate limiter for this record if record.rateLimiter == nil { record.rateLimiter = flowcontrol.NewTokenBucketPassiveRateLimiterWithClock(f.qps, f.burst, f.clock) } // ensure we have available rate filter := !record.rateLimiter.TryAccept() // update the cache f.cache.Add(eventKey, record) return filter } // EventAggregatorKeyFunc is responsible for grouping events for aggregation // It returns a tuple of the following: // aggregateKey - key the identifies the aggregate group to bucket this event // localKey - key that makes this event in the local group type EventAggregatorKeyFunc func(event *v1.Event) (aggregateKey string, localKey string) // EventAggregatorByReasonFunc aggregates events by exact match on event.Source, event.InvolvedObject, event.Type, // event.Reason, event.ReportingController and event.ReportingInstance func EventAggregatorByReasonFunc(event *v1.Event) (string, string) { return strings.Join([]string{ event.Source.Component, event.Source.Host, event.InvolvedObject.Kind, event.InvolvedObject.Namespace, event.InvolvedObject.Name, string(event.InvolvedObject.UID), event.InvolvedObject.APIVersion, event.Type, event.Reason, event.ReportingController, event.ReportingInstance, }, ""), event.Message } // EventAggregatorMessageFunc is responsible for producing an aggregation message type EventAggregatorMessageFunc func(event *v1.Event) string // EventAggregatorByReasonMessageFunc returns an aggregate message by prefixing the incoming message func EventAggregatorByReasonMessageFunc(event *v1.Event) string { return "(combined from similar events): " + event.Message } // EventAggregator identifies similar events and aggregates them into a single event type EventAggregator struct { sync.RWMutex // The cache that manages aggregation state cache *lru.Cache // The function that groups events for aggregation keyFunc EventAggregatorKeyFunc // The function that generates a message for an aggregate event messageFunc EventAggregatorMessageFunc // The maximum number of events in the specified interval before aggregation occurs maxEvents uint // The amount of time in seconds that must transpire since the last occurrence of a similar event before it's considered new maxIntervalInSeconds uint // clock is used to allow for testing over a time interval clock clock.PassiveClock } // NewEventAggregator returns a new instance of an EventAggregator func NewEventAggregator(lruCacheSize int, keyFunc EventAggregatorKeyFunc, messageFunc EventAggregatorMessageFunc, maxEvents int, maxIntervalInSeconds int, clock clock.PassiveClock) *EventAggregator { return &EventAggregator{ cache: lru.New(lruCacheSize), keyFunc: keyFunc, messageFunc: messageFunc, maxEvents: uint(maxEvents), maxIntervalInSeconds: uint(maxIntervalInSeconds), clock: clock, } } // aggregateRecord holds data used to perform aggregation decisions type aggregateRecord struct { // we track the number of unique local keys we have seen in the aggregate set to know when to actually aggregate // if the size of this set exceeds the max, we know we need to aggregate localKeys sets.String // The last time at which the aggregate was recorded lastTimestamp metav1.Time } // EventAggregate checks if a similar event has been seen according to the // aggregation configuration (max events, max interval, etc) and returns: // // - The (potentially modified) event that should be created // - The cache key for the event, for correlation purposes. This will be set to // the full key for normal events, and to the result of // EventAggregatorMessageFunc for aggregate events. func (e *EventAggregator) EventAggregate(newEvent *v1.Event) (*v1.Event, string) { now := metav1.NewTime(e.clock.Now()) var record aggregateRecord // eventKey is the full cache key for this event eventKey := getEventKey(newEvent) // aggregateKey is for the aggregate event, if one is needed. aggregateKey, localKey := e.keyFunc(newEvent) // Do we have a record of similar events in our cache? e.Lock() defer e.Unlock() value, found := e.cache.Get(aggregateKey) if found { record = value.(aggregateRecord) } // Is the previous record too old? If so, make a fresh one. Note: if we didn't // find a similar record, its lastTimestamp will be the zero value, so we // create a new one in that case. maxInterval := time.Duration(e.maxIntervalInSeconds) * time.Second interval := now.Time.Sub(record.lastTimestamp.Time) if interval > maxInterval { record = aggregateRecord{localKeys: sets.NewString()} } // Write the new event into the aggregation record and put it on the cache record.localKeys.Insert(localKey) record.lastTimestamp = now e.cache.Add(aggregateKey, record) // If we are not yet over the threshold for unique events, don't correlate them if uint(record.localKeys.Len()) < e.maxEvents { return newEvent, eventKey } // do not grow our local key set any larger than max record.localKeys.PopAny() // create a new aggregate event, and return the aggregateKey as the cache key // (so that it can be overwritten.) eventCopy := &v1.Event{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%v.%x", newEvent.InvolvedObject.Name, now.UnixNano()), Namespace: newEvent.Namespace, }, Count: 1, FirstTimestamp: now, InvolvedObject: newEvent.InvolvedObject, LastTimestamp: now, Message: e.messageFunc(newEvent), Type: newEvent.Type, Reason: newEvent.Reason, Source: newEvent.Source, } return eventCopy, aggregateKey } // eventLog records data about when an event was observed type eventLog struct { // The number of times the event has occurred since first occurrence. count uint // The time at which the event was first recorded. firstTimestamp metav1.Time // The unique name of the first occurrence of this event name string // Resource version returned from previous interaction with server resourceVersion string } // eventLogger logs occurrences of an event type eventLogger struct { sync.RWMutex cache *lru.Cache clock clock.PassiveClock } // newEventLogger observes events and counts their frequencies func newEventLogger(lruCacheEntries int, clock clock.PassiveClock) *eventLogger { return &eventLogger{cache: lru.New(lruCacheEntries), clock: clock} } // eventObserve records an event, or updates an existing one if key is a cache hit func (e *eventLogger) eventObserve(newEvent *v1.Event, key string) (*v1.Event, []byte, error) { var ( patch []byte err error ) eventCopy := *newEvent event := &eventCopy e.Lock() defer e.Unlock() // Check if there is an existing event we should update lastObservation := e.lastEventObservationFromCache(key) // If we found a result, prepare a patch if lastObservation.count > 0 { // update the event based on the last observation so patch will work as desired event.Name = lastObservation.name event.ResourceVersion = lastObservation.resourceVersion event.FirstTimestamp = lastObservation.firstTimestamp event.Count = int32(lastObservation.count) + 1 eventCopy2 := *event eventCopy2.Count = 0 eventCopy2.LastTimestamp = metav1.NewTime(time.Unix(0, 0)) eventCopy2.Message = "" newData, _ := json.Marshal(event) oldData, _ := json.Marshal(eventCopy2) patch, err = strategicpatch.CreateTwoWayMergePatch(oldData, newData, event) } // record our new observation e.cache.Add( key, eventLog{ count: uint(event.Count), firstTimestamp: event.FirstTimestamp, name: event.Name, resourceVersion: event.ResourceVersion, }, ) return event, patch, err } // updateState updates its internal tracking information based on latest server state func (e *eventLogger) updateState(event *v1.Event) { key := getEventKey(event) e.Lock() defer e.Unlock() // record our new observation e.cache.Add( key, eventLog{ count: uint(event.Count), firstTimestamp: event.FirstTimestamp, name: event.Name, resourceVersion: event.ResourceVersion, }, ) } // lastEventObservationFromCache returns the event from the cache, reads must be protected via external lock func (e *eventLogger) lastEventObservationFromCache(key string) eventLog { value, ok := e.cache.Get(key) if ok { observationValue, ok := value.(eventLog) if ok { return observationValue } } return eventLog{} } // EventCorrelator processes all incoming events and performs analysis to avoid overwhelming the system. It can filter all // incoming events to see if the event should be filtered from further processing. It can aggregate similar events that occur // frequently to protect the system from spamming events that are difficult for users to distinguish. It performs de-duplication // to ensure events that are observed multiple times are compacted into a single event with increasing counts. type EventCorrelator struct { // the function to filter the event filterFunc EventFilterFunc // the object that performs event aggregation aggregator *EventAggregator // the object that observes events as they come through logger *eventLogger } // EventCorrelateResult is the result of a Correlate type EventCorrelateResult struct { // the event after correlation Event *v1.Event // if provided, perform a strategic patch when updating the record on the server Patch []byte // if true, do no further processing of the event Skip bool } // NewEventCorrelator returns an EventCorrelator configured with default values. // // The EventCorrelator is responsible for event filtering, aggregating, and counting // prior to interacting with the API server to record the event. // // The default behavior is as follows: // - Aggregation is performed if a similar event is recorded 10 times // in a 10 minute rolling interval. A similar event is an event that varies only by // the Event.Message field. Rather than recording the precise event, aggregation // will create a new event whose message reports that it has combined events with // the same reason. // - Events are incrementally counted if the exact same event is encountered multiple // times. // - A source may burst 25 events about an object, but has a refill rate budget // per object of 1 event every 5 minutes to control long-tail of spam. func NewEventCorrelator(clock clock.PassiveClock) *EventCorrelator { cacheSize := maxLruCacheEntries spamFilter := NewEventSourceObjectSpamFilter(cacheSize, defaultSpamBurst, defaultSpamQPS, clock, getSpamKey) return &EventCorrelator{ filterFunc: spamFilter.Filter, aggregator: NewEventAggregator( cacheSize, EventAggregatorByReasonFunc, EventAggregatorByReasonMessageFunc, defaultAggregateMaxEvents, defaultAggregateIntervalInSeconds, clock), logger: newEventLogger(cacheSize, clock), } } func NewEventCorrelatorWithOptions(options CorrelatorOptions) *EventCorrelator { optionsWithDefaults := populateDefaults(options) spamFilter := NewEventSourceObjectSpamFilter( optionsWithDefaults.LRUCacheSize, optionsWithDefaults.BurstSize, optionsWithDefaults.QPS, optionsWithDefaults.Clock, optionsWithDefaults.SpamKeyFunc) return &EventCorrelator{ filterFunc: spamFilter.Filter, aggregator: NewEventAggregator( optionsWithDefaults.LRUCacheSize, optionsWithDefaults.KeyFunc, optionsWithDefaults.MessageFunc, optionsWithDefaults.MaxEvents, optionsWithDefaults.MaxIntervalInSeconds, optionsWithDefaults.Clock), logger: newEventLogger(optionsWithDefaults.LRUCacheSize, optionsWithDefaults.Clock), } } // populateDefaults populates the zero value options with defaults func populateDefaults(options CorrelatorOptions) CorrelatorOptions { if options.LRUCacheSize == 0 { options.LRUCacheSize = maxLruCacheEntries } if options.BurstSize == 0 { options.BurstSize = defaultSpamBurst } if options.QPS == 0 { options.QPS = defaultSpamQPS } if options.KeyFunc == nil { options.KeyFunc = EventAggregatorByReasonFunc } if options.MessageFunc == nil { options.MessageFunc = EventAggregatorByReasonMessageFunc } if options.MaxEvents == 0 { options.MaxEvents = defaultAggregateMaxEvents } if options.MaxIntervalInSeconds == 0 { options.MaxIntervalInSeconds = defaultAggregateIntervalInSeconds } if options.Clock == nil { options.Clock = clock.RealClock{} } if options.SpamKeyFunc == nil { options.SpamKeyFunc = getSpamKey } return options } // EventCorrelate filters, aggregates, counts, and de-duplicates all incoming events func (c *EventCorrelator) EventCorrelate(newEvent *v1.Event) (*EventCorrelateResult, error) { if newEvent == nil { return nil, fmt.Errorf("event is nil") } aggregateEvent, ckey := c.aggregator.EventAggregate(newEvent) observedEvent, patch, err := c.logger.eventObserve(aggregateEvent, ckey) if c.filterFunc(observedEvent) { return &EventCorrelateResult{Skip: true}, nil } return &EventCorrelateResult{Event: observedEvent, Patch: patch}, err } // UpdateState based on the latest observed state from server func (c *EventCorrelator) UpdateState(event *v1.Event) { c.logger.updateState(event) } kubernetes-client-go-a2dfcab/tools/record/events_cache_test.go000066400000000000000000000326031472614177300250370ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package record import ( "reflect" "strconv" "strings" "testing" "time" "github.com/google/go-cmp/cmp" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" testclocks "k8s.io/utils/clock/testing" ) func makeObjectReference(kind, name, namespace string) v1.ObjectReference { return v1.ObjectReference{ Kind: kind, Name: name, Namespace: namespace, UID: "C934D34AFB20242", APIVersion: "version", FieldPath: "spec.containers{mycontainer}", } } func makeEvent(reason, message string, involvedObject v1.ObjectReference) v1.Event { eventTime := metav1.Now() event := v1.Event{ Reason: reason, Message: message, InvolvedObject: involvedObject, Source: v1.EventSource{ Component: "kubelet", Host: "kublet.node1", }, Count: 1, FirstTimestamp: eventTime, LastTimestamp: eventTime, Type: v1.EventTypeNormal, } return event } func makeEvents(num int, template v1.Event) []v1.Event { events := []v1.Event{} for i := 0; i < num; i++ { events = append(events, template) } return events } func makeUniqueEvents(num int) []v1.Event { events := []v1.Event{} kind := "Pod" for i := 0; i < num; i++ { reason := strings.Join([]string{"reason", strconv.Itoa(i)}, "-") message := strings.Join([]string{"message", strconv.Itoa(i)}, "-") name := strings.Join([]string{"pod", strconv.Itoa(i)}, "-") namespace := strings.Join([]string{"ns", strconv.Itoa(i)}, "-") involvedObject := makeObjectReference(kind, name, namespace) events = append(events, makeEvent(reason, message, involvedObject)) } return events } func makeSimilarEvents(num int, template v1.Event, messagePrefix string) []v1.Event { events := makeEvents(num, template) for i := range events { events[i].Message = strings.Join([]string{messagePrefix, strconv.Itoa(i), events[i].Message}, "-") } return events } func setCount(event v1.Event, count int) v1.Event { event.Count = int32(count) return event } func validateEvent(messagePrefix string, actualEvent *v1.Event, expectedEvent *v1.Event, t *testing.T) (*v1.Event, error) { recvEvent := *actualEvent expectCompression := expectedEvent.Count > 1 t.Logf("%v - expectedEvent.Count is %d\n", messagePrefix, expectedEvent.Count) // Just check that the timestamp was set. if recvEvent.FirstTimestamp.IsZero() || recvEvent.LastTimestamp.IsZero() { t.Errorf("%v - timestamp wasn't set: %#v", messagePrefix, recvEvent) } actualFirstTimestamp := recvEvent.FirstTimestamp actualLastTimestamp := recvEvent.LastTimestamp if actualFirstTimestamp.Equal(&actualLastTimestamp) { if expectCompression { t.Errorf("%v - FirstTimestamp (%q) and LastTimestamp (%q) must be different to indicate event compression happened, but were the same. Actual Event: %#v", messagePrefix, actualFirstTimestamp, actualLastTimestamp, recvEvent) } } else { if expectedEvent.Count == 1 { t.Errorf("%v - FirstTimestamp (%q) and LastTimestamp (%q) must be equal to indicate only one occurrence of the event, but were different. Actual Event: %#v", messagePrefix, actualFirstTimestamp, actualLastTimestamp, recvEvent) } } // Temp clear time stamps for comparison because actual values don't matter for comparison recvEvent.FirstTimestamp = expectedEvent.FirstTimestamp recvEvent.LastTimestamp = expectedEvent.LastTimestamp recvEvent.ReportingController = expectedEvent.ReportingController // Check that name has the right prefix. if n, en := recvEvent.Name, expectedEvent.Name; !strings.HasPrefix(n, en) { t.Errorf("%v - Name '%v' does not contain prefix '%v'", messagePrefix, n, en) } recvEvent.Name = expectedEvent.Name if e, a := expectedEvent, &recvEvent; !reflect.DeepEqual(e, a) { t.Errorf("%v - diff: %s", messagePrefix, cmp.Diff(e, a)) } recvEvent.FirstTimestamp = actualFirstTimestamp recvEvent.LastTimestamp = actualLastTimestamp return actualEvent, nil } // TestEventAggregatorByReasonFunc ensures that two events are aggregated if they vary only by event.message func TestEventAggregatorByReasonFunc(t *testing.T) { event1 := makeEvent("end-of-world", "it was fun", makeObjectReference("Pod", "pod1", "other")) event2 := makeEvent("end-of-world", "it was awful", makeObjectReference("Pod", "pod1", "other")) event3 := makeEvent("nevermind", "it was a bug", makeObjectReference("Pod", "pod1", "other")) aggKey1, localKey1 := EventAggregatorByReasonFunc(&event1) aggKey2, localKey2 := EventAggregatorByReasonFunc(&event2) aggKey3, _ := EventAggregatorByReasonFunc(&event3) if aggKey1 != aggKey2 { t.Errorf("Expected %v equal %v", aggKey1, aggKey2) } if localKey1 == localKey2 { t.Errorf("Expected %v to not equal %v", aggKey1, aggKey3) } if aggKey1 == aggKey3 { t.Errorf("Expected %v to not equal %v", aggKey1, aggKey3) } } // TestEventAggregatorByReasonMessageFunc validates the proper output for an aggregate message func TestEventAggregatorByReasonMessageFunc(t *testing.T) { expectedPrefix := "(combined from similar events): " event1 := makeEvent("end-of-world", "it was fun", makeObjectReference("Pod", "pod1", "other")) actual := EventAggregatorByReasonMessageFunc(&event1) if !strings.HasPrefix(actual, expectedPrefix) { t.Errorf("Expected %v to begin with prefix %v", actual, expectedPrefix) } } // TestEventCorrelator validates proper counting, aggregation of events func TestEventCorrelator(t *testing.T) { firstEvent := makeEvent("first", "i am first", makeObjectReference("Pod", "my-pod", "my-ns")) duplicateEvent := makeEvent("duplicate", "me again", makeObjectReference("Pod", "my-pod", "my-ns")) uniqueEvent := makeEvent("unique", "snowflake", makeObjectReference("Pod", "my-pod", "my-ns")) similarEvent := makeEvent("similar", "similar message", makeObjectReference("Pod", "my-pod", "my-ns")) similarEvent.InvolvedObject.FieldPath = "spec.containers{container1}" aggregateEvent := makeEvent(similarEvent.Reason, EventAggregatorByReasonMessageFunc(&similarEvent), similarEvent.InvolvedObject) similarButDifferentContainerEvent := similarEvent similarButDifferentContainerEvent.InvolvedObject.FieldPath = "spec.containers{container2}" scenario := map[string]struct { previousEvents []v1.Event newEvent v1.Event expectedEvent v1.Event intervalSeconds int expectedSkip bool }{ "create-a-single-event": { previousEvents: []v1.Event{}, newEvent: firstEvent, expectedEvent: setCount(firstEvent, 1), intervalSeconds: 5, }, "the-same-event-should-just-count": { previousEvents: makeEvents(1, duplicateEvent), newEvent: duplicateEvent, expectedEvent: setCount(duplicateEvent, 2), intervalSeconds: 5, }, "the-same-event-should-just-count-even-if-more-than-aggregate": { previousEvents: makeEvents(defaultAggregateMaxEvents, duplicateEvent), newEvent: duplicateEvent, expectedEvent: setCount(duplicateEvent, defaultAggregateMaxEvents+1), intervalSeconds: 30, // larger interval induces aggregation but not spam. }, "the-same-event-is-spam-if-happens-too-frequently": { previousEvents: makeEvents(defaultSpamBurst+1, duplicateEvent), newEvent: duplicateEvent, expectedSkip: true, intervalSeconds: 1, }, "create-many-unique-events": { previousEvents: makeUniqueEvents(30), newEvent: uniqueEvent, expectedEvent: setCount(uniqueEvent, 1), intervalSeconds: 5, }, "similar-events-should-aggregate-event": { previousEvents: makeSimilarEvents(defaultAggregateMaxEvents-1, similarEvent, similarEvent.Message), newEvent: similarEvent, expectedEvent: setCount(aggregateEvent, 1), intervalSeconds: 5, }, "similar-events-many-times-should-count-the-aggregate": { previousEvents: makeSimilarEvents(defaultAggregateMaxEvents, similarEvent, similarEvent.Message), newEvent: similarEvent, expectedEvent: setCount(aggregateEvent, 2), intervalSeconds: 5, }, "events-from-different-containers-do-not-aggregate": { previousEvents: makeEvents(1, similarButDifferentContainerEvent), newEvent: similarEvent, expectedEvent: setCount(similarEvent, 1), intervalSeconds: 5, }, "similar-events-whose-interval-is-greater-than-aggregate-interval-do-not-aggregate": { previousEvents: makeSimilarEvents(defaultAggregateMaxEvents-1, similarEvent, similarEvent.Message), newEvent: similarEvent, expectedEvent: setCount(similarEvent, 1), intervalSeconds: defaultAggregateIntervalInSeconds, }, } for testScenario, testInput := range scenario { eventInterval := time.Duration(testInput.intervalSeconds) * time.Second clock := testclocks.SimpleIntervalClock{Time: time.Now(), Duration: eventInterval} correlator := NewEventCorrelator(&clock) for i := range testInput.previousEvents { event := testInput.previousEvents[i] now := metav1.NewTime(clock.Now()) event.FirstTimestamp = now event.LastTimestamp = now result, err := correlator.EventCorrelate(&event) if err != nil { t.Errorf("scenario %v: unexpected error playing back prevEvents %v", testScenario, err) } // if we are skipping the event, we can avoid updating state if !result.Skip { correlator.UpdateState(result.Event) } } // update the input to current clock value now := metav1.NewTime(clock.Now()) testInput.newEvent.FirstTimestamp = now testInput.newEvent.LastTimestamp = now result, err := correlator.EventCorrelate(&testInput.newEvent) if err != nil { t.Errorf("scenario %v: unexpected error correlating input event %v", testScenario, err) } // verify we did not get skip from filter function unexpectedly... if result.Skip != testInput.expectedSkip { t.Errorf("scenario %v: expected skip %v, but got %v", testScenario, testInput.expectedSkip, result.Skip) continue } // we wanted to actually skip, so no event is needed to validate if testInput.expectedSkip { continue } // validate event _, err = validateEvent(testScenario, result.Event, &testInput.expectedEvent, t) if err != nil { t.Errorf("scenario %v: unexpected error validating result %v", testScenario, err) } } } func TestEventSpamFilter(t *testing.T) { spamKeyFuncBasedOnObjectsAndReason := func(e *v1.Event) string { return strings.Join([]string{ e.Source.Component, e.Source.Host, e.InvolvedObject.Kind, e.InvolvedObject.Namespace, e.InvolvedObject.Name, string(e.InvolvedObject.UID), e.InvolvedObject.APIVersion, e.Reason, }, "") } burstSize := 1 eventInterval := time.Duration(1) * time.Second originalEvent := makeEvent("original", "i am first", makeObjectReference("Pod", "my-pod", "my-ns")) differentReasonEvent := makeEvent("duplicate", "me again", makeObjectReference("Pod", "my-pod", "my-ns")) spamEvent := makeEvent("original", "me again", makeObjectReference("Pod", "my-pod", "my-ns")) testCases := map[string]struct { newEvent v1.Event expectedEvent v1.Event expectedSkip bool spamKeyFunc EventSpamKeyFunc }{ "event should be reported as spam if object reference is the same for default spam filter": { newEvent: differentReasonEvent, expectedSkip: true, }, "event should not be reported as spam if object reference is the same, but reason is different for custom spam filter": { newEvent: differentReasonEvent, expectedEvent: differentReasonEvent, expectedSkip: false, spamKeyFunc: spamKeyFuncBasedOnObjectsAndReason, }, "event should be reported as spam if object reference and reason is the same, but message is different for custom spam filter": { newEvent: spamEvent, expectedSkip: true, spamKeyFunc: spamKeyFuncBasedOnObjectsAndReason, }, } for testDescription, testInput := range testCases { c := testclocks.SimpleIntervalClock{Time: time.Now(), Duration: eventInterval} correlator := NewEventCorrelatorWithOptions(CorrelatorOptions{ Clock: &c, SpamKeyFunc: testInput.spamKeyFunc, BurstSize: burstSize, }) // emitting original event result, err := correlator.EventCorrelate(&originalEvent) if err != nil { t.Errorf("scenario %v: unexpected error correlating originalEvent %v", testDescription, err) } // if we are skipping the event, we can avoid updating state if !result.Skip { correlator.UpdateState(result.Event) } result, err = correlator.EventCorrelate(&testInput.newEvent) if err != nil { t.Errorf("scenario %v: unexpected error correlating input event %v", testDescription, err) } // verify we did not get skip from filter function unexpectedly... if result.Skip != testInput.expectedSkip { t.Errorf("scenario %v: expected skip %v, but got %v", testDescription, testInput.expectedSkip, result.Skip) continue } // we wanted to actually skip, so no event is needed to validate if testInput.expectedSkip { continue } // validate event _, err = validateEvent(testDescription, result.Event, &testInput.expectedEvent, t) if err != nil { t.Errorf("scenario %v: unexpected error validating result %v", testDescription, err) } } } kubernetes-client-go-a2dfcab/tools/record/fake.go000066400000000000000000000050631472614177300222570ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package record import ( "fmt" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog/v2" ) // FakeRecorder is used as a fake during tests. It is thread safe. It is usable // when created manually and not by NewFakeRecorder, however all events may be // thrown away in this case. type FakeRecorder struct { Events chan string IncludeObject bool } var _ EventRecorderLogger = &FakeRecorder{} func objectString(object runtime.Object, includeObject bool) string { if !includeObject { return "" } return fmt.Sprintf(" involvedObject{kind=%s,apiVersion=%s}", object.GetObjectKind().GroupVersionKind().Kind, object.GetObjectKind().GroupVersionKind().GroupVersion(), ) } func annotationsString(annotations map[string]string) string { if len(annotations) == 0 { return "" } else { return " " + fmt.Sprint(annotations) } } func (f *FakeRecorder) writeEvent(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { if f.Events != nil { f.Events <- fmt.Sprintf(eventtype+" "+reason+" "+messageFmt, args...) + objectString(object, f.IncludeObject) + annotationsString(annotations) } } func (f *FakeRecorder) Event(object runtime.Object, eventtype, reason, message string) { f.writeEvent(object, nil, eventtype, reason, "%s", message) } func (f *FakeRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) { f.writeEvent(object, nil, eventtype, reason, messageFmt, args...) } func (f *FakeRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { f.writeEvent(object, annotations, eventtype, reason, messageFmt, args...) } func (f *FakeRecorder) WithLogger(logger klog.Logger) EventRecorderLogger { return f } // NewFakeRecorder creates new fake event recorder with event channel with // buffer of given size. func NewFakeRecorder(bufferSize int) *FakeRecorder { return &FakeRecorder{ Events: make(chan string, bufferSize), } } kubernetes-client-go-a2dfcab/tools/record/main_test.go000066400000000000000000000012631472614177300233320ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package record import ( "testing" "go.uber.org/goleak" ) func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } kubernetes-client-go-a2dfcab/tools/record/util/000077500000000000000000000000001472614177300217735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/record/util/util.go000066400000000000000000000021661472614177300233040ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package util import ( "net/http" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" ) // ValidateEventType checks that eventtype is an expected type of event func ValidateEventType(eventtype string) bool { switch eventtype { case v1.EventTypeNormal, v1.EventTypeWarning: return true } return false } // IsKeyNotFoundError is utility function that checks if an error is not found error func IsKeyNotFoundError(err error) bool { statusErr, _ := err.(*errors.StatusError) return statusErr != nil && statusErr.Status().Code == http.StatusNotFound } kubernetes-client-go-a2dfcab/tools/reference/000077500000000000000000000000001472614177300214765ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/reference/ref.go000066400000000000000000000061511472614177300226040ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package reference import ( "errors" "fmt" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) var ( // Errors that could be returned by GetReference. ErrNilObject = errors.New("can't reference a nil object") ) // GetReference returns an ObjectReference which refers to the given // object, or an error if the object doesn't follow the conventions // that would allow this. // TODO: should take a meta.Interface see https://issue.k8s.io/7127 func GetReference(scheme *runtime.Scheme, obj runtime.Object) (*v1.ObjectReference, error) { if obj == nil { return nil, ErrNilObject } if ref, ok := obj.(*v1.ObjectReference); ok { // Don't make a reference to a reference. return ref, nil } // An object that implements only List has enough metadata to build a reference var listMeta metav1.Common objectMeta, err := meta.Accessor(obj) if err != nil { listMeta, err = meta.CommonAccessor(obj) if err != nil { return nil, err } } else { listMeta = objectMeta } gvk := obj.GetObjectKind().GroupVersionKind() // If object meta doesn't contain data about kind and/or version, // we are falling back to scheme. // // TODO: This doesn't work for CRDs, which are not registered in scheme. if gvk.Empty() { gvks, _, err := scheme.ObjectKinds(obj) if err != nil { return nil, err } if len(gvks) == 0 || gvks[0].Empty() { return nil, fmt.Errorf("unexpected gvks registered for object %T: %v", obj, gvks) } // TODO: The same object can be registered for multiple group versions // (although in practise this doesn't seem to be used). // In such case, the version set may not be correct. gvk = gvks[0] } kind := gvk.Kind version := gvk.GroupVersion().String() // only has list metadata if objectMeta == nil { return &v1.ObjectReference{ Kind: kind, APIVersion: version, ResourceVersion: listMeta.GetResourceVersion(), }, nil } return &v1.ObjectReference{ Kind: kind, APIVersion: version, Name: objectMeta.GetName(), Namespace: objectMeta.GetNamespace(), UID: objectMeta.GetUID(), ResourceVersion: objectMeta.GetResourceVersion(), }, nil } // GetPartialReference is exactly like GetReference, but allows you to set the FieldPath. func GetPartialReference(scheme *runtime.Scheme, obj runtime.Object, fieldPath string) (*v1.ObjectReference, error) { ref, err := GetReference(scheme, obj) if err != nil { return nil, err } ref.FieldPath = fieldPath return ref, nil } kubernetes-client-go-a2dfcab/tools/reference/ref_test.go000066400000000000000000000036161472614177300236460ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package reference import ( "testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) type TestRuntimeObj struct { metav1.TypeMeta metav1.ObjectMeta } func (o *TestRuntimeObj) DeepCopyObject() runtime.Object { panic("die") } func TestGetReferenceRefVersion(t *testing.T) { tests := []struct { name string input *TestRuntimeObj groupVersion schema.GroupVersion expectedRefVersion string }{ { name: "v1 GV from scheme", input: &TestRuntimeObj{ ObjectMeta: metav1.ObjectMeta{}, }, groupVersion: schema.GroupVersion{Group: "", Version: "v1"}, expectedRefVersion: "v1", }, { name: "foo.group/v3 GV from scheme", input: &TestRuntimeObj{ ObjectMeta: metav1.ObjectMeta{}, }, groupVersion: schema.GroupVersion{Group: "foo.group", Version: "v3"}, expectedRefVersion: "foo.group/v3", }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { scheme := runtime.NewScheme() scheme.AddKnownTypes(test.groupVersion, &TestRuntimeObj{}) ref, err := GetReference(scheme, test.input) if err != nil { t.Fatal(err) } if test.expectedRefVersion != ref.APIVersion { t.Errorf("expected %q, got %q", test.expectedRefVersion, ref.APIVersion) } }) } } kubernetes-client-go-a2dfcab/tools/remotecommand/000077500000000000000000000000001472614177300223725ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/remotecommand/OWNERS000066400000000000000000000002131472614177300233260ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - aojea - liggitt - seans3 reviewers: - aojea - liggitt - seans3 kubernetes-client-go-a2dfcab/tools/remotecommand/doc.go000066400000000000000000000014411472614177300234660ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package remotecommand adds support for executing commands in containers, // with support for separate stdin, stdout, and stderr streams, as well as // TTY. package remotecommand // import "k8s.io/client-go/tools/remotecommand" kubernetes-client-go-a2dfcab/tools/remotecommand/errorstream.go000066400000000000000000000030441472614177300252670ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "fmt" "io" "k8s.io/apimachinery/pkg/util/runtime" ) // errorStreamDecoder interprets the data on the error channel and creates a go error object from it. type errorStreamDecoder interface { decode(message []byte) error } // watchErrorStream watches the errorStream for remote command error data, // decodes it with the given errorStreamDecoder, sends the decoded error (or nil if the remote // command exited successfully) to the returned error channel, and closes it. // This function returns immediately. func watchErrorStream(errorStream io.Reader, d errorStreamDecoder) chan error { errorChan := make(chan error) go func() { defer runtime.HandleCrash() message, err := io.ReadAll(errorStream) switch { case err != nil && err != io.EOF: errorChan <- fmt.Errorf("error reading from error stream: %s", err) case len(message) > 0: errorChan <- d.decode(message) default: errorChan <- nil } close(errorChan) }() return errorChan } kubernetes-client-go-a2dfcab/tools/remotecommand/fallback.go000066400000000000000000000037551472614177300244720ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "context" "k8s.io/klog/v2" ) var _ Executor = &FallbackExecutor{} type FallbackExecutor struct { primary Executor secondary Executor shouldFallback func(error) bool } // NewFallbackExecutor creates an Executor that first attempts to use the // WebSocketExecutor, falling back to the legacy SPDYExecutor if the initial // websocket "StreamWithContext" call fails. // func NewFallbackExecutor(config *restclient.Config, method string, url *url.URL) (Executor, error) { func NewFallbackExecutor(primary, secondary Executor, shouldFallback func(error) bool) (Executor, error) { return &FallbackExecutor{ primary: primary, secondary: secondary, shouldFallback: shouldFallback, }, nil } // Stream is deprecated. Please use "StreamWithContext". func (f *FallbackExecutor) Stream(options StreamOptions) error { return f.StreamWithContext(context.Background(), options) } // StreamWithContext initially attempts to call "StreamWithContext" using the // primary executor, falling back to calling the secondary executor if the // initial primary call to upgrade to a websocket connection fails. func (f *FallbackExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { err := f.primary.StreamWithContext(ctx, options) if f.shouldFallback(err) { klog.V(4).Infof("RemoteCommand fallback: %v", err) return f.secondary.StreamWithContext(ctx, options) } return err } kubernetes-client-go-a2dfcab/tools/remotecommand/fallback_test.go000066400000000000000000000360771472614177300255340ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "bytes" "context" "crypto/rand" "crypto/tls" "io" "net/http" "net/http/httptest" "net/url" "sync/atomic" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/httpstream" utilnettesting "k8s.io/apimachinery/pkg/util/net/testing" "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" ) func TestFallbackClient_WebSocketPrimarySucceeds(t *testing.T) { // Create fake WebSocket server. Copy received STDIN data back onto STDOUT stream. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { w.WriteHeader(http.StatusForbidden) return } defer conns.conn.Close() // Loopback the STDIN stream onto the STDOUT stream. _, err = io.Copy(conns.stdoutStream, conns.stdinStream) require.NoError(t, err) })) defer websocketServer.Close() // Now create the fallback client (executor), and point it to the "websocketServer". // Must add STDIN and STDOUT query params for the client request. websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) require.NoError(t, err) websocketExecutor, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) require.NoError(t, err) spdyExecutor, err := NewSPDYExecutor(&rest.Config{Host: websocketLocation.Host}, "POST", websocketLocation) require.NoError(t, err) // Never fallback, so always use the websocketExecutor, which succeeds against websocket server. exec, err := NewFallbackExecutor(websocketExecutor, spdyExecutor, func(error) bool { return false }) require.NoError(t, err) // Generate random data, and set it up to stream on STDIN. The data will be // returned on the STDOUT buffer. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error") } } data, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Errorf("error reading the stream: %v", err) return } // Check the random data sent on STDIN was the same returned on STDOUT. if !bytes.Equal(randomData, data) { t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) } } func TestFallbackClient_SPDYSecondarySucceeds(t *testing.T) { // Create fake SPDY server. Copy received STDIN data back onto STDOUT stream. spdyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var stdin, stdout bytes.Buffer ctx, err := createHTTPStreams(w, req, &StreamOptions{ Stdin: &stdin, Stdout: &stdout, }) if err != nil { w.WriteHeader(http.StatusForbidden) return } defer ctx.conn.Close() _, err = io.Copy(ctx.stdoutStream, ctx.stdinStream) if err != nil { t.Fatalf("error copying STDIN to STDOUT: %v", err) } })) defer spdyServer.Close() spdyLocation, err := url.Parse(spdyServer.URL) require.NoError(t, err) websocketExecutor, err := NewWebSocketExecutor(&rest.Config{Host: spdyLocation.Host}, "GET", spdyServer.URL) require.NoError(t, err) spdyExecutor, err := NewSPDYExecutor(&rest.Config{Host: spdyLocation.Host}, "POST", spdyLocation) require.NoError(t, err) // Always fallback to spdyExecutor, and spdyExecutor succeeds against fake spdy server. exec, err := NewFallbackExecutor(websocketExecutor, spdyExecutor, func(error) bool { return true }) require.NoError(t, err) // Generate random data, and set it up to stream on STDIN. The data will be // returned on the STDOUT buffer. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stdout: &stdout, } errorChan := make(chan error) go func() { errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error") } } data, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Errorf("error reading the stream: %v", err) return } // Check the random data sent on STDIN was the same returned on STDOUT. if !bytes.Equal(randomData, data) { t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) } } func TestFallbackClient_PrimaryAndSecondaryFail(t *testing.T) { // Create fake WebSocket server. Copy received STDIN data back onto STDOUT stream. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { w.WriteHeader(http.StatusForbidden) return } defer conns.conn.Close() // Loopback the STDIN stream onto the STDOUT stream. _, err = io.Copy(conns.stdoutStream, conns.stdinStream) require.NoError(t, err) })) defer websocketServer.Close() // Now create the fallback client (executor), and point it to the "websocketServer". // Must add STDIN and STDOUT query params for the client request. websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) require.NoError(t, err) websocketExecutor, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) require.NoError(t, err) spdyExecutor, err := NewSPDYExecutor(&rest.Config{Host: websocketLocation.Host}, "POST", websocketLocation) require.NoError(t, err) // Always fallback to spdyExecutor, but spdyExecutor fails against websocket server. exec, err := NewFallbackExecutor(websocketExecutor, spdyExecutor, func(error) bool { return true }) require.NoError(t, err) // Update the websocket executor to request remote command v4, which is unsupported. fallbackExec, ok := exec.(*FallbackExecutor) assert.True(t, ok, "error casting executor as FallbackExecutor") websocketExec, ok := fallbackExec.primary.(*wsStreamExecutor) assert.True(t, ok, "error casting executor as websocket executor") // Set the attempted subprotocol version to V4; websocket server only accepts V5. websocketExec.protocols = []string{remotecommand.StreamProtocolV4Name} // Generate random data, and set it up to stream on STDIN. The data will be // returned on the STDOUT buffer. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stdout: &stdout, } errorChan := make(chan error) go func() { errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: // Ensure secondary executor returned an error. require.Error(t, err) } } // localhostCert was generated from crypto/tls/generate_cert.go with the following command: // // go run generate_cert.go --rsa-bits 2048 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h var localhostCert = []byte(`-----BEGIN CERTIFICATE----- MIIDGTCCAgGgAwIBAgIRALL5AZcefF4kkYV1SEG6YrMwDQYJKoZIhvcNAQELBQAw EjEQMA4GA1UEChMHQWNtZSBDbzAgFw03MDAxMDEwMDAwMDBaGA8yMDg0MDEyOTE2 MDAwMFowEjEQMA4GA1UEChMHQWNtZSBDbzCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBALQ/FHcyVwdFHxARbbD2KBtDUT7Eni+8ioNdjtGcmtXqBv45EC1C JOqqGJTroFGJ6Q9kQIZ9FqH5IJR2fOOJD9kOTueG4Vt1JY1rj1Kbpjefu8XleZ5L SBwIWVnN/lEsEbuKmj7N2gLt5AH3zMZiBI1mg1u9Z5ZZHYbCiTpBrwsq6cTlvR9g dyo1YkM5hRESCzsrL0aUByoo0qRMD8ZsgANJwgsiO0/M6idbxDwv1BnGwGmRYvOE Hxpy3v0Jg7GJYrvnpnifJTs4nw91N5X9pXxR7FFzi/6HTYDWRljvTb0w6XciKYAz bWZ0+cJr5F7wB7ovlbm7HrQIR7z7EIIu2d8CAwEAAaNoMGYwDgYDVR0PAQH/BAQD AgKkMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1UdEwEB/wQFMAMBAf8wLgYDVR0R BCcwJYILZXhhbXBsZS5jb22HBH8AAAGHEAAAAAAAAAAAAAAAAAAAAAEwDQYJKoZI hvcNAQELBQADggEBAFPPWopNEJtIA2VFAQcqN6uJK+JVFOnjGRoCrM6Xgzdm0wxY XCGjsxY5dl+V7KzdGqu858rCaq5osEBqypBpYAnS9C38VyCDA1vPS1PsN8SYv48z DyBwj+7R2qar0ADBhnhWxvYO9M72lN/wuCqFKYMeFSnJdQLv3AsrrHe9lYqOa36s 8wxSwVTFTYXBzljPEnSaaJMPqFD8JXaZK1ryJPkO5OsCNQNGtatNiWAf3DcmwHAT MGYMzP0u4nw47aRz9shB8w+taPKHx2BVwE1m/yp3nHVioOjXqA1fwRQVGclCJSH1 D2iq3hWVHRENgjTjANBPICLo9AZ4JfN6PH19mnU= -----END CERTIFICATE-----`) // localhostKey is the private key for localhostCert. var localhostKey = []byte(`-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAtD8UdzJXB0UfEBFtsPYoG0NRPsSeL7yKg12O0Zya1eoG/jkQ LUIk6qoYlOugUYnpD2RAhn0WofkglHZ844kP2Q5O54bhW3UljWuPUpumN5+7xeV5 nktIHAhZWc3+USwRu4qaPs3aAu3kAffMxmIEjWaDW71nllkdhsKJOkGvCyrpxOW9 H2B3KjViQzmFERILOysvRpQHKijSpEwPxmyAA0nCCyI7T8zqJ1vEPC/UGcbAaZFi 84QfGnLe/QmDsYliu+emeJ8lOzifD3U3lf2lfFHsUXOL/odNgNZGWO9NvTDpdyIp gDNtZnT5wmvkXvAHui+VubsetAhHvPsQgi7Z3wIDAQABAoIBAGmw93IxjYCQ0ncc kSKMJNZfsdtJdaxuNRZ0nNNirhQzR2h403iGaZlEpmdkhzxozsWcto1l+gh+SdFk bTUK4MUZM8FlgO2dEqkLYh5BcMT7ICMZvSfJ4v21E5eqR68XVUqQKoQbNvQyxFk3 EddeEGdNrkb0GDK8DKlBlzAW5ep4gjG85wSTjR+J+muUv3R0BgLBFSuQnIDM/IMB LWqsja/QbtB7yppe7jL5u8UCFdZG8BBKT9fcvFIu5PRLO3MO0uOI7LTc8+W1Xm23 uv+j3SY0+v+6POjK0UlJFFi/wkSPTFIfrQO1qFBkTDQHhQ6q/7GnILYYOiGbIRg2 NNuP52ECgYEAzXEoy50wSYh8xfFaBuxbm3ruuG2W49jgop7ZfoFrPWwOQKAZS441 VIwV4+e5IcA6KkuYbtGSdTYqK1SMkgnUyD/VevwAqH5TJoEIGu0pDuKGwVuwqioZ frCIAV5GllKyUJ55VZNbRr2vY2fCsWbaCSCHETn6C16DNuTCe5C0JBECgYEA4JqY 5GpNbMG8fOt4H7hU0Fbm2yd6SHJcQ3/9iimef7xG6ajxsYrIhg1ft+3IPHMjVI0+ 9brwHDnWg4bOOx/VO4VJBt6Dm/F33bndnZRkuIjfSNpLM51P+EnRdaFVHOJHwKqx uF69kihifCAG7YATgCveeXImzBUSyZUz9UrETu8CgYARNBimdFNG1RcdvEg9rC0/ p9u1tfecvNySwZqU7WF9kz7eSonTueTdX521qAHowaAdSpdJMGODTTXaywm6cPhQ jIfj9JZZhbqQzt1O4+08Qdvm9TamCUB5S28YLjza+bHU7nBaqixKkDfPqzCyilpX yVGGL8SwjwmN3zop/sQXAQKBgC0JMsESQ6YcDsRpnrOVjYQc+LtW5iEitTdfsaID iGGKihmOI7B66IxgoCHMTws39wycKdSyADVYr5e97xpR3rrJlgQHmBIrz+Iow7Q2 LiAGaec8xjl6QK/DdXmFuQBKqyKJ14rljFODP4QuE9WJid94bGqjpf3j99ltznZP 4J8HAoGAJb4eb4lu4UGwifDzqfAPzLGCoi0fE1/hSx34lfuLcc1G+LEu9YDKoOVJ 9suOh0b5K/bfEy9KrVMBBriduvdaERSD8S3pkIQaitIz0B029AbE4FLFf9lKQpP2 KR8NJEkK99Vh/tew6jAMll70xFrE7aF8VLXJVE7w4sQzuvHxl9Q= -----END RSA PRIVATE KEY----- `) // See (https://github.com/kubernetes/kubernetes/issues/126134). func TestFallbackClient_WebSocketHTTPSProxyCausesSPDYFallback(t *testing.T) { cert, err := tls.X509KeyPair(localhostCert, localhostKey) if err != nil { t.Errorf("https (valid hostname): proxy_test: %v", err) } var proxyCalled atomic.Int64 proxyHandler := utilnettesting.NewHTTPProxyHandler(t, func(req *http.Request) bool { proxyCalled.Add(1) return true }) defer proxyHandler.Wait() proxyServer := httptest.NewUnstartedServer(proxyHandler) proxyServer.TLS = &tls.Config{Certificates: []tls.Certificate{cert}} proxyServer.StartTLS() defer proxyServer.Close() //nolint:errcheck proxyLocation, err := url.Parse(proxyServer.URL) require.NoError(t, err) // Create fake SPDY server. Copy received STDIN data back onto STDOUT stream. spdyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var stdin, stdout bytes.Buffer ctx, err := createHTTPStreams(w, req, &StreamOptions{ Stdin: &stdin, Stdout: &stdout, }) if err != nil { w.WriteHeader(http.StatusForbidden) return } defer ctx.conn.Close() //nolint:errcheck _, err = io.Copy(ctx.stdoutStream, ctx.stdinStream) if err != nil { t.Fatalf("error copying STDIN to STDOUT: %v", err) } })) defer spdyServer.Close() //nolint:errcheck backendLocation, err := url.Parse(spdyServer.URL) require.NoError(t, err) clientConfig := &rest.Config{ Host: spdyServer.URL, TLSClientConfig: rest.TLSClientConfig{CAData: localhostCert}, Proxy: func(req *http.Request) (*url.URL, error) { return proxyLocation, nil }, } // Websocket with https proxy will fail in dialing (falling back to SPDY). websocketExecutor, err := NewWebSocketExecutor(clientConfig, "GET", backendLocation.String()) require.NoError(t, err) spdyExecutor, err := NewSPDYExecutor(clientConfig, "POST", backendLocation) require.NoError(t, err) // Fallback to spdyExecutor with websocket https proxy error; spdyExecutor succeeds against fake spdy server. sawHTTPSProxyError := false exec, err := NewFallbackExecutor(websocketExecutor, spdyExecutor, func(err error) bool { if httpstream.IsUpgradeFailure(err) { t.Errorf("saw upgrade failure: %v", err) return true } if httpstream.IsHTTPSProxyError(err) { sawHTTPSProxyError = true t.Logf("saw https proxy error: %v", err) return true } return false }) require.NoError(t, err) // Generate random data, and set it up to stream on STDIN. The data will be // returned on the STDOUT buffer. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stdout: &stdout, } errorChan := make(chan error) go func() { errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error") } } data, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Errorf("error reading the stream: %v", err) return } // Check the random data sent on STDIN was the same returned on STDOUT. if !bytes.Equal(randomData, data) { t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) } // Ensure the https proxy error was observed if !sawHTTPSProxyError { t.Errorf("expected to see https proxy error") } // Ensure the proxy was called once if e, a := int64(1), proxyCalled.Load(); e != a { t.Errorf("expected %d proxy call, got %d", e, a) } } kubernetes-client-go-a2dfcab/tools/remotecommand/reader.go000066400000000000000000000032251472614177300241650ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "io" ) // readerWrapper delegates to an io.Reader so that only the io.Reader interface is implemented, // to keep io.Copy from doing things we don't want when copying from the reader to the data stream. // // If the Stdin io.Reader provided to remotecommand implements a WriteTo function (like bytes.Buffer does[1]), // io.Copy calls that method[2] to attempt to write the entire buffer to the stream in one call. // That results in an oversized call to spdystream.Stream#Write [3], // which results in a single oversized data frame[4] that is too large. // // [1] https://golang.org/pkg/bytes/#Buffer.WriteTo // [2] https://golang.org/pkg/io/#Copy // [3] https://github.com/kubernetes/kubernetes/blob/90295640ef87db9daa0144c5617afe889e7992b2/vendor/github.com/docker/spdystream/stream.go#L66-L73 // [4] https://github.com/kubernetes/kubernetes/blob/90295640ef87db9daa0144c5617afe889e7992b2/vendor/github.com/docker/spdystream/spdy/write.go#L302-L304 type readerWrapper struct { reader io.Reader } func (r readerWrapper) Read(p []byte) (int, error) { return r.reader.Read(p) } kubernetes-client-go-a2dfcab/tools/remotecommand/remotecommand.go000066400000000000000000000036261472614177300255620ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "context" "io" "net/http" "k8s.io/apimachinery/pkg/util/httpstream" ) // StreamOptions holds information pertaining to the current streaming session: // input/output streams, if the client is requesting a TTY, and a terminal size queue to // support terminal resizing. type StreamOptions struct { Stdin io.Reader Stdout io.Writer Stderr io.Writer Tty bool TerminalSizeQueue TerminalSizeQueue } // Executor is an interface for transporting shell-style streams. type Executor interface { // Deprecated: use StreamWithContext instead to avoid possible resource leaks. // See https://github.com/kubernetes/kubernetes/pull/103177 for details. Stream(options StreamOptions) error // StreamWithContext initiates the transport of the standard shell streams. It will // transport any non-nil stream to a remote system, and return an error if a problem // occurs. If tty is set, the stderr stream is not used (raw TTY manages stdout and // stderr over the stdout stream). // The context controls the entire lifetime of stream execution. StreamWithContext(ctx context.Context, options StreamOptions) error } type streamCreator interface { CreateStream(headers http.Header) (httpstream.Stream, error) } type streamProtocolHandler interface { stream(conn streamCreator) error } kubernetes-client-go-a2dfcab/tools/remotecommand/resize.go000066400000000000000000000021741472614177300242260ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand // TerminalSize and TerminalSizeQueue was a part of k8s.io/kubernetes/pkg/util/term // and were moved in order to decouple client from other term dependencies // TerminalSize represents the width and height of a terminal. type TerminalSize struct { Width uint16 Height uint16 } // TerminalSizeQueue is capable of returning terminal resize events as they occur. type TerminalSizeQueue interface { // Next returns the new terminal size after the terminal has been resized. It returns nil when // monitoring has been stopped. Next() *TerminalSize } kubernetes-client-go-a2dfcab/tools/remotecommand/spdy.go000066400000000000000000000133121472614177300237000ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "context" "fmt" "net/http" "net/url" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/remotecommand" restclient "k8s.io/client-go/rest" "k8s.io/client-go/transport/spdy" "k8s.io/klog/v2" ) // spdyStreamExecutor handles transporting standard shell streams over an httpstream connection. type spdyStreamExecutor struct { upgrader spdy.Upgrader transport http.RoundTripper method string url *url.URL protocols []string rejectRedirects bool // if true, receiving redirect from upstream is an error } // NewSPDYExecutor connects to the provided server and upgrades the connection to // multiplexed bidirectional streams. func NewSPDYExecutor(config *restclient.Config, method string, url *url.URL) (Executor, error) { wrapper, upgradeRoundTripper, err := spdy.RoundTripperFor(config) if err != nil { return nil, err } return NewSPDYExecutorForTransports(wrapper, upgradeRoundTripper, method, url) } // NewSPDYExecutorRejectRedirects returns an Executor that will upgrade the future // connection to a SPDY bi-directional streaming connection when calling "Stream" (deprecated) // or "StreamWithContext" (preferred). Additionally, if the upstream server returns a redirect // during the attempted upgrade in these "Stream" calls, an error is returned. func NewSPDYExecutorRejectRedirects(transport http.RoundTripper, upgrader spdy.Upgrader, method string, url *url.URL) (Executor, error) { executor, err := NewSPDYExecutorForTransports(transport, upgrader, method, url) if err != nil { return nil, err } spdyExecutor := executor.(*spdyStreamExecutor) spdyExecutor.rejectRedirects = true return spdyExecutor, nil } // NewSPDYExecutorForTransports connects to the provided server using the given transport, // upgrades the response using the given upgrader to multiplexed bidirectional streams. func NewSPDYExecutorForTransports(transport http.RoundTripper, upgrader spdy.Upgrader, method string, url *url.URL) (Executor, error) { return NewSPDYExecutorForProtocols( transport, upgrader, method, url, remotecommand.StreamProtocolV5Name, remotecommand.StreamProtocolV4Name, remotecommand.StreamProtocolV3Name, remotecommand.StreamProtocolV2Name, remotecommand.StreamProtocolV1Name, ) } // NewSPDYExecutorForProtocols connects to the provided server and upgrades the connection to // multiplexed bidirectional streams using only the provided protocols. Exposed for testing, most // callers should use NewSPDYExecutor or NewSPDYExecutorForTransports. func NewSPDYExecutorForProtocols(transport http.RoundTripper, upgrader spdy.Upgrader, method string, url *url.URL, protocols ...string) (Executor, error) { return &spdyStreamExecutor{ upgrader: upgrader, transport: transport, method: method, url: url, protocols: protocols, }, nil } // Stream opens a protocol streamer to the server and streams until a client closes // the connection or the server disconnects. func (e *spdyStreamExecutor) Stream(options StreamOptions) error { return e.StreamWithContext(context.Background(), options) } // newConnectionAndStream creates a new SPDY connection and a stream protocol handler upon it. func (e *spdyStreamExecutor) newConnectionAndStream(ctx context.Context, options StreamOptions) (httpstream.Connection, streamProtocolHandler, error) { req, err := http.NewRequestWithContext(ctx, e.method, e.url.String(), nil) if err != nil { return nil, nil, fmt.Errorf("error creating request: %v", err) } client := http.Client{Transport: e.transport} if e.rejectRedirects { client.CheckRedirect = func(req *http.Request, via []*http.Request) error { return fmt.Errorf("redirect not allowed") } } conn, protocol, err := spdy.Negotiate( e.upgrader, &client, req, e.protocols..., ) if err != nil { return nil, nil, err } var streamer streamProtocolHandler switch protocol { case remotecommand.StreamProtocolV5Name: streamer = newStreamProtocolV5(options) case remotecommand.StreamProtocolV4Name: streamer = newStreamProtocolV4(options) case remotecommand.StreamProtocolV3Name: streamer = newStreamProtocolV3(options) case remotecommand.StreamProtocolV2Name: streamer = newStreamProtocolV2(options) case "": klog.V(4).Infof("The server did not negotiate a streaming protocol version. Falling back to %s", remotecommand.StreamProtocolV1Name) fallthrough case remotecommand.StreamProtocolV1Name: streamer = newStreamProtocolV1(options) } return conn, streamer, nil } // StreamWithContext opens a protocol streamer to the server and streams until a client closes // the connection or the server disconnects or the context is done. func (e *spdyStreamExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { conn, streamer, err := e.newConnectionAndStream(ctx, options) if err != nil { return err } defer conn.Close() panicChan := make(chan any, 1) errorChan := make(chan error, 1) go func() { defer func() { if p := recover(); p != nil { panicChan <- p } }() errorChan <- streamer.stream(conn) }() select { case p := <-panicChan: panic(p) case err := <-errorChan: return err case <-ctx.Done(): return ctx.Err() } } kubernetes-client-go-a2dfcab/tools/remotecommand/spdy_test.go000066400000000000000000000243301472614177300247410ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "bytes" "context" "crypto/rand" "encoding/json" "errors" "io" "net/http" "net/http/httptest" "net/url" "strings" "testing" "time" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/spdy" remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" ) type AttachFunc func(in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan TerminalSize) error type streamContext struct { conn io.Closer stdinStream io.ReadCloser stdoutStream io.WriteCloser stderrStream io.WriteCloser writeStatus func(status *apierrors.StatusError) error } type streamAndReply struct { httpstream.Stream replySent <-chan struct{} } type fakeEmptyDataPty struct { } func (s *fakeEmptyDataPty) Read(p []byte) (int, error) { return len(p), nil } func (s *fakeEmptyDataPty) Write(p []byte) (int, error) { return len(p), nil } type fakeMassiveDataPty struct{} func (s *fakeMassiveDataPty) Read(p []byte) (int, error) { time.Sleep(time.Duration(1) * time.Second) return copy(p, []byte{}), errors.New("client crashed after 1 second") } func (s *fakeMassiveDataPty) Write(p []byte) (int, error) { time.Sleep(time.Duration(1) * time.Second) return len(p), errors.New("return err") } func fakeMassiveDataAttacher(stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan TerminalSize) error { copyDone := make(chan struct{}, 3) if stdin == nil { return errors.New("stdin is requested") // we need stdin to notice the conn break } go func() { io.Copy(io.Discard, stdin) copyDone <- struct{}{} }() go func() { if stdout == nil { return } copyDone <- writeMassiveData(stdout) }() go func() { if stderr == nil { return } copyDone <- writeMassiveData(stderr) }() select { case <-copyDone: return nil } } func writeMassiveData(stdStream io.Writer) struct{} { // write to stdin or stdout for { _, err := io.Copy(stdStream, strings.NewReader("something")) if err != nil && err.Error() != "EOF" { break } } return struct{}{} } func TestSPDYExecutorStream(t *testing.T) { tests := []struct { timeout time.Duration name string options StreamOptions expectError string attacher AttachFunc }{ { name: "stdoutBlockTest", options: StreamOptions{ Stdin: &fakeMassiveDataPty{}, Stdout: &fakeMassiveDataPty{}, }, expectError: "", attacher: fakeMassiveDataAttacher, }, { name: "stderrBlockTest", options: StreamOptions{ Stdin: &fakeMassiveDataPty{}, Stderr: &fakeMassiveDataPty{}, }, expectError: "", attacher: fakeMassiveDataAttacher, }, { timeout: 500 * time.Millisecond, name: "timeoutTest", options: StreamOptions{ Stdin: &fakeMassiveDataPty{}, Stderr: &fakeMassiveDataPty{}, }, expectError: context.DeadlineExceeded.Error(), attacher: fakeMassiveDataAttacher, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { server := newTestHTTPServer(test.attacher, &test.options) defer server.Close() ctx, cancel := context.Background(), func() {} if test.timeout > 0 { ctx, cancel = context.WithTimeout(ctx, test.timeout) } defer cancel() err := attach2Server(ctx, server.URL, test.options) gotError := "" if err != nil { gotError = err.Error() } if test.expectError != gotError { t.Errorf("%s: expected [%v], got [%v]", test.name, test.expectError, gotError) } }) } } func newTestHTTPServer(f AttachFunc, options *StreamOptions) *httptest.Server { //nolint:errcheck server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { ctx, err := createHTTPStreams(writer, request, options) if err != nil { return } defer ctx.conn.Close() // handle input output err = f(ctx.stdinStream, ctx.stdoutStream, ctx.stderrStream, false, nil) if err != nil { ctx.writeStatus(apierrors.NewInternalError(err)) } else { ctx.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{ Status: metav1.StatusSuccess, }}) } })) return server } func attach2Server(ctx context.Context, rawURL string, options StreamOptions) error { uri, _ := url.Parse(rawURL) exec, err := NewSPDYExecutor(&rest.Config{Host: uri.Host}, "POST", uri) if err != nil { return err } e := make(chan error, 1) go func(e chan error) { e <- exec.StreamWithContext(ctx, options) }(e) select { case err := <-e: return err case <-time.After(wait.ForeverTestTimeout): return errors.New("execute timeout") } } // simplify createHttpStreams , only support StreamProtocolV4Name func createHTTPStreams(w http.ResponseWriter, req *http.Request, opts *StreamOptions) (*streamContext, error) { _, err := httpstream.Handshake(req, w, []string{remotecommandconsts.StreamProtocolV4Name}) if err != nil { return nil, err } upgrader := spdy.NewResponseUpgrader() streamCh := make(chan streamAndReply) conn := upgrader.UpgradeResponse(w, req, func(stream httpstream.Stream, replySent <-chan struct{}) error { streamCh <- streamAndReply{Stream: stream, replySent: replySent} return nil }) ctx := &streamContext{ conn: conn, } // wait for stream replyChan := make(chan struct{}, 4) defer close(replyChan) receivedStreams := 0 expectedStreams := 1 if opts.Stdout != nil { expectedStreams++ } if opts.Stdin != nil { expectedStreams++ } if opts.Stderr != nil { expectedStreams++ } WaitForStreams: for { select { case stream := <-streamCh: streamType := stream.Headers().Get(v1.StreamType) switch streamType { case v1.StreamTypeError: replyChan <- struct{}{} ctx.writeStatus = v4WriteStatusFunc(stream) case v1.StreamTypeStdout: replyChan <- struct{}{} ctx.stdoutStream = stream case v1.StreamTypeStdin: replyChan <- struct{}{} ctx.stdinStream = stream case v1.StreamTypeStderr: replyChan <- struct{}{} ctx.stderrStream = stream default: // add other stream ... return nil, errors.New("unimplemented stream type") } case <-replyChan: receivedStreams++ if receivedStreams == expectedStreams { break WaitForStreams } } } return ctx, nil } func v4WriteStatusFunc(stream io.Writer) func(status *apierrors.StatusError) error { return func(status *apierrors.StatusError) error { bs, err := json.Marshal(status.Status()) if err != nil { return err } _, err = stream.Write(bs) return err } } // writeDetector provides a helper method to block until the underlying writer written. type writeDetector struct { written chan bool closed bool io.Writer } func newWriterDetector(w io.Writer) *writeDetector { return &writeDetector{ written: make(chan bool), Writer: w, } } func (w *writeDetector) BlockUntilWritten() { <-w.written } func (w *writeDetector) Write(p []byte) (n int, err error) { if !w.closed { close(w.written) w.closed = true } return w.Writer.Write(p) } // `Executor.StreamWithContext` starts a goroutine in the background to do the streaming // and expects the deferred close of the connection leads to the exit of the goroutine on cancellation. // This test verifies that works. func TestStreamExitsAfterConnectionIsClosed(t *testing.T) { writeDetector := newWriterDetector(&fakeEmptyDataPty{}) options := StreamOptions{ Stdin: &fakeEmptyDataPty{}, Stdout: writeDetector, } server := newTestHTTPServer(fakeMassiveDataAttacher, &options) ctx, cancelFn := context.WithTimeout(context.Background(), 500*time.Millisecond) defer cancelFn() uri, _ := url.Parse(server.URL) exec, err := NewSPDYExecutor(&rest.Config{Host: uri.Host}, "POST", uri) if err != nil { t.Fatal(err) } streamExec := exec.(*spdyStreamExecutor) conn, streamer, err := streamExec.newConnectionAndStream(ctx, options) if err != nil { t.Fatal(err) } errorChan := make(chan error) go func() { errorChan <- streamer.stream(conn) }() // Wait until stream goroutine starts. writeDetector.BlockUntilWritten() // Close the connection conn.Close() select { case <-time.After(1 * time.Second): t.Fatalf("expect stream to be closed after connection is closed.") case <-errorChan: return } } func TestStreamRandomData(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var stdin, stdout bytes.Buffer ctx, err := createHTTPStreams(w, req, &StreamOptions{ Stdin: &stdin, Stdout: &stdout, }) if err != nil { t.Errorf("error on createHTTPStreams: %v", err) return } defer ctx.conn.Close() io.Copy(ctx.stdoutStream, ctx.stdinStream) //nolint:errcheck })) defer server.Close() uri, _ := url.Parse(server.URL) exec, err := NewSPDYExecutor(&rest.Config{Host: uri.Host}, "POST", uri) if err != nil { t.Fatal(err) } randomData := make([]byte, 1024*1024) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stdout: &stdout, } errorChan := make(chan error) go func() { errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error") } } data, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Errorf("error reading the stream: %v", err) return } if !bytes.Equal(randomData, data) { t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) } } kubernetes-client-go-a2dfcab/tools/remotecommand/v1.go000066400000000000000000000107061472614177300232530ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "fmt" "io" "net/http" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/klog/v2" ) // streamProtocolV1 implements the first version of the streaming exec & attach // protocol. This version has some bugs, such as not being able to detect when // non-interactive stdin data has ended. See https://issues.k8s.io/13394 and // https://issues.k8s.io/13395 for more details. type streamProtocolV1 struct { StreamOptions errorStream httpstream.Stream remoteStdin httpstream.Stream remoteStdout httpstream.Stream remoteStderr httpstream.Stream } var _ streamProtocolHandler = &streamProtocolV1{} func newStreamProtocolV1(options StreamOptions) streamProtocolHandler { return &streamProtocolV1{ StreamOptions: options, } } func (p *streamProtocolV1) stream(conn streamCreator) error { doneChan := make(chan struct{}, 2) errorChan := make(chan error) cp := func(s string, dst io.Writer, src io.Reader) { klog.V(6).Infof("Copying %s", s) defer klog.V(6).Infof("Done copying %s", s) if _, err := io.Copy(dst, src); err != nil && err != io.EOF { klog.Errorf("Error copying %s: %v", s, err) } if s == v1.StreamTypeStdout || s == v1.StreamTypeStderr { doneChan <- struct{}{} } } // set up all the streams first var err error headers := http.Header{} headers.Set(v1.StreamType, v1.StreamTypeError) p.errorStream, err = conn.CreateStream(headers) if err != nil { return err } defer p.errorStream.Reset() // Create all the streams first, then start the copy goroutines. The server doesn't start its copy // goroutines until it's received all of the streams. If the client creates the stdin stream and // immediately begins copying stdin data to the server, it's possible to overwhelm and wedge the // spdy frame handler in the server so that it is full of unprocessed frames. The frames aren't // getting processed because the server hasn't started its copying, and it won't do that until it // gets all the streams. By creating all the streams first, we ensure that the server is ready to // process data before the client starts sending any. See https://issues.k8s.io/16373 for more info. if p.Stdin != nil { headers.Set(v1.StreamType, v1.StreamTypeStdin) p.remoteStdin, err = conn.CreateStream(headers) if err != nil { return err } defer p.remoteStdin.Reset() } if p.Stdout != nil { headers.Set(v1.StreamType, v1.StreamTypeStdout) p.remoteStdout, err = conn.CreateStream(headers) if err != nil { return err } defer p.remoteStdout.Reset() } if p.Stderr != nil && !p.Tty { headers.Set(v1.StreamType, v1.StreamTypeStderr) p.remoteStderr, err = conn.CreateStream(headers) if err != nil { return err } defer p.remoteStderr.Reset() } // now that all the streams have been created, proceed with reading & copying // always read from errorStream go func() { message, err := io.ReadAll(p.errorStream) if err != nil && err != io.EOF { errorChan <- fmt.Errorf("Error reading from error stream: %s", err) return } if len(message) > 0 { errorChan <- fmt.Errorf("Error executing remote command: %s", message) return } }() if p.Stdin != nil { // TODO this goroutine will never exit cleanly (the io.Copy never unblocks) // because stdin is not closed until the process exits. If we try to call // stdin.Close(), it returns no error but doesn't unblock the copy. It will // exit when the process exits, instead. go cp(v1.StreamTypeStdin, p.remoteStdin, readerWrapper{p.Stdin}) } waitCount := 0 completedStreams := 0 if p.Stdout != nil { waitCount++ go cp(v1.StreamTypeStdout, p.Stdout, p.remoteStdout) } if p.Stderr != nil && !p.Tty { waitCount++ go cp(v1.StreamTypeStderr, p.Stderr, p.remoteStderr) } Loop: for { select { case <-doneChan: completedStreams++ if completedStreams == waitCount { break Loop } case err := <-errorChan: return err } } return nil } kubernetes-client-go-a2dfcab/tools/remotecommand/v2.go000066400000000000000000000124641472614177300232570ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "fmt" "io" "net/http" "sync" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/runtime" ) // streamProtocolV2 implements version 2 of the streaming protocol for attach // and exec. The original streaming protocol was metav1. As a result, this // version is referred to as version 2, even though it is the first actual // numbered version. type streamProtocolV2 struct { StreamOptions errorStream io.Reader remoteStdin io.ReadWriteCloser remoteStdout io.Reader remoteStderr io.Reader } var _ streamProtocolHandler = &streamProtocolV2{} func newStreamProtocolV2(options StreamOptions) streamProtocolHandler { return &streamProtocolV2{ StreamOptions: options, } } func (p *streamProtocolV2) createStreams(conn streamCreator) error { var err error headers := http.Header{} // set up error stream headers.Set(v1.StreamType, v1.StreamTypeError) p.errorStream, err = conn.CreateStream(headers) if err != nil { return err } // set up stdin stream if p.Stdin != nil { headers.Set(v1.StreamType, v1.StreamTypeStdin) p.remoteStdin, err = conn.CreateStream(headers) if err != nil { return err } } // set up stdout stream if p.Stdout != nil { headers.Set(v1.StreamType, v1.StreamTypeStdout) p.remoteStdout, err = conn.CreateStream(headers) if err != nil { return err } } // set up stderr stream if p.Stderr != nil && !p.Tty { headers.Set(v1.StreamType, v1.StreamTypeStderr) p.remoteStderr, err = conn.CreateStream(headers) if err != nil { return err } } return nil } func (p *streamProtocolV2) copyStdin() { if p.Stdin != nil { var once sync.Once // copy from client's stdin to container's stdin go func() { defer runtime.HandleCrash() // if p.stdin is noninteractive, p.g. `echo abc | kubectl exec -i -- cat`, make sure // we close remoteStdin as soon as the copy from p.stdin to remoteStdin finishes. Otherwise // the executed command will remain running. defer once.Do(func() { p.remoteStdin.Close() }) if _, err := io.Copy(p.remoteStdin, readerWrapper{p.Stdin}); err != nil { runtime.HandleError(err) } }() // read from remoteStdin until the stream is closed. this is essential to // be able to exit interactive sessions cleanly and not leak goroutines or // hang the client's terminal. // // TODO we aren't using go-dockerclient any more; revisit this to determine if it's still // required by engine-api. // // go-dockerclient's current hijack implementation // (https://github.com/fsouza/go-dockerclient/blob/89f3d56d93788dfe85f864a44f85d9738fca0670/client.go#L564) // waits for all three streams (stdin/stdout/stderr) to finish copying // before returning. When hijack finishes copying stdout/stderr, it calls // Close() on its side of remoteStdin, which allows this copy to complete. // When that happens, we must Close() on our side of remoteStdin, to // allow the copy in hijack to complete, and hijack to return. go func() { defer runtime.HandleCrash() defer once.Do(func() { p.remoteStdin.Close() }) // this "copy" doesn't actually read anything - it's just here to wait for // the server to close remoteStdin. if _, err := io.Copy(io.Discard, p.remoteStdin); err != nil { runtime.HandleError(err) } }() } } func (p *streamProtocolV2) copyStdout(wg *sync.WaitGroup) { if p.Stdout == nil { return } wg.Add(1) go func() { defer runtime.HandleCrash() defer wg.Done() // make sure, packet in queue can be consumed. // block in queue may lead to deadlock in conn.server // issue: https://github.com/kubernetes/kubernetes/issues/96339 defer io.Copy(io.Discard, p.remoteStdout) if _, err := io.Copy(p.Stdout, p.remoteStdout); err != nil { runtime.HandleError(err) } }() } func (p *streamProtocolV2) copyStderr(wg *sync.WaitGroup) { if p.Stderr == nil || p.Tty { return } wg.Add(1) go func() { defer runtime.HandleCrash() defer wg.Done() defer io.Copy(io.Discard, p.remoteStderr) if _, err := io.Copy(p.Stderr, p.remoteStderr); err != nil { runtime.HandleError(err) } }() } func (p *streamProtocolV2) stream(conn streamCreator) error { if err := p.createStreams(conn); err != nil { return err } // now that all the streams have been created, proceed with reading & copying errorChan := watchErrorStream(p.errorStream, &errorDecoderV2{}) p.copyStdin() var wg sync.WaitGroup p.copyStdout(&wg) p.copyStderr(&wg) // we're waiting for stdout/stderr to finish copying wg.Wait() // waits for errorStream to finish reading with an error or nil return <-errorChan } // errorDecoderV2 interprets the error channel data as plain text. type errorDecoderV2 struct{} func (d *errorDecoderV2) decode(message []byte) error { return fmt.Errorf("error executing remote command: %s", message) } kubernetes-client-go-a2dfcab/tools/remotecommand/v2_test.go000066400000000000000000000130641472614177300243130ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "errors" "io" "net/http" "strings" "testing" "time" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/wait" ) type fakeReader struct { err error } func (r *fakeReader) Read([]byte) (int, error) { return 0, r.err } type fakeWriter struct{} func (*fakeWriter) Write([]byte) (int, error) { return 0, nil } type fakeStreamCreator struct { created map[string]bool errors map[string]error } var _ streamCreator = &fakeStreamCreator{} func (f *fakeStreamCreator) CreateStream(headers http.Header) (httpstream.Stream, error) { streamType := headers.Get(v1.StreamType) f.created[streamType] = true return nil, f.errors[streamType] } func TestV2CreateStreams(t *testing.T) { tests := []struct { name string stdin bool stdinError error stdout bool stdoutError error stderr bool stderrError error errorError error tty bool expectError bool }{ { name: "stdin error", stdin: true, stdinError: errors.New("stdin error"), expectError: true, }, { name: "stdout error", stdout: true, stdoutError: errors.New("stdout error"), expectError: true, }, { name: "stderr error", stderr: true, stderrError: errors.New("stderr error"), expectError: true, }, { name: "error stream error", stdin: true, stdout: true, stderr: true, errorError: errors.New("error stream error"), expectError: true, }, { name: "no errors", stdin: true, stdout: true, stderr: true, expectError: false, }, { name: "no errors, stderr & tty set, don't expect stderr", stdin: true, stdout: true, stderr: true, tty: true, expectError: false, }, } for _, test := range tests { conn := &fakeStreamCreator{ created: make(map[string]bool), errors: map[string]error{ v1.StreamTypeStdin: test.stdinError, v1.StreamTypeStdout: test.stdoutError, v1.StreamTypeStderr: test.stderrError, v1.StreamTypeError: test.errorError, }, } opts := StreamOptions{Tty: test.tty} if test.stdin { opts.Stdin = &fakeReader{} } if test.stdout { opts.Stdout = &fakeWriter{} } if test.stderr { opts.Stderr = &fakeWriter{} } h := newStreamProtocolV2(opts).(*streamProtocolV2) err := h.createStreams(conn) if test.expectError { if err == nil { t.Errorf("%s: expected error", test.name) continue } if e, a := test.stdinError, err; test.stdinError != nil && e != a { t.Errorf("%s: expected %v, got %v", test.name, e, a) } if e, a := test.stdoutError, err; test.stdoutError != nil && e != a { t.Errorf("%s: expected %v, got %v", test.name, e, a) } if e, a := test.stderrError, err; test.stderrError != nil && e != a { t.Errorf("%s: expected %v, got %v", test.name, e, a) } if e, a := test.errorError, err; test.errorError != nil && e != a { t.Errorf("%s: expected %v, got %v", test.name, e, a) } continue } if !test.expectError && err != nil { t.Errorf("%s: unexpected error: %v", test.name, err) continue } if test.stdin && !conn.created[v1.StreamTypeStdin] { t.Errorf("%s: expected stdin stream", test.name) } if test.stdout && !conn.created[v1.StreamTypeStdout] { t.Errorf("%s: expected stdout stream", test.name) } if test.stderr { if test.tty && conn.created[v1.StreamTypeStderr] { t.Errorf("%s: unexpected stderr stream because tty is set", test.name) } else if !test.tty && !conn.created[v1.StreamTypeStderr] { t.Errorf("%s: expected stderr stream", test.name) } } if !conn.created[v1.StreamTypeError] { t.Errorf("%s: expected error stream", test.name) } } } func TestV2ErrorStreamReading(t *testing.T) { tests := []struct { name string stream io.Reader expectedError error }{ { name: "error reading from stream", stream: &fakeReader{errors.New("foo")}, expectedError: errors.New("error reading from error stream: foo"), }, { name: "stream returns an error", stream: strings.NewReader("some error"), expectedError: errors.New("error executing remote command: some error"), }, } for _, test := range tests { h := newStreamProtocolV2(StreamOptions{}).(*streamProtocolV2) h.errorStream = test.stream ch := watchErrorStream(h.errorStream, &errorDecoderV2{}) if ch == nil { t.Fatalf("%s: unexpected nil channel", test.name) } var err error select { case err = <-ch: case <-time.After(wait.ForeverTestTimeout): t.Fatalf("%s: timed out", test.name) } if test.expectedError != nil { if err == nil { t.Errorf("%s: expected an error", test.name) } else if e, a := test.expectedError, err; e.Error() != a.Error() { t.Errorf("%s: expected %q, got %q", test.name, e, a) } continue } if test.expectedError == nil && err != nil { t.Errorf("%s: unexpected error: %v", test.name, err) continue } } } kubernetes-client-go-a2dfcab/tools/remotecommand/v3.go000066400000000000000000000047551472614177300232640ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "encoding/json" "io" "net/http" "sync" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/runtime" ) // streamProtocolV3 implements version 3 of the streaming protocol for attach // and exec. This version adds support for resizing the container's terminal. type streamProtocolV3 struct { *streamProtocolV2 resizeStream io.Writer } var _ streamProtocolHandler = &streamProtocolV3{} func newStreamProtocolV3(options StreamOptions) streamProtocolHandler { return &streamProtocolV3{ streamProtocolV2: newStreamProtocolV2(options).(*streamProtocolV2), } } func (p *streamProtocolV3) createStreams(conn streamCreator) error { // set up the streams from v2 if err := p.streamProtocolV2.createStreams(conn); err != nil { return err } // set up resize stream if p.Tty { headers := http.Header{} headers.Set(v1.StreamType, v1.StreamTypeResize) var err error p.resizeStream, err = conn.CreateStream(headers) if err != nil { return err } } return nil } func (p *streamProtocolV3) handleResizes() { if p.resizeStream == nil || p.TerminalSizeQueue == nil { return } go func() { defer runtime.HandleCrash() encoder := json.NewEncoder(p.resizeStream) for { size := p.TerminalSizeQueue.Next() if size == nil { return } if err := encoder.Encode(&size); err != nil { runtime.HandleError(err) } } }() } func (p *streamProtocolV3) stream(conn streamCreator) error { if err := p.createStreams(conn); err != nil { return err } // now that all the streams have been created, proceed with reading & copying errorChan := watchErrorStream(p.errorStream, &errorDecoderV3{}) p.handleResizes() p.copyStdin() var wg sync.WaitGroup p.copyStdout(&wg) p.copyStderr(&wg) // we're waiting for stdout/stderr to finish copying wg.Wait() // waits for errorStream to finish reading with an error or nil return <-errorChan } type errorDecoderV3 struct { errorDecoderV2 } kubernetes-client-go-a2dfcab/tools/remotecommand/v4.go000066400000000000000000000063771472614177300232670ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "encoding/json" "errors" "fmt" "strconv" "sync" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/client-go/util/exec" ) // streamProtocolV4 implements version 4 of the streaming protocol for attach // and exec. This version adds support for exit codes on the error stream through // the use of metav1.Status instead of plain text messages. type streamProtocolV4 struct { *streamProtocolV3 } var _ streamProtocolHandler = &streamProtocolV4{} func newStreamProtocolV4(options StreamOptions) streamProtocolHandler { return &streamProtocolV4{ streamProtocolV3: newStreamProtocolV3(options).(*streamProtocolV3), } } func (p *streamProtocolV4) createStreams(conn streamCreator) error { return p.streamProtocolV3.createStreams(conn) } func (p *streamProtocolV4) handleResizes() { p.streamProtocolV3.handleResizes() } func (p *streamProtocolV4) stream(conn streamCreator) error { if err := p.createStreams(conn); err != nil { return err } // now that all the streams have been created, proceed with reading & copying errorChan := watchErrorStream(p.errorStream, &errorDecoderV4{}) p.handleResizes() p.copyStdin() var wg sync.WaitGroup p.copyStdout(&wg) p.copyStderr(&wg) // we're waiting for stdout/stderr to finish copying wg.Wait() // waits for errorStream to finish reading with an error or nil return <-errorChan } // errorDecoderV4 interprets the json-marshaled metav1.Status on the error channel // and creates an exec.ExitError from it. type errorDecoderV4 struct{} func (d *errorDecoderV4) decode(message []byte) error { status := metav1.Status{} err := json.Unmarshal(message, &status) if err != nil { return fmt.Errorf("error stream protocol error: %v in %q", err, string(message)) } switch status.Status { case metav1.StatusSuccess: return nil case metav1.StatusFailure: if status.Reason == remotecommand.NonZeroExitCodeReason { if status.Details == nil { return errors.New("error stream protocol error: details must be set") } for i := range status.Details.Causes { c := &status.Details.Causes[i] if c.Type != remotecommand.ExitCodeCauseType { continue } rc, err := strconv.ParseUint(c.Message, 10, 8) if err != nil { return fmt.Errorf("error stream protocol error: invalid exit code value %q", c.Message) } return exec.CodeExitError{ Err: fmt.Errorf("command terminated with exit code %d", rc), Code: int(rc), } } return fmt.Errorf("error stream protocol error: no %s cause given", remotecommand.ExitCodeCauseType) } default: return errors.New("error stream protocol error: unknown error") } return fmt.Errorf(status.Message) } kubernetes-client-go-a2dfcab/tools/remotecommand/v4_test.go000066400000000000000000000037421472614177300243170ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "fmt" "strings" "testing" ) func TestV4ErrorDecoder(t *testing.T) { dec := errorDecoderV4{} type Test struct { message string err string } for _, test := range []Test{ { message: "{}", err: "error stream protocol error: unknown error", }, { message: "{", err: "unexpected end of JSON input in \"{\"", }, { message: `{"status": "Success" }`, err: "", }, { message: `{"status": "Failure", "message": "foobar" }`, err: "foobar", }, { message: `{"status": "Failure", "message": "foobar", "reason": "NonZeroExitCode", "details": {"causes": [{"reason": "foo"}] } }`, err: "error stream protocol error: no ExitCode cause given", }, { message: `{"status": "Failure", "message": "foobar", "reason": "NonZeroExitCode", "details": {"causes": [{"reason": "ExitCode"}] } }`, err: "error stream protocol error: invalid exit code value \"\"", }, { message: `{"status": "Failure", "message": "foobar", "reason": "NonZeroExitCode", "details": {"causes": [{"reason": "ExitCode", "message": "42"}] } }`, err: "command terminated with exit code 42", }, } { err := dec.decode([]byte(test.message)) want := test.err if want == "" { want = "" } if got := fmt.Sprintf("%v", err); !strings.Contains(got, want) { t.Errorf("wrong error for message %q: want=%q, got=%q", test.message, want, got) } } } kubernetes-client-go-a2dfcab/tools/remotecommand/v5.go000066400000000000000000000021351472614177300232540ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand // streamProtocolV5 add support for V5 of the remote command subprotocol. // For the streamProtocolHandler, this version is the same as V4. type streamProtocolV5 struct { *streamProtocolV4 } var _ streamProtocolHandler = &streamProtocolV5{} func newStreamProtocolV5(options StreamOptions) streamProtocolHandler { return &streamProtocolV5{ streamProtocolV4: newStreamProtocolV4(options).(*streamProtocolV4), } } func (p *streamProtocolV5) stream(conn streamCreator) error { return p.streamProtocolV4.stream(conn) } kubernetes-client-go-a2dfcab/tools/remotecommand/websocket.go000066400000000000000000000425011472614177300247110ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "context" "errors" "fmt" "io" "net" "net/http" "sync" "time" gwebsocket "github.com/gorilla/websocket" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/remotecommand" restclient "k8s.io/client-go/rest" "k8s.io/client-go/transport/websocket" "k8s.io/klog/v2" ) // writeDeadline defines the time that a client-side write to the websocket // connection must complete before an i/o timeout occurs. const writeDeadline = 60 * time.Second var ( _ Executor = &wsStreamExecutor{} _ streamCreator = &wsStreamCreator{} _ httpstream.Stream = &stream{} streamType2streamID = map[string]byte{ v1.StreamTypeStdin: remotecommand.StreamStdIn, v1.StreamTypeStdout: remotecommand.StreamStdOut, v1.StreamTypeStderr: remotecommand.StreamStdErr, v1.StreamTypeError: remotecommand.StreamErr, v1.StreamTypeResize: remotecommand.StreamResize, } ) const ( // pingPeriod defines how often a heartbeat "ping" message is sent. pingPeriod = 5 * time.Second // pingReadDeadline defines the time waiting for a response heartbeat // "pong" message before a timeout error occurs for websocket reading. // This duration must always be greater than the "pingPeriod". By defining // this deadline in terms of the ping period, we are essentially saying // we can drop "X" (e.g. 12) pings before firing the timeout. pingReadDeadline = (pingPeriod * 12) + (1 * time.Second) ) // wsStreamExecutor handles transporting standard shell streams over an httpstream connection. type wsStreamExecutor struct { transport http.RoundTripper upgrader websocket.ConnectionHolder method string url string // requested protocols in priority order (e.g. v5.channel.k8s.io before v4.channel.k8s.io). protocols []string // selected protocol from the handshake process; could be empty string if handshake fails. negotiated string // period defines how often a "ping" heartbeat message is sent to the other endpoint. heartbeatPeriod time.Duration // deadline defines the amount of time before "pong" response must be received. heartbeatDeadline time.Duration } func NewWebSocketExecutor(config *restclient.Config, method, url string) (Executor, error) { // Only supports V5 protocol for correct version skew functionality. // Previous api servers will proxy upgrade requests to legacy websocket // servers on container runtimes which support V1-V4. These legacy // websocket servers will not handle the new CLOSE signal. return NewWebSocketExecutorForProtocols(config, method, url, remotecommand.StreamProtocolV5Name) } // NewWebSocketExecutorForProtocols allows to execute commands via a WebSocket connection. func NewWebSocketExecutorForProtocols(config *restclient.Config, method, url string, protocols ...string) (Executor, error) { transport, upgrader, err := websocket.RoundTripperFor(config) if err != nil { return nil, fmt.Errorf("error creating websocket transports: %v", err) } return &wsStreamExecutor{ transport: transport, upgrader: upgrader, method: method, url: url, protocols: protocols, heartbeatPeriod: pingPeriod, heartbeatDeadline: pingReadDeadline, }, nil } // Deprecated: use StreamWithContext instead to avoid possible resource leaks. // See https://github.com/kubernetes/kubernetes/pull/103177 for details. func (e *wsStreamExecutor) Stream(options StreamOptions) error { return e.StreamWithContext(context.Background(), options) } // StreamWithContext upgrades an HTTPRequest to a WebSocket connection, and starts the various // goroutines to implement the necessary streams over the connection. The "options" parameter // defines which streams are requested. Returns an error if one occurred. This method is NOT // safe to run concurrently with the same executor (because of the state stored in the upgrader). func (e *wsStreamExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { req, err := http.NewRequestWithContext(ctx, e.method, e.url, nil) if err != nil { return err } conn, err := websocket.Negotiate(e.transport, e.upgrader, req, e.protocols...) if err != nil { return err } if conn == nil { panic(fmt.Errorf("websocket connection is nil")) } defer conn.Close() e.negotiated = conn.Subprotocol() klog.V(4).Infof("The subprotocol is %s", e.negotiated) var streamer streamProtocolHandler switch e.negotiated { case remotecommand.StreamProtocolV5Name: streamer = newStreamProtocolV5(options) case remotecommand.StreamProtocolV4Name: streamer = newStreamProtocolV4(options) case remotecommand.StreamProtocolV3Name: streamer = newStreamProtocolV3(options) case remotecommand.StreamProtocolV2Name: streamer = newStreamProtocolV2(options) case "": klog.V(4).Infof("The server did not negotiate a streaming protocol version. Falling back to %s", remotecommand.StreamProtocolV1Name) fallthrough case remotecommand.StreamProtocolV1Name: streamer = newStreamProtocolV1(options) } panicChan := make(chan any, 1) errorChan := make(chan error, 1) go func() { defer func() { if p := recover(); p != nil { panicChan <- p } }() creator := newWSStreamCreator(conn) go creator.readDemuxLoop( e.upgrader.DataBufferSize(), e.heartbeatPeriod, e.heartbeatDeadline, ) errorChan <- streamer.stream(creator) }() select { case p := <-panicChan: panic(p) case err := <-errorChan: return err case <-ctx.Done(): return ctx.Err() } } type wsStreamCreator struct { conn *gwebsocket.Conn // Protects writing to websocket connection; reading is lock-free connWriteLock sync.Mutex // map of stream id to stream; multiple streams read/write the connection streams map[byte]*stream streamsMu sync.Mutex // setStreamErr holds the error to return to anyone calling setStreams. // this is populated in closeAllStreamReaders setStreamErr error } func newWSStreamCreator(conn *gwebsocket.Conn) *wsStreamCreator { return &wsStreamCreator{ conn: conn, streams: map[byte]*stream{}, } } func (c *wsStreamCreator) getStream(id byte) *stream { c.streamsMu.Lock() defer c.streamsMu.Unlock() return c.streams[id] } func (c *wsStreamCreator) setStream(id byte, s *stream) error { c.streamsMu.Lock() defer c.streamsMu.Unlock() if c.setStreamErr != nil { return c.setStreamErr } c.streams[id] = s return nil } // CreateStream uses id from passed headers to create a stream over "c.conn" connection. // Returns a Stream structure or nil and an error if one occurred. func (c *wsStreamCreator) CreateStream(headers http.Header) (httpstream.Stream, error) { streamType := headers.Get(v1.StreamType) id, ok := streamType2streamID[streamType] if !ok { return nil, fmt.Errorf("unknown stream type: %s", streamType) } if s := c.getStream(id); s != nil { return nil, fmt.Errorf("duplicate stream for type %s", streamType) } reader, writer := io.Pipe() s := &stream{ headers: headers, readPipe: reader, writePipe: writer, conn: c.conn, connWriteLock: &c.connWriteLock, id: id, } if err := c.setStream(id, s); err != nil { _ = s.writePipe.Close() _ = s.readPipe.Close() return nil, err } return s, nil } // readDemuxLoop is the lock-free reading processor for this endpoint of the websocket // connection. This loop reads the connection, and demultiplexes the data // into one of the individual stream pipes (by checking the stream id). This // loop can *not* be run concurrently, because there can only be one websocket // connection reader at a time (a read mutex would provide no benefit). func (c *wsStreamCreator) readDemuxLoop(bufferSize int, period time.Duration, deadline time.Duration) { // Initialize and start the ping/pong heartbeat. h := newHeartbeat(c.conn, period, deadline) // Set initial timeout for websocket connection reading. if err := c.conn.SetReadDeadline(time.Now().Add(deadline)); err != nil { klog.Errorf("Websocket initial setting read deadline failed %v", err) return } go h.start() // Buffer size must correspond to the same size allocated // for the read buffer during websocket client creation. A // difference can cause incomplete connection reads. readBuffer := make([]byte, bufferSize) for { // NextReader() only returns data messages (BinaryMessage or Text // Message). Even though this call will never return control frames // such as ping, pong, or close, this call is necessary for these // message types to be processed. There can only be one reader // at a time, so this reader loop must *not* be run concurrently; // there is no lock for reading. Calling "NextReader()" before the // current reader has been processed will close the current reader. // If the heartbeat read deadline times out, this "NextReader()" will // return an i/o error, and error handling will clean up. messageType, r, err := c.conn.NextReader() if err != nil { websocketErr, ok := err.(*gwebsocket.CloseError) if ok && websocketErr.Code == gwebsocket.CloseNormalClosure { err = nil // readers will get io.EOF as it's a normal closure } else { err = fmt.Errorf("next reader: %w", err) } c.closeAllStreamReaders(err) return } // All remote command protocols send/receive only binary data messages. if messageType != gwebsocket.BinaryMessage { c.closeAllStreamReaders(fmt.Errorf("unexpected message type: %d", messageType)) return } // It's ok to read just a single byte because the underlying library wraps the actual // connection with a buffered reader anyway. _, err = io.ReadFull(r, readBuffer[:1]) if err != nil { c.closeAllStreamReaders(fmt.Errorf("read stream id: %w", err)) return } streamID := readBuffer[0] s := c.getStream(streamID) if s == nil { klog.Errorf("Unknown stream id %d, discarding message", streamID) continue } for { nr, errRead := r.Read(readBuffer) if nr > 0 { // Write the data to the stream's pipe. This can block. _, errWrite := s.writePipe.Write(readBuffer[:nr]) if errWrite != nil { // Pipe must have been closed by the stream user. // Nothing to do, discard the message. break } } if errRead != nil { if errRead == io.EOF { break } c.closeAllStreamReaders(fmt.Errorf("read message: %w", err)) return } } } } // closeAllStreamReaders closes readers in all streams. // This unblocks all stream.Read() calls, and keeps any future streams from being created. func (c *wsStreamCreator) closeAllStreamReaders(err error) { c.streamsMu.Lock() defer c.streamsMu.Unlock() for _, s := range c.streams { // Closing writePipe unblocks all readPipe.Read() callers and prevents any future writes. _ = s.writePipe.CloseWithError(err) } // ensure callers to setStreams receive an error after this point if err != nil { c.setStreamErr = err } else { c.setStreamErr = fmt.Errorf("closed all streams") } } type stream struct { headers http.Header readPipe *io.PipeReader writePipe *io.PipeWriter // conn is used for writing directly into the connection. // Is nil after Close() / Reset() to prevent future writes. conn *gwebsocket.Conn // connWriteLock protects conn against concurrent write operations. There must be a single writer and a single reader only. // The mutex is shared across all streams because the underlying connection is shared. connWriteLock *sync.Mutex id byte } func (s *stream) Read(p []byte) (n int, err error) { return s.readPipe.Read(p) } // Write writes directly to the underlying WebSocket connection. func (s *stream) Write(p []byte) (n int, err error) { klog.V(4).Infof("Write() on stream %d", s.id) defer klog.V(4).Infof("Write() done on stream %d", s.id) s.connWriteLock.Lock() defer s.connWriteLock.Unlock() if s.conn == nil { return 0, fmt.Errorf("write on closed stream %d", s.id) } err = s.conn.SetWriteDeadline(time.Now().Add(writeDeadline)) if err != nil { klog.V(7).Infof("Websocket setting write deadline failed %v", err) return 0, err } // Message writer buffers the message data, so we don't need to do that ourselves. // Just write id and the data as two separate writes to avoid allocating an intermediate buffer. w, err := s.conn.NextWriter(gwebsocket.BinaryMessage) if err != nil { return 0, err } defer func() { if w != nil { w.Close() } }() _, err = w.Write([]byte{s.id}) if err != nil { return 0, err } n, err = w.Write(p) if err != nil { return n, err } err = w.Close() w = nil return n, err } // Close half-closes the stream, indicating this side is finished with the stream. func (s *stream) Close() error { klog.V(4).Infof("Close() on stream %d", s.id) defer klog.V(4).Infof("Close() done on stream %d", s.id) s.connWriteLock.Lock() defer s.connWriteLock.Unlock() if s.conn == nil { return fmt.Errorf("Close() on already closed stream %d", s.id) } // Communicate the CLOSE stream signal to the other websocket endpoint. err := s.conn.WriteMessage(gwebsocket.BinaryMessage, []byte{remotecommand.StreamClose, s.id}) s.conn = nil return err } func (s *stream) Reset() error { klog.V(4).Infof("Reset() on stream %d", s.id) defer klog.V(4).Infof("Reset() done on stream %d", s.id) s.Close() return s.writePipe.Close() } func (s *stream) Headers() http.Header { return s.headers } func (s *stream) Identifier() uint32 { return uint32(s.id) } // heartbeat encasulates data necessary for the websocket ping/pong heartbeat. This // heartbeat works by setting a read deadline on the websocket connection, then // pushing this deadline into the future for every successful heartbeat. If the // heartbeat "pong" fails to respond within the deadline, then the "NextReader()" call // inside the "readDemuxLoop" will return an i/o error prompting a connection close // and cleanup. type heartbeat struct { conn *gwebsocket.Conn // period defines how often a "ping" heartbeat message is sent to the other endpoint period time.Duration // closing the "closer" channel will clean up the heartbeat timers closer chan struct{} // optional data to send with "ping" message message []byte // optionally received data message with "pong" message, same as sent with ping pongMessage []byte } // newHeartbeat creates heartbeat structure encapsulating fields necessary to // run the websocket connection ping/pong mechanism and sets up handlers on // the websocket connection. func newHeartbeat(conn *gwebsocket.Conn, period time.Duration, deadline time.Duration) *heartbeat { h := &heartbeat{ conn: conn, period: period, closer: make(chan struct{}), } // Set up handler for receiving returned "pong" message from other endpoint // by pushing the read deadline into the future. The "msg" received could // be empty. h.conn.SetPongHandler(func(msg string) error { // Push the read deadline into the future. klog.V(8).Infof("Pong message received (%s)--resetting read deadline", msg) err := h.conn.SetReadDeadline(time.Now().Add(deadline)) if err != nil { klog.Errorf("Websocket setting read deadline failed %v", err) return err } if len(msg) > 0 { h.pongMessage = []byte(msg) } return nil }) // Set up handler to cleanup timers when this endpoint receives "Close" message. closeHandler := h.conn.CloseHandler() h.conn.SetCloseHandler(func(code int, text string) error { close(h.closer) return closeHandler(code, text) }) return h } // setMessage is optional data sent with "ping" heartbeat. According to the websocket RFC // this data sent with "ping" message should be returned in "pong" message. func (h *heartbeat) setMessage(msg string) { h.message = []byte(msg) } // start the heartbeat by setting up necesssary handlers and looping by sending "ping" // message every "period" until the "closer" channel is closed. func (h *heartbeat) start() { // Loop to continually send "ping" message through websocket connection every "period". t := time.NewTicker(h.period) defer t.Stop() for { select { case <-h.closer: klog.V(8).Infof("closed channel--returning") return case <-t.C: // "WriteControl" does not need to be protected by a mutex. According to // gorilla/websockets library docs: "The Close and WriteControl methods can // be called concurrently with all other methods." if err := h.conn.WriteControl(gwebsocket.PingMessage, h.message, time.Now().Add(pingReadDeadline)); err == nil { klog.V(8).Infof("Websocket Ping succeeeded") } else { klog.Errorf("Websocket Ping failed: %v", err) if errors.Is(err, gwebsocket.ErrCloseSent) { // we continue because c.conn.CloseChan will manage closing the connection already continue } else if e, ok := err.(net.Error); ok && e.Timeout() { // Continue, in case this is a transient failure. // c.conn.CloseChan above will tell us when the connection is // actually closed. // If Temporary function hadn't been deprecated, we would have used it. // But most of temporary errors are timeout errors anyway. continue } return } } } } kubernetes-client-go-a2dfcab/tools/remotecommand/websocket_test.go000066400000000000000000001441371472614177300257600ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package remotecommand import ( "bytes" "context" "crypto/rand" "encoding/json" "fmt" "io" "math" mrand "math/rand" "net/http" "net/http/httptest" "net/url" "reflect" "strings" "sync" "testing" "time" gwebsocket "github.com/gorilla/websocket" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/wsstream" "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) // TestWebSocketClient_LoopbackStdinToStdout returns random data sent on the STDIN channel // back down the STDOUT channel. A subsequent comparison checks if the data // sent on the STDIN channel is the same as the data returned on the STDOUT // channel. This test can be run many times by the "stress" tool to check // if there is any data which would cause problems with the WebSocket streams. func TestWebSocketClient_LoopbackStdinToStdout(t *testing.T) { // Create fake WebSocket server. Copy received STDIN data back onto STDOUT stream. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() // Loopback the STDIN stream onto the STDOUT stream. _, err = io.Copy(conns.stdoutStream, conns.stdinStream) if err != nil { t.Fatalf("error copying STDIN to STDOUT: %v", err) } })) defer websocketServer.Close() // Now create the WebSocket client (executor), and point it to the "websocketServer". // Must add STDIN and STDOUT query params for the WebSocket client request. websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } // Generate random data, and set it up to stream on STDIN. The data will be // returned on the STDOUT buffer. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error") } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } data, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Fatalf("error reading the stream: %v", err) } // Check the random data sent on STDIN was the same returned on STDOUT. if !bytes.Equal(randomData, data) { t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) } } // TestWebSocketClient_DifferentBufferSizes runs the previous loopback (STDIN -> STDOUT) test with different // buffer sizes for reading from the opposite end of the websocket connection (in the websocket server). func TestWebSocketClient_DifferentBufferSizes(t *testing.T) { // 1k, 4k, 64k, and 128k buffer sizes for reading STDIN at websocket server endpoint. // The standard buffer size for io.Copy is 32k. bufferSizes := []int{1 * 1024, 4 * 1024, 64 * 1024, 128 * 1024} for _, bufferSize := range bufferSizes { // Create fake WebSocket server. Copy received STDIN data back onto STDOUT stream. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() // Loopback the STDIN stream onto the STDOUT stream, using buffer with size. buffer := make([]byte, bufferSize) _, err = io.CopyBuffer(conns.stdoutStream, conns.stdinStream, buffer) if err != nil { t.Fatalf("error copying STDIN to STDOUT: %v", err) } })) defer websocketServer.Close() // Now create the WebSocket client (executor), and point it to the "websocketServer". // Must add STDIN and STDOUT query params for the WebSocket client request. websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } // Generate random data, and set it up to stream on STDIN. The data will be // returned on the STDOUT buffer. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error") } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } data, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Errorf("error reading the stream: %v", err) return } // Check all the random data sent on STDIN was the same returned on STDOUT. if !bytes.Equal(randomData, data) { t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) } } } // TestWebSocketClient_LoopbackStdinAsPipe uses a pipe to send random data on the STDIN // channel, then closes the pipe. The fake server simply returns all STDIN data back // onto the STDOUT channel, and the received data on STDOUT is validated against the // random data initially sent. func TestWebSocketClient_LoopbackStdinAsPipe(t *testing.T) { // Create fake WebSocket server. Copy received STDIN data back onto STDOUT stream. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() // Loopback the STDIN stream onto the STDOUT stream. _, err = io.Copy(conns.stdoutStream, conns.stdinStream) if err != nil { t.Fatalf("error copying STDIN to STDOUT: %v", err) } })) defer websocketServer.Close() // Now create the WebSocket client (executor), and point it to the "websocketServer". // Must add STDIN and STDOUT query params for the WebSocket client request. websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } // Generate random data, and it will be written on the STDIN pipe. The same // data will be returned on the STDOUT channel. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } reader, writer := io.Pipe() var stdout bytes.Buffer options := &StreamOptions{ Stdin: reader, Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() // Write the random data onto the pipe connected to STDIN, then close the pipe. _, err = writer.Write(randomData) if err != nil { t.Fatalf("unable to write random data to STDIN pipe: %v", err) } writer.Close() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error") } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } data, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Errorf("error reading the stream: %v", err) return } // Check the random data sent on STDIN was the same returned on STDOUT. if !bytes.Equal(randomData, data) { t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) } } // TestWebSocketClient_LoopbackStdinToStderr returns random data sent on the STDIN channel // back down the STDERR channel. A subsequent comparison checks if the data // sent on the STDIN channel is the same as the data returned on the STDERR // channel. This test can be run many times by the "stress" tool to check // if there is any data which would cause problems with the WebSocket streams. func TestWebSocketClient_LoopbackStdinToStderr(t *testing.T) { // Create fake WebSocket server. Copy received STDIN data back onto STDERR stream. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() // Loopback the STDIN stream onto the STDERR stream. _, err = io.Copy(conns.stderrStream, conns.stdinStream) if err != nil { t.Fatalf("error copying STDIN to STDERR: %v", err) } })) defer websocketServer.Close() // Now create the WebSocket client (executor), and point it to the "websocketServer". // Must add STDIN and STDERR query params for the WebSocket client request. websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stderr=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } // Generate random data, and set it up to stream on STDIN. The data will be // returned on the STDERR buffer. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stderr bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stderr: &stderr, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error") } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } data, err := io.ReadAll(bytes.NewReader(stderr.Bytes())) if err != nil { t.Errorf("error reading the stream: %v", err) return } // Check the random data sent on STDIN was the same returned on STDERR. if !bytes.Equal(randomData, data) { t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) } } // TestWebSocketClient_MultipleReadChannels tests two streams (STDOUT, STDERR) reading from // the websocket connection at the same time. func TestWebSocketClient_MultipleReadChannels(t *testing.T) { // Create fake WebSocket server, which uses a TeeReader to copy the same data // onto the STDOUT stream onto the STDERR stream as well. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() // TeeReader copies data read on STDIN onto STDERR. stdinReader := io.TeeReader(conns.stdinStream, conns.stderrStream) // Also copy STDIN to STDOUT. _, err = io.Copy(conns.stdoutStream, stdinReader) if err != nil { t.Errorf("error copying STDIN to STDOUT: %v", err) } })) defer websocketServer.Close() // Now create the WebSocket client (executor), and point it to the "websocketServer". // Must add stdin, stdout, and stderr query param for the WebSocket client request. websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stdout=true" + "&" + "stderr=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } // Generate 1MB of random data, and set it up to stream on STDIN. The data will be // returned on the STDOUT and STDERR buffers. randomSize := 1024 * 1024 randomData := make([]byte, randomSize) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stdout, stderr bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stdout: &stdout, Stderr: &stderr, } errorChan := make(chan error) go func() { errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error: %v", err) } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } // Validate the data read from the STDOUT stream is the same as sent on the STDIN stream. stdoutBytes, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Fatalf("error reading the stream: %v", err) } if !bytes.Equal(stdoutBytes, randomData) { t.Errorf("unexpected data received (%d) sent (%d)", len(stdoutBytes), len(randomData)) } // Validate the data read from the STDERR stream is the same as sent on the STDIN stream. stderrBytes, err := io.ReadAll(bytes.NewReader(stderr.Bytes())) if err != nil { t.Fatalf("error reading the stream: %v", err) } if !bytes.Equal(stderrBytes, randomData) { t.Errorf("unexpected data received (%d) sent (%d)", len(stderrBytes), len(randomData)) } } // Returns a random exit code in the range(1-127). func randomExitCode() int { errorCode := mrand.Intn(128) if errorCode == 0 { errorCode = 1 } return errorCode } // TestWebSocketClient_ErrorStream tests the websocket error stream by hard-coding a // structured non-zero exit code error from the websocket server to the websocket client. func TestWebSocketClient_ErrorStream(t *testing.T) { expectedExitCode := randomExitCode() // Create fake WebSocket server. Returns structured exit code error on error stream. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() _, err = io.Copy(conns.stderrStream, conns.stdinStream) if err != nil { t.Fatalf("error copying STDIN to STDERR: %v", err) } // Force an non-zero exit code error returned on the error stream. err = conns.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{ Status: metav1.StatusFailure, Reason: remotecommand.NonZeroExitCodeReason, Details: &metav1.StatusDetails{ Causes: []metav1.StatusCause{ { Type: remotecommand.ExitCodeCauseType, Message: fmt.Sprintf("%d", expectedExitCode), }, }, }, }}) if err != nil { t.Fatalf("error writing status: %v", err) } })) defer websocketServer.Close() // Now create the WebSocket client (executor), and point it to the "websocketServer". websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stderr=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } randomData := make([]byte, 256) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } var stderr bytes.Buffer options := &StreamOptions{ Stdin: bytes.NewReader(randomData), Stderr: &stderr, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } // Expect exit code error on error stream. if err == nil { t.Errorf("expected error, but received none") } expectedError := fmt.Sprintf("command terminated with exit code %d", expectedExitCode) // Compare expected error with exit code to actual error. if expectedError != err.Error() { t.Errorf("expected error (%s), got (%s)", expectedError, err) } } } // fakeTerminalSizeQueue implements TerminalSizeQueue, returning a random set of // "maxSizes" number of TerminalSizes, storing the TerminalSizes in "sizes" slice. type fakeTerminalSizeQueue struct { maxSizes int terminalSizes []TerminalSize } // newTerminalSizeQueue returns a pointer to a fakeTerminalSizeQueue passing // "max" number of random TerminalSizes created. func newTerminalSizeQueue(max int) *fakeTerminalSizeQueue { return &fakeTerminalSizeQueue{ maxSizes: max, terminalSizes: make([]TerminalSize, 0, max), } } // Next returns a pointer to the next random TerminalSize, or nil if we have // already returned "maxSizes" TerminalSizes already. Stores the randomly // created TerminalSize in "terminalSizes" field for later validation. func (f *fakeTerminalSizeQueue) Next() *TerminalSize { if len(f.terminalSizes) >= f.maxSizes { return nil } size := randomTerminalSize() f.terminalSizes = append(f.terminalSizes, size) return &size } // randomTerminalSize returns a TerminalSize with random values in the // range (0-65535) for the fields Width and Height. func randomTerminalSize() TerminalSize { randWidth := uint16(mrand.Intn(int(math.Pow(2, 16)))) randHeight := uint16(mrand.Intn(int(math.Pow(2, 16)))) return TerminalSize{ Width: randWidth, Height: randHeight, } } // randReader implements the ReadCloser interface, and it continuously // returns random data until it is closed. Stores number of random // bytes generated and returned. type randReader struct { randBytes []byte closed bool lock sync.Mutex } // Read implements the Reader interface filling the passed buffer with // random data, returning the number of bytes filled and an error // if one occurs. Return 0 and EOF if the randReader has been closed. func (r *randReader) Read(b []byte) (int, error) { r.lock.Lock() defer r.lock.Unlock() if r.closed { return 0, io.EOF } n, err := rand.Read(b) c := bytes.Clone(b) r.randBytes = append(r.randBytes, c...) return n, err } // Close implements the Closer interface, setting the close field true. // Further calls to Read() after Close() will return 0, EOF. Returns // nil error. func (r *randReader) Close() (err error) { r.lock.Lock() defer r.lock.Unlock() r.closed = true return nil } // TestWebSocketClient_MultipleWriteChannels tests two streams (STDIN, TTY resize) writing to the // websocket connection at the same time to exercise the connection write lock. func TestWebSocketClient_MultipleWriteChannels(t *testing.T) { // Create the fake terminal size queue and the actualTerminalSizes which // will be received at the opposite websocket endpoint. numSizeQueue := 10000 sizeQueue := newTerminalSizeQueue(numSizeQueue) actualTerminalSizes := make([]TerminalSize, 0, numSizeQueue) // Create ReadCloser sending random data on STDIN stream over websocket connection. stdinReader := randReader{randBytes: []byte{}, closed: false} // Create fake WebSocket server, which will receive concurrently the STDIN stream as // well as the resize stream (TerminalSizes). Store the TerminalSize data from the resize // stream for subsequent validation. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { var wg sync.WaitGroup conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() // Create goroutine to loopback the STDIN stream onto the STDOUT stream. wg.Add(1) go func() { _, err := io.Copy(conns.stdoutStream, conns.stdinStream) if err != nil { t.Errorf("error copying STDIN to STDOUT: %v", err) } wg.Done() }() // Read the terminal resize requests, storing them in actualTerminalSizes for i := 0; i < numSizeQueue; i++ { actualTerminalSize := <-conns.resizeChan actualTerminalSizes = append(actualTerminalSizes, actualTerminalSize) } stdinReader.Close() // Stops the random STDIN stream generation wg.Wait() // Wait for all bytes copied from STDIN to STDOUT })) defer websocketServer.Close() // Now create the WebSocket client (executor), and point it to the "websocketServer". // Must add stdin, stdout, and TTY query param for the WebSocket client request. websocketServer.URL = websocketServer.URL + "?" + "tty=true" + "&" + "stdin=true" + "&" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdin: &stdinReader, Stdout: &stdout, Tty: true, TerminalSizeQueue: sizeQueue, } errorChan := make(chan error) go func() { errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err != nil { t.Errorf("unexpected error: %v", err) } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } // Check the random data sent on STDIN was the same returned on STDOUT *and* // that a minimum amount of random data was sent and received, ensuring concurrency. stdoutBytes, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) if err != nil { t.Fatalf("error reading the stream: %v", err) } if len(stdoutBytes) == 0 { t.Errorf("No STDOUT bytes processed before resize stream finished: %d", len(stdoutBytes)) } if !bytes.Equal(stdoutBytes, stdinReader.randBytes) { t.Errorf("unexpected data received (%d) sent (%d)", len(stdoutBytes), len(stdinReader.randBytes)) } // Validate the random TerminalSizes sent on the resize stream are the same // as the actual TerminalSizes received at the websocket server. if len(actualTerminalSizes) != numSizeQueue { t.Errorf("expected received terminal size window (%d), got (%d)", numSizeQueue, len(actualTerminalSizes)) } for i, actual := range actualTerminalSizes { expected := sizeQueue.terminalSizes[i] if !reflect.DeepEqual(expected, actual) { t.Errorf("expected terminal resize window %v, got %v", expected, actual) } } } // TestWebSocketClient_ProtocolVersions validates that remote command subprotocol versions V2-V4 // (V5 is already tested elsewhere) can be negotiated. func TestWebSocketClient_ProtocolVersions(t *testing.T) { // Create a raw websocket server that accepts V2-V4 versions of // the remote command subprotocol. var upgrader = gwebsocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true // Accepting all requests }, Subprotocols: []string{ remotecommand.StreamProtocolV4Name, remotecommand.StreamProtocolV3Name, remotecommand.StreamProtocolV2Name, }, } // Upgrade a raw websocket server connection. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conn, err := upgrader.Upgrade(w, req, nil) if err != nil { t.Fatalf("unable to upgrade to create websocket connection: %v", err) } defer conn.Close() })) defer websocketServer.Close() // Set up the websocket client with the STDOUT stream. websocketServer.URL = websocketServer.URL + "?" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } // Iterate through previous remote command protocol versions, validating the // requested protocol version is the one that is negotiated. versions := []string{ remotecommand.StreamProtocolV4Name, remotecommand.StreamProtocolV3Name, remotecommand.StreamProtocolV2Name, } for _, requestedVersion := range versions { streamExec := exec.(*wsStreamExecutor) streamExec.protocols = []string{requestedVersion} var stdout bytes.Buffer options := &StreamOptions{ Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case <-errorChan: // Validate remote command protocol requestedVersion was negotiated. streamExec := exec.(*wsStreamExecutor) if requestedVersion != streamExec.negotiated { t.Fatalf("expected protocol version (%s), got (%s)", requestedVersion, streamExec.negotiated) } } } } // TestWebSocketClient_BadHandshake tests that a "bad handshake" error occurs when // the WebSocketExecutor attempts to upgrade the connection to a subprotocol version // (V4) that is not supported by the websocket server (only supports V5). func TestWebSocketClient_BadHandshake(t *testing.T) { // Create fake WebSocket server (supports V5 subprotocol). websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { // Bad handshake means websocket server will not completely initialize. _, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err == nil { t.Fatalf("expected error, but received none.") } if !strings.Contains(err.Error(), "websocket server finished before becoming ready") { t.Errorf("expected websocket server error, but got: %v", err) } })) defer websocketServer.Close() websocketServer.URL = websocketServer.URL + "?" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } streamExec := exec.(*wsStreamExecutor) // Set the attempted subprotocol version to V4; websocket server only accepts V5. streamExec.protocols = []string{remotecommand.StreamProtocolV4Name} var stdout bytes.Buffer options := &StreamOptions{ Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- streamExec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: // Expecting unable to upgrade connection -- "bad handshake" error. if err == nil { t.Errorf("expected error but received none") } if !strings.Contains(err.Error(), "bad handshake") { t.Errorf("expected bad handshake error, got (%s)", err) } } } // TestWebSocketClient_HeartbeatTimeout tests the heartbeat by forcing a // timeout by setting the ping period greater than the deadline. func TestWebSocketClient_HeartbeatTimeout(t *testing.T) { blockRequestCtx, unblockRequest := context.WithCancel(context.Background()) defer unblockRequest() // Create fake WebSocket server which blocks. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() <-blockRequestCtx.Done() })) defer websocketServer.Close() // Create websocket client connecting to fake server. websocketServer.URL = websocketServer.URL + "?" + "stdin=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } streamExec := exec.(*wsStreamExecutor) // Ping period is greater than the ping deadline, forcing the timeout to fire. pingPeriod := wait.ForeverTestTimeout // this lets the heartbeat deadline expire without renewing it pingDeadline := time.Second // this gives setup 1 second to establish streams streamExec.heartbeatPeriod = pingPeriod streamExec.heartbeatDeadline = pingDeadline // Send some random data to the websocket server through STDIN. randomData := make([]byte, 128) if _, err := rand.Read(randomData); err != nil { t.Errorf("unexpected error reading random data: %v", err) } options := &StreamOptions{ Stdin: bytes.NewReader(randomData), } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- streamExec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expected heartbeat timeout, got none.") case err := <-errorChan: // Expecting heartbeat timeout error. if err == nil { t.Fatalf("expected error but received none") } if !strings.Contains(err.Error(), "i/o timeout") { t.Errorf("expected heartbeat timeout error, got (%s)", err) } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } } // TestWebSocketClient_TextMessageTypeError tests when the wrong message type is returned // from the other websocket endpoint. Remote command protocols use "BinaryMessage", but // this test hard-codes returning a "TextMessage". func TestWebSocketClient_TextMessageTypeError(t *testing.T) { var upgrader = gwebsocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true // Accepting all requests }, Subprotocols: []string{remotecommand.StreamProtocolV5Name}, } // Upgrade a raw websocket server connection. Returns wrong message type "TextMessage". websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conn, err := upgrader.Upgrade(w, req, nil) if err != nil { t.Fatalf("unable to upgrade to create websocket connection: %v", err) } defer conn.Close() msg := []byte("test message with wrong message type.") stdOutMsg := append([]byte{remotecommand.StreamStdOut}, msg...) // Wrong message type "TextMessage". err = conn.WriteMessage(gwebsocket.TextMessage, stdOutMsg) if err != nil { t.Fatalf("error writing text message to websocket: %v", err) } })) defer websocketServer.Close() // Set up the websocket client with the STDOUT stream. websocketServer.URL = websocketServer.URL + "?" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: // Expecting bad message type error. if err == nil { t.Fatalf("expected error but received none") } if !strings.Contains(err.Error(), "unexpected message type") { t.Errorf("expected bad message type error, got (%s)", err) } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } } // TestWebSocketClient_EmptyMessageHandled tests that the error of a completely empty message // is handled correctly. If the message is completely empty, the initial read of the stream id // should fail (followed by cleanup). func TestWebSocketClient_EmptyMessageHandled(t *testing.T) { var upgrader = gwebsocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true // Accepting all requests }, Subprotocols: []string{remotecommand.StreamProtocolV5Name}, } // Upgrade a raw websocket server connection. Returns wrong message type "TextMessage". websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conn, err := upgrader.Upgrade(w, req, nil) if err != nil { t.Fatalf("unable to upgrade to create websocket connection: %v", err) } defer conn.Close() // Send completely empty message, including missing initial stream id. conn.WriteMessage(gwebsocket.BinaryMessage, []byte{}) //nolint:errcheck })) defer websocketServer.Close() // Set up the websocket client with the STDOUT stream. websocketServer.URL = websocketServer.URL + "?" + "stdout=true" websocketLocation, err := url.Parse(websocketServer.URL) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", websocketServer.URL) } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: // Expecting error reading initial stream id. if err == nil { t.Fatalf("expected error but received none") } if !strings.Contains(err.Error(), "read stream id") { t.Errorf("expected error reading stream id, got (%s)", err) } // Validate remote command v5 protocol was negotiated. streamExec := exec.(*wsStreamExecutor) if remotecommand.StreamProtocolV5Name != streamExec.negotiated { t.Fatalf("expected remote command v5 protocol, got (%s)", streamExec.negotiated) } } } func TestWebSocketClient_ExecutorErrors(t *testing.T) { // Invalid config causes transport creation error in websocket executor constructor. config := rest.Config{ ExecProvider: &clientcmdapi.ExecConfig{}, AuthProvider: &clientcmdapi.AuthProviderConfig{}, } _, err := NewWebSocketExecutor(&config, "GET", "http://localhost") if err == nil { t.Errorf("expecting executor constructor error, but received none.") } else if !strings.Contains(err.Error(), "error creating websocket transports") { t.Errorf("expecting error creating transports, got (%s)", err.Error()) } // Verify that a nil context will cause an error in StreamWithContext exec, err := NewWebSocketExecutor(&rest.Config{}, "GET", "http://localhost") if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. var ctx context.Context errorChan <- exec.StreamWithContext(ctx, StreamOptions{}) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: // Expecting error with nil context. if err == nil { t.Fatalf("expected error but received none") } if !strings.Contains(err.Error(), "nil Context") { t.Errorf("expected nil context error, got (%s)", err) } } } func TestWebSocketClient_HeartbeatSucceeds(t *testing.T) { var upgrader = gwebsocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true // Accepting all requests }, } // Upgrade a raw websocket server connection, which automatically responds to Ping. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conn, err := upgrader.Upgrade(w, req, nil) if err != nil { t.Fatalf("unable to upgrade to create websocket connection: %v", err) } defer conn.Close() for { _, _, err := conn.ReadMessage() if err != nil { break } } })) defer websocketServer.Close() // Create a raw websocket client, connecting to the websocket server. url := strings.ReplaceAll(websocketServer.URL, "http", "ws") client, _, err := gwebsocket.DefaultDialer.Dial(url, nil) if err != nil { t.Fatalf("dial: %v", err) } defer client.Close() // Create a heartbeat using the client websocket connection, and start it. // "period" is less than "deadline", so ping/pong heartbeat will succceed. var expectedMsg = "test heartbeat message" var period = 100 * time.Millisecond var deadline = 200 * time.Millisecond heartbeat := newHeartbeat(client, period, deadline) heartbeat.setMessage(expectedMsg) // Add a channel to the handler to retrieve the "pong" message. pongMsgCh := make(chan string) pongHandler := heartbeat.conn.PongHandler() heartbeat.conn.SetPongHandler(func(msg string) error { pongMsgCh <- msg return pongHandler(msg) }) go heartbeat.start() var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() for { _, _, err := client.ReadMessage() if err != nil { t.Logf("client err reading message: %v", err) return } } }() select { case actualMsg := <-pongMsgCh: close(heartbeat.closer) // Validate the received pong message is the same as sent in ping. if expectedMsg != actualMsg { t.Errorf("expected received pong message (%s), got (%s)", expectedMsg, actualMsg) } case <-time.After(period * 4): // This case should not happen. close(heartbeat.closer) t.Errorf("unexpected heartbeat timeout") } wg.Wait() } func TestLateStreamCreation(t *testing.T) { c := newWSStreamCreator(nil) c.closeAllStreamReaders(nil) if err := c.setStream(0, nil); err == nil { t.Fatal("expected error adding stream after closeAllStreamReaders") } } func TestWebSocketClient_StreamsAndExpectedErrors(t *testing.T) { // Validate Stream functions. c := newWSStreamCreator(nil) headers := http.Header{} headers.Set(v1.StreamType, v1.StreamTypeStdin) s, err := c.CreateStream(headers) if err != nil { t.Errorf("unexpected stream creation error: %v", err) } expectedStreamID := uint32(remotecommand.StreamStdIn) actualStreamID := s.Identifier() if expectedStreamID != actualStreamID { t.Errorf("expecting stream id (%d), got (%d)", expectedStreamID, actualStreamID) } actualHeaders := s.Headers() if !reflect.DeepEqual(headers, actualHeaders) { t.Errorf("expecting stream headers (%v), got (%v)", headers, actualHeaders) } // Validate stream reset does not return error. err = s.Reset() if err != nil { t.Errorf("unexpected error in stream reset: %v", err) } // Validate close with nil connection is an error. err = s.Close() if err == nil { t.Errorf("expecting stream Close error, but received none") } if !strings.Contains(err.Error(), "Close() on already closed stream") { t.Errorf("expected stream close error, got (%s)", err) } // Validate write with nil connection is an error. n, err := s.Write([]byte("not written")) if n != 0 { t.Errorf("expected zero bytes written, wrote (%d) instead", n) } if err == nil { t.Errorf("expecting stream Write error, but received none") } if !strings.Contains(err.Error(), "write on closed stream") { t.Errorf("expected stream write error, got (%s)", err) } // Validate CreateStream errors -- unknown stream headers = http.Header{} headers.Set(v1.StreamType, "UNKNOWN") _, err = c.CreateStream(headers) if err == nil { t.Errorf("expecting CreateStream error, but received none") } else if !strings.Contains(err.Error(), "unknown stream type") { t.Errorf("expecting unknown stream type error, got (%s)", err.Error()) } // Validate CreateStream errors -- duplicate stream headers.Set(v1.StreamType, v1.StreamTypeError) c.streams[remotecommand.StreamErr] = &stream{} _, err = c.CreateStream(headers) if err == nil { t.Errorf("expecting CreateStream error, but received none") } else if !strings.Contains(err.Error(), "duplicate stream") { t.Errorf("expecting duplicate stream error, got (%s)", err.Error()) } } // options contains details about which streams are required for // remote command execution. type options struct { stdin bool stdout bool stderr bool tty bool } // Translates query params in request into options struct. func streamOptionsFromRequest(req *http.Request) *options { query := req.URL.Query() tty := query.Get("tty") == "true" stdin := query.Get("stdin") == "true" stdout := query.Get("stdout") == "true" stderr := query.Get("stderr") == "true" return &options{ stdin: stdin, stdout: stdout, stderr: stderr, tty: tty, } } // websocketStreams contains the WebSocket connection and streams from a server. type websocketStreams struct { conn io.Closer stdinStream io.ReadCloser stdoutStream io.WriteCloser stderrStream io.WriteCloser writeStatus func(status *apierrors.StatusError) error resizeStream io.ReadCloser resizeChan chan TerminalSize tty bool } // Create WebSocket server streams to respond to a WebSocket client. Creates the streams passed // in the stream options. func webSocketServerStreams(req *http.Request, w http.ResponseWriter, opts *options) (*websocketStreams, error) { conn, err := createWebSocketStreams(req, w, opts) if err != nil { return nil, err } if conn.resizeStream != nil { conn.resizeChan = make(chan TerminalSize) go handleResizeEvents(req.Context(), conn.resizeStream, conn.resizeChan) } return conn, nil } // Read terminal resize events off of passed stream and queue into passed channel. func handleResizeEvents(ctx context.Context, stream io.Reader, channel chan<- TerminalSize) { defer close(channel) decoder := json.NewDecoder(stream) for { size := TerminalSize{} if err := decoder.Decode(&size); err != nil { break } select { case channel <- size: case <-ctx.Done(): // To avoid leaking this routine, exit if the http request finishes. This path // would generally be hit if starting the process fails and nothing is started to // ingest these resize events. return } } } // createChannels returns the standard channel types for a shell connection (STDIN 0, STDOUT 1, STDERR 2) // along with the approximate duplex value. It also creates the error (3) and resize (4) channels. func createChannels(opts *options) []wsstream.ChannelType { // open the requested channels, and always open the error channel channels := make([]wsstream.ChannelType, 5) channels[remotecommand.StreamStdIn] = readChannel(opts.stdin) channels[remotecommand.StreamStdOut] = writeChannel(opts.stdout) channels[remotecommand.StreamStdErr] = writeChannel(opts.stderr) channels[remotecommand.StreamErr] = wsstream.WriteChannel channels[remotecommand.StreamResize] = wsstream.ReadChannel return channels } // readChannel returns wsstream.ReadChannel if real is true, or wsstream.IgnoreChannel. func readChannel(real bool) wsstream.ChannelType { if real { return wsstream.ReadChannel } return wsstream.IgnoreChannel } // writeChannel returns wsstream.WriteChannel if real is true, or wsstream.IgnoreChannel. func writeChannel(real bool) wsstream.ChannelType { if real { return wsstream.WriteChannel } return wsstream.IgnoreChannel } // createWebSocketStreams returns a "channels" struct containing the websocket connection and // streams needed to perform an exec or an attach. func createWebSocketStreams(req *http.Request, w http.ResponseWriter, opts *options) (*websocketStreams, error) { channels := createChannels(opts) conn := wsstream.NewConn(map[string]wsstream.ChannelProtocolConfig{ remotecommand.StreamProtocolV5Name: { Binary: true, Channels: channels, }, }) conn.SetIdleTimeout(4 * time.Hour) // Opening the connection responds to WebSocket client, negotiating // the WebSocket upgrade connection and the subprotocol. _, streams, err := conn.Open(w, req) if err != nil { return nil, err } // Send an empty message to the lowest writable channel to notify the client the connection is established //nolint:errcheck switch { case opts.stdout: streams[remotecommand.StreamStdOut].Write([]byte{}) case opts.stderr: streams[remotecommand.StreamStdErr].Write([]byte{}) default: streams[remotecommand.StreamErr].Write([]byte{}) } wsStreams := &websocketStreams{ conn: conn, stdinStream: streams[remotecommand.StreamStdIn], stdoutStream: streams[remotecommand.StreamStdOut], stderrStream: streams[remotecommand.StreamStdErr], tty: opts.tty, resizeStream: streams[remotecommand.StreamResize], } wsStreams.writeStatus = func(stream io.Writer) func(status *apierrors.StatusError) error { return func(status *apierrors.StatusError) error { bs, err := json.Marshal(status.Status()) if err != nil { return err } _, err = stream.Write(bs) return err } }(streams[remotecommand.StreamErr]) return wsStreams, nil } // See (https://github.com/kubernetes/kubernetes/issues/126134). func TestWebSocketClient_HTTPSProxyErrorExpected(t *testing.T) { urlStr := "http://127.0.0.1/never-used" + "?" + "stdin=true" + "&" + "stdout=true" websocketLocation, err := url.Parse(urlStr) if err != nil { t.Fatalf("Unable to parse WebSocket server URL: %s", urlStr) } // proxy url with https scheme will trigger websocket dialing error. httpsProxyFunc := func(req *http.Request) (*url.URL, error) { return url.Parse("https://127.0.0.1") } exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host, Proxy: httpsProxyFunc}, "GET", urlStr) if err != nil { t.Errorf("unexpected error creating websocket executor: %v", err) } var stdout bytes.Buffer options := &StreamOptions{ Stdout: &stdout, } errorChan := make(chan error) go func() { // Start the streaming on the WebSocket "exec" client. errorChan <- exec.StreamWithContext(context.Background(), *options) }() select { case <-time.After(wait.ForeverTestTimeout): t.Fatalf("expect stream to be closed after connection is closed.") case err := <-errorChan: if err == nil { t.Errorf("expected error but received none") } if !httpstream.IsHTTPSProxyError(err) { t.Errorf("expected https proxy error, got (%s)", err) } } } kubernetes-client-go-a2dfcab/tools/watch/000077500000000000000000000000001472614177300206465ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/tools/watch/informerwatcher.go000066400000000000000000000071471472614177300244050ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package watch import ( "sync" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" ) func newEventProcessor(out chan<- watch.Event) *eventProcessor { return &eventProcessor{ out: out, cond: sync.NewCond(&sync.Mutex{}), done: make(chan struct{}), } } // eventProcessor buffers events and writes them to an out chan when a reader // is waiting. Because of the requirement to buffer events, it synchronizes // input with a condition, and synchronizes output with a channels. It needs to // be able to yield while both waiting on an input condition and while blocked // on writing to the output channel. type eventProcessor struct { out chan<- watch.Event cond *sync.Cond buff []watch.Event done chan struct{} } func (e *eventProcessor) run() { for { batch := e.takeBatch() e.writeBatch(batch) if e.stopped() { return } } } func (e *eventProcessor) takeBatch() []watch.Event { e.cond.L.Lock() defer e.cond.L.Unlock() for len(e.buff) == 0 && !e.stopped() { e.cond.Wait() } batch := e.buff e.buff = nil return batch } func (e *eventProcessor) writeBatch(events []watch.Event) { for _, event := range events { select { case e.out <- event: case <-e.done: return } } } func (e *eventProcessor) push(event watch.Event) { e.cond.L.Lock() defer e.cond.L.Unlock() defer e.cond.Signal() e.buff = append(e.buff, event) } func (e *eventProcessor) stopped() bool { select { case <-e.done: return true default: return false } } func (e *eventProcessor) stop() { close(e.done) e.cond.Signal() } // NewIndexerInformerWatcher will create an IndexerInformer and wrap it into watch.Interface // so you can use it anywhere where you'd have used a regular Watcher returned from Watch method. // it also returns a channel you can use to wait for the informers to fully shutdown. func NewIndexerInformerWatcher(lw cache.ListerWatcher, objType runtime.Object) (cache.Indexer, cache.Controller, watch.Interface, <-chan struct{}) { ch := make(chan watch.Event) w := watch.NewProxyWatcher(ch) e := newEventProcessor(ch) indexer, informer := cache.NewIndexerInformer(lw, objType, 0, cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { e.push(watch.Event{ Type: watch.Added, Object: obj.(runtime.Object), }) }, UpdateFunc: func(old, new interface{}) { e.push(watch.Event{ Type: watch.Modified, Object: new.(runtime.Object), }) }, DeleteFunc: func(obj interface{}) { staleObj, stale := obj.(cache.DeletedFinalStateUnknown) if stale { // We have no means of passing the additional information down using // watch API based on watch.Event but the caller can filter such // objects by checking if metadata.deletionTimestamp is set obj = staleObj.Obj } e.push(watch.Event{ Type: watch.Deleted, Object: obj.(runtime.Object), }) }, }, cache.Indexers{}) go e.run() doneCh := make(chan struct{}) go func() { defer close(doneCh) defer e.stop() informer.Run(w.StopChan()) }() return indexer, informer, w, doneCh } kubernetes-client-go-a2dfcab/tools/watch/informerwatcher_test.go000066400000000000000000000303301472614177300254320ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package watch import ( "context" "reflect" goruntime "runtime" "sort" "testing" "time" "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/dump" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" clientfeatures "k8s.io/client-go/features" clientfeaturestesting "k8s.io/client-go/features/testing" fakeclientset "k8s.io/client-go/kubernetes/fake" testcore "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" ) // TestEventProcessorExit is expected to timeout if the event processor fails // to exit when stopped. func TestEventProcessorExit(t *testing.T) { event := watch.Event{} tests := []struct { name string write func(e *eventProcessor) }{ { name: "exit on blocked read", write: func(e *eventProcessor) { e.push(event) }, }, { name: "exit on blocked write", write: func(e *eventProcessor) { e.push(event) e.push(event) }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { out := make(chan watch.Event) e := newEventProcessor(out) test.write(e) exited := make(chan struct{}) go func() { e.run() close(exited) }() <-out e.stop() goruntime.Gosched() <-exited }) } } type apiInt int func (apiInt) GetObjectKind() schema.ObjectKind { return nil } func (apiInt) DeepCopyObject() runtime.Object { return nil } func TestEventProcessorOrdersEvents(t *testing.T) { out := make(chan watch.Event) e := newEventProcessor(out) go e.run() numProcessed := 0 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) go func() { for i := 0; i < 1000; i++ { e := <-out if got, want := int(e.Object.(apiInt)), i; got != want { t.Errorf("unexpected event: got=%d, want=%d", got, want) } numProcessed++ } cancel() }() for i := 0; i < 1000; i++ { e.push(watch.Event{Object: apiInt(i)}) } <-ctx.Done() e.stop() if numProcessed != 1000 { t.Errorf("unexpected number of events processed: %d", numProcessed) } } type byEventTypeAndName []watch.Event func (a byEventTypeAndName) Len() int { return len(a) } func (a byEventTypeAndName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a byEventTypeAndName) Less(i, j int) bool { if a[i].Type < a[j].Type { return true } if a[i].Type > a[j].Type { return false } return a[i].Object.(*corev1.Secret).Name < a[j].Object.(*corev1.Secret).Name } func newTestSecret(name, key, value string) *corev1.Secret { return &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, StringData: map[string]string{ key: value, }, } } func TestNewInformerWatcher(t *testing.T) { // Make sure there are no 2 same types of events on a secret with the same name or that might be flaky. tt := []struct { name string watchListFeatureEnabled bool objects []runtime.Object inputEvents []watch.Event outputEvents []watch.Event }{ { name: "WatchListClient feature disabled", watchListFeatureEnabled: false, objects: []runtime.Object{ newTestSecret("pod-1", "foo-1", "initial"), newTestSecret("pod-2", "foo-2", "initial"), newTestSecret("pod-3", "foo-3", "initial"), }, inputEvents: []watch.Event{ { Type: watch.Added, Object: newTestSecret("pod-4", "foo-4", "initial"), }, { Type: watch.Modified, Object: newTestSecret("pod-2", "foo-2", "new"), }, { Type: watch.Deleted, Object: newTestSecret("pod-3", "foo-3", "initial"), }, }, outputEvents: []watch.Event{ // When WatchListClient is disabled, ListAndWatch creates fake // ADDED events for each object listed. { Type: watch.Added, Object: newTestSecret("pod-1", "foo-1", "initial"), }, { Type: watch.Added, Object: newTestSecret("pod-2", "foo-2", "initial"), }, { Type: watch.Added, Object: newTestSecret("pod-3", "foo-3", "initial"), }, // Normal events follow. { Type: watch.Added, Object: newTestSecret("pod-4", "foo-4", "initial"), }, { Type: watch.Modified, Object: newTestSecret("pod-2", "foo-2", "new"), }, { Type: watch.Deleted, Object: newTestSecret("pod-3", "foo-3", "initial"), }, }, }, { name: "WatchListClient feature enabled", watchListFeatureEnabled: true, objects: []runtime.Object{ newTestSecret("pod-1", "foo-1", "initial"), newTestSecret("pod-2", "foo-2", "initial"), newTestSecret("pod-3", "foo-3", "initial"), }, inputEvents: []watch.Event{ { Type: watch.Added, Object: newTestSecret("pod-1", "foo-1", "initial"), }, { Type: watch.Added, Object: newTestSecret("pod-2", "foo-2", "initial"), }, { Type: watch.Added, Object: newTestSecret("pod-3", "foo-3", "initial"), }, // ListWatch bookmark indicates that initial listing is done { Type: watch.Bookmark, Object: &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ metav1.InitialEventsAnnotationKey: "true", }, }, }, }, { Type: watch.Added, Object: newTestSecret("pod-4", "foo-4", "initial"), }, { Type: watch.Modified, Object: newTestSecret("pod-2", "foo-2", "new"), }, { Type: watch.Deleted, Object: newTestSecret("pod-3", "foo-3", "initial"), }, }, outputEvents: []watch.Event{ // When WatchListClient is enabled, WatchList receives // ADDED events from the server for each existing object. { Type: watch.Added, Object: newTestSecret("pod-1", "foo-1", "initial"), }, { Type: watch.Added, Object: newTestSecret("pod-2", "foo-2", "initial"), }, { Type: watch.Added, Object: newTestSecret("pod-3", "foo-3", "initial"), }, // Bookmark event at the end of listing is not sent to the client. // Normal events follow. { Type: watch.Added, Object: newTestSecret("pod-4", "foo-4", "initial"), }, { Type: watch.Modified, Object: newTestSecret("pod-2", "foo-2", "new"), }, { Type: watch.Deleted, Object: newTestSecret("pod-3", "foo-3", "initial"), }, }, }, } for _, tc := range tt { t.Run(tc.name, func(t *testing.T) { clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, tc.watchListFeatureEnabled) fake := fakeclientset.NewSimpleClientset(tc.objects...) inputCh := make(chan watch.Event) inputWatcher := watch.NewProxyWatcher(inputCh) // Indexer should stop the input watcher when the output watcher is stopped. // But stop it at the end of the test, just in case. defer inputWatcher.Stop() inputStopCh := inputWatcher.StopChan() fake.PrependWatchReactor("secrets", testcore.DefaultWatchReactor(inputWatcher, nil)) // Send events and then close the done channel inputDoneCh := make(chan struct{}) go func() { defer close(inputDoneCh) for _, e := range tc.inputEvents { select { case inputCh <- e: case <-inputStopCh: return } } }() lw := &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return fake.CoreV1().Secrets("").List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return fake.CoreV1().Secrets("").Watch(context.TODO(), options) }, } _, _, outputWatcher, informerDoneCh := NewIndexerInformerWatcher(lw, &corev1.Secret{}) outputCh := outputWatcher.ResultChan() timeoutCh := time.After(wait.ForeverTestTimeout) var result []watch.Event loop: for { select { case event, ok := <-outputCh: if !ok { t.Errorf("Output result channel closed prematurely") break loop } result = append(result, *event.DeepCopy()) if len(result) >= len(tc.outputEvents) { break loop } case <-timeoutCh: t.Error("Timed out waiting for events") break loop } } // Informers don't guarantee event order so we need to sort these arrays to compare them. sort.Sort(byEventTypeAndName(tc.outputEvents)) sort.Sort(byEventTypeAndName(result)) if !reflect.DeepEqual(tc.outputEvents, result) { t.Errorf("\nexpected: %s,\ngot: %s,\ndiff: %s", dump.Pretty(tc.outputEvents), dump.Pretty(result), cmp.Diff(tc.outputEvents, result)) return } // Send some more events, but don't read them. // Stop producing events when the consumer stops the watcher. go func() { defer close(inputCh) for _, e := range tc.inputEvents { select { case inputCh <- e: case <-inputStopCh: return } } }() // Stop before reading all the data to make sure the informer can deal with closed channel outputWatcher.Stop() select { case <-informerDoneCh: case <-time.After(wait.ForeverTestTimeout): t.Error("Timed out waiting for informer to cleanup") } }) } } // TestInformerWatcherDeletedFinalStateUnknown tests the code path when `DeleteFunc` // in `NewIndexerInformerWatcher` receives a `cache.DeletedFinalStateUnknown` // object from the underlying `DeltaFIFO`. The triggering condition is described // at https://github.com/kubernetes/kubernetes/blob/dc39ab2417bfddcec37be4011131c59921fdbe98/staging/src/k8s.io/client-go/tools/cache/delta_fifo.go#L736-L739. // // Code from @liggitt func TestInformerWatcherDeletedFinalStateUnknown(t *testing.T) { listCalls := 0 watchCalls := 0 lw := &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { retval := &corev1.SecretList{} if listCalls == 0 { // Return a list with items in it retval.ResourceVersion = "1" retval.Items = []corev1.Secret{{ObjectMeta: metav1.ObjectMeta{Name: "secret1", Namespace: "ns1", ResourceVersion: "123"}}} } else { // Return empty lists after the first call retval.ResourceVersion = "2" } listCalls++ return retval, nil }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { w := watch.NewRaceFreeFake() if options.ResourceVersion == "1" { go func() { // Close with a "Gone" error when trying to start a watch from the first list w.Error(&apierrors.NewGone("gone").ErrStatus) w.Stop() }() } watchCalls++ return w, nil }, } _, _, w, done := NewIndexerInformerWatcher(lw, &corev1.Secret{}) defer w.Stop() // Expect secret add select { case event, ok := <-w.ResultChan(): if !ok { t.Fatal("unexpected close") } if event.Type != watch.Added { t.Fatalf("expected Added event, got %#v", event) } if event.Object.(*corev1.Secret).ResourceVersion != "123" { t.Fatalf("expected added Secret with rv=123, got %#v", event.Object) } case <-time.After(time.Second * 10): t.Fatal("timeout") } // Expect secret delete because the relist was missing the secret select { case event, ok := <-w.ResultChan(): if !ok { t.Fatal("unexpected close") } if event.Type != watch.Deleted { t.Fatalf("expected Deleted event, got %#v", event) } if event.Object.(*corev1.Secret).ResourceVersion != "123" { t.Fatalf("expected deleted Secret with rv=123, got %#v", event.Object) } case <-time.After(time.Second * 10): t.Fatal("timeout") } w.Stop() select { case <-done: case <-time.After(time.Second * 10): t.Fatal("timeout") } if listCalls < 2 { t.Fatalf("expected at least 2 list calls, got %d", listCalls) } if watchCalls < 1 { t.Fatalf("expected at least 1 watch call, got %d", watchCalls) } } kubernetes-client-go-a2dfcab/tools/watch/retrywatcher.go000066400000000000000000000224511472614177300237240ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package watch import ( "context" "errors" "fmt" "io" "net/http" "sync" "time" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/dump" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" "k8s.io/klog/v2" ) // resourceVersionGetter is an interface used to get resource version from events. // We can't reuse an interface from meta otherwise it would be a cyclic dependency and we need just this one method type resourceVersionGetter interface { GetResourceVersion() string } // RetryWatcher will make sure that in case the underlying watcher is closed (e.g. due to API timeout or etcd timeout) // it will get restarted from the last point without the consumer even knowing about it. // RetryWatcher does that by inspecting events and keeping track of resourceVersion. // Especially useful when using watch.UntilWithoutRetry where premature termination is causing issues and flakes. // Please note that this is not resilient to etcd cache not having the resource version anymore - you would need to // use Informers for that. type RetryWatcher struct { lastResourceVersion string watcherClient cache.Watcher resultChan chan watch.Event stopChan chan struct{} doneChan chan struct{} minRestartDelay time.Duration stopChanLock sync.Mutex } // NewRetryWatcher creates a new RetryWatcher. // It will make sure that watches gets restarted in case of recoverable errors. // The initialResourceVersion will be given to watch method when first called. func NewRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher) (*RetryWatcher, error) { return newRetryWatcher(initialResourceVersion, watcherClient, 1*time.Second) } func newRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher, minRestartDelay time.Duration) (*RetryWatcher, error) { switch initialResourceVersion { case "", "0": // TODO: revisit this if we ever get WATCH v2 where it means start "now" // without doing the synthetic list of objects at the beginning (see #74022) return nil, fmt.Errorf("initial RV %q is not supported due to issues with underlying WATCH", initialResourceVersion) default: break } rw := &RetryWatcher{ lastResourceVersion: initialResourceVersion, watcherClient: watcherClient, stopChan: make(chan struct{}), doneChan: make(chan struct{}), resultChan: make(chan watch.Event, 0), minRestartDelay: minRestartDelay, } go rw.receive() return rw, nil } func (rw *RetryWatcher) send(event watch.Event) bool { // Writing to an unbuffered channel is blocking operation // and we need to check if stop wasn't requested while doing so. select { case rw.resultChan <- event: return true case <-rw.stopChan: return false } } // doReceive returns true when it is done, false otherwise. // If it is not done the second return value holds the time to wait before calling it again. func (rw *RetryWatcher) doReceive() (bool, time.Duration) { watcher, err := rw.watcherClient.Watch(metav1.ListOptions{ ResourceVersion: rw.lastResourceVersion, AllowWatchBookmarks: true, }) // We are very unlikely to hit EOF here since we are just establishing the call, // but it may happen that the apiserver is just shutting down (e.g. being restarted) // This is consistent with how it is handled for informers switch err { case nil: break case io.EOF: // watch closed normally return false, 0 case io.ErrUnexpectedEOF: klog.V(1).InfoS("Watch closed with unexpected EOF", "err", err) return false, 0 default: msg := "Watch failed" if net.IsProbableEOF(err) || net.IsTimeout(err) { klog.V(5).InfoS(msg, "err", err) // Retry return false, 0 } klog.ErrorS(err, msg) // Retry return false, 0 } if watcher == nil { klog.ErrorS(nil, "Watch returned nil watcher") // Retry return false, 0 } ch := watcher.ResultChan() defer watcher.Stop() for { select { case <-rw.stopChan: klog.V(4).InfoS("Stopping RetryWatcher.") return true, 0 case event, ok := <-ch: if !ok { klog.V(4).InfoS("Failed to get event! Re-creating the watcher.", "resourceVersion", rw.lastResourceVersion) return false, 0 } // We need to inspect the event and get ResourceVersion out of it switch event.Type { case watch.Added, watch.Modified, watch.Deleted, watch.Bookmark: metaObject, ok := event.Object.(resourceVersionGetter) if !ok { _ = rw.send(watch.Event{ Type: watch.Error, Object: &apierrors.NewInternalError(errors.New("retryWatcher: doesn't support resourceVersion")).ErrStatus, }) // We have to abort here because this might cause lastResourceVersion inconsistency by skipping a potential RV with valid data! return true, 0 } resourceVersion := metaObject.GetResourceVersion() if resourceVersion == "" { _ = rw.send(watch.Event{ Type: watch.Error, Object: &apierrors.NewInternalError(fmt.Errorf("retryWatcher: object %#v doesn't support resourceVersion", event.Object)).ErrStatus, }) // We have to abort here because this might cause lastResourceVersion inconsistency by skipping a potential RV with valid data! return true, 0 } // All is fine; send the non-bookmark events and update resource version. if event.Type != watch.Bookmark { ok = rw.send(event) if !ok { return true, 0 } } rw.lastResourceVersion = resourceVersion continue case watch.Error: // This round trip allows us to handle unstructured status errObject := apierrors.FromObject(event.Object) statusErr, ok := errObject.(*apierrors.StatusError) if !ok { klog.Error(fmt.Sprintf("Received an error which is not *metav1.Status but %s", dump.Pretty(event.Object))) // Retry unknown errors return false, 0 } status := statusErr.ErrStatus statusDelay := time.Duration(0) if status.Details != nil { statusDelay = time.Duration(status.Details.RetryAfterSeconds) * time.Second } switch status.Code { case http.StatusGone: // Never retry RV too old errors _ = rw.send(event) return true, 0 case http.StatusGatewayTimeout, http.StatusInternalServerError: // Retry return false, statusDelay default: // We retry by default. RetryWatcher is meant to proceed unless it is certain // that it can't. If we are not certain, we proceed with retry and leave it // up to the user to timeout if needed. // Log here so we have a record of hitting the unexpected error // and we can whitelist some error codes if we missed any that are expected. klog.V(5).Info(fmt.Sprintf("Retrying after unexpected error: %s", dump.Pretty(event.Object))) // Retry return false, statusDelay } default: klog.Errorf("Failed to recognize Event type %q", event.Type) _ = rw.send(watch.Event{ Type: watch.Error, Object: &apierrors.NewInternalError(fmt.Errorf("retryWatcher failed to recognize Event type %q", event.Type)).ErrStatus, }) // We are unable to restart the watch and have to stop the loop or this might cause lastResourceVersion inconsistency by skipping a potential RV with valid data! return true, 0 } } } } // receive reads the result from a watcher, restarting it if necessary. func (rw *RetryWatcher) receive() { defer close(rw.doneChan) defer close(rw.resultChan) klog.V(4).Info("Starting RetryWatcher.") defer klog.V(4).Info("Stopping RetryWatcher.") ctx, cancel := context.WithCancel(context.Background()) defer cancel() go func() { select { case <-rw.stopChan: cancel() return case <-ctx.Done(): return } }() // We use non sliding until so we don't introduce delays on happy path when WATCH call // timeouts or gets closed and we need to reestablish it while also avoiding hot loops. wait.NonSlidingUntilWithContext(ctx, func(ctx context.Context) { done, retryAfter := rw.doReceive() if done { cancel() return } timer := time.NewTimer(retryAfter) select { case <-ctx.Done(): timer.Stop() return case <-timer.C: } klog.V(4).Infof("Restarting RetryWatcher at RV=%q", rw.lastResourceVersion) }, rw.minRestartDelay) } // ResultChan implements Interface. func (rw *RetryWatcher) ResultChan() <-chan watch.Event { return rw.resultChan } // Stop implements Interface. func (rw *RetryWatcher) Stop() { rw.stopChanLock.Lock() defer rw.stopChanLock.Unlock() // Prevent closing an already closed channel to prevent a panic select { case <-rw.stopChan: default: close(rw.stopChan) } } // Done allows the caller to be notified when Retry watcher stops. func (rw *RetryWatcher) Done() <-chan struct{} { return rw.doneChan } kubernetes-client-go-a2dfcab/tools/watch/retrywatcher_test.go000066400000000000000000000402561472614177300247660ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package watch import ( "errors" "flag" "fmt" "reflect" "strconv" "sync/atomic" "testing" "time" "github.com/google/go-cmp/cmp" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/dump" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" "k8s.io/klog/v2" ) func init() { // Enable klog which is used in dependencies klog.InitFlags(nil) flag.Set("logtostderr", "true") flag.Set("v", "9") } type testObject struct { resourceVersion string } func (o testObject) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } func (o testObject) DeepCopyObject() runtime.Object { return o } func (o testObject) GetResourceVersion() string { return o.resourceVersion } func withCounter(w cache.Watcher) (*uint32, cache.Watcher) { var counter uint32 return &counter, &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { atomic.AddUint32(&counter, 1) return w.Watch(options) }, } } func makeTestEvent(rv int) watch.Event { return watch.Event{ Type: watch.Added, Object: testObject{ resourceVersion: fmt.Sprintf("%d", rv), }, } } func arrayToChannel(array []watch.Event) chan watch.Event { ch := make(chan watch.Event, len(array)) for _, event := range array { ch <- event } return ch } // parseResourceVersionOrDie is test-only that code simulating the server and thus can interpret resourceVersion func parseResourceVersionOrDie(resourceVersion string) uint64 { // We can't use etcdstorage.Versioner.ParseResourceVersion() because of imports restrictions if resourceVersion == "" { return 0 } version, err := strconv.ParseUint(resourceVersion, 10, 64) if err != nil { panic(fmt.Errorf("failed to parse resourceVersion %q", resourceVersion)) } return version } func fromRV(resourceVersion string, array []watch.Event) []watch.Event { var result []watch.Event rv := parseResourceVersionOrDie(resourceVersion) for _, event := range array { if event.Type == watch.Error { if len(result) == 0 { // Skip error events until we find an object matching RV requirement continue } } else { rvGetter, ok := event.Object.(resourceVersionGetter) if ok { if parseResourceVersionOrDie(rvGetter.GetResourceVersion()) <= rv { continue } } } result = append(result, event) } return result } func closeAfterN(n int, source chan watch.Event) chan watch.Event { result := make(chan watch.Event, 0) go func() { defer close(result) defer close(source) for i := 0; i < n; i++ { result <- <-source } }() return result } type unexpectedError struct { // Inheriting any struct fulfilling runtime.Object interface would do. metav1.Status } var _ runtime.Object = &unexpectedError{} func TestNewRetryWatcher(t *testing.T) { tt := []struct { name string initialRV string err error }{ { name: "empty RV should fail", initialRV: "", err: errors.New("initial RV \"\" is not supported due to issues with underlying WATCH"), }, { name: "RV \"0\" should fail", initialRV: "0", err: errors.New("initial RV \"0\" is not supported due to issues with underlying WATCH"), }, } for _, tc := range tt { t.Run(tc.name, func(t *testing.T) { _, err := NewRetryWatcher(tc.initialRV, nil) if !reflect.DeepEqual(err, tc.err) { t.Errorf("Expected error: %v, got: %v", tc.err, err) } }) } } func TestRetryWatcher(t *testing.T) { tt := []struct { name string initialRV string watchClient cache.Watcher watchCount uint32 expected []watch.Event }{ { name: "recovers if watchClient returns error", initialRV: "1", watchClient: &cache.ListWatch{ WatchFunc: func() func(options metav1.ListOptions) (watch.Interface, error) { firstRun := true return func(options metav1.ListOptions) (watch.Interface, error) { if firstRun { firstRun = false return nil, fmt.Errorf("test error") } return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(2), }))), nil } }(), }, watchCount: 2, expected: []watch.Event{ makeTestEvent(2), }, }, { name: "recovers if watchClient returns nil watcher", initialRV: "1", watchClient: &cache.ListWatch{ WatchFunc: func() func(options metav1.ListOptions) (watch.Interface, error) { firstRun := true return func(options metav1.ListOptions) (watch.Interface, error) { if firstRun { firstRun = false return nil, nil } return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(2), }))), nil } }(), }, watchCount: 2, expected: []watch.Event{ makeTestEvent(2), }, }, { name: "works with empty initialRV", initialRV: "1", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(2), }))), nil }, }, watchCount: 1, expected: []watch.Event{ makeTestEvent(2), }, }, { name: "works with initialRV set, skipping the preceding items but reading those directly following", initialRV: "1", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(1), makeTestEvent(2), }))), nil }, }, watchCount: 1, expected: []watch.Event{ makeTestEvent(2), }, }, { name: "works with initialRV set, skipping the preceding items with none following", initialRV: "3", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(2), }))), nil }, }, watchCount: 1, expected: nil, }, { name: "fails on Gone (RV too old error)", initialRV: "5", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(5), makeTestEvent(6), {Type: watch.Error, Object: &apierrors.NewGone("").ErrStatus}, makeTestEvent(7), makeTestEvent(8), }))), nil }, }, watchCount: 1, expected: []watch.Event{ makeTestEvent(6), { Type: watch.Error, Object: &apierrors.NewGone("").ErrStatus, }, }, }, { name: "recovers from timeout error", initialRV: "5", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(6), { Type: watch.Error, Object: &apierrors.NewTimeoutError("", 0).ErrStatus, }, makeTestEvent(7), }))), nil }, }, watchCount: 2, expected: []watch.Event{ makeTestEvent(6), makeTestEvent(7), }, }, { name: "recovers from internal server error", initialRV: "5", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(6), { Type: watch.Error, Object: &apierrors.NewInternalError(errors.New("")).ErrStatus, }, makeTestEvent(7), }))), nil }, }, watchCount: 2, expected: []watch.Event{ makeTestEvent(6), makeTestEvent(7), }, }, { name: "recovers from unexpected error code", initialRV: "5", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(6), { Type: watch.Error, Object: &metav1.Status{ Code: 666, }, }, makeTestEvent(7), }))), nil }, }, watchCount: 2, expected: []watch.Event{ makeTestEvent(6), makeTestEvent(7), }, }, { name: "recovers from unexpected error type", initialRV: "5", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(6), { Type: watch.Error, Object: &unexpectedError{}, }, makeTestEvent(7), }))), nil }, }, watchCount: 2, expected: []watch.Event{ makeTestEvent(6), makeTestEvent(7), }, }, { name: "survives 1 closed watch and reads 1 item", initialRV: "5", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(closeAfterN(1, arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(6), })))), nil }, }, watchCount: 2, expected: []watch.Event{ makeTestEvent(6), }, }, { name: "survives 2 closed watches and reads 2 items", initialRV: "4", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(closeAfterN(1, arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(5), makeTestEvent(6), })))), nil }, }, watchCount: 3, expected: []watch.Event{ makeTestEvent(5), makeTestEvent(6), }, }, { name: "survives 2 closed watches and reads 2 items for nonconsecutive RVs", initialRV: "4", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(closeAfterN(1, arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(5), makeTestEvent(7), })))), nil }, }, watchCount: 3, expected: []watch.Event{ makeTestEvent(5), makeTestEvent(7), }, }, { name: "survives 2 closed watches and reads 2 items for nonconsecutive RVs starting at much lower RV", initialRV: "2", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(closeAfterN(1, arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(5), makeTestEvent(7), })))), nil }, }, watchCount: 3, expected: []watch.Event{ makeTestEvent(5), makeTestEvent(7), }, }, { name: "survives 4 closed watches and reads 4 items for nonconsecutive, spread RVs", initialRV: "2", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(closeAfterN(1, arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(5), makeTestEvent(6), makeTestEvent(7), makeTestEvent(11), })))), nil }, }, watchCount: 5, expected: []watch.Event{ makeTestEvent(5), makeTestEvent(6), makeTestEvent(7), makeTestEvent(11), }, }, { name: "survives 4 closed watches and reads 4 items for nonconsecutive, spread RVs and skips those with lower or equal RV", initialRV: "2", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(closeAfterN(1, arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(1), makeTestEvent(2), makeTestEvent(5), makeTestEvent(6), makeTestEvent(7), makeTestEvent(11), })))), nil }, }, watchCount: 5, expected: []watch.Event{ makeTestEvent(5), makeTestEvent(6), makeTestEvent(7), makeTestEvent(11), }, }, { name: "survives 2 closed watches and reads 2+2+1 items skipping those with equal RV", initialRV: "1", watchClient: &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(closeAfterN(2, arrayToChannel(fromRV(options.ResourceVersion, []watch.Event{ makeTestEvent(1), makeTestEvent(2), makeTestEvent(5), makeTestEvent(6), makeTestEvent(7), makeTestEvent(11), })))), nil }, }, watchCount: 3, expected: []watch.Event{ makeTestEvent(2), makeTestEvent(5), makeTestEvent(6), makeTestEvent(7), makeTestEvent(11), }, }, } for _, tc := range tt { tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() atomicCounter, watchFunc := withCounter(tc.watchClient) watcher, err := newRetryWatcher(tc.initialRV, watchFunc, time.Duration(0)) if err != nil { t.Fatalf("failed to create a RetryWatcher: %v", err) } defer func() { watcher.Stop() t.Log("Waiting on RetryWatcher to stop...") <-watcher.Done() }() var got []watch.Event for i := 0; i < len(tc.expected); i++ { event, ok := <-watcher.ResultChan() if !ok { t.Errorf("expected event %s, but channel is closed", dump.Pretty(tc.expected[i])) break } got = append(got, event) } // (Sanity check, best effort) Make sure there are no more events to be received // RetryWatcher proxies the source channel so we can't try reading it immediately // but have to tolerate some delay. Given this is best effort detection we can use short duration. // It also makes sure that for 0 events the watchFunc has time to be called. select { case event, ok := <-watcher.ResultChan(): if ok { t.Errorf("Unexpected event received after reading all the expected ones: %s", dump.Pretty(event)) } case <-time.After(10 * time.Millisecond): break } var counter uint32 // We always count with the last watch reestablishing which is imminent but still a race. // We will wait for the last watch to reestablish to avoid it. err = wait.PollImmediate(10*time.Millisecond, 10*time.Second, func() (done bool, err error) { counter = atomic.LoadUint32(atomicCounter) return counter == tc.watchCount, nil }) if err == wait.ErrWaitTimeout { t.Errorf("expected %d watcher starts, but it has started %d times", tc.watchCount, counter) } else if err != nil { t.Fatal(err) } if !reflect.DeepEqual(tc.expected, got) { t.Fatalf("expected %s, got %s;\ndiff: %s", dump.Pretty(tc.expected), dump.Pretty(got), cmp.Diff(tc.expected, got)) } }) } } func TestRetryWatcherToFinishWithUnreadEvents(t *testing.T) { watcher, err := NewRetryWatcher("1", &cache.ListWatch{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return watch.NewProxyWatcher(arrayToChannel([]watch.Event{ makeTestEvent(2), })), nil }, }) if err != nil { t.Fatalf("failed to create a RetryWatcher: %v", err) } // Give the watcher a chance to get to sending events (blocking) time.Sleep(10 * time.Millisecond) watcher.Stop() // Verify a second stop does not cause a panic watcher.Stop() maxTime := time.Second select { case <-watcher.Done(): break case <-time.After(maxTime): t.Errorf("The watcher failed to be closed in %s", maxTime) } // RetryWatcher result channel should be closed _, ok := <-watcher.ResultChan() if ok { t.Error("ResultChan is not closed") } } kubernetes-client-go-a2dfcab/tools/watch/until.go000066400000000000000000000160561472614177300223400ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package watch import ( "context" "errors" "fmt" "time" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" "k8s.io/klog/v2" ) // PreconditionFunc returns true if the condition has been reached, false if it has not been reached yet, // or an error if the condition failed or detected an error state. type PreconditionFunc func(store cache.Store) (bool, error) // ConditionFunc returns true if the condition has been reached, false if it has not been reached yet, // or an error if the condition cannot be checked and should terminate. In general, it is better to define // level driven conditions over edge driven conditions (pod has ready=true, vs pod modified and ready changed // from false to true). type ConditionFunc func(event watch.Event) (bool, error) // ErrWatchClosed is returned when the watch channel is closed before timeout in UntilWithoutRetry. var ErrWatchClosed = errors.New("watch closed before UntilWithoutRetry timeout") // UntilWithoutRetry reads items from the watch until each provided condition succeeds, and then returns the last watch // encountered. The first condition that returns an error terminates the watch (and the event is also returned). // If no event has been received, the returned event will be nil. // Conditions are satisfied sequentially so as to provide a useful primitive for higher level composition. // Waits until context deadline or until context is canceled. // // Warning: Unless you have a very specific use case (probably a special Watcher) don't use this function!!! // Warning: This will fail e.g. on API timeouts and/or 'too old resource version' error. // Warning: You are most probably looking for a function *Until* or *UntilWithSync* below, // Warning: solving such issues. // TODO: Consider making this function private to prevent misuse when the other occurrences in our codebase are gone. func UntilWithoutRetry(ctx context.Context, watcher watch.Interface, conditions ...ConditionFunc) (*watch.Event, error) { ch := watcher.ResultChan() defer watcher.Stop() var lastEvent *watch.Event for _, condition := range conditions { // check the next condition against the previous event and short circuit waiting for the next watch if lastEvent != nil { done, err := condition(*lastEvent) if err != nil { return lastEvent, err } if done { continue } } ConditionSucceeded: for { select { case event, ok := <-ch: if !ok { return lastEvent, ErrWatchClosed } lastEvent = &event done, err := condition(event) if err != nil { return lastEvent, err } if done { break ConditionSucceeded } case <-ctx.Done(): return lastEvent, wait.ErrWaitTimeout } } } return lastEvent, nil } // Until wraps the watcherClient's watch function with RetryWatcher making sure that watcher gets restarted in case of errors. // The initialResourceVersion will be given to watch method when first called. It shall not be "" or "0" // given the underlying WATCH call issues (#74022). // Remaining behaviour is identical to function UntilWithoutRetry. (See above.) // Until can deal with API timeouts and lost connections. // It guarantees you to see all events and in the order they happened. // Due to this guarantee there is no way it can deal with 'Resource version too old error'. It will fail in this case. // (See `UntilWithSync` if you'd prefer to recover from all the errors including RV too old by re-listing // those items. In normal code you should care about being level driven so you'd not care about not seeing all the edges.) // // The most frequent usage for Until would be a test where you want to verify exact order of events ("edges"). func Until(ctx context.Context, initialResourceVersion string, watcherClient cache.Watcher, conditions ...ConditionFunc) (*watch.Event, error) { w, err := NewRetryWatcher(initialResourceVersion, watcherClient) if err != nil { return nil, err } return UntilWithoutRetry(ctx, w, conditions...) } // UntilWithSync creates an informer from lw, optionally checks precondition when the store is synced, // and watches the output until each provided condition succeeds, in a way that is identical // to function UntilWithoutRetry. (See above.) // UntilWithSync can deal with all errors like API timeout, lost connections and 'Resource version too old'. // It is the only function that can recover from 'Resource version too old', Until and UntilWithoutRetry will // just fail in that case. On the other hand it can't provide you with guarantees as strong as using simple // Watch method with Until. It can skip some intermediate events in case of watch function failing but it will // re-list to recover and you always get an event, if there has been a change, after recovery. // Also with the current implementation based on DeltaFIFO, order of the events you receive is guaranteed only for // particular object, not between more of them even it's the same resource. // The most frequent usage would be a command that needs to watch the "state of the world" and should't fail, like: // waiting for object reaching a state, "small" controllers, ... func UntilWithSync(ctx context.Context, lw cache.ListerWatcher, objType runtime.Object, precondition PreconditionFunc, conditions ...ConditionFunc) (*watch.Event, error) { indexer, informer, watcher, done := NewIndexerInformerWatcher(lw, objType) // We need to wait for the internal informers to fully stop so it's easier to reason about // and it works with non-thread safe clients. defer func() { <-done }() // Proxy watcher can be stopped multiple times so it's fine to use defer here to cover alternative branches and // let UntilWithoutRetry to stop it defer watcher.Stop() if precondition != nil { if !cache.WaitForCacheSync(ctx.Done(), informer.HasSynced) { return nil, fmt.Errorf("UntilWithSync: unable to sync caches: %w", ctx.Err()) } done, err := precondition(indexer) if err != nil { return nil, err } if done { return nil, nil } } return UntilWithoutRetry(ctx, watcher, conditions...) } // ContextWithOptionalTimeout wraps context.WithTimeout and handles infinite timeouts expressed as 0 duration. func ContextWithOptionalTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { if timeout < 0 { // This should be handled in validation klog.Errorf("Timeout for context shall not be negative!") timeout = 0 } if timeout == 0 { return context.WithCancel(parent) } return context.WithTimeout(parent, timeout) } kubernetes-client-go-a2dfcab/tools/watch/until_test.go000066400000000000000000000216151472614177300233740ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package watch import ( "context" "errors" "fmt" "reflect" "strings" "testing" "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" fakeclient "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/tools/cache" ) type fakePod struct { } func (obj *fakePod) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } func (obj *fakePod) DeepCopyObject() runtime.Object { panic("DeepCopyObject not supported by fakePod") } func TestUntil(t *testing.T) { fw := watch.NewFake() go func() { var obj *fakePod fw.Add(obj) fw.Modify(obj) }() conditions := []ConditionFunc{ func(event watch.Event) (bool, error) { return event.Type == watch.Added, nil }, func(event watch.Event) (bool, error) { return event.Type == watch.Modified, nil }, } ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() lastEvent, err := UntilWithoutRetry(ctx, fw, conditions...) if err != nil { t.Fatalf("expected nil error, got %#v", err) } if lastEvent == nil { t.Fatal("expected an event") } if lastEvent.Type != watch.Modified { t.Fatalf("expected MODIFIED event type, got %v", lastEvent.Type) } if got, isPod := lastEvent.Object.(*fakePod); !isPod { t.Fatalf("expected a pod event, got %#v", got) } } func TestUntilMultipleConditions(t *testing.T) { fw := watch.NewFake() go func() { var obj *fakePod fw.Add(obj) }() conditions := []ConditionFunc{ func(event watch.Event) (bool, error) { return event.Type == watch.Added, nil }, func(event watch.Event) (bool, error) { return event.Type == watch.Added, nil }, } ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() lastEvent, err := UntilWithoutRetry(ctx, fw, conditions...) if err != nil { t.Fatalf("expected nil error, got %#v", err) } if lastEvent == nil { t.Fatal("expected an event") } if lastEvent.Type != watch.Added { t.Fatalf("expected MODIFIED event type, got %v", lastEvent.Type) } if got, isPod := lastEvent.Object.(*fakePod); !isPod { t.Fatalf("expected a pod event, got %#v", got) } } func TestUntilMultipleConditionsFail(t *testing.T) { fw := watch.NewFake() go func() { var obj *fakePod fw.Add(obj) }() conditions := []ConditionFunc{ func(event watch.Event) (bool, error) { return event.Type == watch.Added, nil }, func(event watch.Event) (bool, error) { return event.Type == watch.Added, nil }, func(event watch.Event) (bool, error) { return event.Type == watch.Deleted, nil }, } ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() lastEvent, err := UntilWithoutRetry(ctx, fw, conditions...) if err != wait.ErrWaitTimeout { t.Fatalf("expected ErrWaitTimeout error, got %#v", err) } if lastEvent == nil { t.Fatal("expected an event") } if lastEvent.Type != watch.Added { t.Fatalf("expected ADDED event type, got %v", lastEvent.Type) } if got, isPod := lastEvent.Object.(*fakePod); !isPod { t.Fatalf("expected a pod event, got %#v", got) } } func TestUntilTimeout(t *testing.T) { fw := watch.NewFake() go func() { var obj *fakePod fw.Add(obj) fw.Modify(obj) }() conditions := []ConditionFunc{ func(event watch.Event) (bool, error) { return event.Type == watch.Added, nil }, func(event watch.Event) (bool, error) { return event.Type == watch.Modified, nil }, } lastEvent, err := UntilWithoutRetry(context.Background(), fw, conditions...) if err != nil { t.Fatalf("expected nil error, got %#v", err) } if lastEvent == nil { t.Fatal("expected an event") } if lastEvent.Type != watch.Modified { t.Fatalf("expected MODIFIED event type, got %v", lastEvent.Type) } if got, isPod := lastEvent.Object.(*fakePod); !isPod { t.Fatalf("expected a pod event, got %#v", got) } } func TestUntilErrorCondition(t *testing.T) { fw := watch.NewFake() go func() { var obj *fakePod fw.Add(obj) }() expected := "something bad" conditions := []ConditionFunc{ func(event watch.Event) (bool, error) { return event.Type == watch.Added, nil }, func(event watch.Event) (bool, error) { return false, errors.New(expected) }, } ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() _, err := UntilWithoutRetry(ctx, fw, conditions...) if err == nil { t.Fatal("expected an error") } if !strings.Contains(err.Error(), expected) { t.Fatalf("expected %q in error string, got %q", expected, err.Error()) } } func TestUntilWithSync(t *testing.T) { // FIXME: test preconditions tt := []struct { name string lw *cache.ListWatch preconditionFunc PreconditionFunc conditionFunc ConditionFunc expectedErr error expectedEvent *watch.Event }{ { name: "doesn't wait for sync with no precondition", lw: &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { select {} }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { select {} }, }, preconditionFunc: nil, conditionFunc: func(e watch.Event) (bool, error) { return true, nil }, expectedErr: wait.ErrWaitTimeout, expectedEvent: nil, }, { name: "waits indefinitely with precondition if it can't sync", lw: &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { select {} }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { select {} }, }, preconditionFunc: func(store cache.Store) (bool, error) { return true, nil }, conditionFunc: func(e watch.Event) (bool, error) { return true, nil }, expectedErr: fmt.Errorf("UntilWithSync: unable to sync caches: %w", context.DeadlineExceeded), expectedEvent: nil, }, { name: "precondition can stop the loop", lw: func() *cache.ListWatch { fakeclient := fakeclient.NewSimpleClientset(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "first"}}) return &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return fakeclient.CoreV1().Secrets("").List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return fakeclient.CoreV1().Secrets("").Watch(context.TODO(), options) }, } }(), preconditionFunc: func(store cache.Store) (bool, error) { _, exists, err := store.Get(&metav1.ObjectMeta{Namespace: "", Name: "first"}) if err != nil { return true, err } if exists { return true, nil } return false, nil }, conditionFunc: func(e watch.Event) (bool, error) { return true, errors.New("should never reach this") }, expectedErr: nil, expectedEvent: nil, }, { name: "precondition lets it proceed to regular condition", lw: func() *cache.ListWatch { fakeclient := fakeclient.NewSimpleClientset(&corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "first"}}) return &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return fakeclient.CoreV1().Secrets("").List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { return fakeclient.CoreV1().Secrets("").Watch(context.TODO(), options) }, } }(), preconditionFunc: func(store cache.Store) (bool, error) { return false, nil }, conditionFunc: func(e watch.Event) (bool, error) { if e.Type == watch.Added { return true, nil } panic("no other events are expected") }, expectedErr: nil, expectedEvent: &watch.Event{Type: watch.Added, Object: &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "first"}}}, }, } for _, tc := range tt { t.Run(tc.name, func(t *testing.T) { // Informer waits for caches to sync by polling in 100ms intervals, // timeout needs to be reasonably higher ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) defer cancel() event, err := UntilWithSync(ctx, tc.lw, &corev1.Secret{}, tc.preconditionFunc, tc.conditionFunc) if !reflect.DeepEqual(err, tc.expectedErr) { t.Errorf("expected error %#v, got %#v", tc.expectedErr, err) } if !reflect.DeepEqual(event, tc.expectedEvent) { t.Errorf("expected event %#v, got %#v", tc.expectedEvent, event) } }) } } kubernetes-client-go-a2dfcab/transport/000077500000000000000000000000001472614177300204345ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/transport/OWNERS000066400000000000000000000002071472614177300213730ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners reviewers: - smarterclayton - wojtek-t - deads2k - liggitt - caesarxuchao kubernetes-client-go-a2dfcab/transport/cache.go000066400000000000000000000122701472614177300220300ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "context" "fmt" "net" "net/http" "strings" "sync" "time" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/metrics" ) // TlsTransportCache caches TLS http.RoundTrippers different configurations. The // same RoundTripper will be returned for configs with identical TLS options If // the config has no custom TLS options, http.DefaultTransport is returned. type tlsTransportCache struct { mu sync.Mutex transports map[tlsCacheKey]*http.Transport } // DialerStopCh is stop channel that is passed down to dynamic cert dialer. // It's exposed as variable for testing purposes to avoid testing for goroutine // leakages. var DialerStopCh = wait.NeverStop const idleConnsPerHost = 25 var tlsCache = &tlsTransportCache{transports: make(map[tlsCacheKey]*http.Transport)} type tlsCacheKey struct { insecure bool caData string certData string keyData string `datapolicy:"security-key"` certFile string keyFile string serverName string nextProtos string disableCompression bool // these functions are wrapped to allow them to be used as map keys getCert *GetCertHolder dial *DialHolder } func (t tlsCacheKey) String() string { keyText := "" if len(t.keyData) > 0 { keyText = "" } return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, serverName:%s, disableCompression:%t, getCert:%p, dial:%p", t.insecure, t.caData, t.certData, keyText, t.serverName, t.disableCompression, t.getCert, t.dial) } func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { key, canCache, err := tlsConfigKey(config) if err != nil { return nil, err } if canCache { // Ensure we only create a single transport for the given TLS options c.mu.Lock() defer c.mu.Unlock() defer metrics.TransportCacheEntries.Observe(len(c.transports)) // See if we already have a custom transport for this config if t, ok := c.transports[key]; ok { metrics.TransportCreateCalls.Increment("hit") return t, nil } metrics.TransportCreateCalls.Increment("miss") } else { metrics.TransportCreateCalls.Increment("uncacheable") } // Get the TLS options for this client config tlsConfig, err := TLSConfigFor(config) if err != nil { return nil, err } // The options didn't require a custom TLS config if tlsConfig == nil && config.DialHolder == nil && config.Proxy == nil { return http.DefaultTransport, nil } var dial func(ctx context.Context, network, address string) (net.Conn, error) if config.DialHolder != nil { dial = config.DialHolder.Dial } else { dial = (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).DialContext } // If we use are reloading files, we need to handle certificate rotation properly // TODO(jackkleeman): We can also add rotation here when config.HasCertCallback() is true if config.TLS.ReloadTLSFiles && tlsConfig != nil && tlsConfig.GetClientCertificate != nil { dynamicCertDialer := certRotatingDialer(tlsConfig.GetClientCertificate, dial) tlsConfig.GetClientCertificate = dynamicCertDialer.GetClientCertificate dial = dynamicCertDialer.connDialer.DialContext go dynamicCertDialer.Run(DialerStopCh) } proxy := http.ProxyFromEnvironment if config.Proxy != nil { proxy = config.Proxy } transport := utilnet.SetTransportDefaults(&http.Transport{ Proxy: proxy, TLSHandshakeTimeout: 10 * time.Second, TLSClientConfig: tlsConfig, MaxIdleConnsPerHost: idleConnsPerHost, DialContext: dial, DisableCompression: config.DisableCompression, }) if canCache { // Cache a single transport for these options c.transports[key] = transport } return transport, nil } // tlsConfigKey returns a unique key for tls.Config objects returned from TLSConfigFor func tlsConfigKey(c *Config) (tlsCacheKey, bool, error) { // Make sure ca/key/cert content is loaded if err := loadTLSFiles(c); err != nil { return tlsCacheKey{}, false, err } if c.Proxy != nil { // cannot determine equality for functions return tlsCacheKey{}, false, nil } k := tlsCacheKey{ insecure: c.TLS.Insecure, caData: string(c.TLS.CAData), serverName: c.TLS.ServerName, nextProtos: strings.Join(c.TLS.NextProtos, ","), disableCompression: c.DisableCompression, getCert: c.TLS.GetCertHolder, dial: c.DialHolder, } if c.TLS.ReloadTLSFiles { k.certFile = c.TLS.CertFile k.keyFile = c.TLS.KeyFile } else { k.certData = string(c.TLS.CertData) k.keyData = string(c.TLS.KeyData) } return k, true, nil } kubernetes-client-go-a2dfcab/transport/cache_go118.go000066400000000000000000000014151472614177300227460ustar00rootroot00000000000000//go:build go1.18 /* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport // assert at compile time that tlsCacheKey is comparable in a way that will never panic at runtime. var _ = isComparable[tlsCacheKey] func isComparable[T comparable]() {} kubernetes-client-go-a2dfcab/transport/cache_test.go000066400000000000000000000124611472614177300230710ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "context" "crypto/tls" "net" "net/http" "net/url" "reflect" "testing" ) func TestTLSConfigKey(t *testing.T) { // Make sure config fields that don't affect the tls config don't affect the cache key identicalConfigurations := map[string]*Config{ "empty": {}, "basic": {Username: "bob", Password: "password"}, "bearer": {BearerToken: "token"}, "user agent": {UserAgent: "useragent"}, "transport": {Transport: http.DefaultTransport}, "wrap transport": {WrapTransport: func(http.RoundTripper) http.RoundTripper { return nil }}, } for nameA, valueA := range identicalConfigurations { for nameB, valueB := range identicalConfigurations { keyA, canCache, err := tlsConfigKey(valueA) if err != nil { t.Errorf("Unexpected error for %q: %v", nameA, err) continue } if !canCache { t.Errorf("Unexpected canCache=false") continue } keyB, canCache, err := tlsConfigKey(valueB) if err != nil { t.Errorf("Unexpected error for %q: %v", nameB, err) continue } if !canCache { t.Errorf("Unexpected canCache=false") continue } if keyA != keyB { t.Errorf("Expected identical cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB) continue } if keyA != (tlsCacheKey{}) { t.Errorf("Expected empty cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB) continue } } } // Make sure config fields that affect the tls config affect the cache key dialer := net.Dialer{} getCert := &GetCertHolder{GetCert: func() (*tls.Certificate, error) { return nil, nil }} uniqueConfigurations := map[string]*Config{ "proxy": {Proxy: func(request *http.Request) (*url.URL, error) { return nil, nil }}, "no tls": {}, "dialer": {DialHolder: &DialHolder{Dial: dialer.DialContext}}, "dialer2": {DialHolder: &DialHolder{Dial: func(ctx context.Context, network, address string) (net.Conn, error) { return nil, nil }}}, "insecure": {TLS: TLSConfig{Insecure: true}}, "cadata 1": {TLS: TLSConfig{CAData: []byte{1}}}, "cadata 2": {TLS: TLSConfig{CAData: []byte{2}}}, "cert 1, key 1": { TLS: TLSConfig{ CertData: []byte{1}, KeyData: []byte{1}, }, }, "cert 1, key 1, servername 1": { TLS: TLSConfig{ CertData: []byte{1}, KeyData: []byte{1}, ServerName: "1", }, }, "cert 1, key 1, servername 2": { TLS: TLSConfig{ CertData: []byte{1}, KeyData: []byte{1}, ServerName: "2", }, }, "cert 1, key 2": { TLS: TLSConfig{ CertData: []byte{1}, KeyData: []byte{2}, }, }, "cert 2, key 1": { TLS: TLSConfig{ CertData: []byte{2}, KeyData: []byte{1}, }, }, "cert 2, key 2": { TLS: TLSConfig{ CertData: []byte{2}, KeyData: []byte{2}, }, }, "cadata 1, cert 1, key 1": { TLS: TLSConfig{ CAData: []byte{1}, CertData: []byte{1}, KeyData: []byte{1}, }, }, "getCert1": { TLS: TLSConfig{ KeyData: []byte{1}, GetCertHolder: getCert, }, }, "getCert2": { TLS: TLSConfig{ KeyData: []byte{1}, GetCertHolder: &GetCertHolder{GetCert: func() (*tls.Certificate, error) { return nil, nil }}, }, }, "getCert1, key 2": { TLS: TLSConfig{ KeyData: []byte{2}, GetCertHolder: getCert, }, }, "http2, http1.1": {TLS: TLSConfig{NextProtos: []string{"h2", "http/1.1"}}}, "http1.1-only": {TLS: TLSConfig{NextProtos: []string{"http/1.1"}}}, } for nameA, valueA := range uniqueConfigurations { for nameB, valueB := range uniqueConfigurations { keyA, canCacheA, err := tlsConfigKey(valueA) if err != nil { t.Errorf("Unexpected error for %q: %v", nameA, err) continue } keyB, canCacheB, err := tlsConfigKey(valueB) if err != nil { t.Errorf("Unexpected error for %q: %v", nameB, err) continue } shouldCacheA := valueA.Proxy == nil if shouldCacheA != canCacheA { t.Errorf("Unexpected canCache=false for " + nameA) } configIsNotEmpty := !reflect.DeepEqual(*valueA, Config{}) if keyA == (tlsCacheKey{}) && shouldCacheA && configIsNotEmpty { t.Errorf("Expected non-empty cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB) continue } // Make sure we get the same key on the same config if nameA == nameB { if keyA != keyB { t.Errorf("Expected identical cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB) } if canCacheA != canCacheB { t.Errorf("Expected identical canCache %q and %q, got:\n\t%v\n\t%v", nameA, nameB, canCacheA, canCacheB) } continue } if canCacheA && canCacheB { if keyA == keyB { t.Errorf("Expected unique cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB) continue } } } } } kubernetes-client-go-a2dfcab/transport/cert_rotation.go000066400000000000000000000106511472614177300236420ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "bytes" "crypto/tls" "fmt" "reflect" "sync" "time" utilnet "k8s.io/apimachinery/pkg/util/net" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/connrotation" "k8s.io/client-go/util/workqueue" "k8s.io/klog/v2" ) const workItemKey = "key" // CertCallbackRefreshDuration is exposed so that integration tests can crank up the reload speed. var CertCallbackRefreshDuration = 5 * time.Minute type reloadFunc func(*tls.CertificateRequestInfo) (*tls.Certificate, error) type dynamicClientCert struct { clientCert *tls.Certificate certMtx sync.RWMutex reload reloadFunc connDialer *connrotation.Dialer // queue only ever has one item, but it has nice error handling backoff/retry semantics queue workqueue.TypedRateLimitingInterface[string] } func certRotatingDialer(reload reloadFunc, dial utilnet.DialFunc) *dynamicClientCert { d := &dynamicClientCert{ reload: reload, connDialer: connrotation.NewDialer(connrotation.DialFunc(dial)), queue: workqueue.NewTypedRateLimitingQueueWithConfig( workqueue.DefaultTypedControllerRateLimiter[string](), workqueue.TypedRateLimitingQueueConfig[string]{Name: "DynamicClientCertificate"}, ), } return d } // loadClientCert calls the callback and rotates connections if needed func (c *dynamicClientCert) loadClientCert() (*tls.Certificate, error) { cert, err := c.reload(nil) if err != nil { return nil, err } // check to see if we have a change. If the values are the same, do nothing. c.certMtx.RLock() haveCert := c.clientCert != nil if certsEqual(c.clientCert, cert) { c.certMtx.RUnlock() return c.clientCert, nil } c.certMtx.RUnlock() c.certMtx.Lock() c.clientCert = cert c.certMtx.Unlock() // The first certificate requested is not a rotation that is worth closing connections for if !haveCert { return cert, nil } klog.V(1).Infof("certificate rotation detected, shutting down client connections to start using new credentials") c.connDialer.CloseAll() return cert, nil } // certsEqual compares tls Certificates, ignoring the Leaf which may get filled in dynamically func certsEqual(left, right *tls.Certificate) bool { if left == nil || right == nil { return left == right } if !byteMatrixEqual(left.Certificate, right.Certificate) { return false } if !reflect.DeepEqual(left.PrivateKey, right.PrivateKey) { return false } if !byteMatrixEqual(left.SignedCertificateTimestamps, right.SignedCertificateTimestamps) { return false } if !bytes.Equal(left.OCSPStaple, right.OCSPStaple) { return false } return true } func byteMatrixEqual(left, right [][]byte) bool { if len(left) != len(right) { return false } for i := range left { if !bytes.Equal(left[i], right[i]) { return false } } return true } // run starts the controller and blocks until stopCh is closed. func (c *dynamicClientCert) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer c.queue.ShutDown() klog.V(3).Infof("Starting client certificate rotation controller") defer klog.V(3).Infof("Shutting down client certificate rotation controller") go wait.Until(c.runWorker, time.Second, stopCh) go wait.PollImmediateUntil(CertCallbackRefreshDuration, func() (bool, error) { c.queue.Add(workItemKey) return false, nil }, stopCh) <-stopCh } func (c *dynamicClientCert) runWorker() { for c.processNextWorkItem() { } } func (c *dynamicClientCert) processNextWorkItem() bool { dsKey, quit := c.queue.Get() if quit { return false } defer c.queue.Done(dsKey) _, err := c.loadClientCert() if err == nil { c.queue.Forget(dsKey) return true } utilruntime.HandleError(fmt.Errorf("%v failed with : %v", dsKey, err)) c.queue.AddRateLimited(dsKey) return true } func (c *dynamicClientCert) GetClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error) { return c.loadClientCert() } kubernetes-client-go-a2dfcab/transport/config.go000066400000000000000000000137441472614177300222410ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "context" "crypto/tls" "net" "net/http" "net/url" ) // Config holds various options for establishing a transport. type Config struct { // UserAgent is an optional field that specifies the caller of this // request. UserAgent string // The base TLS configuration for this transport. TLS TLSConfig // Username and password for basic authentication Username string Password string `datapolicy:"password"` // Bearer token for authentication BearerToken string `datapolicy:"token"` // Path to a file containing a BearerToken. // If set, the contents are periodically read. // The last successfully read value takes precedence over BearerToken. BearerTokenFile string // Impersonate is the config that this Config will impersonate using Impersonate ImpersonationConfig // DisableCompression bypasses automatic GZip compression requests to the // server. DisableCompression bool // Transport may be used for custom HTTP behavior. This attribute may // not be specified with the TLS client certificate options. Use // WrapTransport for most client level operations. Transport http.RoundTripper // WrapTransport will be invoked for custom HTTP behavior after the // underlying transport is initialized (either the transport created // from TLSClientConfig, Transport, or http.DefaultTransport). The // config may layer other RoundTrippers on top of the returned // RoundTripper. // // A future release will change this field to an array. Use config.Wrap() // instead of setting this value directly. WrapTransport WrapperFunc // DialHolder specifies the dial function for creating unencrypted TCP connections. // This struct indirection is used to make transport configs cacheable. DialHolder *DialHolder // Proxy is the proxy func to be used for all requests made by this // transport. If Proxy is nil, http.ProxyFromEnvironment is used. If Proxy // returns a nil *URL, no proxy is used. // // socks5 proxying does not currently support spdy streaming endpoints. Proxy func(*http.Request) (*url.URL, error) } // DialHolder is used to make the wrapped function comparable so that it can be used as a map key. type DialHolder struct { Dial func(ctx context.Context, network, address string) (net.Conn, error) } // ImpersonationConfig has all the available impersonation options type ImpersonationConfig struct { // UserName matches user.Info.GetName() UserName string // UID matches user.Info.GetUID() UID string // Groups matches user.Info.GetGroups() Groups []string // Extra matches user.Info.GetExtra() Extra map[string][]string } // HasCA returns whether the configuration has a certificate authority or not. func (c *Config) HasCA() bool { return len(c.TLS.CAData) > 0 || len(c.TLS.CAFile) > 0 } // HasBasicAuth returns whether the configuration has basic authentication or not. func (c *Config) HasBasicAuth() bool { return len(c.Username) != 0 } // HasTokenAuth returns whether the configuration has token authentication or not. func (c *Config) HasTokenAuth() bool { return len(c.BearerToken) != 0 || len(c.BearerTokenFile) != 0 } // HasCertAuth returns whether the configuration has certificate authentication or not. func (c *Config) HasCertAuth() bool { return (len(c.TLS.CertData) != 0 || len(c.TLS.CertFile) != 0) && (len(c.TLS.KeyData) != 0 || len(c.TLS.KeyFile) != 0) } // HasCertCallback returns whether the configuration has certificate callback or not. func (c *Config) HasCertCallback() bool { return c.TLS.GetCertHolder != nil } // Wrap adds a transport middleware function that will give the caller // an opportunity to wrap the underlying http.RoundTripper prior to the // first API call being made. The provided function is invoked after any // existing transport wrappers are invoked. func (c *Config) Wrap(fn WrapperFunc) { c.WrapTransport = Wrappers(c.WrapTransport, fn) } // TLSConfig holds the information needed to set up a TLS transport. type TLSConfig struct { CAFile string // Path of the PEM-encoded server trusted root certificates. CertFile string // Path of the PEM-encoded client certificate. KeyFile string // Path of the PEM-encoded client key. ReloadTLSFiles bool // Set to indicate that the original config provided files, and that they should be reloaded Insecure bool // Server should be accessed without verifying the certificate. For testing only. ServerName string // Override for the server name passed to the server for SNI and used to verify certificates. CAData []byte // Bytes of the PEM-encoded server trusted root certificates. Supercedes CAFile. CertData []byte // Bytes of the PEM-encoded client certificate. Supercedes CertFile. KeyData []byte // Bytes of the PEM-encoded client key. Supercedes KeyFile. // NextProtos is a list of supported application level protocols, in order of preference. // Used to populate tls.Config.NextProtos. // To indicate to the server http/1.1 is preferred over http/2, set to ["http/1.1", "h2"] (though the server is free to ignore that preference). // To use only http/1.1, set to ["http/1.1"]. NextProtos []string // Callback that returns a TLS client certificate. CertData, CertFile, KeyData and KeyFile supercede this field. // This struct indirection is used to make transport configs cacheable. GetCertHolder *GetCertHolder } // GetCertHolder is used to make the wrapped function comparable so that it can be used as a map key. type GetCertHolder struct { GetCert func() (*tls.Certificate, error) } kubernetes-client-go-a2dfcab/transport/round_trippers.go000066400000000000000000000513431472614177300240500ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "crypto/tls" "fmt" "net/http" "net/http/httptrace" "strings" "sync" "time" "golang.org/x/oauth2" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/klog/v2" ) // HTTPWrappersForConfig wraps a round tripper with any relevant layered // behavior from the config. Exposed to allow more clients that need HTTP-like // behavior but then must hijack the underlying connection (like WebSocket or // HTTP2 clients). Pure HTTP clients should use the RoundTripper returned from // New. func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTripper, error) { if config.WrapTransport != nil { rt = config.WrapTransport(rt) } rt = DebugWrappers(rt) // Set authentication wrappers switch { case config.HasBasicAuth() && config.HasTokenAuth(): return nil, fmt.Errorf("username/password or bearer token may be set, but not both") case config.HasTokenAuth(): var err error rt, err = NewBearerAuthWithRefreshRoundTripper(config.BearerToken, config.BearerTokenFile, rt) if err != nil { return nil, err } case config.HasBasicAuth(): rt = NewBasicAuthRoundTripper(config.Username, config.Password, rt) } if len(config.UserAgent) > 0 { rt = NewUserAgentRoundTripper(config.UserAgent, rt) } if len(config.Impersonate.UserName) > 0 || len(config.Impersonate.UID) > 0 || len(config.Impersonate.Groups) > 0 || len(config.Impersonate.Extra) > 0 { rt = NewImpersonatingRoundTripper(config.Impersonate, rt) } return rt, nil } // DebugWrappers wraps a round tripper and logs based on the current log level. func DebugWrappers(rt http.RoundTripper) http.RoundTripper { switch { case bool(klog.V(9).Enabled()): rt = NewDebuggingRoundTripper(rt, DebugCurlCommand, DebugURLTiming, DebugDetailedTiming, DebugResponseHeaders) case bool(klog.V(8).Enabled()): rt = NewDebuggingRoundTripper(rt, DebugJustURL, DebugRequestHeaders, DebugResponseStatus, DebugResponseHeaders) case bool(klog.V(7).Enabled()): rt = NewDebuggingRoundTripper(rt, DebugJustURL, DebugRequestHeaders, DebugResponseStatus) case bool(klog.V(6).Enabled()): rt = NewDebuggingRoundTripper(rt, DebugURLTiming) } return rt } type authProxyRoundTripper struct { username string groups []string extra map[string][]string rt http.RoundTripper } var _ utilnet.RoundTripperWrapper = &authProxyRoundTripper{} // NewAuthProxyRoundTripper provides a roundtripper which will add auth proxy fields to requests for // authentication terminating proxy cases // assuming you pull the user from the context: // username is the user.Info.GetName() of the user // groups is the user.Info.GetGroups() of the user // extra is the user.Info.GetExtra() of the user // extra can contain any additional information that the authenticator // thought was interesting, for example authorization scopes. // In order to faithfully round-trip through an impersonation flow, these keys // MUST be lowercase. func NewAuthProxyRoundTripper(username string, groups []string, extra map[string][]string, rt http.RoundTripper) http.RoundTripper { return &authProxyRoundTripper{ username: username, groups: groups, extra: extra, rt: rt, } } func (rt *authProxyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { req = utilnet.CloneRequest(req) SetAuthProxyHeaders(req, rt.username, rt.groups, rt.extra) return rt.rt.RoundTrip(req) } // SetAuthProxyHeaders stomps the auth proxy header fields. It mutates its argument. func SetAuthProxyHeaders(req *http.Request, username string, groups []string, extra map[string][]string) { req.Header.Del("X-Remote-User") req.Header.Del("X-Remote-Group") for key := range req.Header { if strings.HasPrefix(strings.ToLower(key), strings.ToLower("X-Remote-Extra-")) { req.Header.Del(key) } } req.Header.Set("X-Remote-User", username) for _, group := range groups { req.Header.Add("X-Remote-Group", group) } for key, values := range extra { for _, value := range values { req.Header.Add("X-Remote-Extra-"+headerKeyEscape(key), value) } } } func (rt *authProxyRoundTripper) CancelRequest(req *http.Request) { tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *authProxyRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } type userAgentRoundTripper struct { agent string rt http.RoundTripper } var _ utilnet.RoundTripperWrapper = &userAgentRoundTripper{} // NewUserAgentRoundTripper will add User-Agent header to a request unless it has already been set. func NewUserAgentRoundTripper(agent string, rt http.RoundTripper) http.RoundTripper { return &userAgentRoundTripper{agent, rt} } func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { if len(req.Header.Get("User-Agent")) != 0 { return rt.rt.RoundTrip(req) } req = utilnet.CloneRequest(req) req.Header.Set("User-Agent", rt.agent) return rt.rt.RoundTrip(req) } func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) { tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *userAgentRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } type basicAuthRoundTripper struct { username string password string `datapolicy:"password"` rt http.RoundTripper } var _ utilnet.RoundTripperWrapper = &basicAuthRoundTripper{} // NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a // request unless it has already been set. func NewBasicAuthRoundTripper(username, password string, rt http.RoundTripper) http.RoundTripper { return &basicAuthRoundTripper{username, password, rt} } func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { if len(req.Header.Get("Authorization")) != 0 { return rt.rt.RoundTrip(req) } req = utilnet.CloneRequest(req) req.SetBasicAuth(rt.username, rt.password) return rt.rt.RoundTrip(req) } func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) { tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *basicAuthRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } // These correspond to the headers used in pkg/apis/authentication. We don't want the package dependency, // but you must not change the values. const ( // ImpersonateUserHeader is used to impersonate a particular user during an API server request ImpersonateUserHeader = "Impersonate-User" // ImpersonateUIDHeader is used to impersonate a particular UID during an API server request ImpersonateUIDHeader = "Impersonate-Uid" // ImpersonateGroupHeader is used to impersonate a particular group during an API server request. // It can be repeated multiplied times for multiple groups. ImpersonateGroupHeader = "Impersonate-Group" // ImpersonateUserExtraHeaderPrefix is a prefix for a header used to impersonate an entry in the // extra map[string][]string for user.Info. The key for the `extra` map is suffix. // The same key can be repeated multiple times to have multiple elements in the slice under a single key. // For instance: // Impersonate-Extra-Foo: one // Impersonate-Extra-Foo: two // results in extra["Foo"] = []string{"one", "two"} ImpersonateUserExtraHeaderPrefix = "Impersonate-Extra-" ) type impersonatingRoundTripper struct { impersonate ImpersonationConfig delegate http.RoundTripper } var _ utilnet.RoundTripperWrapper = &impersonatingRoundTripper{} // NewImpersonatingRoundTripper will add an Act-As header to a request unless it has already been set. func NewImpersonatingRoundTripper(impersonate ImpersonationConfig, delegate http.RoundTripper) http.RoundTripper { return &impersonatingRoundTripper{impersonate, delegate} } func (rt *impersonatingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { // use the user header as marker for the rest. if len(req.Header.Get(ImpersonateUserHeader)) != 0 { return rt.delegate.RoundTrip(req) } req = utilnet.CloneRequest(req) req.Header.Set(ImpersonateUserHeader, rt.impersonate.UserName) if rt.impersonate.UID != "" { req.Header.Set(ImpersonateUIDHeader, rt.impersonate.UID) } for _, group := range rt.impersonate.Groups { req.Header.Add(ImpersonateGroupHeader, group) } for k, vv := range rt.impersonate.Extra { for _, v := range vv { req.Header.Add(ImpersonateUserExtraHeaderPrefix+headerKeyEscape(k), v) } } return rt.delegate.RoundTrip(req) } func (rt *impersonatingRoundTripper) CancelRequest(req *http.Request) { tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *impersonatingRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.delegate } type bearerAuthRoundTripper struct { bearer string source oauth2.TokenSource rt http.RoundTripper } var _ utilnet.RoundTripperWrapper = &bearerAuthRoundTripper{} // NewBearerAuthRoundTripper adds the provided bearer token to a request // unless the authorization header has already been set. func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTripper { return &bearerAuthRoundTripper{bearer, nil, rt} } // NewBearerAuthWithRefreshRoundTripper adds the provided bearer token to a request // unless the authorization header has already been set. // If tokenFile is non-empty, it is periodically read, // and the last successfully read content is used as the bearer token. // If tokenFile is non-empty and bearer is empty, the tokenFile is read // immediately to populate the initial bearer token. func NewBearerAuthWithRefreshRoundTripper(bearer string, tokenFile string, rt http.RoundTripper) (http.RoundTripper, error) { if len(tokenFile) == 0 { return &bearerAuthRoundTripper{bearer, nil, rt}, nil } source := NewCachedFileTokenSource(tokenFile) if len(bearer) == 0 { token, err := source.Token() if err != nil { return nil, err } bearer = token.AccessToken } return &bearerAuthRoundTripper{bearer, source, rt}, nil } func (rt *bearerAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { if len(req.Header.Get("Authorization")) != 0 { return rt.rt.RoundTrip(req) } req = utilnet.CloneRequest(req) token := rt.bearer if rt.source != nil { if refreshedToken, err := rt.source.Token(); err == nil { token = refreshedToken.AccessToken } } req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) return rt.rt.RoundTrip(req) } func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) { tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *bearerAuthRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } // requestInfo keeps track of information about a request/response combination type requestInfo struct { RequestHeaders http.Header `datapolicy:"token"` RequestVerb string RequestURL string ResponseStatus string ResponseHeaders http.Header ResponseErr error muTrace sync.Mutex // Protect trace fields DNSLookup time.Duration Dialing time.Duration GetConnection time.Duration TLSHandshake time.Duration ServerProcessing time.Duration ConnectionReused bool Duration time.Duration } // newRequestInfo creates a new RequestInfo based on an http request func newRequestInfo(req *http.Request) *requestInfo { return &requestInfo{ RequestURL: req.URL.String(), RequestVerb: req.Method, RequestHeaders: req.Header, } } // complete adds information about the response to the requestInfo func (r *requestInfo) complete(response *http.Response, err error) { if err != nil { r.ResponseErr = err return } r.ResponseStatus = response.Status r.ResponseHeaders = response.Header } // toCurl returns a string that can be run as a command in a terminal (minus the body) func (r *requestInfo) toCurl() string { headers := "" for key, values := range r.RequestHeaders { for _, value := range values { value = maskValue(key, value) headers += fmt.Sprintf(` -H %q`, fmt.Sprintf("%s: %s", key, value)) } } return fmt.Sprintf("curl -v -X%s %s '%s'", r.RequestVerb, headers, r.RequestURL) } // debuggingRoundTripper will display information about the requests passing // through it based on what is configured type debuggingRoundTripper struct { delegatedRoundTripper http.RoundTripper levels map[DebugLevel]bool } var _ utilnet.RoundTripperWrapper = &debuggingRoundTripper{} // DebugLevel is used to enable debugging of certain // HTTP requests and responses fields via the debuggingRoundTripper. type DebugLevel int const ( // DebugJustURL will add to the debug output HTTP requests method and url. DebugJustURL DebugLevel = iota // DebugURLTiming will add to the debug output the duration of HTTP requests. DebugURLTiming // DebugCurlCommand will add to the debug output the curl command equivalent to the // HTTP request. DebugCurlCommand // DebugRequestHeaders will add to the debug output the HTTP requests headers. DebugRequestHeaders // DebugResponseStatus will add to the debug output the HTTP response status. DebugResponseStatus // DebugResponseHeaders will add to the debug output the HTTP response headers. DebugResponseHeaders // DebugDetailedTiming will add to the debug output the duration of the HTTP requests events. DebugDetailedTiming ) // NewDebuggingRoundTripper allows to display in the logs output debug information // on the API requests performed by the client. func NewDebuggingRoundTripper(rt http.RoundTripper, levels ...DebugLevel) http.RoundTripper { drt := &debuggingRoundTripper{ delegatedRoundTripper: rt, levels: make(map[DebugLevel]bool, len(levels)), } for _, v := range levels { drt.levels[v] = true } return drt } func (rt *debuggingRoundTripper) CancelRequest(req *http.Request) { tryCancelRequest(rt.WrappedRoundTripper(), req) } var knownAuthTypes = map[string]bool{ "bearer": true, "basic": true, "negotiate": true, } // maskValue masks credential content from authorization headers // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization func maskValue(key string, value string) string { if !strings.EqualFold(key, "Authorization") { return value } if len(value) == 0 { return "" } var authType string if i := strings.Index(value, " "); i > 0 { authType = value[0:i] } else { authType = value } if !knownAuthTypes[strings.ToLower(authType)] { return "" } if len(value) > len(authType)+1 { value = authType + " " } else { value = authType } return value } func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { reqInfo := newRequestInfo(req) if rt.levels[DebugJustURL] { klog.Infof("%s %s", reqInfo.RequestVerb, reqInfo.RequestURL) } if rt.levels[DebugCurlCommand] { klog.Infof("%s", reqInfo.toCurl()) } if rt.levels[DebugRequestHeaders] { klog.Info("Request Headers:") for key, values := range reqInfo.RequestHeaders { for _, value := range values { value = maskValue(key, value) klog.Infof(" %s: %s", key, value) } } } startTime := time.Now() if rt.levels[DebugDetailedTiming] { var getConn, dnsStart, dialStart, tlsStart, serverStart time.Time var host string trace := &httptrace.ClientTrace{ // DNS DNSStart: func(info httptrace.DNSStartInfo) { reqInfo.muTrace.Lock() defer reqInfo.muTrace.Unlock() dnsStart = time.Now() host = info.Host }, DNSDone: func(info httptrace.DNSDoneInfo) { reqInfo.muTrace.Lock() defer reqInfo.muTrace.Unlock() reqInfo.DNSLookup = time.Since(dnsStart) klog.Infof("HTTP Trace: DNS Lookup for %s resolved to %v", host, info.Addrs) }, // Dial ConnectStart: func(network, addr string) { reqInfo.muTrace.Lock() defer reqInfo.muTrace.Unlock() dialStart = time.Now() }, ConnectDone: func(network, addr string, err error) { reqInfo.muTrace.Lock() defer reqInfo.muTrace.Unlock() reqInfo.Dialing = time.Since(dialStart) if err != nil { klog.Infof("HTTP Trace: Dial to %s:%s failed: %v", network, addr, err) } else { klog.Infof("HTTP Trace: Dial to %s:%s succeed", network, addr) } }, // TLS TLSHandshakeStart: func() { tlsStart = time.Now() }, TLSHandshakeDone: func(_ tls.ConnectionState, _ error) { reqInfo.muTrace.Lock() defer reqInfo.muTrace.Unlock() reqInfo.TLSHandshake = time.Since(tlsStart) }, // Connection (it can be DNS + Dial or just the time to get one from the connection pool) GetConn: func(hostPort string) { getConn = time.Now() }, GotConn: func(info httptrace.GotConnInfo) { reqInfo.muTrace.Lock() defer reqInfo.muTrace.Unlock() reqInfo.GetConnection = time.Since(getConn) reqInfo.ConnectionReused = info.Reused }, // Server Processing (time since we wrote the request until first byte is received) WroteRequest: func(info httptrace.WroteRequestInfo) { reqInfo.muTrace.Lock() defer reqInfo.muTrace.Unlock() serverStart = time.Now() }, GotFirstResponseByte: func() { reqInfo.muTrace.Lock() defer reqInfo.muTrace.Unlock() reqInfo.ServerProcessing = time.Since(serverStart) }, } req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace)) } response, err := rt.delegatedRoundTripper.RoundTrip(req) reqInfo.Duration = time.Since(startTime) reqInfo.complete(response, err) if rt.levels[DebugURLTiming] { klog.Infof("%s %s %s in %d milliseconds", reqInfo.RequestVerb, reqInfo.RequestURL, reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) } if rt.levels[DebugDetailedTiming] { stats := "" if !reqInfo.ConnectionReused { stats += fmt.Sprintf(`DNSLookup %d ms Dial %d ms TLSHandshake %d ms`, reqInfo.DNSLookup.Nanoseconds()/int64(time.Millisecond), reqInfo.Dialing.Nanoseconds()/int64(time.Millisecond), reqInfo.TLSHandshake.Nanoseconds()/int64(time.Millisecond), ) } else { stats += fmt.Sprintf(`GetConnection %d ms`, reqInfo.GetConnection.Nanoseconds()/int64(time.Millisecond)) } if reqInfo.ServerProcessing != 0 { stats += fmt.Sprintf(` ServerProcessing %d ms`, reqInfo.ServerProcessing.Nanoseconds()/int64(time.Millisecond)) } stats += fmt.Sprintf(` Duration %d ms`, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) klog.Infof("HTTP Statistics: %s", stats) } if rt.levels[DebugResponseStatus] { klog.Infof("Response Status: %s in %d milliseconds", reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) } if rt.levels[DebugResponseHeaders] { klog.Info("Response Headers:") for key, values := range reqInfo.ResponseHeaders { for _, value := range values { klog.Infof(" %s: %s", key, value) } } } return response, err } func (rt *debuggingRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.delegatedRoundTripper } func legalHeaderByte(b byte) bool { return int(b) < len(legalHeaderKeyBytes) && legalHeaderKeyBytes[b] } func shouldEscape(b byte) bool { // url.PathUnescape() returns an error if any '%' is not followed by two // hexadecimal digits, so we'll intentionally encode it. return !legalHeaderByte(b) || b == '%' } func headerKeyEscape(key string) string { buf := strings.Builder{} for i := 0; i < len(key); i++ { b := key[i] if shouldEscape(b) { // %-encode bytes that should be escaped: // https://tools.ietf.org/html/rfc3986#section-2.1 fmt.Fprintf(&buf, "%%%02X", b) continue } buf.WriteByte(b) } return buf.String() } // legalHeaderKeyBytes was copied from net/http/lex.go's isTokenTable. // See https://httpwg.github.io/specs/rfc7230.html#rule.token.separators var legalHeaderKeyBytes = [127]bool{ '%': true, '!': true, '#': true, '$': true, '&': true, '\'': true, '*': true, '+': true, '-': true, '.': true, '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'W': true, 'V': true, 'X': true, 'Y': true, 'Z': true, '^': true, '_': true, '`': true, 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, 'y': true, 'z': true, '|': true, '~': true, } kubernetes-client-go-a2dfcab/transport/round_trippers_test.go000066400000000000000000000335271472614177300251130ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "bytes" "fmt" "net/http" "net/url" "reflect" "strings" "testing" "k8s.io/klog/v2" ) type testRoundTripper struct { Request *http.Request Response *http.Response Err error } func (rt *testRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { rt.Request = req return rt.Response, rt.Err } func TestMaskValue(t *testing.T) { tcs := []struct { key string value string expected string }{ { key: "Authorization", value: "Basic YWxhZGRpbjpvcGVuc2VzYW1l", expected: "Basic ", }, { key: "Authorization", value: "basic", expected: "basic", }, { key: "Authorization", value: "Basic", expected: "Basic", }, { key: "Authorization", value: "Bearer cn389ncoiwuencr", expected: "Bearer ", }, { key: "Authorization", value: "Bearer", expected: "Bearer", }, { key: "Authorization", value: "bearer", expected: "bearer", }, { key: "Authorization", value: "bearer ", expected: "bearer", }, { key: "Authorization", value: "Negotiate cn389ncoiwuencr", expected: "Negotiate ", }, { key: "ABC", value: "Negotiate cn389ncoiwuencr", expected: "Negotiate cn389ncoiwuencr", }, { key: "Authorization", value: "Negotiate", expected: "Negotiate", }, { key: "Authorization", value: "Negotiate ", expected: "Negotiate", }, { key: "Authorization", value: "negotiate", expected: "negotiate", }, { key: "Authorization", value: "abc cn389ncoiwuencr", expected: "", }, { key: "Authorization", value: "", expected: "", }, } for _, tc := range tcs { maskedValue := maskValue(tc.key, tc.value) if tc.expected != maskedValue { t.Errorf("unexpected value %s, given %s.", maskedValue, tc.value) } } } func TestBearerAuthRoundTripper(t *testing.T) { rt := &testRoundTripper{} req := &http.Request{} NewBearerAuthRoundTripper("test", rt).RoundTrip(req) if rt.Request == nil { t.Fatalf("unexpected nil request: %v", rt) } if rt.Request == req { t.Fatalf("round tripper should have copied request object: %#v", rt.Request) } if rt.Request.Header.Get("Authorization") != "Bearer test" { t.Errorf("unexpected authorization header: %#v", rt.Request) } } func TestBasicAuthRoundTripper(t *testing.T) { for n, tc := range map[string]struct { user string pass string }{ "basic": {user: "user", pass: "pass"}, "no pass": {user: "user"}, } { rt := &testRoundTripper{} req := &http.Request{} NewBasicAuthRoundTripper(tc.user, tc.pass, rt).RoundTrip(req) if rt.Request == nil { t.Fatalf("%s: unexpected nil request: %v", n, rt) } if rt.Request == req { t.Fatalf("%s: round tripper should have copied request object: %#v", n, rt.Request) } if user, pass, found := rt.Request.BasicAuth(); !found || user != tc.user || pass != tc.pass { t.Errorf("%s: unexpected authorization header: %#v", n, rt.Request) } } } func TestUserAgentRoundTripper(t *testing.T) { rt := &testRoundTripper{} req := &http.Request{ Header: make(http.Header), } req.Header.Set("User-Agent", "other") NewUserAgentRoundTripper("test", rt).RoundTrip(req) if rt.Request == nil { t.Fatalf("unexpected nil request: %v", rt) } if rt.Request != req { t.Fatalf("round tripper should not have copied request object: %#v", rt.Request) } if rt.Request.Header.Get("User-Agent") != "other" { t.Errorf("unexpected user agent header: %#v", rt.Request) } req = &http.Request{} NewUserAgentRoundTripper("test", rt).RoundTrip(req) if rt.Request == nil { t.Fatalf("unexpected nil request: %v", rt) } if rt.Request == req { t.Fatalf("round tripper should have copied request object: %#v", rt.Request) } if rt.Request.Header.Get("User-Agent") != "test" { t.Errorf("unexpected user agent header: %#v", rt.Request) } } func TestImpersonationRoundTripper(t *testing.T) { tcs := []struct { name string impersonationConfig ImpersonationConfig expected map[string][]string }{ { name: "all", impersonationConfig: ImpersonationConfig{ UserName: "user", UID: "uid-a", Groups: []string{"one", "two"}, Extra: map[string][]string{ "first": {"A", "a"}, "second": {"B", "b"}, }, }, expected: map[string][]string{ ImpersonateUserHeader: {"user"}, ImpersonateUIDHeader: {"uid-a"}, ImpersonateGroupHeader: {"one", "two"}, ImpersonateUserExtraHeaderPrefix + "First": {"A", "a"}, ImpersonateUserExtraHeaderPrefix + "Second": {"B", "b"}, }, }, { name: "username, groups and extra", impersonationConfig: ImpersonationConfig{ UserName: "user", Groups: []string{"one", "two"}, Extra: map[string][]string{ "first": {"A", "a"}, "second": {"B", "b"}, }, }, expected: map[string][]string{ ImpersonateUserHeader: {"user"}, ImpersonateGroupHeader: {"one", "two"}, ImpersonateUserExtraHeaderPrefix + "First": {"A", "a"}, ImpersonateUserExtraHeaderPrefix + "Second": {"B", "b"}, }, }, { name: "username and uid", impersonationConfig: ImpersonationConfig{ UserName: "user", UID: "uid-a", }, expected: map[string][]string{ ImpersonateUserHeader: {"user"}, ImpersonateUIDHeader: {"uid-a"}, }, }, { name: "escape handling", impersonationConfig: ImpersonationConfig{ UserName: "user", Extra: map[string][]string{ "test.example.com/thing.thing": {"A", "a"}, }, }, expected: map[string][]string{ ImpersonateUserHeader: {"user"}, ImpersonateUserExtraHeaderPrefix + `Test.example.com%2fthing.thing`: {"A", "a"}, }, }, { name: "double escape handling", impersonationConfig: ImpersonationConfig{ UserName: "user", Extra: map[string][]string{ "test.example.com/thing.thing%20another.thing": {"A", "a"}, }, }, expected: map[string][]string{ ImpersonateUserHeader: {"user"}, ImpersonateUserExtraHeaderPrefix + `Test.example.com%2fthing.thing%2520another.thing`: {"A", "a"}, }, }, } for _, tc := range tcs { rt := &testRoundTripper{} req := &http.Request{ Header: make(http.Header), } NewImpersonatingRoundTripper(tc.impersonationConfig, rt).RoundTrip(req) for k, v := range rt.Request.Header { expected, ok := tc.expected[k] if !ok { t.Errorf("%v missing %v=%v", tc.name, k, v) continue } if !reflect.DeepEqual(expected, v) { t.Errorf("%v expected %v: %v, got %v", tc.name, k, expected, v) } } for k, v := range tc.expected { expected, ok := rt.Request.Header[k] if !ok { t.Errorf("%v missing %v=%v", tc.name, k, v) continue } if !reflect.DeepEqual(expected, v) { t.Errorf("%v expected %v: %v, got %v", tc.name, k, expected, v) } } } } func TestAuthProxyRoundTripper(t *testing.T) { for n, tc := range map[string]struct { username string groups []string extra map[string][]string expectedExtra map[string][]string }{ "allfields": { username: "user", groups: []string{"groupA", "groupB"}, extra: map[string][]string{ "one": {"alpha", "bravo"}, "two": {"charlie", "delta"}, }, expectedExtra: map[string][]string{ "one": {"alpha", "bravo"}, "two": {"charlie", "delta"}, }, }, "escaped extra": { username: "user", groups: []string{"groupA", "groupB"}, extra: map[string][]string{ "one": {"alpha", "bravo"}, "example.com/two": {"charlie", "delta"}, }, expectedExtra: map[string][]string{ "one": {"alpha", "bravo"}, "example.com%2ftwo": {"charlie", "delta"}, }, }, "double escaped extra": { username: "user", groups: []string{"groupA", "groupB"}, extra: map[string][]string{ "one": {"alpha", "bravo"}, "example.com/two%20three": {"charlie", "delta"}, }, expectedExtra: map[string][]string{ "one": {"alpha", "bravo"}, "example.com%2ftwo%2520three": {"charlie", "delta"}, }, }, } { rt := &testRoundTripper{} req := &http.Request{} NewAuthProxyRoundTripper(tc.username, tc.groups, tc.extra, rt).RoundTrip(req) if rt.Request == nil { t.Errorf("%s: unexpected nil request: %v", n, rt) continue } if rt.Request == req { t.Errorf("%s: round tripper should have copied request object: %#v", n, rt.Request) continue } actualUsernames, ok := rt.Request.Header["X-Remote-User"] if !ok { t.Errorf("%s missing value", n) continue } if e, a := []string{tc.username}, actualUsernames; !reflect.DeepEqual(e, a) { t.Errorf("%s expected %v, got %v", n, e, a) continue } actualGroups, ok := rt.Request.Header["X-Remote-Group"] if !ok { t.Errorf("%s missing value", n) continue } if e, a := tc.groups, actualGroups; !reflect.DeepEqual(e, a) { t.Errorf("%s expected %v, got %v", n, e, a) continue } actualExtra := map[string][]string{} for key, values := range rt.Request.Header { if strings.HasPrefix(strings.ToLower(key), strings.ToLower("X-Remote-Extra-")) { extraKey := strings.ToLower(key[len("X-Remote-Extra-"):]) actualExtra[extraKey] = append(actualExtra[key], values...) } } if e, a := tc.expectedExtra, actualExtra; !reflect.DeepEqual(e, a) { t.Errorf("%s expected %v, got %v", n, e, a) continue } } } // TestHeaderEscapeRoundTrip tests to see if foo == url.PathUnescape(headerEscape(foo)) // This behavior is important for client -> API server transmission of extra values. func TestHeaderEscapeRoundTrip(t *testing.T) { t.Parallel() testCases := []struct { name string key string }{ { name: "alpha", key: "alphabetical", }, { name: "alphanumeric", key: "alph4num3r1c", }, { name: "percent encoded", key: "percent%20encoded", }, { name: "almost percent encoded", key: "almost%zzpercent%xxencoded", }, { name: "illegal char & percent encoding", key: "example.com/percent%20encoded", }, { name: "weird unicode stuff", key: "example.com/ᛒᚥᛏᛖᚥᚢとロビン", }, { name: "header legal chars", key: "abc123!#$+.-_*\\^`~|'", }, { name: "legal path, illegal header", key: "@=:", }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { escaped := headerKeyEscape(tc.key) unescaped, err := url.PathUnescape(escaped) if err != nil { t.Fatalf("url.PathUnescape(%q) returned error: %v", escaped, err) } if tc.key != unescaped { t.Errorf("url.PathUnescape(headerKeyEscape(%q)) returned %q, wanted %q", tc.key, unescaped, tc.key) } }) } } func TestDebuggingRoundTripper(t *testing.T) { t.Parallel() rawURL := "https://127.0.0.1:12345/api/v1/pods?limit=500" req := &http.Request{ Method: http.MethodGet, Header: map[string][]string{ "Authorization": {"bearer secretauthtoken"}, "X-Test-Request": {"test"}, }, } res := &http.Response{ Status: "OK", StatusCode: http.StatusOK, Header: map[string][]string{ "X-Test-Response": {"test"}, }, } tcs := []struct { levels []DebugLevel expectedOutputLines []string }{ { levels: []DebugLevel{DebugJustURL}, expectedOutputLines: []string{fmt.Sprintf("%s %s", req.Method, rawURL)}, }, { levels: []DebugLevel{DebugRequestHeaders}, expectedOutputLines: func() []string { lines := []string{fmt.Sprintf("Request Headers:\n")} for key, values := range req.Header { for _, value := range values { if key == "Authorization" { value = "bearer " } lines = append(lines, fmt.Sprintf(" %s: %s\n", key, value)) } } return lines }(), }, { levels: []DebugLevel{DebugResponseHeaders}, expectedOutputLines: func() []string { lines := []string{fmt.Sprintf("Response Headers:\n")} for key, values := range res.Header { for _, value := range values { lines = append(lines, fmt.Sprintf(" %s: %s\n", key, value)) } } return lines }(), }, { levels: []DebugLevel{DebugURLTiming}, expectedOutputLines: []string{fmt.Sprintf("%s %s %s", req.Method, rawURL, res.Status)}, }, { levels: []DebugLevel{DebugResponseStatus}, expectedOutputLines: []string{fmt.Sprintf("Response Status: %s", res.Status)}, }, { levels: []DebugLevel{DebugCurlCommand}, expectedOutputLines: []string{fmt.Sprintf("curl -v -X")}, }, } for _, tc := range tcs { // hijack the klog output tmpWriteBuffer := bytes.NewBuffer(nil) klog.SetOutput(tmpWriteBuffer) klog.LogToStderr(false) // parse rawURL parsedURL, err := url.Parse(rawURL) if err != nil { t.Fatalf("url.Parse(%q) returned error: %v", rawURL, err) } req.URL = parsedURL // execute the round tripper rt := &testRoundTripper{ Response: res, } NewDebuggingRoundTripper(rt, tc.levels...).RoundTrip(req) // call Flush to ensure the text isn't still buffered klog.Flush() // check if klog's output contains the expected lines actual := tmpWriteBuffer.String() for _, expected := range tc.expectedOutputLines { if !strings.Contains(actual, expected) { t.Errorf("%q does not contain expected output %q", actual, expected) } } } } kubernetes-client-go-a2dfcab/transport/spdy/000077500000000000000000000000001472614177300214135ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/transport/spdy/spdy.go000066400000000000000000000064161472614177300227300ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package spdy import ( "fmt" "net/http" "net/url" "time" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/spdy" restclient "k8s.io/client-go/rest" ) // Upgrader validates a response from the server after a SPDY upgrade. type Upgrader interface { // NewConnection validates the response and creates a new Connection. NewConnection(resp *http.Response) (httpstream.Connection, error) } // RoundTripperFor returns a round tripper and upgrader to use with SPDY. func RoundTripperFor(config *restclient.Config) (http.RoundTripper, Upgrader, error) { tlsConfig, err := restclient.TLSConfigFor(config) if err != nil { return nil, nil, err } proxy := http.ProxyFromEnvironment if config.Proxy != nil { proxy = config.Proxy } upgradeRoundTripper, err := spdy.NewRoundTripperWithConfig(spdy.RoundTripperConfig{ TLS: tlsConfig, Proxier: proxy, PingPeriod: time.Second * 5, UpgradeTransport: nil, }) if err != nil { return nil, nil, err } wrapper, err := restclient.HTTPWrappersForConfig(config, upgradeRoundTripper) if err != nil { return nil, nil, err } return wrapper, upgradeRoundTripper, nil } // dialer implements the httpstream.Dialer interface. type dialer struct { client *http.Client upgrader Upgrader method string url *url.URL } var _ httpstream.Dialer = &dialer{} // NewDialer will create a dialer that connects to the provided URL and upgrades the connection to SPDY. func NewDialer(upgrader Upgrader, client *http.Client, method string, url *url.URL) httpstream.Dialer { return &dialer{ client: client, upgrader: upgrader, method: method, url: url, } } func (d *dialer) Dial(protocols ...string) (httpstream.Connection, string, error) { req, err := http.NewRequest(d.method, d.url.String(), nil) if err != nil { return nil, "", fmt.Errorf("error creating request: %v", err) } return Negotiate(d.upgrader, d.client, req, protocols...) } // Negotiate opens a connection to a remote server and attempts to negotiate // a SPDY connection. Upon success, it returns the connection and the protocol selected by // the server. The client transport must use the upgradeRoundTripper - see RoundTripperFor. func Negotiate(upgrader Upgrader, client *http.Client, req *http.Request, protocols ...string) (httpstream.Connection, string, error) { for i := range protocols { req.Header.Add(httpstream.HeaderProtocolVersion, protocols[i]) } resp, err := client.Do(req) if err != nil { return nil, "", fmt.Errorf("error sending request: %v", err) } defer resp.Body.Close() conn, err := upgrader.NewConnection(resp) if err != nil { return nil, "", err } return conn, resp.Header.Get(httpstream.HeaderProtocolVersion), nil } kubernetes-client-go-a2dfcab/transport/token_source.go000066400000000000000000000120761472614177300234710ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "fmt" "net/http" "os" "strings" "sync" "time" "golang.org/x/oauth2" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/klog/v2" ) // TokenSourceWrapTransport returns a WrapTransport that injects bearer tokens // authentication from an oauth2.TokenSource. func TokenSourceWrapTransport(ts oauth2.TokenSource) func(http.RoundTripper) http.RoundTripper { return func(rt http.RoundTripper) http.RoundTripper { return &tokenSourceTransport{ base: rt, ort: &oauth2.Transport{ Source: ts, Base: rt, }, } } } type ResettableTokenSource interface { oauth2.TokenSource ResetTokenOlderThan(time.Time) } // ResettableTokenSourceWrapTransport returns a WrapTransport that injects bearer tokens // authentication from an ResettableTokenSource. func ResettableTokenSourceWrapTransport(ts ResettableTokenSource) func(http.RoundTripper) http.RoundTripper { return func(rt http.RoundTripper) http.RoundTripper { return &tokenSourceTransport{ base: rt, ort: &oauth2.Transport{ Source: ts, Base: rt, }, src: ts, } } } // NewCachedFileTokenSource returns a resettable token source which reads a // token from a file at a specified path and periodically reloads it. func NewCachedFileTokenSource(path string) *cachingTokenSource { return &cachingTokenSource{ now: time.Now, leeway: 10 * time.Second, base: &fileTokenSource{ path: path, // This period was picked because it is half of the duration between when the kubelet // refreshes a projected service account token and when the original token expires. // Default token lifetime is 10 minutes, and the kubelet starts refreshing at 80% of lifetime. // This should induce re-reading at a frequency that works with the token volume source. period: time.Minute, }, } } // NewCachedTokenSource returns resettable token source with caching. It reads // a token from a designed TokenSource if not in cache or expired. func NewCachedTokenSource(ts oauth2.TokenSource) *cachingTokenSource { return &cachingTokenSource{ now: time.Now, base: ts, } } type tokenSourceTransport struct { base http.RoundTripper ort http.RoundTripper src ResettableTokenSource } var _ utilnet.RoundTripperWrapper = &tokenSourceTransport{} func (tst *tokenSourceTransport) RoundTrip(req *http.Request) (*http.Response, error) { // This is to allow --token to override other bearer token providers. if req.Header.Get("Authorization") != "" { return tst.base.RoundTrip(req) } // record time before RoundTrip to make sure newly acquired Unauthorized // token would not be reset. Another request from user is required to reset // and proceed. start := time.Now() resp, err := tst.ort.RoundTrip(req) if err == nil && resp != nil && resp.StatusCode == 401 && tst.src != nil { tst.src.ResetTokenOlderThan(start) } return resp, err } func (tst *tokenSourceTransport) CancelRequest(req *http.Request) { if req.Header.Get("Authorization") != "" { tryCancelRequest(tst.base, req) return } tryCancelRequest(tst.ort, req) } func (tst *tokenSourceTransport) WrappedRoundTripper() http.RoundTripper { return tst.base } type fileTokenSource struct { path string period time.Duration } var _ = oauth2.TokenSource(&fileTokenSource{}) func (ts *fileTokenSource) Token() (*oauth2.Token, error) { tokb, err := os.ReadFile(ts.path) if err != nil { return nil, fmt.Errorf("failed to read token file %q: %v", ts.path, err) } tok := strings.TrimSpace(string(tokb)) if len(tok) == 0 { return nil, fmt.Errorf("read empty token from file %q", ts.path) } return &oauth2.Token{ AccessToken: tok, Expiry: time.Now().Add(ts.period), }, nil } type cachingTokenSource struct { base oauth2.TokenSource leeway time.Duration sync.RWMutex tok *oauth2.Token t time.Time // for testing now func() time.Time } func (ts *cachingTokenSource) Token() (*oauth2.Token, error) { now := ts.now() // fast path ts.RLock() tok := ts.tok ts.RUnlock() if tok != nil && tok.Expiry.Add(-1*ts.leeway).After(now) { return tok, nil } // slow path ts.Lock() defer ts.Unlock() if tok := ts.tok; tok != nil && tok.Expiry.Add(-1*ts.leeway).After(now) { return tok, nil } tok, err := ts.base.Token() if err != nil { if ts.tok == nil { return nil, err } klog.Errorf("Unable to rotate token: %v", err) return ts.tok, nil } ts.t = ts.now() ts.tok = tok return tok, nil } func (ts *cachingTokenSource) ResetTokenOlderThan(t time.Time) { ts.Lock() defer ts.Unlock() if ts.t.Before(t) { ts.tok = nil ts.t = time.Time{} } } kubernetes-client-go-a2dfcab/transport/token_source_test.go000066400000000000000000000156511472614177300245320ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "fmt" "net/http" "reflect" "sync" "testing" "time" "golang.org/x/oauth2" ) type testTokenSource struct { calls int tok *oauth2.Token err error } func (ts *testTokenSource) Token() (*oauth2.Token, error) { ts.calls++ return ts.tok, ts.err } func TestCachingTokenSource(t *testing.T) { start := time.Now() tokA := &oauth2.Token{ AccessToken: "a", Expiry: start.Add(10 * time.Minute), } tokB := &oauth2.Token{ AccessToken: "b", Expiry: start.Add(20 * time.Minute), } tests := []struct { name string tok *oauth2.Token tsTok *oauth2.Token tsErr error wait time.Duration wantTok *oauth2.Token wantErr bool wantTSCalls int }{ { name: "valid token returned from cache", tok: tokA, wantTok: tokA, }, { name: "valid token returned from cache 1 minute before scheduled refresh", tok: tokA, wait: 8 * time.Minute, wantTok: tokA, }, { name: "new token created when cache is empty", tsTok: tokA, wantTok: tokA, wantTSCalls: 1, }, { name: "new token created 1 minute after scheduled refresh", tok: tokA, tsTok: tokB, wait: 10 * time.Minute, wantTok: tokB, wantTSCalls: 1, }, { name: "error on create token returns error", tsErr: fmt.Errorf("error"), wantErr: true, wantTSCalls: 1, }, } for _, c := range tests { t.Run(c.name, func(t *testing.T) { tts := &testTokenSource{ tok: c.tsTok, err: c.tsErr, } ts := &cachingTokenSource{ base: tts, tok: c.tok, leeway: 1 * time.Minute, now: func() time.Time { return start.Add(c.wait) }, } gotTok, gotErr := ts.Token() if got, want := gotTok, c.wantTok; !reflect.DeepEqual(got, want) { t.Errorf("unexpected token:\n\tgot:\t%#v\n\twant:\t%#v", got, want) } if got, want := tts.calls, c.wantTSCalls; got != want { t.Errorf("unexpected number of Token() calls: got %d, want %d", got, want) } if gotErr == nil && c.wantErr { t.Errorf("wanted error but got none") } if gotErr != nil && !c.wantErr { t.Errorf("unexpected error: %v", gotErr) } }) } } func TestCachingTokenSourceRace(t *testing.T) { for i := 0; i < 100; i++ { tts := &testTokenSource{ tok: &oauth2.Token{ AccessToken: "a", Expiry: time.Now().Add(1000 * time.Hour), }, } ts := &cachingTokenSource{ now: time.Now, base: tts, leeway: 1 * time.Minute, } var wg sync.WaitGroup wg.Add(100) errc := make(chan error, 100) for i := 0; i < 100; i++ { go func() { defer wg.Done() if _, err := ts.Token(); err != nil { errc <- err } }() } go func() { wg.Wait() close(errc) }() if err, ok := <-errc; ok { t.Fatalf("err: %v", err) } if tts.calls != 1 { t.Errorf("expected one call to Token() but saw: %d", tts.calls) } } } func TestTokenSourceTransportRoundTrip(t *testing.T) { goodToken := &oauth2.Token{ AccessToken: "good", Expiry: time.Now().Add(1000 * time.Hour), } badToken := &oauth2.Token{ AccessToken: "bad", Expiry: time.Now().Add(1000 * time.Hour), } tests := []struct { name string header http.Header token *oauth2.Token cachedToken *oauth2.Token wantCalls int wantCaching bool }{ { name: "skip oauth rt if has authorization header", header: map[string][]string{"Authorization": {"Bearer TOKEN"}}, token: goodToken, }, { name: "authorized on newly acquired good token", token: goodToken, wantCalls: 1, wantCaching: true, }, { name: "authorized on cached good token", token: goodToken, cachedToken: goodToken, wantCalls: 0, wantCaching: true, }, { name: "unauthorized on newly acquired bad token", token: badToken, wantCalls: 1, wantCaching: true, }, { name: "unauthorized on cached bad token", token: badToken, cachedToken: badToken, wantCalls: 0, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { tts := &testTokenSource{ tok: test.token, } cachedTokenSource := NewCachedTokenSource(tts) cachedTokenSource.tok = test.cachedToken rt := ResettableTokenSourceWrapTransport(cachedTokenSource)(&testTransport{}) rt.RoundTrip(&http.Request{Header: test.header}) if tts.calls != test.wantCalls { t.Errorf("RoundTrip() called Token() = %d times, want %d", tts.calls, test.wantCalls) } if (cachedTokenSource.tok != nil) != test.wantCaching { t.Errorf("Got caching %v, want caching %v", cachedTokenSource != nil, test.wantCaching) } }) } } type uncancellableRT struct { rt http.RoundTripper } func (urt *uncancellableRT) RoundTrip(req *http.Request) (*http.Response, error) { return urt.rt.RoundTrip(req) } func TestTokenSourceTransportCancelRequest(t *testing.T) { tests := []struct { name string header http.Header wrapTransport func(http.RoundTripper) http.RoundTripper expectCancel bool }{ { name: "cancel req with bearer token skips oauth rt", header: map[string][]string{"Authorization": {"Bearer TOKEN"}}, expectCancel: true, }, { name: "can't cancel request with rts that doesn't implent unwrap or cancel", wrapTransport: func(rt http.RoundTripper) http.RoundTripper { return &uncancellableRT{rt: rt} }, expectCancel: false, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { baseRecorder := &testTransport{} var base http.RoundTripper = baseRecorder if test.wrapTransport != nil { base = test.wrapTransport(base) } rt := &tokenSourceTransport{ base: base, ort: &oauth2.Transport{ Base: base, }, } rt.CancelRequest(&http.Request{ Header: test.header, }) if baseRecorder.canceled != test.expectCancel { t.Errorf("unexpected cancel: got=%v, want=%v", baseRecorder.canceled, test.expectCancel) } }) } } type testTransport struct { canceled bool base http.RoundTripper } func (rt *testTransport) RoundTrip(req *http.Request) (*http.Response, error) { if req.Header["Authorization"][0] == "Bearer bad" { return &http.Response{StatusCode: 401}, nil } return nil, nil } func (rt *testTransport) CancelRequest(req *http.Request) { rt.canceled = true if rt.base != nil { tryCancelRequest(rt.base, req) } } kubernetes-client-go-a2dfcab/transport/transport.go000066400000000000000000000302231472614177300230170ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "context" "crypto/tls" "crypto/x509" "encoding/pem" "fmt" "net/http" "os" "sync" "time" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/klog/v2" ) // New returns an http.RoundTripper that will provide the authentication // or transport level security defined by the provided Config. func New(config *Config) (http.RoundTripper, error) { // Set transport level security if config.Transport != nil && (config.HasCA() || config.HasCertAuth() || config.HasCertCallback() || config.TLS.Insecure) { return nil, fmt.Errorf("using a custom transport with TLS certificate options or the insecure flag is not allowed") } if !isValidHolders(config) { return nil, fmt.Errorf("misconfigured holder for dialer or cert callback") } var ( rt http.RoundTripper err error ) if config.Transport != nil { rt = config.Transport } else { rt, err = tlsCache.get(config) if err != nil { return nil, err } } return HTTPWrappersForConfig(config, rt) } func isValidHolders(config *Config) bool { if config.TLS.GetCertHolder != nil && config.TLS.GetCertHolder.GetCert == nil { return false } if config.DialHolder != nil && config.DialHolder.Dial == nil { return false } return true } // TLSConfigFor returns a tls.Config that will provide the transport level security defined // by the provided Config. Will return nil if no transport level security is requested. func TLSConfigFor(c *Config) (*tls.Config, error) { if !(c.HasCA() || c.HasCertAuth() || c.HasCertCallback() || c.TLS.Insecure || len(c.TLS.ServerName) > 0 || len(c.TLS.NextProtos) > 0) { return nil, nil } if c.HasCA() && c.TLS.Insecure { return nil, fmt.Errorf("specifying a root certificates file with the insecure flag is not allowed") } if err := loadTLSFiles(c); err != nil { return nil, err } tlsConfig := &tls.Config{ // Can't use SSLv3 because of POODLE and BEAST // Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher // Can't use TLSv1.1 because of RC4 cipher usage MinVersion: tls.VersionTLS12, InsecureSkipVerify: c.TLS.Insecure, ServerName: c.TLS.ServerName, NextProtos: c.TLS.NextProtos, } if c.HasCA() { /* kubernetes mutual (2-way) x509 between client and apiserver: 1. apiserver sending its apiserver certificate along with its publickey to client >2. client verifies the apiserver certificate sent against its cluster certificate authority data 3. client sending its client certificate along with its public key to the apiserver 4. apiserver verifies the client certificate sent against its cluster certificate authority data description: here, with this block, cluster certificate authority data gets loaded into TLS before the handshake process for client to later during the handshake verify the apiserver certificate normal args related to this stage: --certificate-authority='': Path to a cert file for the certificate authority (retrievable from "kubectl options" command) (suggested by @deads2k) see also: - for the step 1, see: staging/src/k8s.io/apiserver/pkg/server/options/serving.go - for the step 3, see: a few lines below in this file - for the step 4, see: staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go */ rootCAs, err := rootCertPool(c.TLS.CAData) if err != nil { return nil, fmt.Errorf("unable to load root certificates: %w", err) } tlsConfig.RootCAs = rootCAs } var staticCert *tls.Certificate // Treat cert as static if either key or cert was data, not a file if c.HasCertAuth() && !c.TLS.ReloadTLSFiles { // If key/cert were provided, verify them before setting up // tlsConfig.GetClientCertificate. cert, err := tls.X509KeyPair(c.TLS.CertData, c.TLS.KeyData) if err != nil { return nil, err } staticCert = &cert } var dynamicCertLoader func() (*tls.Certificate, error) if c.TLS.ReloadTLSFiles { dynamicCertLoader = cachingCertificateLoader(c.TLS.CertFile, c.TLS.KeyFile) } if c.HasCertAuth() || c.HasCertCallback() { /* kubernetes mutual (2-way) x509 between client and apiserver: 1. apiserver sending its apiserver certificate along with its publickey to client 2. client verifies the apiserver certificate sent against its cluster certificate authority data >3. client sending its client certificate along with its public key to the apiserver 4. apiserver verifies the client certificate sent against its cluster certificate authority data description: here, with this callback function, client certificate and pub key get loaded into TLS during the handshake process for apiserver to later in the step 4 verify the client certificate normal args related to this stage: --client-certificate='': Path to a client certificate file for TLS --client-key='': Path to a client key file for TLS (retrievable from "kubectl options" command) (suggested by @deads2k) see also: - for the step 1, see: staging/src/k8s.io/apiserver/pkg/server/options/serving.go - for the step 2, see: a few lines above in this file - for the step 4, see: staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go */ tlsConfig.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) { // Note: static key/cert data always take precedence over cert // callback. if staticCert != nil { return staticCert, nil } // key/cert files lead to ReloadTLSFiles being set - takes precedence over cert callback if dynamicCertLoader != nil { return dynamicCertLoader() } if c.HasCertCallback() { cert, err := c.TLS.GetCertHolder.GetCert() if err != nil { return nil, err } // GetCert may return empty value, meaning no cert. if cert != nil { return cert, nil } } // Both c.TLS.CertData/KeyData were unset and GetCert didn't return // anything. Return an empty tls.Certificate, no client cert will // be sent to the server. return &tls.Certificate{}, nil } } return tlsConfig, nil } // loadTLSFiles copies the data from the CertFile, KeyFile, and CAFile fields into the CertData, // KeyData, and CAFile fields, or returns an error. If no error is returned, all three fields are // either populated or were empty to start. func loadTLSFiles(c *Config) error { var err error c.TLS.CAData, err = dataFromSliceOrFile(c.TLS.CAData, c.TLS.CAFile) if err != nil { return err } // Check that we are purely loading from files if len(c.TLS.CertFile) > 0 && len(c.TLS.CertData) == 0 && len(c.TLS.KeyFile) > 0 && len(c.TLS.KeyData) == 0 { c.TLS.ReloadTLSFiles = true } c.TLS.CertData, err = dataFromSliceOrFile(c.TLS.CertData, c.TLS.CertFile) if err != nil { return err } c.TLS.KeyData, err = dataFromSliceOrFile(c.TLS.KeyData, c.TLS.KeyFile) return err } // dataFromSliceOrFile returns data from the slice (if non-empty), or from the file, // or an error if an error occurred reading the file func dataFromSliceOrFile(data []byte, file string) ([]byte, error) { if len(data) > 0 { return data, nil } if len(file) > 0 { fileData, err := os.ReadFile(file) if err != nil { return []byte{}, err } return fileData, nil } return nil, nil } // rootCertPool returns nil if caData is empty. When passed along, this will mean "use system CAs". // When caData is not empty, it will be the ONLY information used in the CertPool. func rootCertPool(caData []byte) (*x509.CertPool, error) { // What we really want is a copy of x509.systemRootsPool, but that isn't exposed. It's difficult to build (see the go // code for a look at the platform specific insanity), so we'll use the fact that RootCAs == nil gives us the system values // It doesn't allow trusting either/or, but hopefully that won't be an issue if len(caData) == 0 { return nil, nil } // if we have caData, use it certPool := x509.NewCertPool() if ok := certPool.AppendCertsFromPEM(caData); !ok { return nil, createErrorParsingCAData(caData) } return certPool, nil } // createErrorParsingCAData ALWAYS returns an error. We call it because know we failed to AppendCertsFromPEM // but we don't know the specific error because that API is just true/false func createErrorParsingCAData(pemCerts []byte) error { for len(pemCerts) > 0 { var block *pem.Block block, pemCerts = pem.Decode(pemCerts) if block == nil { return fmt.Errorf("unable to parse bytes as PEM block") } if block.Type != "CERTIFICATE" || len(block.Headers) != 0 { continue } if _, err := x509.ParseCertificate(block.Bytes); err != nil { return fmt.Errorf("failed to parse certificate: %w", err) } } return fmt.Errorf("no valid certificate authority data seen") } // WrapperFunc wraps an http.RoundTripper when a new transport // is created for a client, allowing per connection behavior // to be injected. type WrapperFunc func(rt http.RoundTripper) http.RoundTripper // Wrappers accepts any number of wrappers and returns a wrapper // function that is the equivalent of calling each of them in order. Nil // values are ignored, which makes this function convenient for incrementally // wrapping a function. func Wrappers(fns ...WrapperFunc) WrapperFunc { if len(fns) == 0 { return nil } // optimize the common case of wrapping a possibly nil transport wrapper // with an additional wrapper if len(fns) == 2 && fns[0] == nil { return fns[1] } return func(rt http.RoundTripper) http.RoundTripper { base := rt for _, fn := range fns { if fn != nil { base = fn(base) } } return base } } // ContextCanceller prevents new requests after the provided context is finished. // err is returned when the context is closed, allowing the caller to provide a context // appropriate error. func ContextCanceller(ctx context.Context, err error) WrapperFunc { return func(rt http.RoundTripper) http.RoundTripper { return &contextCanceller{ ctx: ctx, rt: rt, err: err, } } } type contextCanceller struct { ctx context.Context rt http.RoundTripper err error } func (b *contextCanceller) RoundTrip(req *http.Request) (*http.Response, error) { select { case <-b.ctx.Done(): return nil, b.err default: return b.rt.RoundTrip(req) } } func tryCancelRequest(rt http.RoundTripper, req *http.Request) { type canceler interface { CancelRequest(*http.Request) } switch rt := rt.(type) { case canceler: rt.CancelRequest(req) case utilnet.RoundTripperWrapper: tryCancelRequest(rt.WrappedRoundTripper(), req) default: klog.Warningf("Unable to cancel request for %T", rt) } } type certificateCacheEntry struct { cert *tls.Certificate err error birth time.Time } // isStale returns true when this cache entry is too old to be usable func (c *certificateCacheEntry) isStale() bool { return time.Since(c.birth) > time.Second } func newCertificateCacheEntry(certFile, keyFile string) certificateCacheEntry { cert, err := tls.LoadX509KeyPair(certFile, keyFile) return certificateCacheEntry{cert: &cert, err: err, birth: time.Now()} } // cachingCertificateLoader ensures that we don't hammer the filesystem when opening many connections // the underlying cert files are read at most once every second func cachingCertificateLoader(certFile, keyFile string) func() (*tls.Certificate, error) { current := newCertificateCacheEntry(certFile, keyFile) var currentMtx sync.RWMutex return func() (*tls.Certificate, error) { currentMtx.RLock() if current.isStale() { currentMtx.RUnlock() currentMtx.Lock() defer currentMtx.Unlock() if current.isStale() { current = newCertificateCacheEntry(certFile, keyFile) } } else { defer currentMtx.RUnlock() } return current.cert, current.err } } kubernetes-client-go-a2dfcab/transport/transport_test.go000066400000000000000000000376731472614177300240760ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package transport import ( "context" "crypto/tls" "errors" "fmt" "net" "net/http" "testing" ) const ( rootCACert = `-----BEGIN CERTIFICATE----- MIIC4DCCAcqgAwIBAgIBATALBgkqhkiG9w0BAQswIzEhMB8GA1UEAwwYMTAuMTMu MTI5LjEwNkAxNDIxMzU5MDU4MB4XDTE1MDExNTIxNTczN1oXDTE2MDExNTIxNTcz OFowIzEhMB8GA1UEAwwYMTAuMTMuMTI5LjEwNkAxNDIxMzU5MDU4MIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAunDRXGwsiYWGFDlWH6kjGun+PshDGeZX xtx9lUnL8pIRWH3wX6f13PO9sktaOWW0T0mlo6k2bMlSLlSZgG9H6og0W6gLS3vq s4VavZ6DbXIwemZG2vbRwsvR+t4G6Nbwelm6F8RFnA1Fwt428pavmNQ/wgYzo+T1 1eS+HiN4ACnSoDSx3QRWcgBkB1g6VReofVjx63i0J+w8Q/41L9GUuLqquFxu6ZnH 60vTB55lHgFiDLjA1FkEz2dGvGh/wtnFlRvjaPC54JH2K1mPYAUXTreoeJtLJKX0 ycoiyB24+zGCniUmgIsmQWRPaOPircexCp1BOeze82BT1LCZNTVaxQIDAQABoyMw ITAOBgNVHQ8BAf8EBAMCAKQwDwYDVR0TAQH/BAUwAwEB/zALBgkqhkiG9w0BAQsD ggEBADMxsUuAFlsYDpF4fRCzXXwrhbtj4oQwcHpbu+rnOPHCZupiafzZpDu+rw4x YGPnCb594bRTQn4pAu3Ac18NbLD5pV3uioAkv8oPkgr8aUhXqiv7KdDiaWm6sbAL EHiXVBBAFvQws10HMqMoKtO8f1XDNAUkWduakR/U6yMgvOPwS7xl0eUTqyRB6zGb K55q2dejiFWaFqB/y78txzvz6UlOZKE44g2JAVoJVM6kGaxh33q8/FmrL4kuN3ut W+MmJCVDvd4eEqPwbp7146ZWTqpIJ8lvA6wuChtqV8lhAPka2hD/LMqY8iXNmfXD uml0obOEy+ON91k+SWTJ3ggmF/U= -----END CERTIFICATE-----` certData = `-----BEGIN CERTIFICATE----- MIIC6jCCAdSgAwIBAgIBCzALBgkqhkiG9w0BAQswIzEhMB8GA1UEAwwYMTAuMTMu MTI5LjEwNkAxNDIxMzU5MDU4MB4XDTE1MDExNTIyMDEzMVoXDTE2MDExNTIyMDEz MlowGzEZMBcGA1UEAxMQb3BlbnNoaWZ0LWNsaWVudDCCASIwDQYJKoZIhvcNAQEB BQADggEPADCCAQoCggEBAKtdhz0+uCLXw5cSYns9rU/XifFSpb/x24WDdrm72S/v b9BPYsAStiP148buylr1SOuNi8sTAZmlVDDIpIVwMLff+o2rKYDicn9fjbrTxTOj lI4pHJBH+JU3AJ0tbajupioh70jwFS0oYpwtneg2zcnE2Z4l6mhrj2okrc5Q1/X2 I2HChtIU4JYTisObtin10QKJX01CLfYXJLa8upWzKZ4/GOcHG+eAV3jXWoXidtjb 1Usw70amoTZ6mIVCkiu1QwCoa8+ycojGfZhvqMsAp1536ZcCul+Na+AbCv4zKS7F kQQaImVrXdUiFansIoofGlw/JNuoKK6ssVpS5Ic3pgcCAwEAAaM1MDMwDgYDVR0P AQH/BAQDAgCgMBMGA1UdJQQMMAoGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwCwYJ KoZIhvcNAQELA4IBAQCKLREH7bXtXtZ+8vI6cjD7W3QikiArGqbl36bAhhWsJLp/ p/ndKz39iFNaiZ3GlwIURWOOKx3y3GA0x9m8FR+Llthf0EQ8sUjnwaknWs0Y6DQ3 jjPFZOpV3KPCFrdMJ3++E3MgwFC/Ih/N2ebFX9EcV9Vcc6oVWMdwT0fsrhu683rq 6GSR/3iVX1G/pmOiuaR0fNUaCyCfYrnI4zHBDgSfnlm3vIvN2lrsR/DQBakNL8DJ HBgKxMGeUPoneBv+c8DMXIL0EhaFXRlBv9QW45/GiAIOuyFJ0i6hCtGZpJjq4OpQ BRjCI+izPzFTjsxD4aORE+WOkyWFCGPWKfNejfw0 -----END CERTIFICATE-----` keyData = `-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAq12HPT64ItfDlxJiez2tT9eJ8VKlv/HbhYN2ubvZL+9v0E9i wBK2I/Xjxu7KWvVI642LyxMBmaVUMMikhXAwt9/6jaspgOJyf1+NutPFM6OUjikc kEf4lTcAnS1tqO6mKiHvSPAVLShinC2d6DbNycTZniXqaGuPaiStzlDX9fYjYcKG 0hTglhOKw5u2KfXRAolfTUIt9hcktry6lbMpnj8Y5wcb54BXeNdaheJ22NvVSzDv RqahNnqYhUKSK7VDAKhrz7JyiMZ9mG+oywCnXnfplwK6X41r4BsK/jMpLsWRBBoi ZWtd1SIVqewiih8aXD8k26gorqyxWlLkhzemBwIDAQABAoIBAD2XYRs3JrGHQUpU FkdbVKZkvrSY0vAZOqBTLuH0zUv4UATb8487anGkWBjRDLQCgxH+jucPTrztekQK aW94clo0S3aNtV4YhbSYIHWs1a0It0UdK6ID7CmdWkAj6s0T8W8lQT7C46mWYVLm 5mFnCTHi6aB42jZrqmEpC7sivWwuU0xqj3Ml8kkxQCGmyc9JjmCB4OrFFC8NNt6M ObvQkUI6Z3nO4phTbpxkE1/9dT0MmPIF7GhHVzJMS+EyyRYUDllZ0wvVSOM3qZT0 JMUaBerkNwm9foKJ1+dv2nMKZZbJajv7suUDCfU44mVeaEO+4kmTKSGCGjjTBGkr 7L1ySDECgYEA5ElIMhpdBzIivCuBIH8LlUeuzd93pqssO1G2Xg0jHtfM4tz7fyeI cr90dc8gpli24dkSxzLeg3Tn3wIj/Bu64m2TpZPZEIlukYvgdgArmRIPQVxerYey OkrfTNkxU1HXsYjLCdGcGXs5lmb+K/kuTcFxaMOs7jZi7La+jEONwf8CgYEAwCs/ rUOOA0klDsWWisbivOiNPII79c9McZCNBqncCBfMUoiGe8uWDEO4TFHN60vFuVk9 8PkwpCfvaBUX+ajvbafIfHxsnfk1M04WLGCeqQ/ym5Q4sQoQOcC1b1y9qc/xEWfg nIUuia0ukYRpl7qQa3tNg+BNFyjypW8zukUAC/kCgYB1/Kojuxx5q5/oQVPrx73k 2bevD+B3c+DYh9MJqSCNwFtUpYIWpggPxoQan4LwdsmO0PKzocb/ilyNFj4i/vII NToqSc/WjDFpaDIKyuu9oWfhECye45NqLWhb/6VOuu4QA/Nsj7luMhIBehnEAHW+ GkzTKM8oD1PxpEG3nPKXYQKBgQC6AuMPRt3XBl1NkCrpSBy/uObFlFaP2Enpf39S 3OZ0Gv0XQrnSaL1kP8TMcz68rMrGX8DaWYsgytstR4W+jyy7WvZwsUu+GjTJ5aMG 77uEcEBpIi9CBzivfn7hPccE8ZgqPf+n4i6q66yxBJflW5xhvafJqDtW2LcPNbW/ bvzdmQKBgExALRUXpq+5dbmkdXBHtvXdRDZ6rVmrnjy4nI5bPw+1GqQqk6uAR6B/ F6NmLCQOO4PDG/cuatNHIr2FrwTmGdEL6ObLUGWn9Oer9gJhHVqqsY5I4sEPo4XX stR0Yiw0buV6DL/moUO0HIM9Bjh96HJp+LxiIS6UCdIhMPp5HoQa -----END RSA PRIVATE KEY-----` ) func TestNew(t *testing.T) { globalGetCert := &GetCertHolder{ GetCert: func() (*tls.Certificate, error) { return nil, nil }, } globalDial := &DialHolder{ Dial: func(ctx context.Context, network, address string) (net.Conn, error) { return nil, nil }, } testCases := map[string]struct { Config *Config Err bool TLS bool TLSCert bool TLSErr bool Default bool Insecure bool DefaultRoots bool }{ "default transport": { Default: true, Config: &Config{}, }, "insecure": { TLS: true, Insecure: true, DefaultRoots: true, Config: &Config{TLS: TLSConfig{ Insecure: true, }}, }, "server name": { TLS: true, DefaultRoots: true, Config: &Config{TLS: TLSConfig{ ServerName: "foo", }}, }, "ca transport": { TLS: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), }, }, }, "bad ca file transport": { Err: true, Config: &Config{ TLS: TLSConfig{ CAFile: "invalid file", }, }, }, "bad ca data transport": { Err: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert + "this is not valid"), }, }, }, "ca data overriding bad ca file transport": { TLS: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), CAFile: "invalid file", }, }, }, "cert transport": { TLS: true, TLSCert: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), CertData: []byte(certData), KeyData: []byte(keyData), }, }, }, "bad cert data transport": { Err: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), CertData: []byte(certData), KeyData: []byte("bad key data"), }, }, }, "bad file cert transport": { Err: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), CertData: []byte(certData), KeyFile: "invalid file", }, }, }, "key data overriding bad file cert transport": { TLS: true, TLSCert: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), CertData: []byte(certData), KeyData: []byte(keyData), KeyFile: "invalid file", }, }, }, "callback cert and key": { TLS: true, TLSCert: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), GetCertHolder: &GetCertHolder{ GetCert: func() (*tls.Certificate, error) { crt, err := tls.X509KeyPair([]byte(certData), []byte(keyData)) return &crt, err }, }, }, }, }, "cert callback error": { TLS: true, TLSCert: true, TLSErr: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), GetCertHolder: &GetCertHolder{ GetCert: func() (*tls.Certificate, error) { return nil, errors.New("GetCert failure") }, }, }, }, }, "cert data overrides empty callback result": { TLS: true, TLSCert: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), GetCertHolder: &GetCertHolder{ GetCert: func() (*tls.Certificate, error) { return nil, nil }, }, CertData: []byte(certData), KeyData: []byte(keyData), }, }, }, "callback returns nothing": { TLS: true, TLSCert: true, Config: &Config{ TLS: TLSConfig{ CAData: []byte(rootCACert), GetCertHolder: &GetCertHolder{ GetCert: func() (*tls.Certificate, error) { return nil, nil }, }, }, }, }, "nil holders": { Config: &Config{ TLS: TLSConfig{ GetCertHolder: nil, }, DialHolder: nil, }, Err: false, TLS: false, TLSCert: false, TLSErr: false, Default: true, Insecure: false, DefaultRoots: false, }, "non-nil dial holder and nil internal": { Config: &Config{ TLS: TLSConfig{ GetCertHolder: nil, }, DialHolder: &DialHolder{}, }, Err: true, }, "non-nil cert holder and nil internal": { Config: &Config{ TLS: TLSConfig{ GetCertHolder: &GetCertHolder{}, }, DialHolder: nil, }, Err: true, }, "non-nil dial holder+internal": { Config: &Config{ TLS: TLSConfig{ GetCertHolder: nil, }, DialHolder: &DialHolder{ Dial: func(ctx context.Context, network, address string) (net.Conn, error) { return nil, nil }, }, }, Err: false, TLS: true, TLSCert: false, TLSErr: false, Default: false, Insecure: false, DefaultRoots: true, }, "non-nil cert holder+internal": { Config: &Config{ TLS: TLSConfig{ GetCertHolder: &GetCertHolder{ GetCert: func() (*tls.Certificate, error) { return nil, nil }, }, }, DialHolder: nil, }, Err: false, TLS: true, TLSCert: true, TLSErr: false, Default: false, Insecure: false, DefaultRoots: true, }, "non-nil holders+internal with global address": { Config: &Config{ TLS: TLSConfig{ GetCertHolder: globalGetCert, }, DialHolder: globalDial, }, Err: false, TLS: true, TLSCert: true, TLSErr: false, Default: false, Insecure: false, DefaultRoots: true, }, } for k, testCase := range testCases { t.Run(k, func(t *testing.T) { rt, err := New(testCase.Config) switch { case testCase.Err && err == nil: t.Fatal("unexpected non-error") case !testCase.Err && err != nil: t.Fatalf("unexpected error: %v", err) } if testCase.Err { return } switch { case testCase.Default && rt != http.DefaultTransport: t.Fatalf("got %#v, expected the default transport", rt) case !testCase.Default && rt == http.DefaultTransport: t.Fatalf("got %#v, expected non-default transport", rt) } // We only know how to check TLSConfig on http.Transports transport := rt.(*http.Transport) switch { case testCase.TLS && transport.TLSClientConfig == nil: t.Fatalf("got %#v, expected TLSClientConfig", transport) case !testCase.TLS && transport.TLSClientConfig != nil: t.Fatalf("got %#v, expected no TLSClientConfig", transport) } if !testCase.TLS { return } switch { case testCase.DefaultRoots && transport.TLSClientConfig.RootCAs != nil: t.Fatalf("got %#v, expected nil root CAs", transport.TLSClientConfig.RootCAs) case !testCase.DefaultRoots && transport.TLSClientConfig.RootCAs == nil: t.Fatalf("got %#v, expected non-nil root CAs", transport.TLSClientConfig.RootCAs) } switch { case testCase.Insecure != transport.TLSClientConfig.InsecureSkipVerify: t.Fatalf("got %#v, expected %#v", transport.TLSClientConfig.InsecureSkipVerify, testCase.Insecure) } switch { case testCase.TLSCert && transport.TLSClientConfig.GetClientCertificate == nil: t.Fatalf("got %#v, expected TLSClientConfig.GetClientCertificate", transport.TLSClientConfig) case !testCase.TLSCert && transport.TLSClientConfig.GetClientCertificate != nil: t.Fatalf("got %#v, expected no TLSClientConfig.GetClientCertificate", transport.TLSClientConfig) } if !testCase.TLSCert { return } _, err = transport.TLSClientConfig.GetClientCertificate(nil) switch { case testCase.TLSErr && err == nil: t.Error("got nil error from GetClientCertificate, expected non-nil") case !testCase.TLSErr && err != nil: t.Errorf("got error from GetClientCertificate: %q, expected nil", err) } }) } } type fakeRoundTripper struct { Req *http.Request Resp *http.Response Err error } func (rt *fakeRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { rt.Req = req return rt.Resp, rt.Err } type chainRoundTripper struct { rt http.RoundTripper value string } func testChain(value string) WrapperFunc { return func(rt http.RoundTripper) http.RoundTripper { return &chainRoundTripper{rt: rt, value: value} } } func (rt *chainRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { resp, err := rt.rt.RoundTrip(req) if resp != nil { if resp.Header == nil { resp.Header = make(http.Header) } resp.Header.Set("Value", resp.Header.Get("Value")+rt.value) } return resp, err } func TestWrappers(t *testing.T) { resp1 := &http.Response{} wrapperResp1 := func(rt http.RoundTripper) http.RoundTripper { return &fakeRoundTripper{Resp: resp1} } resp2 := &http.Response{} wrapperResp2 := func(rt http.RoundTripper) http.RoundTripper { return &fakeRoundTripper{Resp: resp2} } tests := []struct { name string fns []WrapperFunc wantNil bool want func(*http.Response) bool }{ {fns: []WrapperFunc{}, wantNil: true}, {fns: []WrapperFunc{nil, nil}, wantNil: true}, {fns: []WrapperFunc{nil}, wantNil: false}, {fns: []WrapperFunc{nil, wrapperResp1}, want: func(resp *http.Response) bool { return resp == resp1 }}, {fns: []WrapperFunc{wrapperResp1, nil}, want: func(resp *http.Response) bool { return resp == resp1 }}, {fns: []WrapperFunc{nil, wrapperResp1, nil}, want: func(resp *http.Response) bool { return resp == resp1 }}, {fns: []WrapperFunc{nil, wrapperResp1, wrapperResp2}, want: func(resp *http.Response) bool { return resp == resp2 }}, {fns: []WrapperFunc{wrapperResp1, wrapperResp2}, want: func(resp *http.Response) bool { return resp == resp2 }}, {fns: []WrapperFunc{wrapperResp2, wrapperResp1}, want: func(resp *http.Response) bool { return resp == resp1 }}, {fns: []WrapperFunc{testChain("1")}, want: func(resp *http.Response) bool { return resp.Header.Get("Value") == "1" }}, {fns: []WrapperFunc{testChain("1"), testChain("2")}, want: func(resp *http.Response) bool { return resp.Header.Get("Value") == "12" }}, {fns: []WrapperFunc{testChain("2"), testChain("1")}, want: func(resp *http.Response) bool { return resp.Header.Get("Value") == "21" }}, {fns: []WrapperFunc{testChain("1"), testChain("2"), testChain("3")}, want: func(resp *http.Response) bool { return resp.Header.Get("Value") == "123" }}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := Wrappers(tt.fns...) if got == nil != tt.wantNil { t.Errorf("Wrappers() = %v", got) return } if got == nil { return } rt := &fakeRoundTripper{Resp: &http.Response{}} nested := got(rt) req := &http.Request{} resp, _ := nested.RoundTrip(req) if tt.want != nil && !tt.want(resp) { t.Errorf("unexpected response: %#v", resp) } }) } } func Test_contextCanceller_RoundTrip(t *testing.T) { tests := []struct { name string open bool want bool }{ {name: "open context should call nested round tripper", open: true, want: true}, {name: "closed context should return a known error", open: false, want: false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req := &http.Request{} rt := &fakeRoundTripper{Resp: &http.Response{}} ctx := context.Background() if !tt.open { c, fn := context.WithCancel(ctx) fn() ctx = c } errTesting := fmt.Errorf("testing") b := &contextCanceller{ rt: rt, ctx: ctx, err: errTesting, } got, err := b.RoundTrip(req) if tt.want { if err != nil { t.Errorf("unexpected error: %v", err) } if got != rt.Resp { t.Errorf("wanted response") } if req != rt.Req { t.Errorf("expect nested call") } } else { if err != errTesting { t.Errorf("unexpected error: %v", err) } if got != nil { t.Errorf("wanted no response") } if rt.Req != nil { t.Errorf("want no nested call") } } }) } } kubernetes-client-go-a2dfcab/transport/websocket/000077500000000000000000000000001472614177300224225ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/transport/websocket/roundtripper.go000066400000000000000000000136071472614177300255150ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package websocket import ( "crypto/tls" "errors" "fmt" "net/http" "net/url" gwebsocket "github.com/gorilla/websocket" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/wsstream" utilnet "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" "k8s.io/client-go/transport" ) var ( _ utilnet.TLSClientConfigHolder = &RoundTripper{} _ http.RoundTripper = &RoundTripper{} ) // ConnectionHolder defines functions for structure providing // access to the websocket connection. type ConnectionHolder interface { DataBufferSize() int Connection() *gwebsocket.Conn } // RoundTripper knows how to establish a connection to a remote WebSocket endpoint and make it available for use. // RoundTripper must not be reused. type RoundTripper struct { // TLSConfig holds the TLS configuration settings to use when connecting // to the remote server. TLSConfig *tls.Config // Proxier specifies a function to return a proxy for a given // Request. If the function returns a non-nil error, the // request is aborted with the provided error. // If Proxy is nil or returns a nil *URL, no proxy is used. Proxier func(req *http.Request) (*url.URL, error) // Conn holds the WebSocket connection after a round trip. Conn *gwebsocket.Conn } // Connection returns the stored websocket connection. func (rt *RoundTripper) Connection() *gwebsocket.Conn { return rt.Conn } // DataBufferSize returns the size of buffers for the // websocket connection. func (rt *RoundTripper) DataBufferSize() int { return 32 * 1024 } // TLSClientConfig implements pkg/util/net.TLSClientConfigHolder. func (rt *RoundTripper) TLSClientConfig() *tls.Config { return rt.TLSConfig } // RoundTrip connects to the remote websocket using the headers in the request and the TLS // configuration from the config func (rt *RoundTripper) RoundTrip(request *http.Request) (retResp *http.Response, retErr error) { defer func() { if request.Body != nil { err := request.Body.Close() if retErr == nil { retErr = err } } }() // set the protocol version directly on the dialer from the header protocolVersions := request.Header[wsstream.WebSocketProtocolHeader] delete(request.Header, wsstream.WebSocketProtocolHeader) dialer := gwebsocket.Dialer{ Proxy: rt.Proxier, TLSClientConfig: rt.TLSConfig, Subprotocols: protocolVersions, ReadBufferSize: rt.DataBufferSize() + 1024, // add space for the protocol byte indicating which channel the data is for WriteBufferSize: rt.DataBufferSize() + 1024, // add space for the protocol byte indicating which channel the data is for } switch request.URL.Scheme { case "https": request.URL.Scheme = "wss" case "http": request.URL.Scheme = "ws" default: return nil, fmt.Errorf("unknown url scheme: %s", request.URL.Scheme) } wsConn, resp, err := dialer.DialContext(request.Context(), request.URL.String(), request.Header) if err != nil { if errors.Is(err, gwebsocket.ErrBadHandshake) { // Enhance the error message with the response status if possible. if resp != nil && len(resp.Status) > 0 { err = fmt.Errorf("%w (%s)", err, resp.Status) } return nil, &httpstream.UpgradeFailureError{Cause: err} } return nil, err } // Ensure we got back a protocol we understand foundProtocol := false for _, protocolVersion := range protocolVersions { if protocolVersion == wsConn.Subprotocol() { foundProtocol = true break } } if !foundProtocol { wsConn.Close() // nolint:errcheck return nil, &httpstream.UpgradeFailureError{Cause: fmt.Errorf("invalid protocol, expected one of %q, got %q", protocolVersions, wsConn.Subprotocol())} } rt.Conn = wsConn return resp, nil } // RoundTripperFor transforms the passed rest config into a wrapped roundtripper, as well // as a pointer to the websocket RoundTripper. The websocket RoundTripper contains the // websocket connection after RoundTrip() on the wrapper. Returns an error if there is // a problem creating the round trippers. func RoundTripperFor(config *restclient.Config) (http.RoundTripper, ConnectionHolder, error) { transportCfg, err := config.TransportConfig() if err != nil { return nil, nil, err } tlsConfig, err := transport.TLSConfigFor(transportCfg) if err != nil { return nil, nil, err } proxy := config.Proxy if proxy == nil { proxy = utilnet.NewProxierWithNoProxyCIDR(http.ProxyFromEnvironment) } upgradeRoundTripper := &RoundTripper{ TLSConfig: tlsConfig, Proxier: proxy, } wrapper, err := transport.HTTPWrappersForConfig(transportCfg, upgradeRoundTripper) if err != nil { return nil, nil, err } return wrapper, upgradeRoundTripper, nil } // Negotiate opens a connection to a remote server and attempts to negotiate // a WebSocket connection. Upon success, it returns the negotiated connection. // The round tripper rt must use the WebSocket round tripper wsRt - see RoundTripperFor. func Negotiate(rt http.RoundTripper, connectionInfo ConnectionHolder, req *http.Request, protocols ...string) (*gwebsocket.Conn, error) { // Plumb protocols to RoundTripper#RoundTrip req.Header[wsstream.WebSocketProtocolHeader] = protocols resp, err := rt.RoundTrip(req) if err != nil { return nil, err } err = resp.Body.Close() if err != nil { connectionInfo.Connection().Close() return nil, fmt.Errorf("error closing response body: %v", err) } return connectionInfo.Connection(), nil } kubernetes-client-go-a2dfcab/transport/websocket/roundtripper_test.go000066400000000000000000000124461472614177300265540ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package websocket import ( "context" "io" "net/http" "net/http/httptest" "net/url" "strings" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/wsstream" "k8s.io/apimachinery/pkg/util/remotecommand" restclient "k8s.io/client-go/rest" ) func TestWebSocketRoundTripper_RoundTripperSucceeds(t *testing.T) { // Create fake WebSocket server. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() })) defer websocketServer.Close() // Create the wrapped roundtripper and websocket upgrade roundtripper and call "RoundTrip()". websocketLocation, err := url.Parse(websocketServer.URL) require.NoError(t, err) req, err := http.NewRequestWithContext(context.Background(), "GET", websocketServer.URL, nil) require.NoError(t, err) rt, wsRt, err := RoundTripperFor(&restclient.Config{Host: websocketLocation.Host}) require.NoError(t, err) requestedProtocol := remotecommand.StreamProtocolV5Name req.Header[wsstream.WebSocketProtocolHeader] = []string{requestedProtocol} _, err = rt.RoundTrip(req) require.NoError(t, err) // WebSocket Connection is stored in websocket RoundTripper. // Compare the expected negotiated subprotocol with the actual subprotocol. actualProtocol := wsRt.Connection().Subprotocol() assert.Equal(t, requestedProtocol, actualProtocol) } func TestWebSocketRoundTripper_RoundTripperFails(t *testing.T) { // Create fake WebSocket server. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { // Bad handshake means websocket server will not completely initialize. _, err := webSocketServerStreams(req, w) require.Error(t, err) assert.True(t, strings.Contains(err.Error(), "websocket server finished before becoming ready")) })) defer websocketServer.Close() // Create the wrapped roundtripper and websocket upgrade roundtripper and call "RoundTrip()". websocketLocation, err := url.Parse(websocketServer.URL) require.NoError(t, err) req, err := http.NewRequestWithContext(context.Background(), "GET", websocketServer.URL, nil) require.NoError(t, err) rt, _, err := RoundTripperFor(&restclient.Config{Host: websocketLocation.Host}) require.NoError(t, err) // Requested subprotocol version 1 is not supported by test websocket server. requestedProtocol := remotecommand.StreamProtocolV1Name req.Header[wsstream.WebSocketProtocolHeader] = []string{requestedProtocol} _, err = rt.RoundTrip(req) // Ensure a "bad handshake" error is returned, since requested protocol is not supported. require.Error(t, err) assert.True(t, strings.Contains(err.Error(), "websocket: bad handshake")) assert.True(t, strings.Contains(err.Error(), "403 Forbidden")) assert.True(t, httpstream.IsUpgradeFailure(err)) } func TestWebSocketRoundTripper_NegotiateCreatesConnection(t *testing.T) { // Create fake WebSocket server. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { conns, err := webSocketServerStreams(req, w) if err != nil { t.Fatalf("error on webSocketServerStreams: %v", err) } defer conns.conn.Close() })) defer websocketServer.Close() // Create the websocket roundtripper and call "Negotiate" to create websocket connection. websocketLocation, err := url.Parse(websocketServer.URL) require.NoError(t, err) req, err := http.NewRequestWithContext(context.Background(), "GET", websocketServer.URL, nil) require.NoError(t, err) rt, wsRt, err := RoundTripperFor(&restclient.Config{Host: websocketLocation.Host}) require.NoError(t, err) requestedProtocol := remotecommand.StreamProtocolV5Name conn, err := Negotiate(rt, wsRt, req, requestedProtocol) require.NoError(t, err) // Compare the expected negotiated subprotocol with the actual subprotocol. actualProtocol := conn.Subprotocol() assert.Equal(t, requestedProtocol, actualProtocol) } // websocketStreams contains the WebSocket connection and streams from a server. type websocketStreams struct { conn io.Closer } func webSocketServerStreams(req *http.Request, w http.ResponseWriter) (*websocketStreams, error) { conn := wsstream.NewConn(map[string]wsstream.ChannelProtocolConfig{ remotecommand.StreamProtocolV5Name: { Binary: true, Channels: []wsstream.ChannelType{}, }, }) conn.SetIdleTimeout(4 * time.Hour) // Opening the connection responds to WebSocket client, negotiating // the WebSocket upgrade connection and the subprotocol. _, _, err := conn.Open(w, req) if err != nil { return nil, err } return &websocketStreams{conn: conn}, nil } kubernetes-client-go-a2dfcab/util/000077500000000000000000000000001472614177300173555ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/cert/000077500000000000000000000000001472614177300203125ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/cert/OWNERS000066400000000000000000000002461472614177300212540ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-auth-certificates-approvers reviewers: - sig-auth-certificates-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/util/cert/cert.go000066400000000000000000000173641472614177300216110ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cert import ( "bytes" "crypto" cryptorand "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "fmt" "math" "math/big" "net" "os" "path/filepath" "strings" "time" "k8s.io/client-go/util/keyutil" netutils "k8s.io/utils/net" ) const duration365d = time.Hour * 24 * 365 // Config contains the basic fields required for creating a certificate type Config struct { CommonName string Organization []string AltNames AltNames Usages []x509.ExtKeyUsage NotBefore time.Time } // AltNames contains the domain names and IP addresses that will be added // to the API Server's x509 certificate SubAltNames field. The values will // be passed directly to the x509.Certificate object. type AltNames struct { DNSNames []string IPs []net.IP } // NewSelfSignedCACert creates a CA certificate func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, error) { now := time.Now() // returns a uniform random value in [0, max-1), then add 1 to serial to make it a uniform random value in [1, max). serial, err := cryptorand.Int(cryptorand.Reader, new(big.Int).SetInt64(math.MaxInt64-1)) if err != nil { return nil, err } serial = new(big.Int).Add(serial, big.NewInt(1)) notBefore := now.UTC() if !cfg.NotBefore.IsZero() { notBefore = cfg.NotBefore.UTC() } tmpl := x509.Certificate{ SerialNumber: serial, Subject: pkix.Name{ CommonName: cfg.CommonName, Organization: cfg.Organization, }, DNSNames: []string{cfg.CommonName}, NotBefore: notBefore, NotAfter: now.Add(duration365d * 10).UTC(), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, BasicConstraintsValid: true, IsCA: true, } certDERBytes, err := x509.CreateCertificate(cryptorand.Reader, &tmpl, &tmpl, key.Public(), key) if err != nil { return nil, err } return x509.ParseCertificate(certDERBytes) } // GenerateSelfSignedCertKey creates a self-signed certificate and key for the given host. // Host may be an IP or a DNS name // You may also specify additional subject alt names (either ip or dns names) for the certificate. func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string) ([]byte, []byte, error) { return GenerateSelfSignedCertKeyWithFixtures(host, alternateIPs, alternateDNS, "") } // GenerateSelfSignedCertKeyWithFixtures creates a self-signed certificate and key for the given host. // Host may be an IP or a DNS name. You may also specify additional subject alt names (either ip or dns names) // for the certificate. // // If fixtureDirectory is non-empty, it is a directory path which can contain pre-generated certs. The format is: // _-_-.crt // _-_-.key // Certs/keys not existing in that directory are created. func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, alternateDNS []string, fixtureDirectory string) ([]byte, []byte, error) { validFrom := time.Now().Add(-time.Hour) // valid an hour earlier to avoid flakes due to clock skew maxAge := time.Hour * 24 * 365 // one year self-signed certs baseName := fmt.Sprintf("%s_%s_%s", host, strings.Join(ipsToStrings(alternateIPs), "-"), strings.Join(alternateDNS, "-")) certFixturePath := filepath.Join(fixtureDirectory, baseName+".crt") keyFixturePath := filepath.Join(fixtureDirectory, baseName+".key") if len(fixtureDirectory) > 0 { cert, err := os.ReadFile(certFixturePath) if err == nil { key, err := os.ReadFile(keyFixturePath) if err == nil { return cert, key, nil } return nil, nil, fmt.Errorf("cert %s can be read, but key %s cannot: %v", certFixturePath, keyFixturePath, err) } maxAge = 100 * time.Hour * 24 * 365 // 100 years fixtures } caKey, err := rsa.GenerateKey(cryptorand.Reader, 2048) if err != nil { return nil, nil, err } // returns a uniform random value in [0, max-1), then add 1 to serial to make it a uniform random value in [1, max). serial, err := cryptorand.Int(cryptorand.Reader, new(big.Int).SetInt64(math.MaxInt64-1)) if err != nil { return nil, nil, err } serial = new(big.Int).Add(serial, big.NewInt(1)) caTemplate := x509.Certificate{ SerialNumber: serial, Subject: pkix.Name{ CommonName: fmt.Sprintf("%s-ca@%d", host, time.Now().Unix()), }, NotBefore: validFrom, NotAfter: validFrom.Add(maxAge), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, BasicConstraintsValid: true, IsCA: true, } caDERBytes, err := x509.CreateCertificate(cryptorand.Reader, &caTemplate, &caTemplate, &caKey.PublicKey, caKey) if err != nil { return nil, nil, err } caCertificate, err := x509.ParseCertificate(caDERBytes) if err != nil { return nil, nil, err } priv, err := rsa.GenerateKey(cryptorand.Reader, 2048) if err != nil { return nil, nil, err } // returns a uniform random value in [0, max-1), then add 1 to serial to make it a uniform random value in [1, max). serial, err = cryptorand.Int(cryptorand.Reader, new(big.Int).SetInt64(math.MaxInt64-1)) if err != nil { return nil, nil, err } serial = new(big.Int).Add(serial, big.NewInt(1)) template := x509.Certificate{ SerialNumber: serial, Subject: pkix.Name{ CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()), }, NotBefore: validFrom, NotAfter: validFrom.Add(maxAge), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, BasicConstraintsValid: true, } if ip := netutils.ParseIPSloppy(host); ip != nil { template.IPAddresses = append(template.IPAddresses, ip) } else { template.DNSNames = append(template.DNSNames, host) } template.IPAddresses = append(template.IPAddresses, alternateIPs...) template.DNSNames = append(template.DNSNames, alternateDNS...) derBytes, err := x509.CreateCertificate(cryptorand.Reader, &template, caCertificate, &priv.PublicKey, caKey) if err != nil { return nil, nil, err } // Generate cert, followed by ca certBuffer := bytes.Buffer{} if err := pem.Encode(&certBuffer, &pem.Block{Type: CertificateBlockType, Bytes: derBytes}); err != nil { return nil, nil, err } if err := pem.Encode(&certBuffer, &pem.Block{Type: CertificateBlockType, Bytes: caDERBytes}); err != nil { return nil, nil, err } // Generate key keyBuffer := bytes.Buffer{} if err := pem.Encode(&keyBuffer, &pem.Block{Type: keyutil.RSAPrivateKeyBlockType, Bytes: x509.MarshalPKCS1PrivateKey(priv)}); err != nil { return nil, nil, err } if len(fixtureDirectory) > 0 { if err := os.WriteFile(certFixturePath, certBuffer.Bytes(), 0644); err != nil { return nil, nil, fmt.Errorf("failed to write cert fixture to %s: %v", certFixturePath, err) } if err := os.WriteFile(keyFixturePath, keyBuffer.Bytes(), 0600); err != nil { return nil, nil, fmt.Errorf("failed to write key fixture to %s: %v", certFixturePath, err) } } return certBuffer.Bytes(), keyBuffer.Bytes(), nil } func ipsToStrings(ips []net.IP) []string { ss := make([]string, 0, len(ips)) for _, ip := range ips { ss = append(ss, ip.String()) } return ss } kubernetes-client-go-a2dfcab/util/cert/cert_test.go000066400000000000000000000026231472614177300226400ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cert_test import ( cryptorand "crypto/rand" "crypto/rsa" "testing" "k8s.io/client-go/util/cert" ) const COMMON_NAME = "foo.example.com" // TestSelfSignedCertHasSAN verifies the existing of // a SAN on the generated self-signed certificate. // a SAN ensures that the certificate is considered // valid by default in go 1.15 and above, which // turns off fallback to Common Name by default. func TestSelfSignedCertHasSAN(t *testing.T) { key, err := rsa.GenerateKey(cryptorand.Reader, 2048) if err != nil { t.Fatalf("rsa key failed to generate: %v", err) } selfSignedCert, err := cert.NewSelfSignedCACert(cert.Config{CommonName: COMMON_NAME}, key) if err != nil { t.Fatalf("self signed certificate failed to generate: %v", err) } if len(selfSignedCert.DNSNames) == 0 { t.Fatalf("self signed certificate has zero DNS names.") } } kubernetes-client-go-a2dfcab/util/cert/csr.go000066400000000000000000000043661472614177300214410ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cert import ( cryptorand "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "net" ) // MakeCSR generates a PEM-encoded CSR using the supplied private key, subject, and SANs. // All key types that are implemented via crypto.Signer are supported (This includes *rsa.PrivateKey and *ecdsa.PrivateKey.) func MakeCSR(privateKey interface{}, subject *pkix.Name, dnsSANs []string, ipSANs []net.IP) (csr []byte, err error) { template := &x509.CertificateRequest{ Subject: *subject, DNSNames: dnsSANs, IPAddresses: ipSANs, } return MakeCSRFromTemplate(privateKey, template) } // MakeCSRFromTemplate generates a PEM-encoded CSR using the supplied private // key and certificate request as a template. All key types that are // implemented via crypto.Signer are supported (This includes *rsa.PrivateKey // and *ecdsa.PrivateKey.) func MakeCSRFromTemplate(privateKey interface{}, template *x509.CertificateRequest) ([]byte, error) { t := *template t.SignatureAlgorithm = sigType(privateKey) csrDER, err := x509.CreateCertificateRequest(cryptorand.Reader, &t, privateKey) if err != nil { return nil, err } csrPemBlock := &pem.Block{ Type: CertificateRequestBlockType, Bytes: csrDER, } return pem.EncodeToMemory(csrPemBlock), nil } func sigType(privateKey interface{}) x509.SignatureAlgorithm { // Customize the signature for RSA keys, depending on the key size if privateKey, ok := privateKey.(*rsa.PrivateKey); ok { keySize := privateKey.N.BitLen() switch { case keySize >= 4096: return x509.SHA512WithRSA case keySize >= 3072: return x509.SHA384WithRSA default: return x509.SHA256WithRSA } } return x509.UnknownSignatureAlgorithm } kubernetes-client-go-a2dfcab/util/cert/csr_test.go000066400000000000000000000043111472614177300224660ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cert import ( "crypto/x509" "crypto/x509/pkix" "encoding/pem" "net" "os" "testing" "k8s.io/client-go/util/keyutil" netutils "k8s.io/utils/net" ) func TestMakeCSR(t *testing.T) { keyFile := "testdata/dontUseThisKey.pem" subject := &pkix.Name{ CommonName: "kube-worker", } dnsSANs := []string{"localhost"} ipSANs := []net.IP{netutils.ParseIPSloppy("127.0.0.1")} keyData, err := os.ReadFile(keyFile) if err != nil { t.Fatal(err) } key, err := keyutil.ParsePrivateKeyPEM(keyData) if err != nil { t.Fatal(err) } csrPEM, err := MakeCSR(key, subject, dnsSANs, ipSANs) if err != nil { t.Error(err) } csrBlock, rest := pem.Decode(csrPEM) if csrBlock == nil { t.Fatal("Unable to decode MakeCSR result.") } if len(rest) != 0 { t.Error("Found more than one PEM encoded block in the result.") } if csrBlock.Type != CertificateRequestBlockType { t.Errorf("Found block type %q, wanted 'CERTIFICATE REQUEST'", csrBlock.Type) } csr, err := x509.ParseCertificateRequest(csrBlock.Bytes) if err != nil { t.Errorf("Found %v parsing MakeCSR result as a CertificateRequest.", err) } if csr.Subject.CommonName != subject.CommonName { t.Errorf("Wanted %v, got %v", subject, csr.Subject) } if len(csr.DNSNames) != 1 { t.Errorf("Wanted 1 DNS name in the result, got %d", len(csr.DNSNames)) } else if csr.DNSNames[0] != dnsSANs[0] { t.Errorf("Wanted %v, got %v", dnsSANs[0], csr.DNSNames[0]) } if len(csr.IPAddresses) != 1 { t.Errorf("Wanted 1 IP address in the result, got %d", len(csr.IPAddresses)) } else if csr.IPAddresses[0].String() != ipSANs[0].String() { t.Errorf("Wanted %v, got %v", ipSANs[0], csr.IPAddresses[0]) } } kubernetes-client-go-a2dfcab/util/cert/io.go000066400000000000000000000067151472614177300212610ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cert import ( "crypto/x509" "fmt" "os" "path/filepath" ) // CanReadCertAndKey returns true if the certificate and key files already exists, // otherwise returns false. If lost one of cert and key, returns error. func CanReadCertAndKey(certPath, keyPath string) (bool, error) { certReadable := canReadFile(certPath) keyReadable := canReadFile(keyPath) if certReadable == false && keyReadable == false { return false, nil } if certReadable == false { return false, fmt.Errorf("error reading %s, certificate and key must be supplied as a pair", certPath) } if keyReadable == false { return false, fmt.Errorf("error reading %s, certificate and key must be supplied as a pair", keyPath) } return true, nil } // If the file represented by path exists and // readable, returns true otherwise returns false. func canReadFile(path string) bool { f, err := os.Open(path) if err != nil { return false } defer f.Close() return true } // WriteCert writes the pem-encoded certificate data to certPath. // The certificate file will be created with file mode 0644. // If the certificate file already exists, it will be overwritten. // The parent directory of the certPath will be created as needed with file mode 0755. func WriteCert(certPath string, data []byte) error { if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil { return err } return os.WriteFile(certPath, data, os.FileMode(0644)) } // NewPool returns an x509.CertPool containing the certificates in the given PEM-encoded file. // Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates func NewPool(filename string) (*x509.CertPool, error) { pemBlock, err := os.ReadFile(filename) if err != nil { return nil, err } pool, err := NewPoolFromBytes(pemBlock) if err != nil { return nil, fmt.Errorf("error creating pool from %s: %s", filename, err) } return pool, nil } // NewPoolFromBytes returns an x509.CertPool containing the certificates in the given PEM-encoded bytes. // Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates func NewPoolFromBytes(pemBlock []byte) (*x509.CertPool, error) { certs, err := ParseCertsPEM(pemBlock) if err != nil { return nil, err } pool := x509.NewCertPool() for _, cert := range certs { pool.AddCert(cert) } return pool, nil } // CertsFromFile returns the x509.Certificates contained in the given PEM-encoded file. // Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates func CertsFromFile(file string) ([]*x509.Certificate, error) { pemBlock, err := os.ReadFile(file) if err != nil { return nil, err } certs, err := ParseCertsPEM(pemBlock) if err != nil { return nil, fmt.Errorf("error reading %s: %s", file, err) } return certs, nil } kubernetes-client-go-a2dfcab/util/cert/pem.go000066400000000000000000000040661472614177300214300ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cert import ( "bytes" "crypto/x509" "encoding/pem" "errors" ) const ( // CertificateBlockType is a possible value for pem.Block.Type. CertificateBlockType = "CERTIFICATE" // CertificateRequestBlockType is a possible value for pem.Block.Type. CertificateRequestBlockType = "CERTIFICATE REQUEST" ) // ParseCertsPEM returns the x509.Certificates contained in the given PEM-encoded byte array // Returns an error if a certificate could not be parsed, or if the data does not contain any certificates func ParseCertsPEM(pemCerts []byte) ([]*x509.Certificate, error) { ok := false certs := []*x509.Certificate{} for len(pemCerts) > 0 { var block *pem.Block block, pemCerts = pem.Decode(pemCerts) if block == nil { break } // Only use PEM "CERTIFICATE" blocks without extra headers if block.Type != CertificateBlockType || len(block.Headers) != 0 { continue } cert, err := x509.ParseCertificate(block.Bytes) if err != nil { return certs, err } certs = append(certs, cert) ok = true } if !ok { return certs, errors.New("data does not contain any valid RSA or ECDSA certificates") } return certs, nil } // EncodeCertificates returns the PEM-encoded byte array that represents by the specified certs. func EncodeCertificates(certs ...*x509.Certificate) ([]byte, error) { b := bytes.Buffer{} for _, cert := range certs { if err := pem.Encode(&b, &pem.Block{Type: CertificateBlockType, Bytes: cert.Raw}); err != nil { return []byte{}, err } } return b.Bytes(), nil } kubernetes-client-go-a2dfcab/util/cert/server_inspection.go000066400000000000000000000063311472614177300244050ustar00rootroot00000000000000/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cert import ( "crypto/tls" "crypto/x509" "fmt" "net/url" "strings" ) // GetClientCANames gets the CA names for client certs that a server accepts. This is useful when inspecting the // state of particular servers. apiHost is "host:port" func GetClientCANames(apiHost string) ([]string, error) { // when we run this the second time, we know which one we are expecting acceptableCAs := []string{} tlsConfig := &tls.Config{ InsecureSkipVerify: true, // this is insecure to always get to the GetClientCertificate GetClientCertificate: func(hello *tls.CertificateRequestInfo) (*tls.Certificate, error) { acceptableCAs = []string{} for _, curr := range hello.AcceptableCAs { acceptableCAs = append(acceptableCAs, string(curr)) } return &tls.Certificate{}, nil }, } conn, err := tls.Dial("tcp", apiHost, tlsConfig) if err != nil { return nil, err } if err := conn.Close(); err != nil { return nil, err } return acceptableCAs, nil } // GetClientCANamesForURL is GetClientCANames against a URL string like we use in kubeconfigs func GetClientCANamesForURL(kubeConfigURL string) ([]string, error) { apiserverURL, err := url.Parse(kubeConfigURL) if err != nil { return nil, err } return GetClientCANames(apiserverURL.Host) } // GetServingCertificates returns the x509 certs used by a server as certificates and pem encoded bytes. // The serverName is optional for specifying a different name to get SNI certificates. apiHost is "host:port" func GetServingCertificates(apiHost, serverName string) ([]*x509.Certificate, [][]byte, error) { tlsConfig := &tls.Config{ InsecureSkipVerify: true, // this is insecure so that we always get connected } // if a name is specified for SNI, set it. if len(serverName) > 0 { tlsConfig.ServerName = serverName } conn, err := tls.Dial("tcp", apiHost, tlsConfig) if err != nil { return nil, nil, err } if err = conn.Close(); err != nil { return nil, nil, fmt.Errorf("failed to close connection : %v", err) } peerCerts := conn.ConnectionState().PeerCertificates peerCertBytes := [][]byte{} for _, a := range peerCerts { actualCert, err := EncodeCertificates(a) if err != nil { return nil, nil, err } peerCertBytes = append(peerCertBytes, []byte(strings.TrimSpace(string(actualCert)))) } return peerCerts, peerCertBytes, err } // GetServingCertificatesForURL is GetServingCertificates against a URL string like we use in kubeconfigs func GetServingCertificatesForURL(kubeConfigURL, serverName string) ([]*x509.Certificate, [][]byte, error) { apiserverURL, err := url.Parse(kubeConfigURL) if err != nil { return nil, nil, err } return GetServingCertificates(apiserverURL.Host, serverName) } kubernetes-client-go-a2dfcab/util/cert/testdata/000077500000000000000000000000001472614177300221235ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/cert/testdata/README.md000066400000000000000000000001001472614177300233710ustar00rootroot00000000000000Keys in this directory are generated for testing purposes only. kubernetes-client-go-a2dfcab/util/cert/testdata/dontUseThisKey.pem000066400000000000000000000004401472614177300255460ustar00rootroot00000000000000-----BEGIN EC PRIVATE KEY----- MIGkAgEBBDAPEbSXwyDfWf0+61Oofd7aHkmdX69mrzD2Xb1CHF5syfsoRIhnG0dJ ozBulPZCDDWgBwYFK4EEACKhZANiAATjlMJAtKhEPqU/i7MsrgKcK/RmXHC6He7W 0p69+9qFXg2raJ9zvvbKxkiu2ELOYRDAz0utcFTBOIgoUJEzBVmsjZQ7dvFa1BKP Ym7MFAKG3O2espBqXn+audgdHGh5B0I= -----END EC PRIVATE KEY----- kubernetes-client-go-a2dfcab/util/certificate/000077500000000000000000000000001472614177300216375ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/certificate/OWNERS000066400000000000000000000002461472614177300226010ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-auth-certificates-approvers reviewers: - sig-auth-certificates-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/util/certificate/certificate_manager.go000066400000000000000000000674121472614177300261540ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package certificate import ( "context" "crypto/ecdsa" "crypto/elliptic" cryptorand "crypto/rand" "crypto/rsa" "crypto/tls" "crypto/x509" "encoding/pem" "errors" "fmt" "reflect" "sync" "time" "k8s.io/klog/v2" certificates "k8s.io/api/certificates/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/util/cert" "k8s.io/client-go/util/certificate/csr" "k8s.io/client-go/util/keyutil" ) var ( // certificateWaitTimeout controls the amount of time we wait for certificate // approval in one iteration. certificateWaitTimeout = 15 * time.Minute kubeletServingUsagesWithEncipherment = []certificates.KeyUsage{ // https://tools.ietf.org/html/rfc5280#section-4.2.1.3 // // Digital signature allows the certificate to be used to verify // digital signatures used during TLS negotiation. certificates.UsageDigitalSignature, // KeyEncipherment allows the cert/key pair to be used to encrypt // keys, including the symmetric keys negotiated during TLS setup // and used for data transfer. certificates.UsageKeyEncipherment, // ServerAuth allows the cert to be used by a TLS server to // authenticate itself to a TLS client. certificates.UsageServerAuth, } kubeletServingUsagesNoEncipherment = []certificates.KeyUsage{ // https://tools.ietf.org/html/rfc5280#section-4.2.1.3 // // Digital signature allows the certificate to be used to verify // digital signatures used during TLS negotiation. certificates.UsageDigitalSignature, // ServerAuth allows the cert to be used by a TLS server to // authenticate itself to a TLS client. certificates.UsageServerAuth, } DefaultKubeletServingGetUsages = func(privateKey interface{}) []certificates.KeyUsage { switch privateKey.(type) { case *rsa.PrivateKey: return kubeletServingUsagesWithEncipherment default: return kubeletServingUsagesNoEncipherment } } kubeletClientUsagesWithEncipherment = []certificates.KeyUsage{ // https://tools.ietf.org/html/rfc5280#section-4.2.1.3 // // Digital signature allows the certificate to be used to verify // digital signatures used during TLS negotiation. certificates.UsageDigitalSignature, // KeyEncipherment allows the cert/key pair to be used to encrypt // keys, including the symmetric keys negotiated during TLS setup // and used for data transfer. certificates.UsageKeyEncipherment, // ClientAuth allows the cert to be used by a TLS client to // authenticate itself to the TLS server. certificates.UsageClientAuth, } kubeletClientUsagesNoEncipherment = []certificates.KeyUsage{ // https://tools.ietf.org/html/rfc5280#section-4.2.1.3 // // Digital signature allows the certificate to be used to verify // digital signatures used during TLS negotiation. certificates.UsageDigitalSignature, // ClientAuth allows the cert to be used by a TLS client to // authenticate itself to the TLS server. certificates.UsageClientAuth, } DefaultKubeletClientGetUsages = func(privateKey interface{}) []certificates.KeyUsage { switch privateKey.(type) { case *rsa.PrivateKey: return kubeletClientUsagesWithEncipherment default: return kubeletClientUsagesNoEncipherment } } ) // Manager maintains and updates the certificates in use by this certificate // manager. In the background it communicates with the API server to get new // certificates for certificates about to expire. type Manager interface { // Start the API server status sync loop. Start() // Stop the cert manager loop. Stop() // Current returns the currently selected certificate from the // certificate manager, as well as the associated certificate and key data // in PEM format. Current() *tls.Certificate // ServerHealthy returns true if the manager is able to communicate with // the server. This allows a caller to determine whether the cert manager // thinks it can potentially talk to the API server. The cert manager may // be very conservative and only return true if recent communication has // occurred with the server. ServerHealthy() bool } // Config is the set of configuration parameters available for a new Manager. type Config struct { // ClientsetFn will be used to create a clientset for // creating/fetching new certificate requests generated when a key rotation occurs. // The function will never be invoked in parallel. // It is passed the current client certificate if one exists. ClientsetFn ClientsetFunc // Template is the CertificateRequest that will be used as a template for // generating certificate signing requests for all new keys generated as // part of rotation. It follows the same rules as the template parameter of // crypto.x509.CreateCertificateRequest in the Go standard libraries. Template *x509.CertificateRequest // GetTemplate returns the CertificateRequest that will be used as a template for // generating certificate signing requests for all new keys generated as // part of rotation. It follows the same rules as the template parameter of // crypto.x509.CreateCertificateRequest in the Go standard libraries. // If no template is available, nil may be returned, and no certificate will be requested. // If specified, takes precedence over Template. GetTemplate func() *x509.CertificateRequest // SignerName is the name of the certificate signer that should sign certificates // generated by the manager. SignerName string // RequestedCertificateLifetime is the requested lifetime length for certificates generated by the manager. // Optional. // This will set the spec.expirationSeconds field on the CSR. Controlling the lifetime of // the issued certificate is not guaranteed as the signer may choose to ignore the request. RequestedCertificateLifetime *time.Duration // Usages is the types of usages that certificates generated by the manager // can be used for. It is mutually exclusive with GetUsages. Usages []certificates.KeyUsage // GetUsages is dynamic way to get the types of usages that certificates generated by the manager // can be used for. If Usages is not nil, GetUsages has to be nil, vice versa. // It is mutually exclusive with Usages. GetUsages func(privateKey interface{}) []certificates.KeyUsage // CertificateStore is a persistent store where the current cert/key is // kept and future cert/key pairs will be persisted after they are // generated. CertificateStore Store // BootstrapCertificatePEM is the certificate data that will be returned // from the Manager if the CertificateStore doesn't have any cert/key pairs // currently available and has not yet had a chance to get a new cert/key // pair from the API. If the CertificateStore does have a cert/key pair, // this will be ignored. If there is no cert/key pair available in the // CertificateStore, as soon as Start is called, it will request a new // cert/key pair from the CertificateSigningRequestClient. This is intended // to allow the first boot of a component to be initialized using a // generic, multi-use cert/key pair which will be quickly replaced with a // unique cert/key pair. BootstrapCertificatePEM []byte // BootstrapKeyPEM is the key data that will be returned from the Manager // if the CertificateStore doesn't have any cert/key pairs currently // available. If the CertificateStore does have a cert/key pair, this will // be ignored. If the bootstrap cert/key pair are used, they will be // rotated at the first opportunity, possibly well in advance of expiring. // This is intended to allow the first boot of a component to be // initialized using a generic, multi-use cert/key pair which will be // quickly replaced with a unique cert/key pair. BootstrapKeyPEM []byte `datapolicy:"security-key"` // CertificateRotation will record a metric showing the time in seconds // that certificates lived before being rotated. This metric is a histogram // because there is value in keeping a history of rotation cadences. It // allows one to setup monitoring and alerting of unexpected rotation // behavior and track trends in rotation frequency. CertificateRotation Histogram // CertifcateRenewFailure will record a metric that keeps track of // certificate renewal failures. CertificateRenewFailure Counter // Name is an optional string that will be used when writing log output // or returning errors from manager methods. If not set, SignerName will // be used, if SignerName is not set, if Usages includes client auth the // name will be "client auth", otherwise the value will be "server". Name string // Logf is an optional function that log output will be sent to from the // certificate manager. If not set it will use klog.V(2) Logf func(format string, args ...interface{}) } // Store is responsible for getting and updating the current certificate. // Depending on the concrete implementation, the backing store for this // behavior may vary. type Store interface { // Current returns the currently selected certificate, as well as the // associated certificate and key data in PEM format. If the Store doesn't // have a cert/key pair currently, it should return a NoCertKeyError so // that the Manager can recover by using bootstrap certificates to request // a new cert/key pair. Current() (*tls.Certificate, error) // Update accepts the PEM data for the cert/key pair and makes the new // cert/key pair the 'current' pair, that will be returned by future calls // to Current(). Update(cert, key []byte) (*tls.Certificate, error) } // Gauge will record the remaining lifetime of the certificate each time it is // updated. type Gauge interface { Set(float64) } // Histogram will record the time a rotated certificate was used before being // rotated. type Histogram interface { Observe(float64) } // Counter will wrap a counter with labels type Counter interface { Inc() } // NoCertKeyError indicates there is no cert/key currently available. type NoCertKeyError string // ClientsetFunc returns a new clientset for discovering CSR API availability and requesting CSRs. // It is passed the current certificate if one is available and valid. type ClientsetFunc func(current *tls.Certificate) (clientset.Interface, error) func (e *NoCertKeyError) Error() string { return string(*e) } type manager struct { getTemplate func() *x509.CertificateRequest // lastRequestLock guards lastRequestCancel and lastRequest lastRequestLock sync.Mutex lastRequestCancel context.CancelFunc lastRequest *x509.CertificateRequest dynamicTemplate bool signerName string requestedCertificateLifetime *time.Duration getUsages func(privateKey interface{}) []certificates.KeyUsage forceRotation bool certStore Store certificateRotation Histogram certificateRenewFailure Counter // the following variables must only be accessed under certAccessLock certAccessLock sync.RWMutex cert *tls.Certificate serverHealth bool // the clientFn must only be accessed under the clientAccessLock clientAccessLock sync.Mutex clientsetFn ClientsetFunc stopCh chan struct{} stopped bool // Set to time.Now but can be stubbed out for testing now func() time.Time name string logf func(format string, args ...interface{}) } // NewManager returns a new certificate manager. A certificate manager is // responsible for being the authoritative source of certificates in the // Kubelet and handling updates due to rotation. func NewManager(config *Config) (Manager, error) { cert, forceRotation, err := getCurrentCertificateOrBootstrap( config.CertificateStore, config.BootstrapCertificatePEM, config.BootstrapKeyPEM) if err != nil { return nil, err } getTemplate := config.GetTemplate if getTemplate == nil { getTemplate = func() *x509.CertificateRequest { return config.Template } } if config.GetUsages != nil && config.Usages != nil { return nil, errors.New("cannot specify both GetUsages and Usages") } if config.GetUsages == nil && config.Usages == nil { return nil, errors.New("either GetUsages or Usages should be specified") } var getUsages func(interface{}) []certificates.KeyUsage if config.GetUsages != nil { getUsages = config.GetUsages } else { getUsages = func(interface{}) []certificates.KeyUsage { return config.Usages } } m := manager{ stopCh: make(chan struct{}), clientsetFn: config.ClientsetFn, getTemplate: getTemplate, dynamicTemplate: config.GetTemplate != nil, signerName: config.SignerName, requestedCertificateLifetime: config.RequestedCertificateLifetime, getUsages: getUsages, certStore: config.CertificateStore, cert: cert, forceRotation: forceRotation, certificateRotation: config.CertificateRotation, certificateRenewFailure: config.CertificateRenewFailure, now: time.Now, } name := config.Name if len(name) == 0 { name = m.signerName } if len(name) == 0 { usages := getUsages(nil) switch { case hasKeyUsage(usages, certificates.UsageClientAuth): name = string(certificates.UsageClientAuth) default: name = "certificate" } } m.name = name m.logf = config.Logf if m.logf == nil { m.logf = func(format string, args ...interface{}) { klog.V(2).Infof(format, args...) } } return &m, nil } // Current returns the currently selected certificate from the certificate // manager. This can be nil if the manager was initialized without a // certificate and has not yet received one from the // CertificateSigningRequestClient, or if the current cert has expired. func (m *manager) Current() *tls.Certificate { m.certAccessLock.RLock() defer m.certAccessLock.RUnlock() if m.cert != nil && m.cert.Leaf != nil && m.now().After(m.cert.Leaf.NotAfter) { m.logf("%s: Current certificate is expired", m.name) return nil } return m.cert } // ServerHealthy returns true if the cert manager believes the server // is currently alive. func (m *manager) ServerHealthy() bool { m.certAccessLock.RLock() defer m.certAccessLock.RUnlock() return m.serverHealth } // Stop terminates the manager. func (m *manager) Stop() { m.clientAccessLock.Lock() defer m.clientAccessLock.Unlock() if m.stopped { return } close(m.stopCh) m.stopped = true } // Start will start the background work of rotating the certificates. func (m *manager) Start() { // Certificate rotation depends on access to the API server certificate // signing API, so don't start the certificate manager if we don't have a // client. if m.clientsetFn == nil { m.logf("%s: Certificate rotation is not enabled, no connection to the apiserver", m.name) return } m.logf("%s: Certificate rotation is enabled", m.name) templateChanged := make(chan struct{}) go wait.Until(func() { deadline := m.nextRotationDeadline() if sleepInterval := deadline.Sub(m.now()); sleepInterval > 0 { m.logf("%s: Waiting %v for next certificate rotation", m.name, sleepInterval) timer := time.NewTimer(sleepInterval) defer timer.Stop() select { case <-timer.C: // unblock when deadline expires case <-templateChanged: _, lastRequestTemplate := m.getLastRequest() if reflect.DeepEqual(lastRequestTemplate, m.getTemplate()) { // if the template now matches what we last requested, restart the rotation deadline loop return } m.logf("%s: Certificate template changed, rotating", m.name) } } // Don't enter rotateCerts and trigger backoff if we don't even have a template to request yet if m.getTemplate() == nil { return } backoff := wait.Backoff{ Duration: 2 * time.Second, Factor: 2, Jitter: 0.1, Steps: 5, } if err := wait.ExponentialBackoff(backoff, m.rotateCerts); err != nil { utilruntime.HandleError(fmt.Errorf("%s: Reached backoff limit, still unable to rotate certs: %v", m.name, err)) wait.PollInfinite(32*time.Second, m.rotateCerts) } }, time.Second, m.stopCh) if m.dynamicTemplate { go wait.Until(func() { // check if the current template matches what we last requested lastRequestCancel, lastRequestTemplate := m.getLastRequest() if !m.certSatisfiesTemplate() && !reflect.DeepEqual(lastRequestTemplate, m.getTemplate()) { // if the template is different, queue up an interrupt of the rotation deadline loop. // if we've requested a CSR that matches the new template by the time the interrupt is handled, the interrupt is disregarded. if lastRequestCancel != nil { // if we're currently waiting on a submitted request that no longer matches what we want, stop waiting lastRequestCancel() } select { case templateChanged <- struct{}{}: case <-m.stopCh: } } }, time.Second, m.stopCh) } } func getCurrentCertificateOrBootstrap( store Store, bootstrapCertificatePEM []byte, bootstrapKeyPEM []byte) (cert *tls.Certificate, shouldRotate bool, errResult error) { currentCert, err := store.Current() if err == nil { // if the current cert is expired, fall back to the bootstrap cert if currentCert.Leaf != nil && time.Now().Before(currentCert.Leaf.NotAfter) { return currentCert, false, nil } } else { if _, ok := err.(*NoCertKeyError); !ok { return nil, false, err } } if bootstrapCertificatePEM == nil || bootstrapKeyPEM == nil { return nil, true, nil } bootstrapCert, err := tls.X509KeyPair(bootstrapCertificatePEM, bootstrapKeyPEM) if err != nil { return nil, false, err } if len(bootstrapCert.Certificate) < 1 { return nil, false, fmt.Errorf("no cert/key data found") } certs, err := x509.ParseCertificates(bootstrapCert.Certificate[0]) if err != nil { return nil, false, fmt.Errorf("unable to parse certificate data: %v", err) } if len(certs) < 1 { return nil, false, fmt.Errorf("no cert data found") } bootstrapCert.Leaf = certs[0] if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil { utilruntime.HandleError(fmt.Errorf("unable to set the cert/key pair to the bootstrap certificate: %v", err)) } return &bootstrapCert, true, nil } func (m *manager) getClientset() (clientset.Interface, error) { current := m.Current() m.clientAccessLock.Lock() defer m.clientAccessLock.Unlock() return m.clientsetFn(current) } // RotateCerts is exposed for testing only and is not a part of the public interface. // Returns true if it changed the cert, false otherwise. Error is only returned in // exceptional cases. func (m *manager) RotateCerts() (bool, error) { return m.rotateCerts() } // rotateCerts attempts to request a client cert from the server, wait a reasonable // period of time for it to be signed, and then update the cert on disk. If it cannot // retrieve a cert, it will return false. It will only return error in exceptional cases. // This method also keeps track of "server health" by interpreting the responses it gets // from the server on the various calls it makes. // TODO: return errors, have callers handle and log them correctly func (m *manager) rotateCerts() (bool, error) { m.logf("%s: Rotating certificates", m.name) template, csrPEM, keyPEM, privateKey, err := m.generateCSR() if err != nil { utilruntime.HandleError(fmt.Errorf("%s: Unable to generate a certificate signing request: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } return false, nil } // request the client each time clientSet, err := m.getClientset() if err != nil { utilruntime.HandleError(fmt.Errorf("%s: Unable to load a client to request certificates: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } return false, nil } getUsages := m.getUsages if m.getUsages == nil { getUsages = DefaultKubeletClientGetUsages } usages := getUsages(privateKey) // Call the Certificate Signing Request API to get a certificate for the // new private key reqName, reqUID, err := csr.RequestCertificate(clientSet, csrPEM, "", m.signerName, m.requestedCertificateLifetime, usages, privateKey) if err != nil { utilruntime.HandleError(fmt.Errorf("%s: Failed while requesting a signed certificate from the control plane: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } return false, m.updateServerError(err) } ctx, cancel := context.WithTimeout(context.Background(), certificateWaitTimeout) defer cancel() // Once we've successfully submitted a CSR for this template, record that we did so m.setLastRequest(cancel, template) // Wait for the certificate to be signed. This interface and internal timout // is a remainder after the old design using raw watch wrapped with backoff. crtPEM, err := csr.WaitForCertificate(ctx, clientSet, reqName, reqUID) if err != nil { utilruntime.HandleError(fmt.Errorf("%s: certificate request was not signed: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } return false, nil } cert, err := m.certStore.Update(crtPEM, keyPEM) if err != nil { utilruntime.HandleError(fmt.Errorf("%s: Unable to store the new cert/key pair: %v", m.name, err)) if m.certificateRenewFailure != nil { m.certificateRenewFailure.Inc() } return false, nil } if old := m.updateCached(cert); old != nil && m.certificateRotation != nil { m.certificateRotation.Observe(m.now().Sub(old.Leaf.NotBefore).Seconds()) } return true, nil } // Check that the current certificate on disk satisfies the requests from the // current template. // // Note that extra items in the certificate's SAN or orgs that don't exist in // the template will not trigger a renewal. // // Requires certAccessLock to be locked. func (m *manager) certSatisfiesTemplateLocked() bool { if m.cert == nil { return false } if template := m.getTemplate(); template != nil { if template.Subject.CommonName != m.cert.Leaf.Subject.CommonName { m.logf("%s: Current certificate CN (%s) does not match requested CN (%s)", m.name, m.cert.Leaf.Subject.CommonName, template.Subject.CommonName) return false } currentDNSNames := sets.NewString(m.cert.Leaf.DNSNames...) desiredDNSNames := sets.NewString(template.DNSNames...) missingDNSNames := desiredDNSNames.Difference(currentDNSNames) if len(missingDNSNames) > 0 { m.logf("%s: Current certificate is missing requested DNS names %v", m.name, missingDNSNames.List()) return false } currentIPs := sets.NewString() for _, ip := range m.cert.Leaf.IPAddresses { currentIPs.Insert(ip.String()) } desiredIPs := sets.NewString() for _, ip := range template.IPAddresses { desiredIPs.Insert(ip.String()) } missingIPs := desiredIPs.Difference(currentIPs) if len(missingIPs) > 0 { m.logf("%s: Current certificate is missing requested IP addresses %v", m.name, missingIPs.List()) return false } currentOrgs := sets.NewString(m.cert.Leaf.Subject.Organization...) desiredOrgs := sets.NewString(template.Subject.Organization...) missingOrgs := desiredOrgs.Difference(currentOrgs) if len(missingOrgs) > 0 { m.logf("%s: Current certificate is missing requested orgs %v", m.name, missingOrgs.List()) return false } } return true } func (m *manager) certSatisfiesTemplate() bool { m.certAccessLock.RLock() defer m.certAccessLock.RUnlock() return m.certSatisfiesTemplateLocked() } // nextRotationDeadline returns a value for the threshold at which the // current certificate should be rotated, 80%+/-10% of the expiration of the // certificate. func (m *manager) nextRotationDeadline() time.Time { // forceRotation is not protected by locks if m.forceRotation { m.forceRotation = false return m.now() } m.certAccessLock.RLock() defer m.certAccessLock.RUnlock() if !m.certSatisfiesTemplateLocked() { return m.now() } notAfter := m.cert.Leaf.NotAfter totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore)) deadline := m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration)) m.logf("%s: Certificate expiration is %v, rotation deadline is %v", m.name, notAfter, deadline) return deadline } // jitteryDuration uses some jitter to set the rotation threshold so each node // will rotate at approximately 70-90% of the total lifetime of the // certificate. With jitter, if a number of nodes are added to a cluster at // approximately the same time (such as cluster creation time), they won't all // try to rotate certificates at the same time for the rest of the life of the // cluster. // // This function is represented as a variable to allow replacement during testing. var jitteryDuration = func(totalDuration float64) time.Duration { return wait.Jitter(time.Duration(totalDuration), 0.2) - time.Duration(totalDuration*0.3) } // updateCached sets the most recent retrieved cert and returns the old cert. // It also sets the server as assumed healthy. func (m *manager) updateCached(cert *tls.Certificate) *tls.Certificate { m.certAccessLock.Lock() defer m.certAccessLock.Unlock() m.serverHealth = true old := m.cert m.cert = cert return old } // updateServerError takes an error returned by the server and infers // the health of the server based on the error. It will return nil if // the error does not require immediate termination of any wait loops, // and otherwise it will return the error. func (m *manager) updateServerError(err error) error { m.certAccessLock.Lock() defer m.certAccessLock.Unlock() switch { case apierrors.IsUnauthorized(err): // SSL terminating proxies may report this error instead of the master m.serverHealth = true case apierrors.IsUnexpectedServerError(err): // generally indicates a proxy or other load balancer problem, rather than a problem coming // from the master m.serverHealth = false default: // Identify known errors that could be expected for a cert request that // indicate everything is working normally m.serverHealth = apierrors.IsNotFound(err) || apierrors.IsForbidden(err) } return nil } func (m *manager) generateCSR() (template *x509.CertificateRequest, csrPEM []byte, keyPEM []byte, key interface{}, err error) { // Generate a new private key. privateKey, err := ecdsa.GenerateKey(elliptic.P256(), cryptorand.Reader) if err != nil { return nil, nil, nil, nil, fmt.Errorf("%s: unable to generate a new private key: %v", m.name, err) } der, err := x509.MarshalECPrivateKey(privateKey) if err != nil { return nil, nil, nil, nil, fmt.Errorf("%s: unable to marshal the new key to DER: %v", m.name, err) } keyPEM = pem.EncodeToMemory(&pem.Block{Type: keyutil.ECPrivateKeyBlockType, Bytes: der}) template = m.getTemplate() if template == nil { return nil, nil, nil, nil, fmt.Errorf("%s: unable to create a csr, no template available", m.name) } csrPEM, err = cert.MakeCSRFromTemplate(privateKey, template) if err != nil { return nil, nil, nil, nil, fmt.Errorf("%s: unable to create a csr from the private key: %v", m.name, err) } return template, csrPEM, keyPEM, privateKey, nil } func (m *manager) getLastRequest() (context.CancelFunc, *x509.CertificateRequest) { m.lastRequestLock.Lock() defer m.lastRequestLock.Unlock() return m.lastRequestCancel, m.lastRequest } func (m *manager) setLastRequest(cancel context.CancelFunc, r *x509.CertificateRequest) { m.lastRequestLock.Lock() defer m.lastRequestLock.Unlock() m.lastRequestCancel = cancel m.lastRequest = r } func hasKeyUsage(usages []certificates.KeyUsage, usage certificates.KeyUsage) bool { for _, u := range usages { if u == usage { return true } } return false } kubernetes-client-go-a2dfcab/util/certificate/certificate_manager_test.go000066400000000000000000001266221472614177300272120ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package certificate import ( "bytes" "crypto/tls" "crypto/x509" "crypto/x509/pkix" "fmt" "net" "strings" "testing" "time" certificatesv1 "k8s.io/api/certificates/v1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" certificatesclient "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" clienttesting "k8s.io/client-go/testing" netutils "k8s.io/utils/net" ) var storeCertData = newCertificateData(`-----BEGIN CERTIFICATE----- MIICRzCCAfGgAwIBAgIJALMb7ecMIk3MMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNV BAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNVBAcMBkxvbmRvbjEYMBYGA1UE CgwPR2xvYmFsIFNlY3VyaXR5MRYwFAYDVQQLDA1JVCBEZXBhcnRtZW50MRswGQYD VQQDDBJ0ZXN0LWNlcnRpZmljYXRlLTAwIBcNMTcwNDI2MjMyNjUyWhgPMjExNzA0 MDIyMzI2NTJaMH4xCzAJBgNVBAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNV BAcMBkxvbmRvbjEYMBYGA1UECgwPR2xvYmFsIFNlY3VyaXR5MRYwFAYDVQQLDA1J VCBEZXBhcnRtZW50MRswGQYDVQQDDBJ0ZXN0LWNlcnRpZmljYXRlLTAwXDANBgkq hkiG9w0BAQEFAANLADBIAkEAtBMa7NWpv3BVlKTCPGO/LEsguKqWHBtKzweMY2CV tAL1rQm913huhxF9w+ai76KQ3MHK5IVnLJjYYA5MzP2H5QIDAQABo1AwTjAdBgNV HQ4EFgQU22iy8aWkNSxv0nBxFxerfsvnZVMwHwYDVR0jBBgwFoAU22iy8aWkNSxv 0nBxFxerfsvnZVMwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAANBAEOefGbV NcHxklaW06w6OBYJPwpIhCVozC1qdxGX1dg8VkEKzjOzjgqVD30m59OFmSlBmHsl nkVA6wyOSDYBf3o= -----END CERTIFICATE-----`, `-----BEGIN RSA PRIVATE KEY----- MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtBMa7NWpv3BVlKTC PGO/LEsguKqWHBtKzweMY2CVtAL1rQm913huhxF9w+ai76KQ3MHK5IVnLJjYYA5M zP2H5QIDAQABAkAS9BfXab3OKpK3bIgNNyp+DQJKrZnTJ4Q+OjsqkpXvNltPJosf G8GsiKu/vAt4HGqI3eU77NvRI+mL4MnHRmXBAiEA3qM4FAtKSRBbcJzPxxLEUSwg XSCcosCktbkXvpYrS30CIQDPDxgqlwDEJQ0uKuHkZI38/SPWWqfUmkecwlbpXABK iQIgZX08DA8VfvcA5/Xj1Zjdey9FVY6POLXen6RPiabE97UCICp6eUW7ht+2jjar e35EltCRCjoejRHTuN9TC0uCoVipAiAXaJIx/Q47vGwiw6Y8KXsNU6y54gTbOSxX 54LzHNk/+Q== -----END RSA PRIVATE KEY-----`) var storeTwoCertsData = newCertificateData(`-----BEGIN CERTIFICATE----- MIIDfTCCAyegAwIBAgIUFBl4gUoqZDP/wUJDn37/VJ9upD0wDQYJKoZIhvcNAQEF BQAwfjELMAkGA1UEBhMCR0IxDzANBgNVBAgMBkxvbmRvbjEPMA0GA1UEBwwGTG9u ZG9uMRgwFgYDVQQKDA9HbG9iYWwgU2VjdXJpdHkxFjAUBgNVBAsMDUlUIERlcGFy dG1lbnQxGzAZBgNVBAMMEnRlc3QtY2VydGlmaWNhdGUtMDAeFw0yMDAzMDIxOTM3 MDBaFw0yMTAzMDIxOTM3MDBaMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2Fs aWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEdMBsGA1UEChMURXhhbXBs ZSBDb21wYW55LCBMTEMxEzARBgNVBAsTCk9wZXJhdGlvbnMxGDAWBgNVBAMTD3d3 dy5leGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMiR DNpmwTICFr+P16fKDVjbNCzSjWq+MTu8vAfS6GrLpBTUEe+6zVqxUza/fZenxo8O ucV2JTUv5J4nkT/vG6Qm/mToVJ4vQzLQ5jR2w7v/7cf3oWCwTAKUafgo6/Ga95gn lQB3+Fd8sy96zfFr/7wDSMPPueR5kSFax+cEd30wwv5O7tWj0ro1mrxLssBlwPaR ZlzkkvxBYTzWCqKZsWktQlXciqlFSos0ua7uvwqKN5CTxfC/xoyMxx9kfZm7BzPN ZDqYMFw2HiWdEiLzI4jj+Gh0D5t47tnvlpUMihcX9x0jP6/+hnfcQ8GAP2jR/BXY 5YZRRY70LiCXPevlRAECAwEAAaOBqTCBpjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0l BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYE FOoiE+kh7gGDpyx0KZuCc1lrlTRKMB8GA1UdIwQYMBaAFNtosvGlpDUsb9JwcRcX q37L52VTMCcGA1UdEQQgMB6CC2V4YW1wbGUuY29tgg93d3cuZXhhbXBsZS5jb20w DQYJKoZIhvcNAQEFBQADQQAw6mxQONAD2sivfzIf1eDFd6LU7aE+MnkdlEQjjPCi tlUITFIuO3XavISupP6V9wE0b1wTF1pTlVWArf/0YQXs -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIICRzCCAfGgAwIBAgIJALMb7ecMIk3MMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNV BAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNVBAcMBkxvbmRvbjEYMBYGA1UE CgwPR2xvYmFsIFNlY3VyaXR5MRYwFAYDVQQLDA1JVCBEZXBhcnRtZW50MRswGQYD VQQDDBJ0ZXN0LWNlcnRpZmljYXRlLTAwIBcNMTcwNDI2MjMyNjUyWhgPMjExNzA0 MDIyMzI2NTJaMH4xCzAJBgNVBAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNV BAcMBkxvbmRvbjEYMBYGA1UECgwPR2xvYmFsIFNlY3VyaXR5MRYwFAYDVQQLDA1J VCBEZXBhcnRtZW50MRswGQYDVQQDDBJ0ZXN0LWNlcnRpZmljYXRlLTAwXDANBgkq hkiG9w0BAQEFAANLADBIAkEAtBMa7NWpv3BVlKTCPGO/LEsguKqWHBtKzweMY2CV tAL1rQm913huhxF9w+ai76KQ3MHK5IVnLJjYYA5MzP2H5QIDAQABo1AwTjAdBgNV HQ4EFgQU22iy8aWkNSxv0nBxFxerfsvnZVMwHwYDVR0jBBgwFoAU22iy8aWkNSxv 0nBxFxerfsvnZVMwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAANBAEOefGbV NcHxklaW06w6OBYJPwpIhCVozC1qdxGX1dg8VkEKzjOzjgqVD30m59OFmSlBmHsl nkVA6wyOSDYBf3o= -----END CERTIFICATE-----`, `-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAyJEM2mbBMgIWv4/Xp8oNWNs0LNKNar4xO7y8B9LoasukFNQR 77rNWrFTNr99l6fGjw65xXYlNS/knieRP+8bpCb+ZOhUni9DMtDmNHbDu//tx/eh YLBMApRp+Cjr8Zr3mCeVAHf4V3yzL3rN8Wv/vANIw8+55HmRIVrH5wR3fTDC/k7u 1aPSujWavEuywGXA9pFmXOSS/EFhPNYKopmxaS1CVdyKqUVKizS5ru6/Coo3kJPF 8L/GjIzHH2R9mbsHM81kOpgwXDYeJZ0SIvMjiOP4aHQPm3ju2e+WlQyKFxf3HSM/ r/6Gd9xDwYA/aNH8FdjlhlFFjvQuIJc96+VEAQIDAQABAoIBAQCc6R3tH8a1oPy7 EYXeNy0J/zRqfK82e2V5HsbcOByssHTF9sOxkatm8KPxiQ5wv0mQUiz0VuH1Imrx cHMqWZ5+ZiNQPpM0zjT8ZII1OVUYl7knYIxYYJSW0BW3mAw/EMXzu8POgg1AJMbq tmC4J44DQW6EAtej75ejSKpsCgqRXVoi3iEk9eMLHUFIHqkzl/aKEc7k/P+eKo2h PHsDoKZdmOmZA3OKzw61xAqJICYyplRHatQcEiWJgnLer+9qvUGc4k8eqAYeDGm7 T78XcUvsXOug2GClVWGZu1quFhf7MxjzFfOjz4q9HwPex7X6nQL0IX2hzMECkaMC iUMZGGEhAoGBAOLY1KSNOjvt54MkKznI8stHkx8V73c0Nxbz5Rj8gM0Gwk1FWVas jgoAbKPQ2UL/RglLX1JZvztKvNuWSEeZGqggDvhzB38leiEH+OY7DZ7a0c5sWwdF CpcT1mJb91ww5xEC09WO8Oq3i5olVBBivOl5EjwKHOQn2TUh2OSLhqf/AoGBAOJX mxqdTEUwFU9ecsAOK9labjI7mA5so0vIq8eq1Q670NFszChfSMKJAqQ90N1LEu9z L0f6CBXYCn7sMmOlF4CKE+u2/ieJfD1OkKq7RwEd3pi4X3xtAlcPK8F/QprmQWo0 wi33BDBb4zYkuQB6Q5RYIV2di7k+HBpoQPottBP/AoGAIB4xJUc1qoyJjeDOGfVg ovV0WB9j8026Sw6nLj16Aw1k70nVV1dBGRtsRllomXrJMMGyMleworV3PePuQezk gE9hrz2iHxdwTkLxs69Cw24Z7I8c6E+XK0LMxMpeoHfwD1GGKqN9as4n/uAwIc3J D4lr0oJgCtG1iDdNnTZAD4MCgYAkOpWPCwJ8SJgAnkOLzjjij4D39WX/WRBCPxqP 2R5FP3bLLrj29Vl2GewcUfCumyeqwCsfQDwvEueLLU9bd79tSayqnB3OQklqnrq1 OUjCOv+4Pjq6ddBcEweT70S/+n8Z+tvh85nuC6cwsWwTUX6jrf+ZNnB49CIXb/yG ju42DQKBgAPtbB/ON3+GtnSTHBSY6HwZvGJrBDicrXmr1U9zuA8yYxv8qaRXZkpn 2cpLLvO2MJutwXMYf+T3x1ZCFMkE56pOswSTGrCQWRl3hOiJayLHQyAOYHPnYeZB 78iRJPUZ0biEQUZQ62GBxWkcB0qkxa9m759h/TvLwvV0RrO5Uzd0 -----END RSA PRIVATE KEY-----`) var expiredStoreCertData = newCertificateData(`-----BEGIN CERTIFICATE----- MIIBFzCBwgIJALhygXnxXmN1MA0GCSqGSIb3DQEBCwUAMBMxETAPBgNVBAMMCGhv c3QtMTIzMB4XDTE4MTEwNDIzNTc1NFoXDTE4MTEwNTIzNTc1NFowEzERMA8GA1UE AwwIaG9zdC0xMjMwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAtBMa7NWpv3BVlKTC PGO/LEsguKqWHBtKzweMY2CVtAL1rQm913huhxF9w+ai76KQ3MHK5IVnLJjYYA5M zP2H5QIDAQABMA0GCSqGSIb3DQEBCwUAA0EAN2DPFUtCzqnidL+5nh+46Sk6dkMI T5DD11UuuIjZusKvThsHKVCIsyJ2bDo7cTbI+/nklLRP+FcC2wESFUgXbA== -----END CERTIFICATE-----`, `-----BEGIN RSA PRIVATE KEY----- MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtBMa7NWpv3BVlKTC PGO/LEsguKqWHBtKzweMY2CVtAL1rQm913huhxF9w+ai76KQ3MHK5IVnLJjYYA5M zP2H5QIDAQABAkAS9BfXab3OKpK3bIgNNyp+DQJKrZnTJ4Q+OjsqkpXvNltPJosf G8GsiKu/vAt4HGqI3eU77NvRI+mL4MnHRmXBAiEA3qM4FAtKSRBbcJzPxxLEUSwg XSCcosCktbkXvpYrS30CIQDPDxgqlwDEJQ0uKuHkZI38/SPWWqfUmkecwlbpXABK iQIgZX08DA8VfvcA5/Xj1Zjdey9FVY6POLXen6RPiabE97UCICp6eUW7ht+2jjar e35EltCRCjoejRHTuN9TC0uCoVipAiAXaJIx/Q47vGwiw6Y8KXsNU6y54gTbOSxX 54LzHNk/+Q== -----END RSA PRIVATE KEY-----`) var bootstrapCertData = newCertificateData( `-----BEGIN CERTIFICATE----- MIICRzCCAfGgAwIBAgIJANXr+UzRFq4TMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNV BAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNVBAcMBkxvbmRvbjEYMBYGA1UE CgwPR2xvYmFsIFNlY3VyaXR5MRYwFAYDVQQLDA1JVCBEZXBhcnRtZW50MRswGQYD VQQDDBJ0ZXN0LWNlcnRpZmljYXRlLTEwIBcNMTcwNDI2MjMyNzMyWhgPMjExNzA0 MDIyMzI3MzJaMH4xCzAJBgNVBAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNV BAcMBkxvbmRvbjEYMBYGA1UECgwPR2xvYmFsIFNlY3VyaXR5MRYwFAYDVQQLDA1J VCBEZXBhcnRtZW50MRswGQYDVQQDDBJ0ZXN0LWNlcnRpZmljYXRlLTEwXDANBgkq hkiG9w0BAQEFAANLADBIAkEAqvbkN4RShH1rL37JFp4fZPnn0JUhVWWsrP8NOomJ pXdBDUMGWuEQIsZ1Gf9JrCQLu6ooRyHSKRFpAVbMQ3ABJwIDAQABo1AwTjAdBgNV HQ4EFgQUEGBc6YYheEZ/5MhwqSUYYPYRj2MwHwYDVR0jBBgwFoAUEGBc6YYheEZ/ 5MhwqSUYYPYRj2MwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAANBAIyNmznk 5dgJY52FppEEcfQRdS5k4XFPc22SHPcz77AHf5oWZ1WG9VezOZZPp8NCiFDDlDL8 yma33a5eMyTjLD8= -----END CERTIFICATE-----`, `-----BEGIN RSA PRIVATE KEY----- MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqvbkN4RShH1rL37J Fp4fZPnn0JUhVWWsrP8NOomJpXdBDUMGWuEQIsZ1Gf9JrCQLu6ooRyHSKRFpAVbM Q3ABJwIDAQABAkBC2OBpGLMPHN8BJijIUDFkURakBvuOoX+/8MYiYk7QxEmfLCk6 L6r+GLNFMfXwXcBmXtMKfZKAIKutKf098JaBAiEA10azfqt3G/5owrNA00plSyT6 ZmHPzY9Uq1p/QTR/uOcCIQDLTkfBkLHm0UKeobbO/fSm6ZflhyBRDINy4FvwmZMt wQIgYV/tmQJeIh91q3wBepFQOClFykG8CTMoDUol/YyNqUkCIHfp6Rr7fGL3JIMq QQgf9DCK8SPZqq8DYXjdan0kKBJBAiEAyDb+07o2gpggo8BYUKSaiRCiyXfaq87f eVqgpBq/QN4= -----END RSA PRIVATE KEY-----`) var apiServerCertData = newCertificateData( `-----BEGIN CERTIFICATE----- MIICRzCCAfGgAwIBAgIJAIydTIADd+yqMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNV BAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNVBAcMBkxvbmRvbjEYMBYGA1UE CgwPR2xvYmFsIFNlY3VyaXR5MRYwFAYDVQQLDA1JVCBEZXBhcnRtZW50MRswGQYD VQQDDBJ0ZXN0LWNlcnRpZmljYXRlLTIwIBcNMTcwNDI2MjMyNDU4WhgPMjExNzA0 MDIyMzI0NThaMH4xCzAJBgNVBAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNV BAcMBkxvbmRvbjEYMBYGA1UECgwPR2xvYmFsIFNlY3VyaXR5MRYwFAYDVQQLDA1J VCBEZXBhcnRtZW50MRswGQYDVQQDDBJ0ZXN0LWNlcnRpZmljYXRlLTIwXDANBgkq hkiG9w0BAQEFAANLADBIAkEAuiRet28DV68Dk4A8eqCaqgXmymamUEjW/DxvIQqH 3lbhtm8BwSnS9wUAajSLSWiq3fci2RbRgaSPjUrnbOHCLQIDAQABo1AwTjAdBgNV HQ4EFgQU0vhI4OPGEOqT+VAWwxdhVvcmgdIwHwYDVR0jBBgwFoAU0vhI4OPGEOqT +VAWwxdhVvcmgdIwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAANBALNeJGDe nV5cXbp9W1bC12Tc8nnNXn4ypLE2JTQAvyp51zoZ8hQoSnRVx/VCY55Yu+br8gQZ +tW+O/PoE7B3tuY= -----END CERTIFICATE-----`, `-----BEGIN RSA PRIVATE KEY----- MIIBVgIBADANBgkqhkiG9w0BAQEFAASCAUAwggE8AgEAAkEAuiRet28DV68Dk4A8 eqCaqgXmymamUEjW/DxvIQqH3lbhtm8BwSnS9wUAajSLSWiq3fci2RbRgaSPjUrn bOHCLQIDAQABAkEArDR1g9IqD3aUImNikDgAngbzqpAokOGyMoxeavzpEaFOgCzi gi7HF7yHRmZkUt8CzdEvnHSqRjFuaaB0gGA+AQIhAOc8Z1h8ElLRSqaZGgI3jCTp Izx9HNY//U5NGrXD2+ttAiEAzhOqkqI4+nDab7FpiD7MXI6fO549mEXeVBPvPtsS OcECIQCIfkpOm+ZBBpO3JXaJynoqK4gGI6ALA/ik6LSUiIlfPQIhAISjd9hlfZME bDQT1r8Q3Gx+h9LRqQeHgPBQ3F5ylqqBAiBaJ0hkYvrIdWxNlcLqD3065bJpHQ4S WQkuZUQN1M/Xvg== -----END RSA PRIVATE KEY-----`) type certificateData struct { keyPEM []byte certificatePEM []byte certificate *tls.Certificate } func newCertificateData(certificatePEM string, keyPEM string) *certificateData { certificate, err := tls.X509KeyPair([]byte(certificatePEM), []byte(keyPEM)) if err != nil { panic(fmt.Sprintf("Unable to initialize certificate: %v", err)) } certs, err := x509.ParseCertificates(certificate.Certificate[0]) if err != nil { panic(fmt.Sprintf("Unable to initialize certificate leaf: %v", err)) } certificate.Leaf = certs[0] return &certificateData{ keyPEM: []byte(keyPEM), certificatePEM: []byte(certificatePEM), certificate: &certificate, } } func TestNewManagerNoRotation(t *testing.T) { store := &fakeStore{ cert: storeCertData.certificate, } if _, err := NewManager(&Config{ Template: &x509.CertificateRequest{}, Usages: []certificatesv1.KeyUsage{}, CertificateStore: store, }); err != nil { t.Fatalf("Failed to initialize the certificate manager: %v", err) } } type metricMock struct { calls int lastValue float64 } func (g *metricMock) Set(v float64) { g.calls++ g.lastValue = v } func (g *metricMock) Observe(v float64) { g.calls++ g.lastValue = v } func TestSetRotationDeadline(t *testing.T) { defer func(original func(float64) time.Duration) { jitteryDuration = original }(jitteryDuration) now := time.Now() testCases := []struct { name string notBefore time.Time notAfter time.Time shouldRotate bool }{ {"just issued, still good", now.Add(-1 * time.Hour), now.Add(99 * time.Hour), false}, {"half way expired, still good", now.Add(-24 * time.Hour), now.Add(24 * time.Hour), false}, {"mostly expired, still good", now.Add(-69 * time.Hour), now.Add(31 * time.Hour), false}, {"just about expired, should rotate", now.Add(-91 * time.Hour), now.Add(9 * time.Hour), true}, {"nearly expired, should rotate", now.Add(-99 * time.Hour), now.Add(1 * time.Hour), true}, {"already expired, should rotate", now.Add(-10 * time.Hour), now.Add(-1 * time.Hour), true}, {"long duration", now.Add(-6 * 30 * 24 * time.Hour), now.Add(6 * 30 * 24 * time.Hour), true}, {"short duration", now.Add(-30 * time.Second), now.Add(30 * time.Second), true}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { m := manager{ cert: &tls.Certificate{ Leaf: &x509.Certificate{ NotBefore: tc.notBefore, NotAfter: tc.notAfter, }, }, getTemplate: func() *x509.CertificateRequest { return &x509.CertificateRequest{} }, now: func() time.Time { return now }, logf: t.Logf, } jitteryDuration = func(float64) time.Duration { return time.Duration(float64(tc.notAfter.Sub(tc.notBefore)) * 0.7) } lowerBound := tc.notBefore.Add(time.Duration(float64(tc.notAfter.Sub(tc.notBefore)) * 0.7)) deadline := m.nextRotationDeadline() if !deadline.Equal(lowerBound) { t.Errorf("For notBefore %v, notAfter %v, the rotationDeadline %v should be %v.", tc.notBefore, tc.notAfter, deadline, lowerBound) } }) } } func TestCertSatisfiesTemplate(t *testing.T) { testCases := []struct { name string cert *x509.Certificate template *x509.CertificateRequest shouldSatisfy bool }{ { name: "No certificate, no template", cert: nil, template: nil, shouldSatisfy: false, }, { name: "No certificate", cert: nil, template: &x509.CertificateRequest{}, shouldSatisfy: false, }, { name: "No template", cert: &x509.Certificate{ Subject: pkix.Name{ CommonName: "system:node:fake-node-name", }, }, template: nil, shouldSatisfy: true, }, { name: "Mismatched common name", cert: &x509.Certificate{ Subject: pkix.Name{ CommonName: "system:node:fake-node-name-2", }, }, template: &x509.CertificateRequest{ Subject: pkix.Name{ CommonName: "system:node:fake-node-name", }, }, shouldSatisfy: false, }, { name: "Missing orgs in certificate", cert: &x509.Certificate{ Subject: pkix.Name{ Organization: []string{"system:nodes"}, }, }, template: &x509.CertificateRequest{ Subject: pkix.Name{ Organization: []string{"system:nodes", "foobar"}, }, }, shouldSatisfy: false, }, { name: "Extra orgs in certificate", cert: &x509.Certificate{ Subject: pkix.Name{ Organization: []string{"system:nodes", "foobar"}, }, }, template: &x509.CertificateRequest{ Subject: pkix.Name{ Organization: []string{"system:nodes"}, }, }, shouldSatisfy: true, }, { name: "Missing DNS names in certificate", cert: &x509.Certificate{ Subject: pkix.Name{}, DNSNames: []string{"foo.example.com"}, }, template: &x509.CertificateRequest{ Subject: pkix.Name{}, DNSNames: []string{"foo.example.com", "bar.example.com"}, }, shouldSatisfy: false, }, { name: "Extra DNS names in certificate", cert: &x509.Certificate{ Subject: pkix.Name{}, DNSNames: []string{"foo.example.com", "bar.example.com"}, }, template: &x509.CertificateRequest{ Subject: pkix.Name{}, DNSNames: []string{"foo.example.com"}, }, shouldSatisfy: true, }, { name: "Missing IP addresses in certificate", cert: &x509.Certificate{ Subject: pkix.Name{}, IPAddresses: []net.IP{netutils.ParseIPSloppy("192.168.1.1")}, }, template: &x509.CertificateRequest{ Subject: pkix.Name{}, IPAddresses: []net.IP{netutils.ParseIPSloppy("192.168.1.1"), netutils.ParseIPSloppy("192.168.1.2")}, }, shouldSatisfy: false, }, { name: "Extra IP addresses in certificate", cert: &x509.Certificate{ Subject: pkix.Name{}, IPAddresses: []net.IP{netutils.ParseIPSloppy("192.168.1.1"), netutils.ParseIPSloppy("192.168.1.2")}, }, template: &x509.CertificateRequest{ Subject: pkix.Name{}, IPAddresses: []net.IP{netutils.ParseIPSloppy("192.168.1.1")}, }, shouldSatisfy: true, }, { name: "Matching certificate", cert: &x509.Certificate{ Subject: pkix.Name{ CommonName: "system:node:fake-node-name", Organization: []string{"system:nodes"}, }, DNSNames: []string{"foo.example.com"}, IPAddresses: []net.IP{netutils.ParseIPSloppy("192.168.1.1")}, }, template: &x509.CertificateRequest{ Subject: pkix.Name{ CommonName: "system:node:fake-node-name", Organization: []string{"system:nodes"}, }, DNSNames: []string{"foo.example.com"}, IPAddresses: []net.IP{netutils.ParseIPSloppy("192.168.1.1")}, }, shouldSatisfy: true, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { var tlsCert *tls.Certificate if tc.cert != nil { tlsCert = &tls.Certificate{ Leaf: tc.cert, } } m := manager{ cert: tlsCert, getTemplate: func() *x509.CertificateRequest { return tc.template }, now: time.Now, logf: t.Logf, } result := m.certSatisfiesTemplate() if result != tc.shouldSatisfy { t.Errorf("cert: %+v, template: %+v, certSatisfiesTemplate returned %v, want %v", m.cert, tc.template, result, tc.shouldSatisfy) } }) } } func TestRotateCertCreateCSRError(t *testing.T) { now := time.Now() m := manager{ cert: &tls.Certificate{ Leaf: &x509.Certificate{ NotBefore: now.Add(-2 * time.Hour), NotAfter: now.Add(-1 * time.Hour), }, }, getTemplate: func() *x509.CertificateRequest { return &x509.CertificateRequest{} }, clientsetFn: func(_ *tls.Certificate) (clientset.Interface, error) { return newClientset(fakeClient{failureType: createError}), nil }, now: func() time.Time { return now }, logf: t.Logf, } if success, err := m.rotateCerts(); success { t.Errorf("Got success from 'rotateCerts', wanted failure") } else if err != nil { t.Errorf("Got error %v from 'rotateCerts', wanted no error.", err) } } func TestRotateCertWaitingForResultError(t *testing.T) { now := time.Now() m := manager{ cert: &tls.Certificate{ Leaf: &x509.Certificate{ NotBefore: now.Add(-2 * time.Hour), NotAfter: now.Add(-1 * time.Hour), }, }, getTemplate: func() *x509.CertificateRequest { return &x509.CertificateRequest{} }, clientsetFn: func(_ *tls.Certificate) (clientset.Interface, error) { return newClientset(fakeClient{failureType: watchError}), nil }, now: func() time.Time { return now }, logf: t.Logf, } defer func(t time.Duration) { certificateWaitTimeout = t }(certificateWaitTimeout) certificateWaitTimeout = 1 * time.Millisecond if success, err := m.rotateCerts(); success { t.Errorf("Got success from 'rotateCerts', wanted failure.") } else if err != nil { t.Errorf("Got error %v from 'rotateCerts', wanted no error.", err) } } func TestNewManagerBootstrap(t *testing.T) { store := &fakeStore{} var cm Manager cm, err := NewManager(&Config{ Template: &x509.CertificateRequest{}, Usages: []certificatesv1.KeyUsage{}, CertificateStore: store, BootstrapCertificatePEM: bootstrapCertData.certificatePEM, BootstrapKeyPEM: bootstrapCertData.keyPEM, }) if err != nil { t.Fatalf("Failed to initialize the certificate manager: %v", err) } cert := cm.Current() if cert == nil { t.Errorf("Certificate was nil, expected something.") } if m, ok := cm.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else if !m.forceRotation { t.Errorf("Expected rotation should happen during bootstrap, but it won't.") } } func TestNewManagerNoBootstrap(t *testing.T) { now := time.Now() cert, err := tls.X509KeyPair(storeCertData.certificatePEM, storeCertData.keyPEM) if err != nil { t.Fatalf("Unable to initialize a certificate: %v", err) } cert.Leaf = &x509.Certificate{ NotBefore: now.Add(-24 * time.Hour), NotAfter: now.Add(24 * time.Hour), } store := &fakeStore{ cert: &cert, } cm, err := NewManager(&Config{ Template: &x509.CertificateRequest{}, Usages: []certificatesv1.KeyUsage{}, CertificateStore: store, BootstrapCertificatePEM: bootstrapCertData.certificatePEM, BootstrapKeyPEM: bootstrapCertData.keyPEM, }) if err != nil { t.Fatalf("Failed to initialize the certificate manager: %v", err) } currentCert := cm.Current() if currentCert == nil { t.Errorf("Certificate was nil, expected something.") } if m, ok := cm.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { if m.forceRotation { t.Errorf("Expected rotation should not happen during bootstrap, but it won't.") } } } func TestGetCurrentCertificateOrBootstrap(t *testing.T) { testCases := []struct { description string storeCert *tls.Certificate bootstrapCertData []byte bootstrapKeyData []byte expectedCert *tls.Certificate expectedShouldRotate bool expectedErrMsg string }{ { "return cert from store", storeCertData.certificate, nil, nil, storeCertData.certificate, false, "", }, { "no cert in store and no bootstrap cert", nil, nil, nil, nil, true, "", }, } for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { store := &fakeStore{ cert: tc.storeCert, } certResult, shouldRotate, err := getCurrentCertificateOrBootstrap( store, tc.bootstrapCertData, tc.bootstrapKeyData) if certResult == nil || certResult.Certificate == nil || tc.expectedCert == nil { if certResult != nil && tc.expectedCert != nil { t.Errorf("Got certificate %v, wanted %v", certResult, tc.expectedCert) } } else { if !certificatesEqual(certResult, tc.expectedCert) { t.Errorf("Got certificate %v, wanted %v", certResult, tc.expectedCert) } } if shouldRotate != tc.expectedShouldRotate { t.Errorf("Got shouldRotate %t, wanted %t", shouldRotate, tc.expectedShouldRotate) } if err == nil { if tc.expectedErrMsg != "" { t.Errorf("Got err %v, wanted %q", err, tc.expectedErrMsg) } } else { if tc.expectedErrMsg == "" || !strings.Contains(err.Error(), tc.expectedErrMsg) { t.Errorf("Got err %v, wanted %q", err, tc.expectedErrMsg) } } }) } } func TestInitializeCertificateSigningRequestClient(t *testing.T) { var nilCertificate = &certificateData{} testCases := []struct { description string storeCert *certificateData bootstrapCert *certificateData apiCert *certificateData noV1 bool noV1beta1 bool expectedCertBeforeStart *certificateData expectedCertAfterStart *certificateData }{ { description: "No current certificate, no bootstrap certificate", storeCert: nilCertificate, bootstrapCert: nilCertificate, apiCert: apiServerCertData, expectedCertBeforeStart: nilCertificate, expectedCertAfterStart: apiServerCertData, }, { description: "No current certificate, no bootstrap certificate, no v1 API", storeCert: nilCertificate, bootstrapCert: nilCertificate, apiCert: apiServerCertData, expectedCertBeforeStart: nilCertificate, expectedCertAfterStart: apiServerCertData, noV1: true, }, { description: "No current certificate, no bootstrap certificate, no v1beta1 API", storeCert: nilCertificate, bootstrapCert: nilCertificate, apiCert: apiServerCertData, expectedCertBeforeStart: nilCertificate, expectedCertAfterStart: apiServerCertData, noV1beta1: true, }, { description: "No current certificate, bootstrap certificate", storeCert: nilCertificate, bootstrapCert: bootstrapCertData, apiCert: apiServerCertData, expectedCertBeforeStart: bootstrapCertData, expectedCertAfterStart: apiServerCertData, }, { description: "Current certificate, no bootstrap certificate", storeCert: storeCertData, bootstrapCert: nilCertificate, apiCert: apiServerCertData, expectedCertBeforeStart: storeCertData, expectedCertAfterStart: storeCertData, }, { description: "Current certificate, bootstrap certificate", storeCert: storeCertData, bootstrapCert: bootstrapCertData, apiCert: apiServerCertData, expectedCertBeforeStart: storeCertData, expectedCertAfterStart: storeCertData, }, { description: "Current certificate expired, no bootstrap certificate", storeCert: expiredStoreCertData, bootstrapCert: nilCertificate, apiCert: apiServerCertData, expectedCertBeforeStart: nil, expectedCertAfterStart: apiServerCertData, }, } for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { certificateStore := &fakeStore{ cert: tc.storeCert.certificate, } certificateManager, err := NewManager(&Config{ Template: &x509.CertificateRequest{ Subject: pkix.Name{ Organization: []string{"system:nodes"}, CommonName: "system:node:fake-node-name", }, }, SignerName: certificatesv1.KubeAPIServerClientSignerName, Usages: []certificatesv1.KeyUsage{ certificatesv1.UsageDigitalSignature, certificatesv1.UsageKeyEncipherment, certificatesv1.UsageClientAuth, }, CertificateStore: certificateStore, BootstrapCertificatePEM: tc.bootstrapCert.certificatePEM, BootstrapKeyPEM: tc.bootstrapCert.keyPEM, ClientsetFn: func(_ *tls.Certificate) (clientset.Interface, error) { return newClientset(fakeClient{ noV1: tc.noV1, noV1beta1: tc.noV1beta1, certificatePEM: tc.apiCert.certificatePEM, }), nil }, }) if err != nil { t.Errorf("Got %v, wanted no error.", err) } certificate := certificateManager.Current() if tc.expectedCertBeforeStart == nil { if certificate != nil { t.Errorf("Expected certificate to be nil, was %s", certificate.Leaf.NotAfter) } } else { if !certificatesEqual(certificate, tc.expectedCertBeforeStart.certificate) { t.Errorf("Got %v, wanted %v", certificateString(certificate), certificateString(tc.expectedCertBeforeStart.certificate)) } } if m, ok := certificateManager.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { if m.forceRotation { if success, err := m.rotateCerts(); !success { t.Errorf("Got failure from 'rotateCerts', wanted success.") } else if err != nil { t.Errorf("Got error %v, expected none.", err) } } } certificate = certificateManager.Current() if tc.expectedCertAfterStart == nil { if certificate != nil { t.Errorf("Expected certificate to be nil, was %s", certificate.Leaf.NotAfter) } return } if !certificatesEqual(certificate, tc.expectedCertAfterStart.certificate) { t.Errorf("Got %v, wanted %v", certificateString(certificate), certificateString(tc.expectedCertAfterStart.certificate)) } }) } } func TestInitializeOtherRESTClients(t *testing.T) { var nilCertificate = &certificateData{} testCases := []struct { description string storeCert *certificateData bootstrapCert *certificateData apiCert *certificateData expectedCertBeforeStart *certificateData expectedCertAfterStart *certificateData }{ { description: "No current certificate, no bootstrap certificate", storeCert: nilCertificate, bootstrapCert: nilCertificate, apiCert: apiServerCertData, expectedCertBeforeStart: nilCertificate, expectedCertAfterStart: apiServerCertData, }, { description: "No current certificate, bootstrap certificate", storeCert: nilCertificate, bootstrapCert: bootstrapCertData, apiCert: apiServerCertData, expectedCertBeforeStart: bootstrapCertData, expectedCertAfterStart: apiServerCertData, }, { description: "Current certificate, no bootstrap certificate", storeCert: storeCertData, bootstrapCert: nilCertificate, apiCert: apiServerCertData, expectedCertBeforeStart: storeCertData, expectedCertAfterStart: storeCertData, }, { description: "Current certificate, bootstrap certificate", storeCert: storeCertData, bootstrapCert: bootstrapCertData, apiCert: apiServerCertData, expectedCertBeforeStart: storeCertData, expectedCertAfterStart: storeCertData, }, } for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { certificateStore := &fakeStore{ cert: tc.storeCert.certificate, } certificateManager, err := NewManager(&Config{ Template: &x509.CertificateRequest{ Subject: pkix.Name{ Organization: []string{"system:nodes"}, CommonName: "system:node:fake-node-name", }, }, Usages: []certificatesv1.KeyUsage{ certificatesv1.UsageDigitalSignature, certificatesv1.UsageKeyEncipherment, certificatesv1.UsageClientAuth, }, CertificateStore: certificateStore, BootstrapCertificatePEM: tc.bootstrapCert.certificatePEM, BootstrapKeyPEM: tc.bootstrapCert.keyPEM, ClientsetFn: func(_ *tls.Certificate) (clientset.Interface, error) { return newClientset(fakeClient{ certificatePEM: tc.apiCert.certificatePEM, }), nil }, }) if err != nil { t.Errorf("Got %v, wanted no error.", err) } certificate := certificateManager.Current() if !certificatesEqual(certificate, tc.expectedCertBeforeStart.certificate) { t.Errorf("Got %v, wanted %v", certificateString(certificate), certificateString(tc.expectedCertBeforeStart.certificate)) } if m, ok := certificateManager.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { if m.forceRotation { success, err := certificateManager.(*manager).rotateCerts() if err != nil { t.Errorf("Got error %v, expected none.", err) return } if !success { t.Errorf("Unexpected response 'rotateCerts': %t", success) return } } } certificate = certificateManager.Current() if !certificatesEqual(certificate, tc.expectedCertAfterStart.certificate) { t.Errorf("Got %v, wanted %v", certificateString(certificate), certificateString(tc.expectedCertAfterStart.certificate)) } }) } } func TestServerHealth(t *testing.T) { type certs struct { storeCert *certificateData bootstrapCert *certificateData apiCert *certificateData expectedCertBeforeStart *certificateData expectedCertAfterStart *certificateData } updatedCerts := certs{ storeCert: storeCertData, bootstrapCert: bootstrapCertData, apiCert: apiServerCertData, expectedCertBeforeStart: storeCertData, expectedCertAfterStart: apiServerCertData, } currentCerts := certs{ storeCert: storeCertData, bootstrapCert: bootstrapCertData, apiCert: apiServerCertData, expectedCertBeforeStart: storeCertData, expectedCertAfterStart: storeCertData, } testCases := []struct { description string certs failureType fakeClientFailureType clientErr error expectRotateFail bool expectHealthy bool }{ { description: "Current certificate, bootstrap certificate", certs: updatedCerts, expectHealthy: true, }, { description: "Generic error on create", certs: currentCerts, failureType: createError, expectRotateFail: true, }, { description: "Unauthorized error on create", certs: currentCerts, failureType: createError, clientErr: apierrors.NewUnauthorized("unauthorized"), expectRotateFail: true, expectHealthy: true, }, { description: "Generic unauthorized error on create", certs: currentCerts, failureType: createError, clientErr: apierrors.NewGenericServerResponse(401, "POST", schema.GroupResource{}, "", "", 0, true), expectRotateFail: true, expectHealthy: true, }, { description: "Generic not found error on create", certs: currentCerts, failureType: createError, clientErr: apierrors.NewGenericServerResponse(404, "POST", schema.GroupResource{}, "", "", 0, true), expectRotateFail: true, expectHealthy: false, }, { description: "Not found error on create", certs: currentCerts, failureType: createError, clientErr: apierrors.NewGenericServerResponse(404, "POST", schema.GroupResource{}, "", "", 0, false), expectRotateFail: true, expectHealthy: true, }, } for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { certificateStore := &fakeStore{ cert: tc.storeCert.certificate, } certificateManager, err := NewManager(&Config{ Template: &x509.CertificateRequest{ Subject: pkix.Name{ Organization: []string{"system:nodes"}, CommonName: "system:node:fake-node-name", }, }, Usages: []certificatesv1.KeyUsage{ certificatesv1.UsageDigitalSignature, certificatesv1.UsageKeyEncipherment, certificatesv1.UsageClientAuth, }, CertificateStore: certificateStore, BootstrapCertificatePEM: tc.bootstrapCert.certificatePEM, BootstrapKeyPEM: tc.bootstrapCert.keyPEM, ClientsetFn: func(_ *tls.Certificate) (clientset.Interface, error) { return newClientset(fakeClient{ certificatePEM: tc.apiCert.certificatePEM, failureType: tc.failureType, err: tc.clientErr, }), nil }, }) if err != nil { t.Errorf("Got %v, wanted no error.", err) } certificate := certificateManager.Current() if !certificatesEqual(certificate, tc.expectedCertBeforeStart.certificate) { t.Errorf("Got %v, wanted %v", certificateString(certificate), certificateString(tc.expectedCertBeforeStart.certificate)) } if _, ok := certificateManager.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { success, err := certificateManager.(*manager).rotateCerts() if err != nil { t.Errorf("Got error %v, expected none.", err) return } if !success != tc.expectRotateFail { t.Errorf("Unexpected response 'rotateCerts': %t", success) return } if actual := certificateManager.(*manager).ServerHealthy(); actual != tc.expectHealthy { t.Errorf("Unexpected manager server health: %t", actual) } } certificate = certificateManager.Current() if !certificatesEqual(certificate, tc.expectedCertAfterStart.certificate) { t.Errorf("Got %v, wanted %v", certificateString(certificate), certificateString(tc.expectedCertAfterStart.certificate)) } }) } } func TestRotationLogsDuration(t *testing.T) { h := metricMock{} now := time.Now() certIss := now.Add(-2 * time.Hour) m := manager{ cert: &tls.Certificate{ Leaf: &x509.Certificate{ NotBefore: certIss, NotAfter: now.Add(-1 * time.Hour), }, }, certStore: &fakeStore{cert: expiredStoreCertData.certificate}, getTemplate: func() *x509.CertificateRequest { return &x509.CertificateRequest{} }, clientsetFn: func(_ *tls.Certificate) (clientset.Interface, error) { return newClientset(fakeClient{ certificatePEM: apiServerCertData.certificatePEM, }), nil }, certificateRotation: &h, now: func() time.Time { return now }, logf: t.Logf, } ok, err := m.rotateCerts() if err != nil || !ok { t.Errorf("failed to rotate certs: %v", err) } if h.calls != 1 { t.Errorf("rotation metric was not called") } if h.lastValue != now.Sub(certIss).Seconds() { t.Errorf("rotation metric did not record the right value got: %f; want %f", h.lastValue, now.Sub(certIss).Seconds()) } } type fakeClientFailureType int const ( none fakeClientFailureType = iota createError watchError certificateSigningRequestDenied ) type fakeClient struct { noV1 bool noV1beta1 bool certificatesclient.CertificateSigningRequestInterface failureType fakeClientFailureType certificatePEM []byte err error } func newClientset(opts fakeClient) *fake.Clientset { f := fake.NewSimpleClientset() switch opts.failureType { case createError: f.PrependReactor("create", "certificatesigningrequests", func(action clienttesting.Action) (handled bool, ret runtime.Object, err error) { if opts.err != nil { return true, nil, opts.err } return true, nil, fmt.Errorf("create error") }) case watchError: f.PrependReactor("list", "certificatesigningrequests", func(action clienttesting.Action) (handled bool, ret runtime.Object, err error) { if opts.err != nil { return true, nil, opts.err } return true, nil, fmt.Errorf("watch error") }) f.PrependWatchReactor("certificatesigningrequests", func(action clienttesting.Action) (handled bool, ret watch.Interface, err error) { if opts.err != nil { return true, nil, opts.err } return true, nil, fmt.Errorf("watch error") }) default: f.PrependReactor("create", "certificatesigningrequests", func(action clienttesting.Action) (handled bool, ret runtime.Object, err error) { switch action.GetResource().Version { case "v1": if opts.noV1 { return true, nil, apierrors.NewNotFound(certificatesv1.Resource("certificatesigningrequests"), "") } return true, &certificatesv1.CertificateSigningRequest{ObjectMeta: metav1.ObjectMeta{UID: "fake-uid"}}, nil case "v1beta1": if opts.noV1beta1 { return true, nil, apierrors.NewNotFound(certificatesv1.Resource("certificatesigningrequests"), "") } return true, &certificatesv1beta1.CertificateSigningRequest{ObjectMeta: metav1.ObjectMeta{UID: "fake-uid"}}, nil default: return false, nil, nil } }) f.PrependReactor("list", "certificatesigningrequests", func(action clienttesting.Action) (handled bool, ret runtime.Object, err error) { switch action.GetResource().Version { case "v1": if opts.noV1 { return true, nil, apierrors.NewNotFound(certificatesv1.Resource("certificatesigningrequests"), "") } return true, &certificatesv1.CertificateSigningRequestList{Items: []certificatesv1.CertificateSigningRequest{{ObjectMeta: metav1.ObjectMeta{UID: "fake-uid"}}}}, nil case "v1beta1": if opts.noV1beta1 { return true, nil, apierrors.NewNotFound(certificatesv1.Resource("certificatesigningrequests"), "") } return true, &certificatesv1beta1.CertificateSigningRequestList{Items: []certificatesv1beta1.CertificateSigningRequest{{ObjectMeta: metav1.ObjectMeta{UID: "fake-uid"}}}}, nil default: return false, nil, nil } }) f.PrependWatchReactor("certificatesigningrequests", func(action clienttesting.Action) (handled bool, ret watch.Interface, err error) { switch action.GetResource().Version { case "v1": if opts.noV1 { return true, nil, apierrors.NewNotFound(certificatesv1.Resource("certificatesigningrequests"), "") } return true, &fakeWatch{ version: action.GetResource().Version, failureType: opts.failureType, certificatePEM: opts.certificatePEM, }, nil case "v1beta1": if opts.noV1beta1 { return true, nil, apierrors.NewNotFound(certificatesv1.Resource("certificatesigningrequests"), "") } return true, &fakeWatch{ version: action.GetResource().Version, failureType: opts.failureType, certificatePEM: opts.certificatePEM, }, nil default: return false, nil, nil } }) } return f } type fakeWatch struct { version string failureType fakeClientFailureType certificatePEM []byte } func (w *fakeWatch) Stop() { } func (w *fakeWatch) ResultChan() <-chan watch.Event { var csr runtime.Object switch w.version { case "v1": var condition certificatesv1.CertificateSigningRequestCondition if w.failureType == certificateSigningRequestDenied { condition = certificatesv1.CertificateSigningRequestCondition{ Type: certificatesv1.CertificateDenied, } } else { condition = certificatesv1.CertificateSigningRequestCondition{ Type: certificatesv1.CertificateApproved, } } csr = &certificatesv1.CertificateSigningRequest{ ObjectMeta: metav1.ObjectMeta{UID: "fake-uid"}, Status: certificatesv1.CertificateSigningRequestStatus{ Conditions: []certificatesv1.CertificateSigningRequestCondition{ condition, }, Certificate: []byte(w.certificatePEM), }, } case "v1beta1": var condition certificatesv1beta1.CertificateSigningRequestCondition if w.failureType == certificateSigningRequestDenied { condition = certificatesv1beta1.CertificateSigningRequestCondition{ Type: certificatesv1beta1.CertificateDenied, } } else { condition = certificatesv1beta1.CertificateSigningRequestCondition{ Type: certificatesv1beta1.CertificateApproved, } } csr = &certificatesv1beta1.CertificateSigningRequest{ ObjectMeta: metav1.ObjectMeta{UID: "fake-uid"}, Status: certificatesv1beta1.CertificateSigningRequestStatus{ Conditions: []certificatesv1beta1.CertificateSigningRequestCondition{ condition, }, Certificate: []byte(w.certificatePEM), }, } } c := make(chan watch.Event, 1) c <- watch.Event{ Type: watch.Added, Object: csr, } return c } type fakeStore struct { cert *tls.Certificate } func (s *fakeStore) Current() (*tls.Certificate, error) { if s.cert == nil { noKeyErr := NoCertKeyError("") return nil, &noKeyErr } return s.cert, nil } // Accepts the PEM data for the cert/key pair and makes the new cert/key // pair the 'current' pair, that will be returned by future calls to // Current(). func (s *fakeStore) Update(certPEM, keyPEM []byte) (*tls.Certificate, error) { // In order to make the mocking work, whenever a cert/key pair is passed in // to be updated in the mock store, assume that the certificate manager // generated the key, and then asked the mock CertificateSigningRequest API // to sign it, then the faked API returned a canned response. The canned // signing response will not match the generated key. In order to make // things work out, search here for the correct matching key and use that // instead of the passed in key. That way this file of test code doesn't // have to implement an actual certificate signing process. for _, tc := range []*certificateData{storeCertData, bootstrapCertData, apiServerCertData} { if bytes.Equal(tc.certificatePEM, certPEM) { keyPEM = tc.keyPEM } } cert, err := tls.X509KeyPair(certPEM, keyPEM) if err != nil { return nil, err } now := time.Now() s.cert = &cert s.cert.Leaf = &x509.Certificate{ NotBefore: now.Add(-24 * time.Hour), NotAfter: now.Add(24 * time.Hour), } return s.cert, nil } func certificatesEqual(c1 *tls.Certificate, c2 *tls.Certificate) bool { if c1 == nil || c2 == nil { return c1 == c2 } if len(c1.Certificate) != len(c2.Certificate) { return false } for i := 0; i < len(c1.Certificate); i++ { if !bytes.Equal(c1.Certificate[i], c2.Certificate[i]) { return false } } return true } func certificateString(c *tls.Certificate) string { if c == nil { return "certificate == nil" } if c.Leaf == nil { return "certificate.Leaf == nil" } return c.Leaf.Subject.CommonName } kubernetes-client-go-a2dfcab/util/certificate/certificate_store.go000066400000000000000000000230141472614177300256640ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package certificate import ( "crypto/tls" "crypto/x509" "encoding/pem" "fmt" "os" "path/filepath" "time" certutil "k8s.io/client-go/util/cert" "k8s.io/klog/v2" ) const ( keyExtension = ".key" certExtension = ".crt" pemExtension = ".pem" currentPair = "current" updatedPair = "updated" ) type fileStore struct { pairNamePrefix string certDirectory string keyDirectory string certFile string keyFile string } // FileStore is a store that provides certificate retrieval as well as // the path on disk of the current PEM. type FileStore interface { Store // CurrentPath returns the path on disk of the current certificate/key // pair encoded as PEM files. CurrentPath() string } // NewFileStore returns a concrete implementation of a Store that is based on // storing the cert/key pairs in a single file per pair on disk in the // designated directory. When starting up it will look for the currently // selected cert/key pair in: // // 1. ${certDirectory}/${pairNamePrefix}-current.pem - both cert and key are in the same file. // 2. ${certFile}, ${keyFile} // 3. ${certDirectory}/${pairNamePrefix}.crt, ${keyDirectory}/${pairNamePrefix}.key // // The first one found will be used. If rotation is enabled, future cert/key // updates will be written to the ${certDirectory} directory and // ${certDirectory}/${pairNamePrefix}-current.pem will be created as a soft // link to the currently selected cert/key pair. func NewFileStore( pairNamePrefix string, certDirectory string, keyDirectory string, certFile string, keyFile string) (FileStore, error) { s := fileStore{ pairNamePrefix: pairNamePrefix, certDirectory: certDirectory, keyDirectory: keyDirectory, certFile: certFile, keyFile: keyFile, } if err := s.recover(); err != nil { return nil, err } return &s, nil } // CurrentPath returns the path to the current version of these certificates. func (s *fileStore) CurrentPath() string { return filepath.Join(s.certDirectory, s.filename(currentPair)) } // recover checks if there is a certificate rotation that was interrupted while // progress, and if so, attempts to recover to a good state. func (s *fileStore) recover() error { // If the 'current' file doesn't exist, continue on with the recovery process. currentPath := filepath.Join(s.certDirectory, s.filename(currentPair)) if exists, err := fileExists(currentPath); err != nil { return err } else if exists { return nil } // If the 'updated' file exists, and it is a symbolic link, continue on // with the recovery process. updatedPath := filepath.Join(s.certDirectory, s.filename(updatedPair)) if fi, err := os.Lstat(updatedPath); err != nil { if os.IsNotExist(err) { return nil } return err } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink { return fmt.Errorf("expected %q to be a symlink but it is a file", updatedPath) } // Move the 'updated' symlink to 'current'. if err := os.Rename(updatedPath, currentPath); err != nil { return fmt.Errorf("unable to rename %q to %q: %v", updatedPath, currentPath, err) } return nil } func (s *fileStore) Current() (*tls.Certificate, error) { pairFile := filepath.Join(s.certDirectory, s.filename(currentPair)) if pairFileExists, err := fileExists(pairFile); err != nil { return nil, err } else if pairFileExists { klog.Infof("Loading cert/key pair from %q.", pairFile) return loadFile(pairFile) } certFileExists, err := fileExists(s.certFile) if err != nil { return nil, err } keyFileExists, err := fileExists(s.keyFile) if err != nil { return nil, err } if certFileExists && keyFileExists { klog.Infof("Loading cert/key pair from (%q, %q).", s.certFile, s.keyFile) return loadX509KeyPair(s.certFile, s.keyFile) } c := filepath.Join(s.certDirectory, s.pairNamePrefix+certExtension) k := filepath.Join(s.keyDirectory, s.pairNamePrefix+keyExtension) certFileExists, err = fileExists(c) if err != nil { return nil, err } keyFileExists, err = fileExists(k) if err != nil { return nil, err } if certFileExists && keyFileExists { klog.Infof("Loading cert/key pair from (%q, %q).", c, k) return loadX509KeyPair(c, k) } noKeyErr := NoCertKeyError( fmt.Sprintf("no cert/key files read at %q, (%q, %q) or (%q, %q)", pairFile, s.certFile, s.keyFile, s.certDirectory, s.keyDirectory)) return nil, &noKeyErr } func loadFile(pairFile string) (*tls.Certificate, error) { // LoadX509KeyPair knows how to parse combined cert and private key from // the same file. cert, err := tls.LoadX509KeyPair(pairFile, pairFile) if err != nil { return nil, fmt.Errorf("could not convert data from %q into cert/key pair: %v", pairFile, err) } certs, err := x509.ParseCertificates(cert.Certificate[0]) if err != nil { return nil, fmt.Errorf("unable to parse certificate data: %v", err) } cert.Leaf = certs[0] return &cert, nil } func (s *fileStore) Update(certData, keyData []byte) (*tls.Certificate, error) { ts := time.Now().Format("2006-01-02-15-04-05") pemFilename := s.filename(ts) if err := os.MkdirAll(s.certDirectory, 0755); err != nil { return nil, fmt.Errorf("could not create directory %q to store certificates: %v", s.certDirectory, err) } certPath := filepath.Join(s.certDirectory, pemFilename) f, err := os.OpenFile(certPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0600) if err != nil { return nil, fmt.Errorf("could not open %q: %v", certPath, err) } defer f.Close() // First cert is leaf, remainder are intermediates certs, err := certutil.ParseCertsPEM(certData) if err != nil { return nil, fmt.Errorf("invalid certificate data: %v", err) } for _, c := range certs { pem.Encode(f, &pem.Block{Type: "CERTIFICATE", Bytes: c.Raw}) } keyBlock, _ := pem.Decode(keyData) if keyBlock == nil { return nil, fmt.Errorf("invalid key data") } pem.Encode(f, keyBlock) cert, err := loadFile(certPath) if err != nil { return nil, err } if err := s.updateSymlink(certPath); err != nil { return nil, err } return cert, nil } // updateSymLink updates the current symlink to point to the file that is // passed it. It will fail if there is a non-symlink file exists where the // symlink is expected to be. func (s *fileStore) updateSymlink(filename string) error { // If the 'current' file either doesn't exist, or is already a symlink, // proceed. Otherwise, this is an unrecoverable error. currentPath := filepath.Join(s.certDirectory, s.filename(currentPair)) currentPathExists := false if fi, err := os.Lstat(currentPath); err != nil { if !os.IsNotExist(err) { return err } } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink { return fmt.Errorf("expected %q to be a symlink but it is a file", currentPath) } else { currentPathExists = true } // If the 'updated' file doesn't exist, proceed. If it exists but it is a // symlink, delete it. Otherwise, this is an unrecoverable error. updatedPath := filepath.Join(s.certDirectory, s.filename(updatedPair)) if fi, err := os.Lstat(updatedPath); err != nil { if !os.IsNotExist(err) { return err } } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink { return fmt.Errorf("expected %q to be a symlink but it is a file", updatedPath) } else { if err := os.Remove(updatedPath); err != nil { return fmt.Errorf("unable to remove %q: %v", updatedPath, err) } } // Check that the new cert/key pair file exists to avoid rotating to an // invalid cert/key. if filenameExists, err := fileExists(filename); err != nil { return err } else if !filenameExists { return fmt.Errorf("file %q does not exist so it can not be used as the currently selected cert/key", filename) } // Ensure the source path is absolute to ensure the symlink target is // correct when certDirectory is a relative path. filename, err := filepath.Abs(filename) if err != nil { return err } // Create the 'updated' symlink pointing to the requested file name. if err := os.Symlink(filename, updatedPath); err != nil { return fmt.Errorf("unable to create a symlink from %q to %q: %v", updatedPath, filename, err) } // Replace the 'current' symlink. if currentPathExists { if err := os.Remove(currentPath); err != nil { return fmt.Errorf("unable to remove %q: %v", currentPath, err) } } if err := os.Rename(updatedPath, currentPath); err != nil { return fmt.Errorf("unable to rename %q to %q: %v", updatedPath, currentPath, err) } return nil } func (s *fileStore) filename(qualifier string) string { return s.pairNamePrefix + "-" + qualifier + pemExtension } func loadX509KeyPair(certFile, keyFile string) (*tls.Certificate, error) { cert, err := tls.LoadX509KeyPair(certFile, keyFile) if err != nil { return nil, err } certs, err := x509.ParseCertificates(cert.Certificate[0]) if err != nil { return nil, fmt.Errorf("unable to parse certificate data: %v", err) } cert.Leaf = certs[0] return &cert, nil } // FileExists checks if specified file exists. func fileExists(filename string) (bool, error) { if _, err := os.Stat(filename); os.IsNotExist(err) { return false, nil } else if err != nil { return false, err } return true, nil } kubernetes-client-go-a2dfcab/util/certificate/certificate_store_test.go000066400000000000000000000402261472614177300267270ustar00rootroot00000000000000/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package certificate import ( "bytes" "os" "path/filepath" "testing" ) func TestUpdateSymlinkExistingFileError(t *testing.T) { dir, err := os.MkdirTemp("", "k8s-test-update-symlink") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() pairFile := filepath.Join(dir, "kubelet-current.pem") if err := os.WriteFile(pairFile, nil, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", pairFile, err) } s := fileStore{ certDirectory: dir, pairNamePrefix: "kubelet", } if err := s.updateSymlink(pairFile); err == nil { t.Errorf("Got no error, wanted to fail updating the symlink because there is a file there.") } } func TestUpdateSymlinkNewFileNotExist(t *testing.T) { dir, err := os.MkdirTemp("", "k8s-test-update-symlink") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() oldPairFile := filepath.Join(dir, "kubelet-oldpair.pem") if err := os.WriteFile(oldPairFile, nil, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", oldPairFile, err) } s := fileStore{ certDirectory: dir, pairNamePrefix: "kubelet", } if err := s.updateSymlink(oldPairFile); err != nil { t.Errorf("Got error %v, wanted successful update of the symlink to point to %q", err, oldPairFile) } if _, err := os.Stat(oldPairFile); err != nil { t.Errorf("Got error %v, wanted file %q to be there.", err, oldPairFile) } currentPairFile := filepath.Join(dir, "kubelet-current.pem") if fi, err := os.Lstat(currentPairFile); err != nil { t.Errorf("Got error %v, wanted file %q to be there", err, currentPairFile) } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink { t.Errorf("Got %q not a symlink.", currentPairFile) } newPairFile := filepath.Join(dir, "kubelet-newpair.pem") if err := s.updateSymlink(newPairFile); err == nil { t.Errorf("Got no error, wanted to fail updating the symlink the file %q does not exist.", newPairFile) } } func TestUpdateSymlinkNoSymlink(t *testing.T) { dir, err := os.MkdirTemp("", "k8s-test-update-symlink") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() pairFile := filepath.Join(dir, "kubelet-newfile.pem") if err := os.WriteFile(pairFile, nil, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", pairFile, err) } s := fileStore{ certDirectory: dir, pairNamePrefix: "kubelet", } if err := s.updateSymlink(pairFile); err != nil { t.Errorf("Got error %v, wanted a new symlink to be created", err) } if _, err := os.Stat(pairFile); err != nil { t.Errorf("Got error %v, wanted file %q to be there", err, pairFile) } currentPairFile := filepath.Join(dir, "kubelet-current.pem") if fi, err := os.Lstat(currentPairFile); err != nil { t.Errorf("Got %v, wanted %q to be there", currentPairFile, err) } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink { t.Errorf("%q not a symlink, wanted a symlink.", currentPairFile) } } func TestUpdateSymlinkReplaceExistingSymlink(t *testing.T) { prefix := "kubelet" dir, err := os.MkdirTemp("", "k8s-test-update-symlink") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() oldPairFile := filepath.Join(dir, prefix+"-oldfile.pem") if err := os.WriteFile(oldPairFile, nil, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", oldPairFile, err) } newPairFile := filepath.Join(dir, prefix+"-newfile.pem") if err := os.WriteFile(newPairFile, nil, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", newPairFile, err) } currentPairFile := filepath.Join(dir, prefix+"-current.pem") if err := os.Symlink(oldPairFile, currentPairFile); err != nil { t.Fatalf("unable to create a symlink from %q to %q: %v", currentPairFile, oldPairFile, err) } if resolved, err := os.Readlink(currentPairFile); err != nil { t.Fatalf("Got %v when attempting to resolve symlink %q", err, currentPairFile) } else if resolved != oldPairFile { t.Fatalf("Got %q as resolution of symlink %q, wanted %q", resolved, currentPairFile, oldPairFile) } s := fileStore{ certDirectory: dir, pairNamePrefix: prefix, } if err := s.updateSymlink(newPairFile); err != nil { t.Errorf("Got error %v, wanted a new symlink to be created", err) } if _, err := os.Stat(oldPairFile); err != nil { t.Errorf("Got error %v, wanted file %q to be there", oldPairFile, err) } if _, err := os.Stat(newPairFile); err != nil { t.Errorf("Got error %v, wanted file %q to be there", newPairFile, err) } if fi, err := os.Lstat(currentPairFile); err != nil { t.Errorf("Got %v, wanted %q to be there", currentPairFile, err) } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink { t.Errorf("%q not a symlink, wanted a symlink.", currentPairFile) } if resolved, err := os.Readlink(currentPairFile); err != nil { t.Fatalf("Got %v when attempting to resolve symlink %q", err, currentPairFile) } else if resolved != newPairFile { t.Fatalf("Got %q as resolution of symlink %q, wanted %q", resolved, currentPairFile, newPairFile) } } func TestLoadFile(t *testing.T) { dir, err := os.MkdirTemp("", "k8s-test-load-cert-key-blocks") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() pairFile := filepath.Join(dir, "kubelet-pair.pem") tests := []struct { desc string data []byte }{ {desc: "cert and key", data: bytes.Join([][]byte{storeCertData.certificatePEM, storeCertData.keyPEM}, []byte("\n"))}, {desc: "key and cert", data: bytes.Join([][]byte{storeCertData.keyPEM, storeCertData.certificatePEM}, []byte("\n"))}, } for _, tt := range tests { t.Run(tt.desc, func(t *testing.T) { if err := os.WriteFile(pairFile, tt.data, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", pairFile, err) } cert, err := loadFile(pairFile) if err != nil { t.Fatalf("Could not load certificate from disk: %v", err) } if cert == nil { t.Fatalf("There was no error, but no certificate data was returned.") } if cert.Leaf == nil { t.Fatalf("Got an empty leaf, expected private data.") } }) } } func TestUpdateNoRotation(t *testing.T) { prefix := "kubelet-server" dir, err := os.MkdirTemp("", "k8s-test-certstore-current") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() keyFile := filepath.Join(dir, "kubelet.key") if err := os.WriteFile(keyFile, storeCertData.keyPEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", keyFile, err) } certFile := filepath.Join(dir, "kubelet.crt") if err := os.WriteFile(certFile, storeCertData.certificatePEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", certFile, err) } s, err := NewFileStore(prefix, dir, dir, certFile, keyFile) if err != nil { t.Fatalf("Got %v while creating a new store.", err) } cert, err := s.Update(storeCertData.certificatePEM, storeCertData.keyPEM) if err != nil { t.Errorf("Got %v while updating certificate store.", err) } if cert == nil { t.Errorf("Got nil certificate, expected something real.") } } func TestUpdateRotation(t *testing.T) { prefix := "kubelet-server" dir, err := os.MkdirTemp("", "k8s-test-certstore-current") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() keyFile := filepath.Join(dir, "kubelet.key") if err := os.WriteFile(keyFile, storeCertData.keyPEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", keyFile, err) } certFile := filepath.Join(dir, "kubelet.crt") if err := os.WriteFile(certFile, storeCertData.certificatePEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", certFile, err) } s, err := NewFileStore(prefix, dir, dir, certFile, keyFile) if err != nil { t.Fatalf("Got %v while creating a new store.", err) } cert, err := s.Update(storeCertData.certificatePEM, storeCertData.keyPEM) if err != nil { t.Fatalf("Got %v while updating certificate store.", err) } if cert == nil { t.Fatalf("Got nil certificate, expected something real.") } } func TestUpdateTwoCerts(t *testing.T) { prefix := "kubelet-server" dir, err := os.MkdirTemp("", "k8s-test-certstore-current") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() keyFile := filepath.Join(dir, "kubelet.key") if err := os.WriteFile(keyFile, storeTwoCertsData.keyPEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", keyFile, err) } certFile := filepath.Join(dir, "kubelet.crt") if err := os.WriteFile(certFile, storeTwoCertsData.certificatePEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", certFile, err) } s, err := NewFileStore(prefix, dir, dir, certFile, keyFile) if err != nil { t.Fatalf("Got %v while creating a new store.", err) } cert, err := s.Update(storeTwoCertsData.certificatePEM, storeTwoCertsData.keyPEM) if err != nil { t.Errorf("Got %v while updating certificate store.", err) } if cert == nil { t.Fatalf("Got nil certificate, expected something real.") } if len(cert.Certificate) != 2 { t.Fatalf("Unexpected number of certificates, expected 2, got %v", len(cert.Certificate)) } } func TestUpdateWithBadCertKeyData(t *testing.T) { prefix := "kubelet-server" dir, err := os.MkdirTemp("", "k8s-test-certstore-current") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() keyFile := filepath.Join(dir, "kubelet.key") if err := os.WriteFile(keyFile, storeCertData.keyPEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", keyFile, err) } certFile := filepath.Join(dir, "kubelet.crt") if err := os.WriteFile(certFile, storeCertData.certificatePEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", certFile, err) } s, err := NewFileStore(prefix, dir, dir, certFile, keyFile) if err != nil { t.Fatalf("Got %v while creating a new store.", err) } cert, err := s.Update([]byte{0, 0}, storeCertData.keyPEM) if err == nil { t.Fatalf("Got no error while updating certificate store with invalid data.") } if cert != nil { t.Fatalf("Got %v certificate returned from the update, expected nil.", cert) } } func TestCurrentPairFile(t *testing.T) { prefix := "kubelet-server" dir, err := os.MkdirTemp("", "k8s-test-certstore-current") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() pairFile := filepath.Join(dir, prefix+"-pair.pem") data := append(storeCertData.certificatePEM, []byte("\n")...) data = append(data, storeCertData.keyPEM...) if err := os.WriteFile(pairFile, data, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", pairFile, err) } currentFile := filepath.Join(dir, prefix+"-current.pem") if err := os.Symlink(pairFile, currentFile); err != nil { t.Fatalf("unable to create a symlink from %q to %q: %v", currentFile, pairFile, err) } store, err := NewFileStore("kubelet-server", dir, dir, "", "") if err != nil { t.Fatalf("Failed to initialize certificate store: %v", err) } cert, err := store.Current() if err != nil { t.Fatalf("Could not load certificate from disk: %v", err) } if cert == nil { t.Fatalf("There was no error, but no certificate data was returned.") } if cert.Leaf == nil { t.Fatalf("Got an empty leaf, expected private data.") } } func TestCurrentCertKeyFiles(t *testing.T) { prefix := "kubelet-server" dir, err := os.MkdirTemp("", "k8s-test-certstore-current") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() certFile := filepath.Join(dir, "kubelet.crt") if err := os.WriteFile(certFile, storeCertData.certificatePEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", certFile, err) } keyFile := filepath.Join(dir, "kubelet.key") if err := os.WriteFile(keyFile, storeCertData.keyPEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", keyFile, err) } store, err := NewFileStore(prefix, dir, dir, certFile, keyFile) if err != nil { t.Fatalf("Failed to initialize certificate store: %v", err) } cert, err := store.Current() if err != nil { t.Fatalf("Could not load certificate from disk: %v", err) } if cert == nil { t.Fatalf("There was no error, but no certificate data was returned.") } if cert.Leaf == nil { t.Fatalf("Got an empty leaf, expected private data.") } } func TestCurrentTwoCerts(t *testing.T) { prefix := "kubelet-server" dir, err := os.MkdirTemp("", "k8s-test-certstore-current") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() certFile := filepath.Join(dir, "kubelet.crt") if err := os.WriteFile(certFile, storeTwoCertsData.certificatePEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", certFile, err) } keyFile := filepath.Join(dir, "kubelet.key") if err := os.WriteFile(keyFile, storeTwoCertsData.keyPEM, 0600); err != nil { t.Fatalf("Unable to create the file %q: %v", keyFile, err) } store, err := NewFileStore(prefix, dir, dir, certFile, keyFile) if err != nil { t.Fatalf("Failed to initialize certificate store: %v", err) } cert, err := store.Current() if err != nil { t.Fatalf("Could not load certificate from disk: %v", err) } if cert == nil { t.Fatalf("There was no error, but no certificate data was returned.") } if cert.Leaf == nil { t.Fatalf("Got an empty leaf, expected private data.") } if len(cert.Certificate) != 2 { t.Fatalf("Unexpected number of certificates, expected 2, got %v", len(cert.Certificate)) } } func TestCurrentNoFiles(t *testing.T) { dir, err := os.MkdirTemp("", "k8s-test-certstore-current") if err != nil { t.Fatalf("Unable to create the test directory %q: %v", dir, err) } defer func() { if err := os.RemoveAll(dir); err != nil { t.Errorf("Unable to clean up test directory %q: %v", dir, err) } }() store, err := NewFileStore("kubelet-server", dir, dir, "", "") if err != nil { t.Fatalf("Failed to initialize certificate store: %v", err) } cert, err := store.Current() if err == nil { t.Fatalf("Got no error, expected an error because the cert/key files don't exist.") } if _, ok := err.(*NoCertKeyError); !ok { t.Fatalf("Got error %v, expected NoCertKeyError.", err) } if cert != nil { t.Fatalf("Got certificate, expected no certificate because the cert/key files don't exist.") } } kubernetes-client-go-a2dfcab/util/certificate/csr/000077500000000000000000000000001472614177300224265ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/certificate/csr/csr.go000066400000000000000000000312461472614177300235520ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package csr import ( "context" "crypto" "crypto/x509" "encoding/pem" "fmt" "reflect" "time" certificatesv1 "k8s.io/api/certificates/v1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" watchtools "k8s.io/client-go/tools/watch" certutil "k8s.io/client-go/util/cert" "k8s.io/klog/v2" "k8s.io/utils/pointer" ) // RequestCertificate will either use an existing (if this process has run // before but not to completion) or create a certificate signing request using the // PEM encoded CSR and send it to API server. An optional requestedDuration may be passed // to set the spec.expirationSeconds field on the CSR to control the lifetime of the issued // certificate. This is not guaranteed as the signer may choose to ignore the request. func RequestCertificate(client clientset.Interface, csrData []byte, name, signerName string, requestedDuration *time.Duration, usages []certificatesv1.KeyUsage, privateKey interface{}) (reqName string, reqUID types.UID, err error) { csr := &certificatesv1.CertificateSigningRequest{ // Username, UID, Groups will be injected by API server. TypeMeta: metav1.TypeMeta{Kind: "CertificateSigningRequest"}, ObjectMeta: metav1.ObjectMeta{ Name: name, }, Spec: certificatesv1.CertificateSigningRequestSpec{ Request: csrData, Usages: usages, SignerName: signerName, }, } if len(csr.Name) == 0 { csr.GenerateName = "csr-" } if requestedDuration != nil { csr.Spec.ExpirationSeconds = DurationToExpirationSeconds(*requestedDuration) } reqName, reqUID, err = create(client, csr) switch { case err == nil: return reqName, reqUID, err case apierrors.IsAlreadyExists(err) && len(name) > 0: klog.Infof("csr for this node already exists, reusing") req, err := get(client, name) if err != nil { return "", "", formatError("cannot retrieve certificate signing request: %v", err) } if err := ensureCompatible(req, csr, privateKey); err != nil { return "", "", fmt.Errorf("retrieved csr is not compatible: %v", err) } klog.Infof("csr for this node is still valid") return req.Name, req.UID, nil default: return "", "", formatError("cannot create certificate signing request: %v", err) } } func DurationToExpirationSeconds(duration time.Duration) *int32 { return pointer.Int32(int32(duration / time.Second)) } func ExpirationSecondsToDuration(expirationSeconds int32) time.Duration { return time.Duration(expirationSeconds) * time.Second } func get(client clientset.Interface, name string) (*certificatesv1.CertificateSigningRequest, error) { v1req, v1err := client.CertificatesV1().CertificateSigningRequests().Get(context.TODO(), name, metav1.GetOptions{}) if v1err == nil || !apierrors.IsNotFound(v1err) { return v1req, v1err } v1beta1req, v1beta1err := client.CertificatesV1beta1().CertificateSigningRequests().Get(context.TODO(), name, metav1.GetOptions{}) if v1beta1err != nil { return nil, v1beta1err } v1req = &certificatesv1.CertificateSigningRequest{ ObjectMeta: v1beta1req.ObjectMeta, Spec: certificatesv1.CertificateSigningRequestSpec{ Request: v1beta1req.Spec.Request, }, } if v1beta1req.Spec.SignerName != nil { v1req.Spec.SignerName = *v1beta1req.Spec.SignerName } for _, usage := range v1beta1req.Spec.Usages { v1req.Spec.Usages = append(v1req.Spec.Usages, certificatesv1.KeyUsage(usage)) } return v1req, nil } func create(client clientset.Interface, csr *certificatesv1.CertificateSigningRequest) (reqName string, reqUID types.UID, err error) { // only attempt a create via v1 if we specified signerName and usages and are not using the legacy unknown signerName if len(csr.Spec.Usages) > 0 && len(csr.Spec.SignerName) > 0 && csr.Spec.SignerName != "kubernetes.io/legacy-unknown" { v1req, v1err := client.CertificatesV1().CertificateSigningRequests().Create(context.TODO(), csr, metav1.CreateOptions{}) switch { case v1err != nil && apierrors.IsNotFound(v1err): // v1 CSR API was not found, continue to try v1beta1 case v1err != nil: // other creation error return "", "", v1err default: // success return v1req.Name, v1req.UID, v1err } } // convert relevant bits to v1beta1 v1beta1csr := &certificatesv1beta1.CertificateSigningRequest{ ObjectMeta: csr.ObjectMeta, Spec: certificatesv1beta1.CertificateSigningRequestSpec{ SignerName: &csr.Spec.SignerName, Request: csr.Spec.Request, }, } for _, usage := range csr.Spec.Usages { v1beta1csr.Spec.Usages = append(v1beta1csr.Spec.Usages, certificatesv1beta1.KeyUsage(usage)) } // create v1beta1 v1beta1req, v1beta1err := client.CertificatesV1beta1().CertificateSigningRequests().Create(context.TODO(), v1beta1csr, metav1.CreateOptions{}) if v1beta1err != nil { return "", "", v1beta1err } return v1beta1req.Name, v1beta1req.UID, nil } // WaitForCertificate waits for a certificate to be issued until timeout, or returns an error. func WaitForCertificate(ctx context.Context, client clientset.Interface, reqName string, reqUID types.UID) (certData []byte, err error) { fieldSelector := fields.OneTermEqualSelector("metadata.name", reqName).String() var lw *cache.ListWatch var obj runtime.Object for { // see if the v1 API is available if _, err := client.CertificatesV1().CertificateSigningRequests().List(ctx, metav1.ListOptions{FieldSelector: fieldSelector}); err == nil { // watch v1 objects obj = &certificatesv1.CertificateSigningRequest{} lw = &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fieldSelector return client.CertificatesV1().CertificateSigningRequests().List(ctx, options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fieldSelector return client.CertificatesV1().CertificateSigningRequests().Watch(ctx, options) }, } break } else { klog.V(2).Infof("error fetching v1 certificate signing request: %v", err) } // return if we've timed out if err := ctx.Err(); err != nil { return nil, wait.ErrWaitTimeout } // see if the v1beta1 API is available if _, err := client.CertificatesV1beta1().CertificateSigningRequests().List(ctx, metav1.ListOptions{FieldSelector: fieldSelector}); err == nil { // watch v1beta1 objects obj = &certificatesv1beta1.CertificateSigningRequest{} lw = &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fieldSelector return client.CertificatesV1beta1().CertificateSigningRequests().List(ctx, options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fieldSelector return client.CertificatesV1beta1().CertificateSigningRequests().Watch(ctx, options) }, } break } else { klog.V(2).Infof("error fetching v1beta1 certificate signing request: %v", err) } // return if we've timed out if err := ctx.Err(); err != nil { return nil, wait.ErrWaitTimeout } // wait and try again time.Sleep(time.Second) } var issuedCertificate []byte _, err = watchtools.UntilWithSync( ctx, lw, obj, nil, func(event watch.Event) (bool, error) { switch event.Type { case watch.Modified, watch.Added: case watch.Deleted: return false, fmt.Errorf("csr %q was deleted", reqName) default: return false, nil } switch csr := event.Object.(type) { case *certificatesv1.CertificateSigningRequest: if csr.UID != reqUID { return false, fmt.Errorf("csr %q changed UIDs", csr.Name) } approved := false for _, c := range csr.Status.Conditions { if c.Type == certificatesv1.CertificateDenied { return false, fmt.Errorf("certificate signing request is denied, reason: %v, message: %v", c.Reason, c.Message) } if c.Type == certificatesv1.CertificateFailed { return false, fmt.Errorf("certificate signing request failed, reason: %v, message: %v", c.Reason, c.Message) } if c.Type == certificatesv1.CertificateApproved { approved = true } } if approved { if len(csr.Status.Certificate) > 0 { klog.V(2).Infof("certificate signing request %s is issued", csr.Name) issuedCertificate = csr.Status.Certificate return true, nil } klog.V(2).Infof("certificate signing request %s is approved, waiting to be issued", csr.Name) } case *certificatesv1beta1.CertificateSigningRequest: if csr.UID != reqUID { return false, fmt.Errorf("csr %q changed UIDs", csr.Name) } approved := false for _, c := range csr.Status.Conditions { if c.Type == certificatesv1beta1.CertificateDenied { return false, fmt.Errorf("certificate signing request is denied, reason: %v, message: %v", c.Reason, c.Message) } if c.Type == certificatesv1beta1.CertificateFailed { return false, fmt.Errorf("certificate signing request failed, reason: %v, message: %v", c.Reason, c.Message) } if c.Type == certificatesv1beta1.CertificateApproved { approved = true } } if approved { if len(csr.Status.Certificate) > 0 { klog.V(2).Infof("certificate signing request %s is issued", csr.Name) issuedCertificate = csr.Status.Certificate return true, nil } klog.V(2).Infof("certificate signing request %s is approved, waiting to be issued", csr.Name) } default: return false, fmt.Errorf("unexpected type received: %T", event.Object) } return false, nil }, ) if err == wait.ErrWaitTimeout { return nil, wait.ErrWaitTimeout } if err != nil { return nil, formatError("cannot watch on the certificate signing request: %v", err) } return issuedCertificate, nil } // ensureCompatible ensures that a CSR object is compatible with an original CSR func ensureCompatible(new, orig *certificatesv1.CertificateSigningRequest, privateKey interface{}) error { newCSR, err := parseCSR(new.Spec.Request) if err != nil { return fmt.Errorf("unable to parse new csr: %v", err) } origCSR, err := parseCSR(orig.Spec.Request) if err != nil { return fmt.Errorf("unable to parse original csr: %v", err) } if !reflect.DeepEqual(newCSR.Subject, origCSR.Subject) { return fmt.Errorf("csr subjects differ: new: %#v, orig: %#v", newCSR.Subject, origCSR.Subject) } if len(new.Spec.SignerName) > 0 && len(orig.Spec.SignerName) > 0 && new.Spec.SignerName != orig.Spec.SignerName { return fmt.Errorf("csr signerNames differ: new %q, orig: %q", new.Spec.SignerName, orig.Spec.SignerName) } signer, ok := privateKey.(crypto.Signer) if !ok { return fmt.Errorf("privateKey is not a signer") } newCSR.PublicKey = signer.Public() if err := newCSR.CheckSignature(); err != nil { return fmt.Errorf("error validating signature new CSR against old key: %v", err) } if len(new.Status.Certificate) > 0 { certs, err := certutil.ParseCertsPEM(new.Status.Certificate) if err != nil { return fmt.Errorf("error parsing signed certificate for CSR: %v", err) } now := time.Now() for _, cert := range certs { if now.After(cert.NotAfter) { return fmt.Errorf("one of the certificates for the CSR has expired: %s", cert.NotAfter) } } } return nil } // formatError preserves the type of an API message but alters the message. Expects // a single argument format string, and returns the wrapped error. func formatError(format string, err error) error { if s, ok := err.(apierrors.APIStatus); ok { se := &apierrors.StatusError{ErrStatus: s.Status()} se.ErrStatus.Message = fmt.Sprintf(format, se.ErrStatus.Message) return se } return fmt.Errorf(format, err) } // parseCSR extracts the CSR from the API object and decodes it. func parseCSR(pemData []byte) (*x509.CertificateRequest, error) { // extract PEM from request object block, _ := pem.Decode(pemData) if block == nil || block.Type != "CERTIFICATE REQUEST" { return nil, fmt.Errorf("PEM block type must be CERTIFICATE REQUEST") } return x509.ParseCertificateRequest(block.Bytes) } kubernetes-client-go-a2dfcab/util/certificate/csr/csr_test.go000066400000000000000000000075131472614177300246110ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package csr import ( "crypto" "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "testing" certificates "k8s.io/api/certificates/v1" ) func TestEnsureCompatible(t *testing.T) { privateKey, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { t.Fatal(err) } req := pemWithPrivateKey(privateKey) tests := map[string]struct { new, orig *certificates.CertificateSigningRequest privateKey interface{} err string }{ "nil signerName on 'new' matches any signerName on 'orig'": { new: &certificates.CertificateSigningRequest{ Spec: certificates.CertificateSigningRequestSpec{ Request: req, }, }, orig: &certificates.CertificateSigningRequest{ Spec: certificates.CertificateSigningRequestSpec{ Request: req, SignerName: "example.com/test", }, }, privateKey: privateKey, }, "nil signerName on 'orig' matches any signerName on 'new'": { new: &certificates.CertificateSigningRequest{ Spec: certificates.CertificateSigningRequestSpec{ Request: req, SignerName: "example.com/test", }, }, orig: &certificates.CertificateSigningRequest{ Spec: certificates.CertificateSigningRequestSpec{ Request: req, }, }, privateKey: privateKey, }, "signerName on 'orig' matches signerName on 'new'": { new: &certificates.CertificateSigningRequest{ Spec: certificates.CertificateSigningRequestSpec{ Request: req, SignerName: "example.com/test", }, }, orig: &certificates.CertificateSigningRequest{ Spec: certificates.CertificateSigningRequestSpec{ Request: req, SignerName: "example.com/test", }, }, privateKey: privateKey, }, "signerName on 'orig' does not match signerName on 'new'": { new: &certificates.CertificateSigningRequest{ Spec: certificates.CertificateSigningRequestSpec{ Request: req, SignerName: "example.com/test", }, }, orig: &certificates.CertificateSigningRequest{ Spec: certificates.CertificateSigningRequestSpec{ Request: req, SignerName: "example.com/not-test", }, }, privateKey: privateKey, err: `csr signerNames differ: new "example.com/test", orig: "example.com/not-test"`, }, } for name, test := range tests { t.Run(name, func(t *testing.T) { err := ensureCompatible(test.new, test.orig, test.privateKey) if err != nil && test.err == "" { t.Errorf("expected no error, but got: %v", err) } else if err != nil && test.err != err.Error() { t.Errorf("error did not match as expected, got=%v, exp=%s", err, test.err) } if err == nil && test.err != "" { t.Errorf("expected to get an error but got none") } }) } } func pemWithPrivateKey(pk crypto.PrivateKey) []byte { template := &x509.CertificateRequest{ Subject: pkix.Name{ CommonName: "something", Organization: []string{"test"}, }, } return pemWithTemplate(template, pk) } func pemWithTemplate(template *x509.CertificateRequest, key crypto.PrivateKey) []byte { csrDER, err := x509.CreateCertificateRequest(rand.Reader, template, key) if err != nil { panic(err) } csrPemBlock := &pem.Block{ Type: "CERTIFICATE REQUEST", Bytes: csrDER, } p := pem.EncodeToMemory(csrPemBlock) if p == nil { panic("invalid pem block") } return p } kubernetes-client-go-a2dfcab/util/connrotation/000077500000000000000000000000001472614177300220725ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/connrotation/connrotation.go000066400000000000000000000071611472614177300251430ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package connrotation implements a connection dialer that tracks and can close // all created connections. // // This is used for credential rotation of long-lived connections, when there's // no way to re-authenticate on a live connection. package connrotation import ( "context" "net" "sync" ) // DialFunc is a shorthand for signature of net.DialContext. type DialFunc func(ctx context.Context, network, address string) (net.Conn, error) // Dialer opens connections through Dial and tracks them. type Dialer struct { dial DialFunc *ConnectionTracker } // NewDialer creates a new Dialer instance. // Equivalent to NewDialerWithTracker(dial, nil). func NewDialer(dial DialFunc) *Dialer { return NewDialerWithTracker(dial, nil) } // NewDialerWithTracker creates a new Dialer instance. // // If dial is not nil, it will be used to create new underlying connections. // Otherwise net.DialContext is used. // If tracker is not nil, it will be used to track new underlying connections. // Otherwise NewConnectionTracker() is used. func NewDialerWithTracker(dial DialFunc, tracker *ConnectionTracker) *Dialer { if tracker == nil { tracker = NewConnectionTracker() } return &Dialer{ dial: dial, ConnectionTracker: tracker, } } // ConnectionTracker keeps track of opened connections type ConnectionTracker struct { mu sync.Mutex conns map[*closableConn]struct{} } // NewConnectionTracker returns a connection tracker for use with NewDialerWithTracker func NewConnectionTracker() *ConnectionTracker { return &ConnectionTracker{ conns: make(map[*closableConn]struct{}), } } // CloseAll forcibly closes all tracked connections. // // Note: new connections may get created before CloseAll returns. func (c *ConnectionTracker) CloseAll() { c.mu.Lock() conns := c.conns c.conns = make(map[*closableConn]struct{}) c.mu.Unlock() for conn := range conns { conn.Close() } } // Track adds the connection to the list of tracked connections, // and returns a wrapped copy of the connection that stops tracking the connection // when it is closed. func (c *ConnectionTracker) Track(conn net.Conn) net.Conn { closable := &closableConn{Conn: conn} // When the connection is closed, remove it from the map. This will // be no-op if the connection isn't in the map, e.g. if CloseAll() // is called. closable.onClose = func() { c.mu.Lock() delete(c.conns, closable) c.mu.Unlock() } // Start tracking the connection c.mu.Lock() c.conns[closable] = struct{}{} c.mu.Unlock() return closable } // Dial creates a new tracked connection. func (d *Dialer) Dial(network, address string) (net.Conn, error) { return d.DialContext(context.Background(), network, address) } // DialContext creates a new tracked connection. func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) { conn, err := d.dial(ctx, network, address) if err != nil { return nil, err } return d.ConnectionTracker.Track(conn), nil } type closableConn struct { onClose func() net.Conn } func (c *closableConn) Close() error { go c.onClose() return c.Conn.Close() } kubernetes-client-go-a2dfcab/util/connrotation/connrotation_test.go000066400000000000000000000056211472614177300262010ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package connrotation import ( "context" "net" "sync" "sync/atomic" "testing" "time" ) func TestCloseAll(t *testing.T) { closed := make(chan struct{}, 50) dialFn := func(ctx context.Context, network, address string) (net.Conn, error) { return closeOnlyConn{onClose: func() { closed <- struct{}{} }}, nil } dialer := NewDialer(dialFn) const numConns = 10 // Outer loop to ensure Dialer is re-usable after CloseAll. for i := 0; i < 5; i++ { for j := 0; j < numConns; j++ { if _, err := dialer.Dial("", ""); err != nil { t.Fatal(err) } } dialer.CloseAll() deadline := time.After(time.Second) for j := 0; j < numConns; j++ { select { case <-closed: case <-deadline: t.Fatalf("iteration %d: 1s after CloseAll only %d/%d connections closed", i, j, numConns) } } } } // TestCloseAllRace ensures CloseAll works with connections being simultaneously dialed func TestCloseAllRace(t *testing.T) { conns := int64(0) dialer := NewDialer(func(ctx context.Context, network, address string) (net.Conn, error) { return closeOnlyConn{onClose: func() { atomic.AddInt64(&conns, -1) }}, nil }) const raceCount = 5000 begin := &sync.WaitGroup{} begin.Add(1) wg := &sync.WaitGroup{} // Close all as fast as we can wg.Add(1) go func() { begin.Wait() defer wg.Done() for i := 0; i < raceCount; i++ { dialer.CloseAll() } }() // Dial as fast as we can wg.Add(1) go func() { begin.Wait() defer wg.Done() for i := 0; i < raceCount; i++ { if _, err := dialer.Dial("", ""); err != nil { t.Error(err) return } atomic.AddInt64(&conns, 1) } }() // Trigger both goroutines as close to the same time as possible begin.Done() // Wait for goroutines wg.Wait() // Ensure CloseAll ran after all dials dialer.CloseAll() // Expect all connections to close within 5 seconds for start := time.Now(); time.Since(start) < 5*time.Second; time.Sleep(10 * time.Millisecond) { // Ensure all connections were closed if c := atomic.LoadInt64(&conns); c == 0 { break } else { t.Logf("got %d open connections, want 0, will retry", c) } } // Ensure all connections were closed if c := atomic.LoadInt64(&conns); c != 0 { t.Fatalf("got %d open connections, want 0", c) } } type closeOnlyConn struct { net.Conn onClose func() } func (c closeOnlyConn) Close() error { go c.onClose() return nil } kubernetes-client-go-a2dfcab/util/consistencydetector/000077500000000000000000000000001472614177300234505ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/consistencydetector/data_consistency_detector.go000066400000000000000000000134171472614177300312300ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package consistencydetector import ( "context" "fmt" "sort" "time" "github.com/google/go-cmp/cmp" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/klog/v2" ) type RetrieveItemsFunc[U any] func() []U type ListFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOptions) (T, error) // CheckDataConsistency exists solely for testing purposes. // we cannot use checkWatchListDataConsistencyIfRequested because // it is guarded by an environmental variable. // we cannot manipulate the environmental variable because // it will affect other tests in this package. func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn ListFunc[T], listOptions metav1.ListOptions, retrieveItemsFn RetrieveItemsFunc[U]) { if !canFormAdditionalListCall(lastSyncedResourceVersion, listOptions) { klog.V(4).Infof("data consistency check for %s is enabled but the parameters (RV, ListOptions) doesn't allow for creating a valid LIST request. Skipping the data consistency check.", identity) return } klog.Warningf("data consistency check for %s is enabled, this will result in an additional call to the API server.", identity) retrievedItems := toMetaObjectSliceOrDie(retrieveItemsFn()) listOptions = prepareListCallOptions(lastSyncedResourceVersion, listOptions, len(retrievedItems)) var list runtime.Object err := wait.PollUntilContextCancel(ctx, time.Second, true, func(_ context.Context) (done bool, err error) { list, err = listFn(ctx, listOptions) if err != nil { // the consistency check will only be enabled in the CI // and LIST calls in general will be retired by the client-go library // if we fail simply log and retry klog.Errorf("failed to list data from the server, retrying until stopCh is closed, err: %v", err) return false, nil } return true, nil }) if err != nil { klog.Errorf("failed to list data from the server, the data consistency check for %s won't be performed, stopCh was closed, err: %v", identity, err) return } rawListItems, err := meta.ExtractListWithAlloc(list) if err != nil { panic(err) // this should never happen } listItems := toMetaObjectSliceOrDie(rawListItems) sort.Sort(byUID(listItems)) sort.Sort(byUID(retrievedItems)) if !cmp.Equal(listItems, retrievedItems) { klog.Infof("previously received data for %s is different than received by the standard list api call against etcd, diff: %v", identity, cmp.Diff(listItems, retrievedItems)) msg := fmt.Sprintf("data inconsistency detected for %s, panicking!", identity) panic(msg) } } // canFormAdditionalListCall ensures that we can form a valid LIST requests // for checking data consistency. func canFormAdditionalListCall(lastSyncedResourceVersion string, listOptions metav1.ListOptions) bool { // since we are setting ResourceVersionMatch to metav1.ResourceVersionMatchExact // we need to make sure that the continuation hasn't been set // https://github.com/kubernetes/kubernetes/blob/be4afb9ef90b19ccb6f7e595cbdb247e088b2347/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/validation/validation.go#L38 if len(listOptions.Continue) > 0 { return false } // since we are setting ResourceVersionMatch to metav1.ResourceVersionMatchExact // we need to make sure that the RV is valid because the validation code forbids RV == "0" // https://github.com/kubernetes/kubernetes/blob/be4afb9ef90b19ccb6f7e595cbdb247e088b2347/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/validation/validation.go#L44 if lastSyncedResourceVersion == "0" { return false } return true } // prepareListCallOptions changes the input list options so that // the list call goes directly to etcd func prepareListCallOptions(lastSyncedResourceVersion string, listOptions metav1.ListOptions, retrievedItemsCount int) metav1.ListOptions { // this is our legacy case: // // the watch cache skips the Limit if the ResourceVersion was set to "0" // thus, to compare with data retrieved directly from etcd // we need to skip the limit to for the list call as well. // // note that when the number of retrieved items is less than the request limit, // it means either the watch cache is disabled, or there is not enough data. // in both cases, we can use the limit because we will be able to compare // the data with the items retrieved from etcd. if listOptions.ResourceVersion == "0" && listOptions.Limit > 0 && int64(retrievedItemsCount) > listOptions.Limit { listOptions.Limit = 0 } // set the RV and RVM so that we get the snapshot of data // directly from etcd. listOptions.ResourceVersion = lastSyncedResourceVersion listOptions.ResourceVersionMatch = metav1.ResourceVersionMatchExact return listOptions } type byUID []metav1.Object func (a byUID) Len() int { return len(a) } func (a byUID) Less(i, j int) bool { return a[i].GetUID() < a[j].GetUID() } func (a byUID) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func toMetaObjectSliceOrDie[T any](s []T) []metav1.Object { result := make([]metav1.Object, len(s)) for i, v := range s { m, err := meta.Accessor(v) if err != nil { panic(err) } result[i] = m } return result } kubernetes-client-go-a2dfcab/util/consistencydetector/data_consistency_detector_test.go000066400000000000000000000220001472614177300322530ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package consistencydetector import ( "context" "fmt" "testing" "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/ptr" ) func TestDataConsistencyChecker(t *testing.T) { scenarios := []struct { name string lastSyncedResourceVersion string listResponse runtime.Object retrievedItems []runtime.Object requestOptions metav1.ListOptions expectedRequestOptions []metav1.ListOptions expectedListRequests int expectPanic bool }{ { name: "data consistency check won't panic when data is consistent", lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, TimeoutSeconds: ptr.To(int64(39)), }, }, }, { name: "data consistency check works with unstructured data (dynamic client)", lastSyncedResourceVersion: "2", listResponse: &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "vTest", "kind": "rTestList", }, Items: []unstructured.Unstructured{ *makeUnstructuredObject("vTest", "rTest", "item1"), *makeUnstructuredObject("vTest", "rTest", "item2"), }, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, retrievedItems: []runtime.Object{ makeUnstructuredObject("vTest", "rTest", "item1"), makeUnstructuredObject("vTest", "rTest", "item2"), }, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, TimeoutSeconds: ptr.To(int64(39)), }, }, }, { name: "legacy, the limit is removed from the list options when it wasn't honored by the watch cache", lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{ResourceVersion: "0", Limit: 2}, retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, }, }, }, { name: "the limit is NOT removed from the list options for non-legacy request", lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{ResourceVersion: "2", Limit: 2}, retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { Limit: 2, ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, }, }, }, { name: "legacy, the limit is NOT removed from the list options when the watch cache is disabled", lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{ResourceVersion: "0", Limit: 5}, retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { Limit: 5, ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, }, }, }, { name: "data consistency check won't panic when there is no data", lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, TimeoutSeconds: ptr.To(int64(39)), }, }, }, { name: "data consistency check won't be performed when Continuation was set", requestOptions: metav1.ListOptions{Continue: "fake continuation token"}, expectedListRequests: 0, }, { name: "data consistency check won't be performed when ResourceVersion was set to 0", lastSyncedResourceVersion: "0", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "0"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, }, requestOptions: metav1.ListOptions{}, expectedListRequests: 0, }, { name: "data consistency panics when data is inconsistent", lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, TimeoutSeconds: ptr.To(int64(39)), }, }, expectPanic: true, }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { ctx := context.TODO() if scenario.listResponse == nil { scenario.listResponse = &v1.PodList{} } fakeLister := &listWrapper{response: scenario.listResponse} retrievedItemsFunc := func() []runtime.Object { return scenario.retrievedItems } if scenario.expectPanic { require.Panics(t, func() { CheckDataConsistency(ctx, "", scenario.lastSyncedResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) }) } else { CheckDataConsistency(ctx, "", scenario.lastSyncedResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) } require.Equal(t, fakeLister.counter, scenario.expectedListRequests) require.Equal(t, fakeLister.requestOptions, scenario.expectedRequestOptions) }) } } func TestDataConsistencyCheckerRetry(t *testing.T) { ctx := context.TODO() retrievedItemsFunc := func() []*v1.Pod { return nil } stopListErrorAfter := 5 fakeErrLister := &errorLister{stopErrorAfter: stopListErrorAfter} CheckDataConsistency(ctx, "", "", fakeErrLister.List, metav1.ListOptions{}, retrievedItemsFunc) require.Equal(t, fakeErrLister.listCounter, fakeErrLister.stopErrorAfter) } type errorLister struct { listCounter int stopErrorAfter int } func (lw *errorLister) List(_ context.Context, _ metav1.ListOptions) (runtime.Object, error) { lw.listCounter++ if lw.listCounter == lw.stopErrorAfter { return &v1.PodList{}, nil } return nil, fmt.Errorf("nasty error") } type listWrapper struct { counter int requestOptions []metav1.ListOptions response runtime.Object } func (lw *listWrapper) List(_ context.Context, opts metav1.ListOptions) (runtime.Object, error) { lw.counter++ lw.requestOptions = append(lw.requestOptions, opts) return lw.response, nil } func makePod(name, rv string) *v1.Pod { return &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: name, ResourceVersion: rv, UID: types.UID(name)}} } func makeUnstructuredObject(version, kind, name string) *unstructured.Unstructured { return &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": version, "kind": kind, "metadata": map[string]interface{}{ "name": name, }, }, } } kubernetes-client-go-a2dfcab/util/consistencydetector/list_data_consistency_detector.go000066400000000000000000000060261472614177300322610ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package consistencydetector import ( "context" "os" "strconv" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) var dataConsistencyDetectionForListFromCacheEnabled = false func init() { dataConsistencyDetectionForListFromCacheEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_LIST_FROM_CACHE_INCONSISTENCY_DETECTOR")) } // CheckListFromCacheDataConsistencyIfRequested performs a data consistency check only when // the KUBE_LIST_FROM_CACHE_INCONSISTENCY_DETECTOR environment variable was set during a binary startup // for requests that have a high chance of being served from the watch-cache. // // The consistency check is meant to be enforced only in the CI, not in production. // The check ensures that data retrieved by a list api call from the watch-cache // is exactly the same as data received by the list api call from etcd. // // Note that this function will panic when data inconsistency is detected. // This is intentional because we want to catch it in the CI. // // Note that this function doesn't examine the ListOptions to determine // if the original request has hit the cache because it would be challenging // to maintain consistency with the server-side implementation. // For simplicity, we assume that the first request retrieved data from // the cache (even though this might not be true for some requests) // and issue the second call to get data from etcd for comparison. func CheckListFromCacheDataConsistencyIfRequested[T runtime.Object](ctx context.Context, identity string, listItemsFn ListFunc[T], optionsUsedToReceiveList metav1.ListOptions, receivedList runtime.Object) { if !dataConsistencyDetectionForListFromCacheEnabled { return } checkListFromCacheDataConsistencyIfRequestedInternal(ctx, identity, listItemsFn, optionsUsedToReceiveList, receivedList) } func checkListFromCacheDataConsistencyIfRequestedInternal[T runtime.Object](ctx context.Context, identity string, listItemsFn ListFunc[T], optionsUsedToReceiveList metav1.ListOptions, receivedList runtime.Object) { receivedListMeta, err := meta.ListAccessor(receivedList) if err != nil { panic(err) } rawListItems, err := meta.ExtractListWithAlloc(receivedList) if err != nil { panic(err) // this should never happen } lastSyncedResourceVersion := receivedListMeta.GetResourceVersion() CheckDataConsistency(ctx, identity, lastSyncedResourceVersion, listItemsFn, optionsUsedToReceiveList, func() []runtime.Object { return rawListItems }) } kubernetes-client-go-a2dfcab/util/consistencydetector/list_data_consistency_detector_test.go000066400000000000000000000107101472614177300333130ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package consistencydetector import ( "context" "testing" "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/ptr" ) var ( emptyListFunc = func(_ context.Context, opts metav1.ListOptions) (*v1.PodList, error) { return &v1.PodList{}, nil } emptyListOptions = metav1.ListOptions{} ) func TestDriveCheckWatchListFromCacheDataConsistencyIfRequested(t *testing.T) { ctx := context.TODO() CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "", emptyListFunc, emptyListOptions, &v1.PodList{}) } func TestDriveCheckListFromCacheDataConsistencyIfRequested(t *testing.T) { ctx := context.TODO() CheckListFromCacheDataConsistencyIfRequested(ctx, "", emptyListFunc, emptyListOptions, &v1.PodList{}) } func TestCheckListFromCacheDataConsistencyIfRequestedInternalPanics(t *testing.T) { ctx := context.TODO() pod := makePod("p1", "1") wrappedTarget := func() { checkListFromCacheDataConsistencyIfRequestedInternal(ctx, "", emptyListFunc, emptyListOptions, pod) } require.PanicsWithError(t, "object does not implement the List interfaces", wrappedTarget) } func TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath(t *testing.T) { scenarios := []struct { name string listResponse runtime.Object retrievedList runtime.Object retrievedListOptions metav1.ListOptions expectedRequestOptions metav1.ListOptions }{ { name: "list detector works with a typed list", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, }, retrievedListOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, retrievedList: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, }, expectedRequestOptions: metav1.ListOptions{ ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, TimeoutSeconds: ptr.To(int64(39)), }, }, { name: "list detector works with a unstructured list", listResponse: &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "vTest", "kind": "rTestList", "metadata": map[string]interface{}{ "resourceVersion": "3", }, }, Items: []unstructured.Unstructured{ *makeUnstructuredObject("vTest", "rTest", "item1"), *makeUnstructuredObject("vTest", "rTest", "item2"), *makeUnstructuredObject("vTest", "rTest", "item3"), }, }, retrievedListOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, retrievedList: &unstructured.UnstructuredList{ Object: map[string]interface{}{ "apiVersion": "vTest", "kind": "rTestList", "metadata": map[string]interface{}{ "resourceVersion": "3", }, }, Items: []unstructured.Unstructured{ *makeUnstructuredObject("vTest", "rTest", "item1"), *makeUnstructuredObject("vTest", "rTest", "item2"), *makeUnstructuredObject("vTest", "rTest", "item3"), }, }, expectedRequestOptions: metav1.ListOptions{ ResourceVersion: "3", ResourceVersionMatch: metav1.ResourceVersionMatchExact, TimeoutSeconds: ptr.To(int64(39)), }, }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { ctx := context.TODO() listOptions := metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))} fakeLister := &listWrapper{response: scenario.listResponse} checkListFromCacheDataConsistencyIfRequestedInternal(ctx, "", fakeLister.List, listOptions, scenario.retrievedList) require.Equal(t, 1, fakeLister.counter) require.Len(t, fakeLister.requestOptions, 1) require.Equal(t, fakeLister.requestOptions[0], scenario.expectedRequestOptions) }) } } kubernetes-client-go-a2dfcab/util/consistencydetector/watch_list_data_consistency_detector.go000066400000000000000000000042001472614177300334370ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package consistencydetector import ( "context" "os" "strconv" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) var dataConsistencyDetectionForWatchListEnabled = false func init() { dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) } // IsDataConsistencyDetectionForWatchListEnabled returns true when // the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. func IsDataConsistencyDetectionForWatchListEnabled() bool { return dataConsistencyDetectionForWatchListEnabled } // CheckWatchListFromCacheDataConsistencyIfRequested performs a data consistency check only when // the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. // // The consistency check is meant to be enforced only in the CI, not in production. // The check ensures that data retrieved by the watch-list api call // is exactly the same as data received by the standard list api call against etcd. // // Note that this function will panic when data inconsistency is detected. // This is intentional because we want to catch it in the CI. func CheckWatchListFromCacheDataConsistencyIfRequested[T runtime.Object](ctx context.Context, identity string, listItemsFn ListFunc[T], optionsUsedToReceiveList metav1.ListOptions, receivedList runtime.Object) { if !IsDataConsistencyDetectionForWatchListEnabled() { return } checkListFromCacheDataConsistencyIfRequestedInternal(ctx, identity, listItemsFn, optionsUsedToReceiveList, receivedList) } kubernetes-client-go-a2dfcab/util/csaupgrade/000077500000000000000000000000001472614177300214735ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/csaupgrade/OWNERS000066400000000000000000000002601472614177300224310ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - apelisse - alexzielenski reviewers: - apelisse - alexzielenski - KnVerey labels: - sig/api-machinery kubernetes-client-go-a2dfcab/util/csaupgrade/options.go000066400000000000000000000014651472614177300235230ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package csaupgrade type Option func(*options) // Subresource set the subresource to upgrade from CSA to SSA. func Subresource(s string) Option { return func(opts *options) { opts.subresource = s } } type options struct { subresource string } kubernetes-client-go-a2dfcab/util/csaupgrade/upgrade.go000066400000000000000000000235421472614177300234570ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package csaupgrade import ( "bytes" "encoding/json" "errors" "fmt" "reflect" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" "sigs.k8s.io/structured-merge-diff/v4/fieldpath" ) // Finds all managed fields owners of the given operation type which owns all of // the fields in the given set // // If there is an error decoding one of the fieldsets for any reason, it is ignored // and assumed not to match the query. func FindFieldsOwners( managedFields []metav1.ManagedFieldsEntry, operation metav1.ManagedFieldsOperationType, fields *fieldpath.Set, ) []metav1.ManagedFieldsEntry { var result []metav1.ManagedFieldsEntry for _, entry := range managedFields { if entry.Operation != operation { continue } fieldSet, err := decodeManagedFieldsEntrySet(entry) if err != nil { continue } if fields.Difference(&fieldSet).Empty() { result = append(result, entry) } } return result } // Upgrades the Manager information for fields managed with client-side-apply (CSA) // Prepares fields owned by `csaManager` for 'Update' operations for use now // with the given `ssaManager` for `Apply` operations. // // This transformation should be performed on an object if it has been previously // managed using client-side-apply to prepare it for future use with // server-side-apply. // // Caveats: // 1. This operation is not reversible. Information about which fields the client // owned will be lost in this operation. // 2. Supports being performed either before or after initial server-side apply. // 3. Client-side apply tends to own more fields (including fields that are defaulted), // this will possibly remove this defaults, they will be re-defaulted, that's fine. // 4. Care must be taken to not overwrite the managed fields on the server if they // have changed before sending a patch. // // obj - Target of the operation which has been managed with CSA in the past // csaManagerNames - Names of FieldManagers to merge into ssaManagerName // ssaManagerName - Name of FieldManager to be used for `Apply` operations func UpgradeManagedFields( obj runtime.Object, csaManagerNames sets.Set[string], ssaManagerName string, opts ...Option, ) error { o := options{} for _, opt := range opts { opt(&o) } accessor, err := meta.Accessor(obj) if err != nil { return err } filteredManagers := accessor.GetManagedFields() for csaManagerName := range csaManagerNames { filteredManagers, err = upgradedManagedFields( filteredManagers, csaManagerName, ssaManagerName, o) if err != nil { return err } } // Commit changes to object accessor.SetManagedFields(filteredManagers) return nil } // Calculates a minimal JSON Patch to send to upgrade managed fields // See `UpgradeManagedFields` for more information. // // obj - Target of the operation which has been managed with CSA in the past // csaManagerNames - Names of FieldManagers to merge into ssaManagerName // ssaManagerName - Name of FieldManager to be used for `Apply` operations // // Returns non-nil error if there was an error, a JSON patch, or nil bytes if // there is no work to be done. func UpgradeManagedFieldsPatch( obj runtime.Object, csaManagerNames sets.Set[string], ssaManagerName string, opts ...Option, ) ([]byte, error) { o := options{} for _, opt := range opts { opt(&o) } accessor, err := meta.Accessor(obj) if err != nil { return nil, err } managedFields := accessor.GetManagedFields() filteredManagers := accessor.GetManagedFields() for csaManagerName := range csaManagerNames { filteredManagers, err = upgradedManagedFields( filteredManagers, csaManagerName, ssaManagerName, o) if err != nil { return nil, err } } if reflect.DeepEqual(managedFields, filteredManagers) { // If the managed fields have not changed from the transformed version, // there is no patch to perform return nil, nil } // Create a patch with a diff between old and new objects. // Just include all managed fields since that is only thing that will change // // Also include test for RV to avoid race condition jsonPatch := []map[string]interface{}{ { "op": "replace", "path": "/metadata/managedFields", "value": filteredManagers, }, { // Use "replace" instead of "test" operation so that etcd rejects with // 409 conflict instead of apiserver with an invalid request "op": "replace", "path": "/metadata/resourceVersion", "value": accessor.GetResourceVersion(), }, } return json.Marshal(jsonPatch) } // Returns a copy of the provided managed fields that has been migrated from // client-side-apply to server-side-apply, or an error if there was an issue func upgradedManagedFields( managedFields []metav1.ManagedFieldsEntry, csaManagerName string, ssaManagerName string, opts options, ) ([]metav1.ManagedFieldsEntry, error) { if managedFields == nil { return nil, nil } // Create managed fields clone since we modify the values managedFieldsCopy := make([]metav1.ManagedFieldsEntry, len(managedFields)) if copy(managedFieldsCopy, managedFields) != len(managedFields) { return nil, errors.New("failed to copy managed fields") } managedFields = managedFieldsCopy // Locate SSA manager replaceIndex, managerExists := findFirstIndex(managedFields, func(entry metav1.ManagedFieldsEntry) bool { return entry.Manager == ssaManagerName && entry.Operation == metav1.ManagedFieldsOperationApply && entry.Subresource == opts.subresource }) if !managerExists { // SSA manager does not exist. Find the most recent matching CSA manager, // convert it to an SSA manager. // // (find first index, since managed fields are sorted so that most recent is // first in the list) replaceIndex, managerExists = findFirstIndex(managedFields, func(entry metav1.ManagedFieldsEntry) bool { return entry.Manager == csaManagerName && entry.Operation == metav1.ManagedFieldsOperationUpdate && entry.Subresource == opts.subresource }) if !managerExists { // There are no CSA managers that need to be converted. Nothing to do // Return early return managedFields, nil } // Convert CSA manager into SSA manager managedFields[replaceIndex].Operation = metav1.ManagedFieldsOperationApply managedFields[replaceIndex].Manager = ssaManagerName } err := unionManagerIntoIndex(managedFields, replaceIndex, csaManagerName, opts) if err != nil { return nil, err } // Create version of managed fields which has no CSA managers with the given name filteredManagers := filter(managedFields, func(entry metav1.ManagedFieldsEntry) bool { return !(entry.Manager == csaManagerName && entry.Operation == metav1.ManagedFieldsOperationUpdate && entry.Subresource == opts.subresource) }) return filteredManagers, nil } // Locates an Update manager entry named `csaManagerName` with the same APIVersion // as the manager at the targetIndex. Unions both manager's fields together // into the manager specified by `targetIndex`. No other managers are modified. func unionManagerIntoIndex( entries []metav1.ManagedFieldsEntry, targetIndex int, csaManagerName string, opts options, ) error { ssaManager := entries[targetIndex] // find Update manager of same APIVersion, union ssa fields with it. // discard all other Update managers of the same name csaManagerIndex, csaManagerExists := findFirstIndex(entries, func(entry metav1.ManagedFieldsEntry) bool { return entry.Manager == csaManagerName && entry.Operation == metav1.ManagedFieldsOperationUpdate && entry.Subresource == opts.subresource && entry.APIVersion == ssaManager.APIVersion }) targetFieldSet, err := decodeManagedFieldsEntrySet(ssaManager) if err != nil { return fmt.Errorf("failed to convert fields to set: %w", err) } combinedFieldSet := &targetFieldSet // Union the csa manager with the existing SSA manager. Do nothing if // there was no good candidate found if csaManagerExists { csaManager := entries[csaManagerIndex] csaFieldSet, err := decodeManagedFieldsEntrySet(csaManager) if err != nil { return fmt.Errorf("failed to convert fields to set: %w", err) } combinedFieldSet = combinedFieldSet.Union(&csaFieldSet) } // Encode the fields back to the serialized format err = encodeManagedFieldsEntrySet(&entries[targetIndex], *combinedFieldSet) if err != nil { return fmt.Errorf("failed to encode field set: %w", err) } return nil } func findFirstIndex[T any]( collection []T, predicate func(T) bool, ) (int, bool) { for idx, entry := range collection { if predicate(entry) { return idx, true } } return -1, false } func filter[T any]( collection []T, predicate func(T) bool, ) []T { result := make([]T, 0, len(collection)) for _, value := range collection { if predicate(value) { result = append(result, value) } } if len(result) == 0 { return nil } return result } // Included from fieldmanager.internal to avoid dependency cycle // FieldsToSet creates a set paths from an input trie of fields func decodeManagedFieldsEntrySet(f metav1.ManagedFieldsEntry) (s fieldpath.Set, err error) { err = s.FromJSON(bytes.NewReader(f.FieldsV1.Raw)) return s, err } // SetToFields creates a trie of fields from an input set of paths func encodeManagedFieldsEntrySet(f *metav1.ManagedFieldsEntry, s fieldpath.Set) (err error) { f.FieldsV1.Raw, err = s.ToJSON() return err } kubernetes-client-go-a2dfcab/util/csaupgrade/upgrade_test.go000066400000000000000000001076321472614177300245210ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package csaupgrade_test import ( "encoding/json" "reflect" "testing" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" jsonpatch "gopkg.in/evanphx/json-patch.v4" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/client-go/util/csaupgrade" "sigs.k8s.io/structured-merge-diff/v4/fieldpath" ) func TestFindOwners(t *testing.T) { testCases := []struct { Name string ManagedFieldsYAML string Operation metav1.ManagedFieldsOperationType Fields *fieldpath.Set Expectation []string }{ { // Field a root field path owner Name: "Basic", ManagedFieldsYAML: ` managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" `, Operation: metav1.ManagedFieldsOperationUpdate, Fields: fieldpath.NewSet(fieldpath.MakePathOrDie("data")), Expectation: []string{"kubectl-client-side-apply"}, }, { // Find a fieldpath nested inside another field Name: "Nested", ManagedFieldsYAML: ` managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" `, Operation: metav1.ManagedFieldsOperationUpdate, Fields: fieldpath.NewSet(fieldpath.MakePathOrDie("metadata", "annotations", "kubectl.kubernetes.io/last-applied-configuration")), Expectation: []string{"kubectl-client-side-apply"}, }, { // Search for an operaiton/fieldpath combination that is not found on both // axes Name: "NotFound", ManagedFieldsYAML: ` managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" `, Operation: metav1.ManagedFieldsOperationUpdate, Fields: fieldpath.NewSet(fieldpath.MakePathOrDie("metadata", "annotations", "kubectl.kubernetes.io/last-applied-configuration")), Expectation: []string{}, }, { // Test using apply operation Name: "ApplyOperation", ManagedFieldsYAML: ` managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" `, Operation: metav1.ManagedFieldsOperationApply, Fields: fieldpath.NewSet(fieldpath.MakePathOrDie("metadata", "annotations", "kubectl.kubernetes.io/last-applied-configuration")), Expectation: []string{"kubectl"}, }, { // Of multiple field managers, match a single one Name: "OneOfMultiple", ManagedFieldsYAML: ` managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-23T23:08:23Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" `, Operation: metav1.ManagedFieldsOperationUpdate, Fields: fieldpath.NewSet(fieldpath.MakePathOrDie("metadata", "annotations", "kubectl.kubernetes.io/last-applied-configuration")), Expectation: []string{"kubectl-client-side-apply"}, }, { // have multiple field managers, and match more than one but not all of them Name: "ManyOfMultiple", ManagedFieldsYAML: ` managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-23T23:08:23Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:data: .: {} f:key: {} f:legacy: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl-client-side-apply2 operation: Update time: "2022-08-23T23:08:23Z" `, Operation: metav1.ManagedFieldsOperationUpdate, Fields: fieldpath.NewSet(fieldpath.MakePathOrDie("metadata", "annotations", "kubectl.kubernetes.io/last-applied-configuration")), Expectation: []string{"kubectl-client-side-apply", "kubectl-client-side-apply2"}, }, { // Test with multiple fields to match against Name: "BasicMultipleFields", ManagedFieldsYAML: ` managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:data: .: {} f:key: {} f:legacy: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-23T23:08:23Z" `, Operation: metav1.ManagedFieldsOperationUpdate, Fields: fieldpath.NewSet( fieldpath.MakePathOrDie("data", "key"), fieldpath.MakePathOrDie("metadata", "annotations", "kubectl.kubernetes.io/last-applied-configuration"), ), Expectation: []string{"kubectl-client-side-apply"}, }, { // Test with multiplle fields but the manager is missing one of the fields // requested so it does not match Name: "MissingOneField", ManagedFieldsYAML: ` managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:data: .: {} f:legacy: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-23T23:08:23Z" `, Operation: metav1.ManagedFieldsOperationUpdate, Fields: fieldpath.NewSet( fieldpath.MakePathOrDie("data", "key"), fieldpath.MakePathOrDie("metadata", "annotations", "kubectl.kubernetes.io/last-applied-configuration"), ), Expectation: []string{}, }, } for _, tcase := range testCases { t.Run(tcase.Name, func(t *testing.T) { var entries struct { ManagedFields []metav1.ManagedFieldsEntry `json:"managedFields"` } err := yaml.Unmarshal([]byte(tcase.ManagedFieldsYAML), &entries) require.NoError(t, err) result := csaupgrade.FindFieldsOwners(entries.ManagedFields, tcase.Operation, tcase.Fields) // Compare owner names since they uniquely identify the selected entries // (given that the operation is provided) ownerNames := []string{} for _, entry := range result { ownerNames = append(ownerNames, entry.Manager) require.Equal(t, tcase.Operation, entry.Operation) } require.ElementsMatch(t, tcase.Expectation, ownerNames) }) } } func TestUpgradeCSA(t *testing.T) { cases := []struct { Name string CSAManagers []string SSAManager string Options []csaupgrade.Option OriginalObject []byte ExpectedObject []byte }{ { // Case where there is a CSA entry with the given name, but no SSA entry // is found. Expect that the CSA entry is converted to an SSA entry // and renamed. Name: "csa-basic-direct-conversion", CSAManagers: []string{"kubectl-client-side-apply"}, SSAManager: "kubectl", OriginalObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" name: test namespace: default `), ExpectedObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-22T23:08:23Z" name: test namespace: default `), }, { // This is the case when kubectl --server-side is used for the first time // Server creates duplicate managed fields entry - one for Update and another // for Apply. Expect entries to be merged into one entry, which is unchanged // from initial SSA. Name: "csa-combine-with-ssa-duplicate-keys", CSAManagers: []string{"kubectl-client-side-apply"}, SSAManager: "kubectl", OriginalObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" name: test namespace: default `), ExpectedObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" name: test namespace: default `), }, { // This is the case when kubectl --server-side is used for the first time, // but then a key is removed. A bug would take place where key is left in // CSA entry but no longer present in SSA entry, so it would not be pruned. // This shows that upgrading such an object results in correct behavior next // time SSA applier // Expect final object to have unioned keys from both entries Name: "csa-combine-with-ssa-additional-keys", CSAManagers: []string{"kubectl-client-side-apply"}, SSAManager: "kubectl", OriginalObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" name: test namespace: default `), ExpectedObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" name: test namespace: default `), }, { // Case when there are multiple CSA versions on the object which do not // match the version from the apply entry. Shows they are tossed away // without being merged. Name: "csa-no-applicable-version", CSAManagers: []string{"kubectl-client-side-apply"}, SSAManager: "kubectl", OriginalObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v5 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:data: f:key2: {} f:metadata: f:annotations: f:hello2: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" - apiVersion: v2 fieldsType: FieldsV1 fieldsV1: f:data: f:key3: {} f:metadata: f:annotations: f:hello3: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" - apiVersion: v3 fieldsType: FieldsV1 fieldsV1: f:data: f:key4: {} f:metadata: f:annotations: f:hello3: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" - apiVersion: v4 fieldsType: FieldsV1 fieldsV1: f:data: f:key5: {} f:metadata: f:annotations: f:hello4: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" name: test namespace: default `), ExpectedObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v5 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" name: test namespace: default `), }, { // Case when there are multiple CSA versions on the object which do not // match the version from the apply entry, and one which does. // Shows that CSA entry with matching version is unioned into the SSA entry. Name: "csa-single-applicable-version", CSAManagers: []string{"kubectl-client-side-apply"}, SSAManager: "kubectl", OriginalObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v5 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" - apiVersion: v5 fieldsType: FieldsV1 fieldsV1: f:data: f:key2: {} f:metadata: f:annotations: f:hello2: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" - apiVersion: v2 fieldsType: FieldsV1 fieldsV1: f:data: f:key3: {} f:metadata: f:annotations: f:hello3: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" - apiVersion: v3 fieldsType: FieldsV1 fieldsV1: f:data: f:key4: {} f:metadata: f:annotations: f:hello4: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" - apiVersion: v4 fieldsType: FieldsV1 fieldsV1: f:data: f:key5: {} f:metadata: f:annotations: f:hello5: {} manager: kubectl-client-side-apply operation: Update time: "2022-08-22T23:08:23Z" name: test namespace: default `), ExpectedObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v5 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:key2: {} f:legacy: {} f:metadata: f:annotations: .: {} f:hello2: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" name: test namespace: default `), }, { // Do nothing to object with nothing to migrate and no existing SSA manager Name: "noop", CSAManagers: []string{"kubectl-client-side-apply"}, SSAManager: "not-already-in-object", OriginalObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v5 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" name: test namespace: default `), ExpectedObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v5 fieldsType: FieldsV1 fieldsV1: f:data: .: {} f:key: {} f:legacy: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} manager: kubectl operation: Apply time: "2022-08-23T23:08:23Z" name: test namespace: default `), }, { // Expect multiple targets to be merged into existing ssa manager Name: "multipleTargetsExisting", CSAManagers: []string{"kube-scheduler", "kubectl-client-side-apply"}, SSAManager: "kubectl", OriginalObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:labels: f:name: {} f:spec: f:containers: k:{"name":"kubernetes-pause"}: .: {} f:image: {} f:name: {} manager: kubectl operation: Apply - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:status: f:conditions: .: {} k:{"type":"PodScheduled"}: .: {} f:lastProbeTime: {} f:lastTransitionTime: {} f:message: {} f:reason: {} f:status: {} f:type: {} manager: kube-scheduler operation: Update time: "2022-11-03T23:22:40Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:labels: .: {} f:name: {} f:spec: f:containers: k:{"name":"kubernetes-pause"}: .: {} f:image: {} f:imagePullPolicy: {} f:name: {} f:resources: {} f:terminationMessagePath: {} f:terminationMessagePolicy: {} f:dnsPolicy: {} f:enableServiceLinks: {} f:restartPolicy: {} f:schedulerName: {} f:securityContext: {} f:terminationGracePeriodSeconds: {} manager: kubectl-client-side-apply operation: Update time: "2022-11-03T23:22:40Z" name: test namespace: default `), ExpectedObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:status: f:conditions: .: {} k:{"type":"PodScheduled"}: .: {} f:lastProbeTime: {} f:lastTransitionTime: {} f:message: {} f:reason: {} f:status: {} f:type: {} f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:labels: .: {} f:name: {} f:spec: f:containers: k:{"name":"kubernetes-pause"}: .: {} f:image: {} f:imagePullPolicy: {} f:name: {} f:resources: {} f:terminationMessagePath: {} f:terminationMessagePolicy: {} f:dnsPolicy: {} f:enableServiceLinks: {} f:restartPolicy: {} f:schedulerName: {} f:securityContext: {} f:terminationGracePeriodSeconds: {} manager: kubectl operation: Apply name: test namespace: default `), }, { // Expect multiple targets to be merged into a new ssa manager Name: "multipleTargetsNewInsertion", CSAManagers: []string{"kubectl-client-side-apply", "kube-scheduler"}, SSAManager: "newly-inserted-manager", OriginalObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:labels: f:name: {} f:spec: f:containers: k:{"name":"kubernetes-pause"}: .: {} f:image: {} f:name: {} manager: kubectl operation: Apply - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:status: f:conditions: .: {} k:{"type":"PodScheduled"}: .: {} f:lastProbeTime: {} f:lastTransitionTime: {} f:message: {} f:reason: {} f:status: {} f:type: {} manager: kube-scheduler operation: Update time: "2022-11-03T23:22:40Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:labels: .: {} f:name: {} f:spec: f:containers: k:{"name":"kubernetes-pause"}: .: {} f:image: {} f:imagePullPolicy: {} f:name: {} f:resources: {} f:terminationMessagePath: {} f:terminationMessagePolicy: {} f:dnsPolicy: {} f:enableServiceLinks: {} f:restartPolicy: {} f:schedulerName: {} f:securityContext: {} f:terminationGracePeriodSeconds: {} manager: kubectl-client-side-apply operation: Update time: "2022-11-03T23:22:40Z" name: test namespace: default `), ExpectedObject: []byte(` apiVersion: v1 data: {} kind: ConfigMap metadata: resourceVersion: "1" annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","data":{"key":"value","legacy":"unused"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}} creationTimestamp: "2022-08-22T23:08:23Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:labels: f:name: {} f:spec: f:containers: k:{"name":"kubernetes-pause"}: .: {} f:image: {} f:name: {} manager: kubectl operation: Apply - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:labels: .: {} f:name: {} f:spec: f:containers: k:{"name":"kubernetes-pause"}: .: {} f:image: {} f:imagePullPolicy: {} f:name: {} f:resources: {} f:terminationMessagePath: {} f:terminationMessagePolicy: {} f:dnsPolicy: {} f:enableServiceLinks: {} f:restartPolicy: {} f:schedulerName: {} f:securityContext: {} f:terminationGracePeriodSeconds: {} f:status: f:conditions: .: {} k:{"type":"PodScheduled"}: .: {} f:lastProbeTime: {} f:lastTransitionTime: {} f:message: {} f:reason: {} f:status: {} f:type: {} manager: newly-inserted-manager operation: Apply time: "2022-11-03T23:22:40Z" name: test namespace: default `), }, { // Expect multiple targets to be merged into a new ssa manager Name: "subresource", CSAManagers: []string{"kube-controller-manager"}, SSAManager: "kube-controller-manager", Options: []csaupgrade.Option{csaupgrade.Subresource("status")}, OriginalObject: []byte(` apiVersion: v1 kind: PersistentVolumeClaim metadata: annotations: pv.kubernetes.io/bind-completed: "yes" pv.kubernetes.io/bound-by-controller: "yes" volume.beta.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com volume.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com creationTimestamp: "2024-02-24T15:24:31Z" finalizers: - kubernetes.io/pvc-protection managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:spec: f:accessModes: {} f:resources: f:requests: .: {} f:storage: {} f:storageClassName: {} f:volumeMode: {} manager: Mozilla operation: Update time: "2024-02-24T15:24:31Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:pv.kubernetes.io/bind-completed: {} f:pv.kubernetes.io/bound-by-controller: {} f:volume.beta.kubernetes.io/storage-provisioner: {} f:volume.kubernetes.io/storage-provisioner: {} f:spec: f:volumeName: {} manager: kube-controller-manager operation: Update time: "2024-02-24T15:24:32Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:status: f:accessModes: {} f:capacity: .: {} f:storage: {} f:phase: {} manager: kube-controller-manager operation: Update subresource: status time: "2024-02-24T15:24:32Z" name: test namespace: default resourceVersion: "948647140" uid: f0692a61-0ffe-4fd5-b00f-0b95f3654fb9 spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi storageClassName: ocs-storagecluster-cephfs volumeMode: Filesystem volumeName: pvc-f0692a61-0ffe-4fd5-b00f-0b95f3654fb9 status: accessModes: - ReadWriteOnce capacity: storage: 1Gi phase: Bound `), ExpectedObject: []byte(` apiVersion: v1 kind: PersistentVolumeClaim metadata: annotations: pv.kubernetes.io/bind-completed: "yes" pv.kubernetes.io/bound-by-controller: "yes" volume.beta.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com volume.kubernetes.io/storage-provisioner: openshift-storage.cephfs.csi.ceph.com creationTimestamp: "2024-02-24T15:24:31Z" finalizers: - kubernetes.io/pvc-protection managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:spec: f:accessModes: {} f:resources: f:requests: .: {} f:storage: {} f:storageClassName: {} f:volumeMode: {} manager: Mozilla operation: Update time: "2024-02-24T15:24:31Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:pv.kubernetes.io/bind-completed: {} f:pv.kubernetes.io/bound-by-controller: {} f:volume.beta.kubernetes.io/storage-provisioner: {} f:volume.kubernetes.io/storage-provisioner: {} f:spec: f:volumeName: {} manager: kube-controller-manager operation: Update time: "2024-02-24T15:24:32Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:status: f:accessModes: {} f:capacity: .: {} f:storage: {} f:phase: {} manager: kube-controller-manager operation: Apply subresource: status time: "2024-02-24T15:24:32Z" name: test namespace: default resourceVersion: "948647140" uid: f0692a61-0ffe-4fd5-b00f-0b95f3654fb9 spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi storageClassName: ocs-storagecluster-cephfs volumeMode: Filesystem volumeName: pvc-f0692a61-0ffe-4fd5-b00f-0b95f3654fb9 status: accessModes: - ReadWriteOnce capacity: storage: 1Gi phase: Bound `), }, } for _, testCase := range cases { t.Run(testCase.Name, func(t *testing.T) { initialObject := unstructured.Unstructured{} err := yaml.Unmarshal(testCase.OriginalObject, &initialObject.Object) if err != nil { t.Fatal(err) } upgraded := initialObject.DeepCopy() err = csaupgrade.UpgradeManagedFields( upgraded, sets.New(testCase.CSAManagers...), testCase.SSAManager, testCase.Options..., ) if err != nil { t.Fatal(err) } expectedObject := unstructured.Unstructured{} err = yaml.Unmarshal(testCase.ExpectedObject, &expectedObject.Object) if err != nil { t.Fatal(err) } if !reflect.DeepEqual(&expectedObject, upgraded) { t.Fatal(cmp.Diff(&expectedObject, upgraded)) } // Show that the UpgradeManagedFieldsPatch yields a patch that does // nothing more and nothing less than make the object equal to output // of UpgradeManagedFields initialCopy := initialObject.DeepCopyObject() patchBytes, err := csaupgrade.UpgradeManagedFieldsPatch( initialCopy, sets.New(testCase.CSAManagers...), testCase.SSAManager, testCase.Options...) if err != nil { t.Fatal(err) } else if patchBytes != nil { patch, err := jsonpatch.DecodePatch(patchBytes) if err != nil { t.Fatal(err) } initialJSON, err := json.Marshal(initialObject.Object) if err != nil { t.Fatal(err) } patchedBytes, err := patch.Apply(initialJSON) if err != nil { t.Fatal(err) } var patched unstructured.Unstructured if err := json.Unmarshal(patchedBytes, &patched.Object); err != nil { t.Fatal(err) } if !reflect.DeepEqual(&patched, upgraded) { t.Fatalf("expected patch to produce an upgraded object: %v", cmp.Diff(patched, upgraded)) } } }) } } kubernetes-client-go-a2dfcab/util/exec/000077500000000000000000000000001472614177300203015ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/exec/exec.go000066400000000000000000000026031472614177300215550ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package exec // ExitError is an interface that presents an API similar to os.ProcessState, which is // what ExitError from os/exec is. This is designed to make testing a bit easier and // probably loses some of the cross-platform properties of the underlying library. type ExitError interface { String() string Error() string Exited() bool ExitStatus() int } // CodeExitError is an implementation of ExitError consisting of an error object // and an exit code (the upper bits of os.exec.ExitStatus). type CodeExitError struct { Err error Code int } var _ ExitError = CodeExitError{} func (e CodeExitError) Error() string { return e.Err.Error() } func (e CodeExitError) String() string { return e.Err.Error() } func (e CodeExitError) Exited() bool { return true } func (e CodeExitError) ExitStatus() int { return e.Code } kubernetes-client-go-a2dfcab/util/flowcontrol/000077500000000000000000000000001472614177300217255ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/flowcontrol/backoff.go000066400000000000000000000117101472614177300236470ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package flowcontrol import ( "math/rand" "sync" "time" "k8s.io/utils/clock" testingclock "k8s.io/utils/clock/testing" ) type backoffEntry struct { backoff time.Duration lastUpdate time.Time } type Backoff struct { sync.RWMutex Clock clock.Clock defaultDuration time.Duration maxDuration time.Duration perItemBackoff map[string]*backoffEntry rand *rand.Rand // maxJitterFactor adds jitter to the exponentially backed off delay. // if maxJitterFactor is zero, no jitter is added to the delay in // order to maintain current behavior. maxJitterFactor float64 } func NewFakeBackOff(initial, max time.Duration, tc *testingclock.FakeClock) *Backoff { return newBackoff(tc, initial, max, 0.0) } func NewBackOff(initial, max time.Duration) *Backoff { return NewBackOffWithJitter(initial, max, 0.0) } func NewFakeBackOffWithJitter(initial, max time.Duration, tc *testingclock.FakeClock, maxJitterFactor float64) *Backoff { return newBackoff(tc, initial, max, maxJitterFactor) } func NewBackOffWithJitter(initial, max time.Duration, maxJitterFactor float64) *Backoff { clock := clock.RealClock{} return newBackoff(clock, initial, max, maxJitterFactor) } func newBackoff(clock clock.Clock, initial, max time.Duration, maxJitterFactor float64) *Backoff { var random *rand.Rand if maxJitterFactor > 0 { random = rand.New(rand.NewSource(clock.Now().UnixNano())) } return &Backoff{ perItemBackoff: map[string]*backoffEntry{}, Clock: clock, defaultDuration: initial, maxDuration: max, maxJitterFactor: maxJitterFactor, rand: random, } } // Get the current backoff Duration func (p *Backoff) Get(id string) time.Duration { p.RLock() defer p.RUnlock() var delay time.Duration entry, ok := p.perItemBackoff[id] if ok { delay = entry.backoff } return delay } // move backoff to the next mark, capping at maxDuration func (p *Backoff) Next(id string, eventTime time.Time) { p.Lock() defer p.Unlock() entry, ok := p.perItemBackoff[id] if !ok || hasExpired(eventTime, entry.lastUpdate, p.maxDuration) { entry = p.initEntryUnsafe(id) entry.backoff += p.jitter(entry.backoff) } else { delay := entry.backoff * 2 // exponential delay += p.jitter(entry.backoff) // add some jitter to the delay entry.backoff = min(delay, p.maxDuration) } entry.lastUpdate = p.Clock.Now() } // Reset forces clearing of all backoff data for a given key. func (p *Backoff) Reset(id string) { p.Lock() defer p.Unlock() delete(p.perItemBackoff, id) } // Returns True if the elapsed time since eventTime is smaller than the current backoff window func (p *Backoff) IsInBackOffSince(id string, eventTime time.Time) bool { p.RLock() defer p.RUnlock() entry, ok := p.perItemBackoff[id] if !ok { return false } if hasExpired(eventTime, entry.lastUpdate, p.maxDuration) { return false } return p.Clock.Since(eventTime) < entry.backoff } // Returns True if time since lastupdate is less than the current backoff window. func (p *Backoff) IsInBackOffSinceUpdate(id string, eventTime time.Time) bool { p.RLock() defer p.RUnlock() entry, ok := p.perItemBackoff[id] if !ok { return false } if hasExpired(eventTime, entry.lastUpdate, p.maxDuration) { return false } return eventTime.Sub(entry.lastUpdate) < entry.backoff } // Garbage collect records that have aged past maxDuration. Backoff users are expected // to invoke this periodically. func (p *Backoff) GC() { p.Lock() defer p.Unlock() now := p.Clock.Now() for id, entry := range p.perItemBackoff { if now.Sub(entry.lastUpdate) > p.maxDuration*2 { // GC when entry has not been updated for 2*maxDuration delete(p.perItemBackoff, id) } } } func (p *Backoff) DeleteEntry(id string) { p.Lock() defer p.Unlock() delete(p.perItemBackoff, id) } // Take a lock on *Backoff, before calling initEntryUnsafe func (p *Backoff) initEntryUnsafe(id string) *backoffEntry { entry := &backoffEntry{backoff: p.defaultDuration} p.perItemBackoff[id] = entry return entry } func (p *Backoff) jitter(delay time.Duration) time.Duration { if p.rand == nil { return 0 } return time.Duration(p.rand.Float64() * p.maxJitterFactor * float64(delay)) } // After 2*maxDuration we restart the backoff factor to the beginning func hasExpired(eventTime time.Time, lastUpdate time.Time, maxDuration time.Duration) bool { return eventTime.Sub(lastUpdate) > maxDuration*2 // consider stable if it's ok for twice the maxDuration } kubernetes-client-go-a2dfcab/util/flowcontrol/backoff_test.go000066400000000000000000000165211472614177300247130ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package flowcontrol import ( "testing" "time" testingclock "k8s.io/utils/clock/testing" ) func TestSlowBackoff(t *testing.T) { id := "_idSlow" tc := testingclock.NewFakeClock(time.Now()) step := time.Second maxDuration := 50 * step b := NewFakeBackOff(step, maxDuration, tc) cases := []time.Duration{0, 1, 2, 4, 8, 16, 32, 50, 50, 50} for ix, c := range cases { tc.Step(step) w := b.Get(id) if w != c*step { t.Errorf("input: '%d': expected %s, got %s", ix, c*step, w) } b.Next(id, tc.Now()) } //Now confirm that the Reset cancels backoff. b.Next(id, tc.Now()) b.Reset(id) if b.Get(id) != 0 { t.Errorf("Reset didn't clear the backoff.") } } func TestBackoffReset(t *testing.T) { id := "_idReset" tc := testingclock.NewFakeClock(time.Now()) step := time.Second maxDuration := step * 5 b := NewFakeBackOff(step, maxDuration, tc) startTime := tc.Now() // get to backoff = maxDuration for i := 0; i <= int(maxDuration/step); i++ { tc.Step(step) b.Next(id, tc.Now()) } // backoff should be capped at maxDuration if !b.IsInBackOffSince(id, tc.Now()) { t.Errorf("expected to be in Backoff got %s", b.Get(id)) } lastUpdate := tc.Now() tc.Step(2*maxDuration + step) // time += 11s, 11 > 2*maxDuration if b.IsInBackOffSince(id, lastUpdate) { t.Errorf("expected to not be in Backoff after reset (start=%s, now=%s, lastUpdate=%s), got %s", startTime, tc.Now(), lastUpdate, b.Get(id)) } } func TestBackoffHighWaterMark(t *testing.T) { id := "_idHiWaterMark" tc := testingclock.NewFakeClock(time.Now()) step := time.Second maxDuration := 5 * step b := NewFakeBackOff(step, maxDuration, tc) // get to backoff = maxDuration for i := 0; i <= int(maxDuration/step); i++ { tc.Step(step) b.Next(id, tc.Now()) } // backoff high watermark expires after 2*maxDuration tc.Step(maxDuration + step) b.Next(id, tc.Now()) if b.Get(id) != maxDuration { t.Errorf("expected Backoff to stay at high watermark %s got %s", maxDuration, b.Get(id)) } } func TestBackoffGC(t *testing.T) { id := "_idGC" tc := testingclock.NewFakeClock(time.Now()) step := time.Second maxDuration := 5 * step b := NewFakeBackOff(step, maxDuration, tc) for i := 0; i <= int(maxDuration/step); i++ { tc.Step(step) b.Next(id, tc.Now()) } lastUpdate := tc.Now() tc.Step(maxDuration + step) b.GC() _, found := b.perItemBackoff[id] if !found { t.Errorf("expected GC to skip entry, elapsed time=%s maxDuration=%s", tc.Since(lastUpdate), maxDuration) } tc.Step(maxDuration + step) b.GC() r, found := b.perItemBackoff[id] if found { t.Errorf("expected GC of entry after %s got entry %v", tc.Since(lastUpdate), r) } } func TestIsInBackOffSinceUpdate(t *testing.T) { id := "_idIsInBackOffSinceUpdate" tc := testingclock.NewFakeClock(time.Now()) step := time.Second maxDuration := 10 * step b := NewFakeBackOff(step, maxDuration, tc) startTime := tc.Now() cases := []struct { tick time.Duration inBackOff bool value int }{ {tick: 0, inBackOff: false, value: 0}, {tick: 1, inBackOff: false, value: 1}, {tick: 2, inBackOff: true, value: 2}, {tick: 3, inBackOff: false, value: 2}, {tick: 4, inBackOff: true, value: 4}, {tick: 5, inBackOff: true, value: 4}, {tick: 6, inBackOff: true, value: 4}, {tick: 7, inBackOff: false, value: 4}, {tick: 8, inBackOff: true, value: 8}, {tick: 9, inBackOff: true, value: 8}, {tick: 10, inBackOff: true, value: 8}, {tick: 11, inBackOff: true, value: 8}, {tick: 12, inBackOff: true, value: 8}, {tick: 13, inBackOff: true, value: 8}, {tick: 14, inBackOff: true, value: 8}, {tick: 15, inBackOff: false, value: 8}, {tick: 16, inBackOff: true, value: 10}, {tick: 17, inBackOff: true, value: 10}, {tick: 18, inBackOff: true, value: 10}, {tick: 19, inBackOff: true, value: 10}, {tick: 20, inBackOff: true, value: 10}, {tick: 21, inBackOff: true, value: 10}, {tick: 22, inBackOff: true, value: 10}, {tick: 23, inBackOff: true, value: 10}, {tick: 24, inBackOff: true, value: 10}, {tick: 25, inBackOff: false, value: 10}, {tick: 26, inBackOff: true, value: 10}, {tick: 27, inBackOff: true, value: 10}, {tick: 28, inBackOff: true, value: 10}, {tick: 29, inBackOff: true, value: 10}, {tick: 30, inBackOff: true, value: 10}, {tick: 31, inBackOff: true, value: 10}, {tick: 32, inBackOff: true, value: 10}, {tick: 33, inBackOff: true, value: 10}, {tick: 34, inBackOff: true, value: 10}, {tick: 35, inBackOff: false, value: 10}, {tick: 56, inBackOff: false, value: 0}, {tick: 57, inBackOff: false, value: 1}, } for _, c := range cases { tc.SetTime(startTime.Add(c.tick * step)) if c.inBackOff != b.IsInBackOffSinceUpdate(id, tc.Now()) { t.Errorf("expected IsInBackOffSinceUpdate %v got %v at tick %s", c.inBackOff, b.IsInBackOffSinceUpdate(id, tc.Now()), c.tick*step) } if c.inBackOff && (time.Duration(c.value)*step != b.Get(id)) { t.Errorf("expected backoff value=%s got %s at tick %s", time.Duration(c.value)*step, b.Get(id), c.tick*step) } if !c.inBackOff { b.Next(id, tc.Now()) } } } func TestBackoffWithJitter(t *testing.T) { id := "_idJitter" tc := testingclock.NewFakeClock(time.Now()) // test setup: we show 11 iterations, series of delays we expect with // a jitter factor of zero each time: // 100ms 200ms 400ms 800ms 1.6s 3.2s 06.4s 12.8s 25.6s 51.2s 1m42s // and with jitter factor of 0.1 (max) each time: // 110ms 231ms 485ms 1.0s 2.1s 4.4s 09.4s 19.8s 41.6s 1m27s 2m6s // // with the following configuration, it is guaranteed that the maximum delay // will be reached even though we are unlucky and get jitter factor of zero. // This ensures that this test covers the code path for checking whether // maximum delay has been reached with jitter enabled. initial := 100 * time.Millisecond maxDuration := time.Minute maxJitterFactor := 0.1 attempts := 10 b := NewFakeBackOffWithJitter(initial, maxDuration, tc, maxJitterFactor) assert := func(t *testing.T, factor int, prevDelayGot, curDelayGot time.Duration) { low := time.Duration((float64(prevDelayGot) * float64(factor))) high := low + time.Duration(maxJitterFactor*float64(prevDelayGot)) if !((curDelayGot > low && curDelayGot <= high) || curDelayGot == maxDuration) { t.Errorf("jittered delay not within range: (%s - %s], but got %s", low, high, curDelayGot) } } delays := make([]time.Duration, 0) next := func() time.Duration { tc.Step(initial) b.Next(id, tc.Now()) delay := b.Get(id) delays = append(delays, delay) return delay } if got := b.Get(id); got != 0 { t.Errorf("expected a zero wait durtion, but got: %s", got) } delayGot := next() assert(t, 1, initial, delayGot) prevDelayGot := delayGot for i := 0; i < attempts; i++ { delayGot = next() assert(t, 2, prevDelayGot, delayGot) prevDelayGot = delayGot } t.Logf("exponentially backed off jittered delays: %v", delays) } kubernetes-client-go-a2dfcab/util/flowcontrol/throttle.go000066400000000000000000000126031472614177300241230ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package flowcontrol import ( "context" "errors" "sync" "time" "golang.org/x/time/rate" "k8s.io/utils/clock" ) type PassiveRateLimiter interface { // TryAccept returns true if a token is taken immediately. Otherwise, // it returns false. TryAccept() bool // Stop stops the rate limiter, subsequent calls to CanAccept will return false Stop() // QPS returns QPS of this rate limiter QPS() float32 } type RateLimiter interface { PassiveRateLimiter // Accept returns once a token becomes available. Accept() // Wait returns nil if a token is taken before the Context is done. Wait(ctx context.Context) error } type tokenBucketPassiveRateLimiter struct { limiter *rate.Limiter qps float32 clock clock.PassiveClock } type tokenBucketRateLimiter struct { tokenBucketPassiveRateLimiter clock Clock } // NewTokenBucketRateLimiter creates a rate limiter which implements a token bucket approach. // The rate limiter allows bursts of up to 'burst' to exceed the QPS, while still maintaining a // smoothed qps rate of 'qps'. // The bucket is initially filled with 'burst' tokens, and refills at a rate of 'qps'. // The maximum number of tokens in the bucket is capped at 'burst'. func NewTokenBucketRateLimiter(qps float32, burst int) RateLimiter { limiter := rate.NewLimiter(rate.Limit(qps), burst) return newTokenBucketRateLimiterWithClock(limiter, clock.RealClock{}, qps) } // NewTokenBucketPassiveRateLimiter is similar to NewTokenBucketRateLimiter except that it returns // a PassiveRateLimiter which does not have Accept() and Wait() methods. func NewTokenBucketPassiveRateLimiter(qps float32, burst int) PassiveRateLimiter { limiter := rate.NewLimiter(rate.Limit(qps), burst) return newTokenBucketRateLimiterWithPassiveClock(limiter, clock.RealClock{}, qps) } // An injectable, mockable clock interface. type Clock interface { clock.PassiveClock Sleep(time.Duration) } var _ Clock = (*clock.RealClock)(nil) // NewTokenBucketRateLimiterWithClock is identical to NewTokenBucketRateLimiter // but allows an injectable clock, for testing. func NewTokenBucketRateLimiterWithClock(qps float32, burst int, c Clock) RateLimiter { limiter := rate.NewLimiter(rate.Limit(qps), burst) return newTokenBucketRateLimiterWithClock(limiter, c, qps) } // NewTokenBucketPassiveRateLimiterWithClock is similar to NewTokenBucketRateLimiterWithClock // except that it returns a PassiveRateLimiter which does not have Accept() and Wait() methods // and uses a PassiveClock. func NewTokenBucketPassiveRateLimiterWithClock(qps float32, burst int, c clock.PassiveClock) PassiveRateLimiter { limiter := rate.NewLimiter(rate.Limit(qps), burst) return newTokenBucketRateLimiterWithPassiveClock(limiter, c, qps) } func newTokenBucketRateLimiterWithClock(limiter *rate.Limiter, c Clock, qps float32) *tokenBucketRateLimiter { return &tokenBucketRateLimiter{ tokenBucketPassiveRateLimiter: *newTokenBucketRateLimiterWithPassiveClock(limiter, c, qps), clock: c, } } func newTokenBucketRateLimiterWithPassiveClock(limiter *rate.Limiter, c clock.PassiveClock, qps float32) *tokenBucketPassiveRateLimiter { return &tokenBucketPassiveRateLimiter{ limiter: limiter, qps: qps, clock: c, } } func (tbprl *tokenBucketPassiveRateLimiter) Stop() { } func (tbprl *tokenBucketPassiveRateLimiter) QPS() float32 { return tbprl.qps } func (tbprl *tokenBucketPassiveRateLimiter) TryAccept() bool { return tbprl.limiter.AllowN(tbprl.clock.Now(), 1) } // Accept will block until a token becomes available func (tbrl *tokenBucketRateLimiter) Accept() { now := tbrl.clock.Now() tbrl.clock.Sleep(tbrl.limiter.ReserveN(now, 1).DelayFrom(now)) } func (tbrl *tokenBucketRateLimiter) Wait(ctx context.Context) error { return tbrl.limiter.Wait(ctx) } type fakeAlwaysRateLimiter struct{} func NewFakeAlwaysRateLimiter() RateLimiter { return &fakeAlwaysRateLimiter{} } func (t *fakeAlwaysRateLimiter) TryAccept() bool { return true } func (t *fakeAlwaysRateLimiter) Stop() {} func (t *fakeAlwaysRateLimiter) Accept() {} func (t *fakeAlwaysRateLimiter) QPS() float32 { return 1 } func (t *fakeAlwaysRateLimiter) Wait(ctx context.Context) error { return nil } type fakeNeverRateLimiter struct { wg sync.WaitGroup } func NewFakeNeverRateLimiter() RateLimiter { rl := fakeNeverRateLimiter{} rl.wg.Add(1) return &rl } func (t *fakeNeverRateLimiter) TryAccept() bool { return false } func (t *fakeNeverRateLimiter) Stop() { t.wg.Done() } func (t *fakeNeverRateLimiter) Accept() { t.wg.Wait() } func (t *fakeNeverRateLimiter) QPS() float32 { return 1 } func (t *fakeNeverRateLimiter) Wait(ctx context.Context) error { return errors.New("can not be accept") } var ( _ RateLimiter = (*tokenBucketRateLimiter)(nil) _ RateLimiter = (*fakeAlwaysRateLimiter)(nil) _ RateLimiter = (*fakeNeverRateLimiter)(nil) ) var _ PassiveRateLimiter = (*tokenBucketPassiveRateLimiter)(nil) kubernetes-client-go-a2dfcab/util/flowcontrol/throttle_test.go000066400000000000000000000116511472614177300251640ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package flowcontrol import ( "context" "fmt" "sync" "testing" "time" ) func TestMultithreadedThrottling(t *testing.T) { // Bucket with 100QPS and no burst r := NewTokenBucketRateLimiter(100, 1) // channel to collect 100 tokens taken := make(chan bool, 100) // Set up goroutines to hammer the throttler startCh := make(chan bool) endCh := make(chan bool) for i := 0; i < 10; i++ { go func() { // wait for the starting signal <-startCh for { // get a token r.Accept() select { // try to add it to the taken channel case taken <- true: continue // if taken is full, notify and return default: endCh <- true return } } }() } // record wall time startTime := time.Now() // take the initial capacity so all tokens are the result of refill r.Accept() // start the thundering herd close(startCh) // wait for the first signal that we collected 100 tokens <-endCh // record wall time endTime := time.Now() // tolerate a 1% clock change because these things happen if duration := endTime.Sub(startTime); duration < (time.Second * 99 / 100) { // We shouldn't be able to get 100 tokens out of the bucket in less than 1 second of wall clock time, no matter what t.Errorf("Expected it to take at least 1 second to get 100 tokens, took %v", duration) } else { t.Logf("Took %v to get 100 tokens", duration) } } func TestBasicThrottle(t *testing.T) { r := NewTokenBucketRateLimiter(1, 3) for i := 0; i < 3; i++ { if !r.TryAccept() { t.Error("unexpected false accept") } } if r.TryAccept() { t.Error("unexpected true accept") } } func TestIncrementThrottle(t *testing.T) { r := NewTokenBucketRateLimiter(1, 1) if !r.TryAccept() { t.Error("unexpected false accept") } if r.TryAccept() { t.Error("unexpected true accept") } // Allow to refill time.Sleep(2 * time.Second) if !r.TryAccept() { t.Error("unexpected false accept") } } func TestThrottle(t *testing.T) { r := NewTokenBucketRateLimiter(10, 5) // Should consume 5 tokens immediately, then // the remaining 11 should take at least 1 second (0.1s each) expectedFinish := time.Now().Add(time.Second * 1) for i := 0; i < 16; i++ { r.Accept() } if time.Now().Before(expectedFinish) { t.Error("rate limit was not respected, finished too early") } } func TestAlwaysFake(t *testing.T) { rl := NewFakeAlwaysRateLimiter() if !rl.TryAccept() { t.Error("TryAccept in AlwaysFake should return true.") } // If this will block the test will timeout rl.Accept() } func TestNeverFake(t *testing.T) { rl := NewFakeNeverRateLimiter() if rl.TryAccept() { t.Error("TryAccept in NeverFake should return false.") } finished := false wg := sync.WaitGroup{} wg.Add(1) go func() { rl.Accept() finished = true wg.Done() }() // Wait some time to make sure it never finished. time.Sleep(time.Second) if finished { t.Error("Accept should block forever in NeverFake.") } rl.Stop() wg.Wait() if !finished { t.Error("Stop should make Accept unblock in NeverFake.") } } func TestWait(t *testing.T) { r := NewTokenBucketRateLimiter(0.0001, 1) ctx, cancelFn := context.WithTimeout(context.Background(), time.Second) defer cancelFn() if err := r.Wait(ctx); err != nil { t.Errorf("unexpected wait failed, err: %v", err) } ctx2, cancelFn2 := context.WithTimeout(context.Background(), time.Second) defer cancelFn2() if err := r.Wait(ctx2); err == nil { t.Errorf("unexpected wait success") } else { t.Log(fmt.Sprintf("wait err: %v", err)) } } type fakeClock struct { now time.Time } func newFakeClock() *fakeClock { return &fakeClock{ now: time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC), } } func (fc *fakeClock) Now() time.Time { return fc.now } func (fc *fakeClock) Sleep(d time.Duration) { fc.now = fc.now.Add(d) } func (fc *fakeClock) Since(ts time.Time) time.Duration { return time.Since(ts) } func TestRatePrecisionBug(t *testing.T) { // golang.org/x/time/rate used to have bugs around precision and this // proves that they don't recur (at least in the form we know about). This // case is specifically designed to trigger the problem after 14 seconds. qps := float32(time.Second) / float32(1031425*time.Microsecond) clock := newFakeClock() tb := NewTokenBucketRateLimiterWithClock(qps, 1, clock) for i := 0; i < 60; i++ { if !tb.TryAccept() { t.Fatalf("failed after %d seconds", i*2) } clock.Sleep(2 * time.Second) } } kubernetes-client-go-a2dfcab/util/homedir/000077500000000000000000000000001472614177300210045ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/homedir/homedir.go000066400000000000000000000055641472614177300227740ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package homedir import ( "os" "path/filepath" "runtime" ) // HomeDir returns the home directory for the current user. // On Windows: // 1. the first of %HOME%, %HOMEDRIVE%%HOMEPATH%, %USERPROFILE% containing a `.kube\config` file is returned. // 2. if none of those locations contain a `.kube\config` file, the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that exists and is writeable is returned. // 3. if none of those locations are writeable, the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that exists is returned. // 4. if none of those locations exists, the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that is set is returned. func HomeDir() string { if runtime.GOOS == "windows" { home := os.Getenv("HOME") homeDriveHomePath := "" if homeDrive, homePath := os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH"); len(homeDrive) > 0 && len(homePath) > 0 { homeDriveHomePath = homeDrive + homePath } userProfile := os.Getenv("USERPROFILE") // Return first of %HOME%, %HOMEDRIVE%/%HOMEPATH%, %USERPROFILE% that contains a `.kube\config` file. // %HOMEDRIVE%/%HOMEPATH% is preferred over %USERPROFILE% for backwards-compatibility. for _, p := range []string{home, homeDriveHomePath, userProfile} { if len(p) == 0 { continue } if _, err := os.Stat(filepath.Join(p, ".kube", "config")); err != nil { continue } return p } firstSetPath := "" firstExistingPath := "" // Prefer %USERPROFILE% over %HOMEDRIVE%/%HOMEPATH% for compatibility with other auth-writing tools for _, p := range []string{home, userProfile, homeDriveHomePath} { if len(p) == 0 { continue } if len(firstSetPath) == 0 { // remember the first path that is set firstSetPath = p } info, err := os.Stat(p) if err != nil { continue } if len(firstExistingPath) == 0 { // remember the first path that exists firstExistingPath = p } if info.IsDir() && info.Mode().Perm()&(1<<(uint(7))) != 0 { // return first path that is writeable return p } } // If none are writeable, return first location that exists if len(firstExistingPath) > 0 { return firstExistingPath } // If none exist, return first location that is set if len(firstSetPath) > 0 { return firstSetPath } // We've got nothing return "" } return os.Getenv("HOME") } kubernetes-client-go-a2dfcab/util/jsonpath/000077500000000000000000000000001472614177300212035ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/jsonpath/doc.go000066400000000000000000000015001472614177300222730ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // package jsonpath is a template engine using jsonpath syntax, // which can be seen at http://goessner.net/articles/JsonPath/. // In addition, it has {range} {end} function to iterate list and slice. package jsonpath // import "k8s.io/client-go/util/jsonpath" kubernetes-client-go-a2dfcab/util/jsonpath/jsonpath.go000066400000000000000000000356051472614177300233710ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package jsonpath import ( "bytes" "encoding/json" "fmt" "io" "reflect" "strings" "k8s.io/client-go/third_party/forked/golang/template" ) type JSONPath struct { name string parser *Parser beginRange int inRange int endRange int lastEndNode *Node allowMissingKeys bool outputJSON bool } // New creates a new JSONPath with the given name. func New(name string) *JSONPath { return &JSONPath{ name: name, beginRange: 0, inRange: 0, endRange: 0, } } // AllowMissingKeys allows a caller to specify whether they want an error if a field or map key // cannot be located, or simply an empty result. The receiver is returned for chaining. func (j *JSONPath) AllowMissingKeys(allow bool) *JSONPath { j.allowMissingKeys = allow return j } // Parse parses the given template and returns an error. func (j *JSONPath) Parse(text string) error { var err error j.parser, err = Parse(j.name, text) return err } // Execute bounds data into template and writes the result. func (j *JSONPath) Execute(wr io.Writer, data interface{}) error { fullResults, err := j.FindResults(data) if err != nil { return err } for ix := range fullResults { if err := j.PrintResults(wr, fullResults[ix]); err != nil { return err } } return nil } func (j *JSONPath) FindResults(data interface{}) ([][]reflect.Value, error) { if j.parser == nil { return nil, fmt.Errorf("%s is an incomplete jsonpath template", j.name) } cur := []reflect.Value{reflect.ValueOf(data)} nodes := j.parser.Root.Nodes fullResult := [][]reflect.Value{} for i := 0; i < len(nodes); i++ { node := nodes[i] results, err := j.walk(cur, node) if err != nil { return nil, err } // encounter an end node, break the current block if j.endRange > 0 && j.endRange <= j.inRange { j.endRange-- j.lastEndNode = &nodes[i] break } // encounter a range node, start a range loop if j.beginRange > 0 { j.beginRange-- j.inRange++ if len(results) > 0 { for _, value := range results { j.parser.Root.Nodes = nodes[i+1:] nextResults, err := j.FindResults(value.Interface()) if err != nil { return nil, err } fullResult = append(fullResult, nextResults...) } } else { // If the range has no results, we still need to process the nodes within the range // so the position will advance to the end node j.parser.Root.Nodes = nodes[i+1:] _, err := j.FindResults(nil) if err != nil { return nil, err } } j.inRange-- // Fast forward to resume processing after the most recent end node that was encountered for k := i + 1; k < len(nodes); k++ { if &nodes[k] == j.lastEndNode { i = k break } } continue } fullResult = append(fullResult, results) } return fullResult, nil } // EnableJSONOutput changes the PrintResults behavior to return a JSON array of results func (j *JSONPath) EnableJSONOutput(v bool) { j.outputJSON = v } // PrintResults writes the results into writer func (j *JSONPath) PrintResults(wr io.Writer, results []reflect.Value) error { if j.outputJSON { // convert the []reflect.Value to something that json // will be able to marshal r := make([]interface{}, 0, len(results)) for i := range results { r = append(r, results[i].Interface()) } results = []reflect.Value{reflect.ValueOf(r)} } for i, r := range results { var text []byte var err error outputJSON := true kind := r.Kind() if kind == reflect.Interface { kind = r.Elem().Kind() } switch kind { case reflect.Map: case reflect.Array: case reflect.Slice: case reflect.Struct: default: outputJSON = false } switch { case outputJSON || j.outputJSON: if j.outputJSON { text, err = json.MarshalIndent(r.Interface(), "", " ") text = append(text, '\n') } else { text, err = json.Marshal(r.Interface()) } default: text, err = j.evalToText(r) } if err != nil { return err } if i != len(results)-1 { text = append(text, ' ') } if _, err = wr.Write(text); err != nil { return err } } return nil } // walk visits tree rooted at the given node in DFS order func (j *JSONPath) walk(value []reflect.Value, node Node) ([]reflect.Value, error) { switch node := node.(type) { case *ListNode: return j.evalList(value, node) case *TextNode: return []reflect.Value{reflect.ValueOf(node.Text)}, nil case *FieldNode: return j.evalField(value, node) case *ArrayNode: return j.evalArray(value, node) case *FilterNode: return j.evalFilter(value, node) case *IntNode: return j.evalInt(value, node) case *BoolNode: return j.evalBool(value, node) case *FloatNode: return j.evalFloat(value, node) case *WildcardNode: return j.evalWildcard(value, node) case *RecursiveNode: return j.evalRecursive(value, node) case *UnionNode: return j.evalUnion(value, node) case *IdentifierNode: return j.evalIdentifier(value, node) default: return value, fmt.Errorf("unexpected Node %v", node) } } // evalInt evaluates IntNode func (j *JSONPath) evalInt(input []reflect.Value, node *IntNode) ([]reflect.Value, error) { result := make([]reflect.Value, len(input)) for i := range input { result[i] = reflect.ValueOf(node.Value) } return result, nil } // evalFloat evaluates FloatNode func (j *JSONPath) evalFloat(input []reflect.Value, node *FloatNode) ([]reflect.Value, error) { result := make([]reflect.Value, len(input)) for i := range input { result[i] = reflect.ValueOf(node.Value) } return result, nil } // evalBool evaluates BoolNode func (j *JSONPath) evalBool(input []reflect.Value, node *BoolNode) ([]reflect.Value, error) { result := make([]reflect.Value, len(input)) for i := range input { result[i] = reflect.ValueOf(node.Value) } return result, nil } // evalList evaluates ListNode func (j *JSONPath) evalList(value []reflect.Value, node *ListNode) ([]reflect.Value, error) { var err error curValue := value for _, node := range node.Nodes { curValue, err = j.walk(curValue, node) if err != nil { return curValue, err } } return curValue, nil } // evalIdentifier evaluates IdentifierNode func (j *JSONPath) evalIdentifier(input []reflect.Value, node *IdentifierNode) ([]reflect.Value, error) { results := []reflect.Value{} switch node.Name { case "range": j.beginRange++ results = input case "end": if j.inRange > 0 { j.endRange++ } else { return results, fmt.Errorf("not in range, nothing to end") } default: return input, fmt.Errorf("unrecognized identifier %v", node.Name) } return results, nil } // evalArray evaluates ArrayNode func (j *JSONPath) evalArray(input []reflect.Value, node *ArrayNode) ([]reflect.Value, error) { result := []reflect.Value{} for _, value := range input { value, isNil := template.Indirect(value) if isNil { continue } if value.Kind() != reflect.Array && value.Kind() != reflect.Slice { return input, fmt.Errorf("%v is not array or slice", value.Type()) } params := node.Params if !params[0].Known { params[0].Value = 0 } if params[0].Value < 0 { params[0].Value += value.Len() } if !params[1].Known { params[1].Value = value.Len() } if params[1].Value < 0 || (params[1].Value == 0 && params[1].Derived) { params[1].Value += value.Len() } sliceLength := value.Len() if params[1].Value != params[0].Value { // if you're requesting zero elements, allow it through. if params[0].Value >= sliceLength || params[0].Value < 0 { return input, fmt.Errorf("array index out of bounds: index %d, length %d", params[0].Value, sliceLength) } if params[1].Value > sliceLength || params[1].Value < 0 { return input, fmt.Errorf("array index out of bounds: index %d, length %d", params[1].Value-1, sliceLength) } if params[0].Value > params[1].Value { return input, fmt.Errorf("starting index %d is greater than ending index %d", params[0].Value, params[1].Value) } } else { return result, nil } value = value.Slice(params[0].Value, params[1].Value) step := 1 if params[2].Known { if params[2].Value <= 0 { return input, fmt.Errorf("step must be > 0") } step = params[2].Value } for i := 0; i < value.Len(); i += step { result = append(result, value.Index(i)) } } return result, nil } // evalUnion evaluates UnionNode func (j *JSONPath) evalUnion(input []reflect.Value, node *UnionNode) ([]reflect.Value, error) { result := []reflect.Value{} for _, listNode := range node.Nodes { temp, err := j.evalList(input, listNode) if err != nil { return input, err } result = append(result, temp...) } return result, nil } func (j *JSONPath) findFieldInValue(value *reflect.Value, node *FieldNode) (reflect.Value, error) { t := value.Type() var inlineValue *reflect.Value for ix := 0; ix < t.NumField(); ix++ { f := t.Field(ix) jsonTag := f.Tag.Get("json") parts := strings.Split(jsonTag, ",") if len(parts) == 0 { continue } if parts[0] == node.Value { return value.Field(ix), nil } if len(parts[0]) == 0 { val := value.Field(ix) inlineValue = &val } } if inlineValue != nil { if inlineValue.Kind() == reflect.Struct { // handle 'inline' match, err := j.findFieldInValue(inlineValue, node) if err != nil { return reflect.Value{}, err } if match.IsValid() { return match, nil } } } return value.FieldByName(node.Value), nil } // evalField evaluates field of struct or key of map. func (j *JSONPath) evalField(input []reflect.Value, node *FieldNode) ([]reflect.Value, error) { results := []reflect.Value{} // If there's no input, there's no output if len(input) == 0 { return results, nil } for _, value := range input { var result reflect.Value value, isNil := template.Indirect(value) if isNil { continue } if value.Kind() == reflect.Struct { var err error if result, err = j.findFieldInValue(&value, node); err != nil { return nil, err } } else if value.Kind() == reflect.Map { mapKeyType := value.Type().Key() nodeValue := reflect.ValueOf(node.Value) // node value type must be convertible to map key type if !nodeValue.Type().ConvertibleTo(mapKeyType) { return results, fmt.Errorf("%s is not convertible to %s", nodeValue, mapKeyType) } result = value.MapIndex(nodeValue.Convert(mapKeyType)) } if result.IsValid() { results = append(results, result) } } if len(results) == 0 { if j.allowMissingKeys { return results, nil } return results, fmt.Errorf("%s is not found", node.Value) } return results, nil } // evalWildcard extracts all contents of the given value func (j *JSONPath) evalWildcard(input []reflect.Value, node *WildcardNode) ([]reflect.Value, error) { results := []reflect.Value{} for _, value := range input { value, isNil := template.Indirect(value) if isNil { continue } kind := value.Kind() if kind == reflect.Struct { for i := 0; i < value.NumField(); i++ { results = append(results, value.Field(i)) } } else if kind == reflect.Map { for _, key := range value.MapKeys() { results = append(results, value.MapIndex(key)) } } else if kind == reflect.Array || kind == reflect.Slice || kind == reflect.String { for i := 0; i < value.Len(); i++ { results = append(results, value.Index(i)) } } } return results, nil } // evalRecursive visits the given value recursively and pushes all of them to result func (j *JSONPath) evalRecursive(input []reflect.Value, node *RecursiveNode) ([]reflect.Value, error) { result := []reflect.Value{} for _, value := range input { results := []reflect.Value{} value, isNil := template.Indirect(value) if isNil { continue } kind := value.Kind() if kind == reflect.Struct { for i := 0; i < value.NumField(); i++ { results = append(results, value.Field(i)) } } else if kind == reflect.Map { for _, key := range value.MapKeys() { results = append(results, value.MapIndex(key)) } } else if kind == reflect.Array || kind == reflect.Slice || kind == reflect.String { for i := 0; i < value.Len(); i++ { results = append(results, value.Index(i)) } } if len(results) != 0 { result = append(result, value) output, err := j.evalRecursive(results, node) if err != nil { return result, err } result = append(result, output...) } } return result, nil } // evalFilter filters array according to FilterNode func (j *JSONPath) evalFilter(input []reflect.Value, node *FilterNode) ([]reflect.Value, error) { results := []reflect.Value{} for _, value := range input { value, _ = template.Indirect(value) if value.Kind() != reflect.Array && value.Kind() != reflect.Slice { return input, fmt.Errorf("%v is not array or slice and cannot be filtered", value) } for i := 0; i < value.Len(); i++ { temp := []reflect.Value{value.Index(i)} lefts, err := j.evalList(temp, node.Left) //case exists if node.Operator == "exists" { if len(lefts) > 0 { results = append(results, value.Index(i)) } continue } if err != nil { return input, err } var left, right interface{} switch { case len(lefts) == 0: continue case len(lefts) > 1: return input, fmt.Errorf("can only compare one element at a time") } left = lefts[0].Interface() rights, err := j.evalList(temp, node.Right) if err != nil { return input, err } switch { case len(rights) == 0: continue case len(rights) > 1: return input, fmt.Errorf("can only compare one element at a time") } right = rights[0].Interface() pass := false switch node.Operator { case "<": pass, err = template.Less(left, right) case ">": pass, err = template.Greater(left, right) case "==": pass, err = template.Equal(left, right) case "!=": pass, err = template.NotEqual(left, right) case "<=": pass, err = template.LessEqual(left, right) case ">=": pass, err = template.GreaterEqual(left, right) default: return results, fmt.Errorf("unrecognized filter operator %s", node.Operator) } if err != nil { return results, err } if pass { results = append(results, value.Index(i)) } } } return results, nil } // evalToText translates reflect value to corresponding text func (j *JSONPath) evalToText(v reflect.Value) ([]byte, error) { iface, ok := template.PrintableValue(v) if !ok { return nil, fmt.Errorf("can't print type %s", v.Type()) } if iface == nil { return []byte("null"), nil } var buffer bytes.Buffer fmt.Fprint(&buffer, iface) return buffer.Bytes(), nil } kubernetes-client-go-a2dfcab/util/jsonpath/jsonpath_test.go000066400000000000000000000611621472614177300244250ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package jsonpath import ( "bytes" "encoding/json" "fmt" "reflect" "sort" "strings" "testing" ) type jsonpathTest struct { name string template string input interface{} expect string expectError bool } func testJSONPath(tests []jsonpathTest, allowMissingKeys bool, t *testing.T) { for _, test := range tests { j := New(test.name) j.AllowMissingKeys(allowMissingKeys) err := j.Parse(test.template) if err != nil { if !test.expectError { t.Errorf("in %s, parse %s error %v", test.name, test.template, err) } continue } buf := new(bytes.Buffer) err = j.Execute(buf, test.input) if test.expectError { if err == nil { t.Errorf(`in %s, expected execute error, got %q`, test.name, buf) } continue } else if err != nil { t.Errorf("in %s, execute error %v", test.name, err) } out := buf.String() if out != test.expect { t.Errorf(`in %s, expect to get "%s", got "%s"`, test.name, test.expect, out) } } } // testJSONPathSortOutput test cases related to map, the results may print in random order func testJSONPathSortOutput(tests []jsonpathTest, t *testing.T) { for _, test := range tests { j := New(test.name) err := j.Parse(test.template) if err != nil { t.Errorf("in %s, parse %s error %v", test.name, test.template, err) } buf := new(bytes.Buffer) err = j.Execute(buf, test.input) if err != nil { t.Errorf("in %s, execute error %v", test.name, err) } out := buf.String() //since map is visited in random order, we need to sort the results. sortedOut := strings.Fields(out) sort.Strings(sortedOut) sortedExpect := strings.Fields(test.expect) sort.Strings(sortedExpect) if !reflect.DeepEqual(sortedOut, sortedExpect) { t.Errorf(`in %s, expect to get "%s", got "%s"`, test.name, test.expect, out) } } } func testFailJSONPath(tests []jsonpathTest, t *testing.T) { for _, test := range tests { j := New(test.name) err := j.Parse(test.template) if err != nil { t.Errorf("in %s, parse %s error %v", test.name, test.template, err) } buf := new(bytes.Buffer) err = j.Execute(buf, test.input) var out string if err == nil { out = "nil" } else { out = err.Error() } if out != test.expect { t.Errorf("in %s, expect to get error %q, got %q", test.name, test.expect, out) } } } func TestTypesInput(t *testing.T) { types := map[string]interface{}{ "bools": []bool{true, false, true, false}, "integers": []int{1, 2, 3, 4}, "floats": []float64{1.0, 2.2, 3.3, 4.0}, "strings": []string{"one", "two", "three", "four"}, "interfaces": []interface{}{true, "one", 1, 1.1}, "maps": []map[string]interface{}{ {"name": "one", "value": 1}, {"name": "two", "value": 2.02}, {"name": "three", "value": 3.03}, {"name": "four", "value": 4.04}, }, "structs": []struct { Name string `json:"name"` Value interface{} `json:"value"` Type string `json:"type"` }{ {Name: "one", Value: 1, Type: "integer"}, {Name: "two", Value: 2.002, Type: "float"}, {Name: "three", Value: 3, Type: "integer"}, {Name: "four", Value: 4.004, Type: "float"}, }, } sliceTests := []jsonpathTest{ // boolean slice tests {"boolSlice", `{ .bools }`, types, `[true,false,true,false]`, false}, {"boolSliceIndex", `{ .bools[0] }`, types, `true`, false}, {"boolSliceIndex", `{ .bools[-1] }`, types, `false`, false}, {"boolSubSlice", `{ .bools[0:2] }`, types, `true false`, false}, {"boolSubSliceFirst2", `{ .bools[:2] }`, types, `true false`, false}, {"boolSubSliceStep2", `{ .bools[:4:2] }`, types, `true true`, false}, // integer slice tests {"integerSlice", `{ .integers }`, types, `[1,2,3,4]`, false}, {"integerSliceIndex", `{ .integers[0] }`, types, `1`, false}, {"integerSliceIndexReverse", `{ .integers[-2] }`, types, `3`, false}, {"integerSubSliceFirst2", `{ .integers[0:2] }`, types, `1 2`, false}, {"integerSubSliceFirst2Alt", `{ .integers[:2] }`, types, `1 2`, false}, {"integerSubSliceStep2", `{ .integers[:4:2] }`, types, `1 3`, false}, // float slice tests {"floatSlice", `{ .floats }`, types, `[1,2.2,3.3,4]`, false}, {"floatSliceIndex", `{ .floats[0] }`, types, `1`, false}, {"floatSliceIndexReverse", `{ .floats[-2] }`, types, `3.3`, false}, {"floatSubSliceFirst2", `{ .floats[0:2] }`, types, `1 2.2`, false}, {"floatSubSliceFirst2Alt", `{ .floats[:2] }`, types, `1 2.2`, false}, {"floatSubSliceStep2", `{ .floats[:4:2] }`, types, `1 3.3`, false}, // strings slice tests {"stringSlice", `{ .strings }`, types, `["one","two","three","four"]`, false}, {"stringSliceIndex", `{ .strings[0] }`, types, `one`, false}, {"stringSliceIndexReverse", `{ .strings[-2] }`, types, `three`, false}, {"stringSubSliceFirst2", `{ .strings[0:2] }`, types, `one two`, false}, {"stringSubSliceFirst2Alt", `{ .strings[:2] }`, types, `one two`, false}, {"stringSubSliceStep2", `{ .strings[:4:2] }`, types, `one three`, false}, // interfaces slice tests {"interfaceSlice", `{ .interfaces }`, types, `[true,"one",1,1.1]`, false}, {"interfaceSliceIndex", `{ .interfaces[0] }`, types, `true`, false}, {"interfaceSliceIndexReverse", `{ .interfaces[-2] }`, types, `1`, false}, {"interfaceSubSliceFirst2", `{ .interfaces[0:2] }`, types, `true one`, false}, {"interfaceSubSliceFirst2Alt", `{ .interfaces[:2] }`, types, `true one`, false}, {"interfaceSubSliceStep2", `{ .interfaces[:4:2] }`, types, `true 1`, false}, // maps slice tests {"mapSlice", `{ .maps }`, types, `[{"name":"one","value":1},{"name":"two","value":2.02},{"name":"three","value":3.03},{"name":"four","value":4.04}]`, false}, {"mapSliceIndex", `{ .maps[0] }`, types, `{"name":"one","value":1}`, false}, {"mapSliceIndexReverse", `{ .maps[-2] }`, types, `{"name":"three","value":3.03}`, false}, {"mapSubSliceFirst2", `{ .maps[0:2] }`, types, `{"name":"one","value":1} {"name":"two","value":2.02}`, false}, {"mapSubSliceFirst2Alt", `{ .maps[:2] }`, types, `{"name":"one","value":1} {"name":"two","value":2.02}`, false}, {"mapSubSliceStepOdd", `{ .maps[::2] }`, types, `{"name":"one","value":1} {"name":"three","value":3.03}`, false}, {"mapSubSliceStepEven", `{ .maps[1::2] }`, types, `{"name":"two","value":2.02} {"name":"four","value":4.04}`, false}, // structs slice tests {"structSlice", `{ .structs }`, types, `[{"name":"one","value":1,"type":"integer"},{"name":"two","value":2.002,"type":"float"},{"name":"three","value":3,"type":"integer"},{"name":"four","value":4.004,"type":"float"}]`, false}, {"structSliceIndex", `{ .structs[0] }`, types, `{"name":"one","value":1,"type":"integer"}`, false}, {"structSliceIndexReverse", `{ .structs[-2] }`, types, `{"name":"three","value":3,"type":"integer"}`, false}, {"structSubSliceFirst2", `{ .structs[0:2] }`, types, `{"name":"one","value":1,"type":"integer"} {"name":"two","value":2.002,"type":"float"}`, false}, {"structSubSliceFirst2Alt", `{ .structs[:2] }`, types, `{"name":"one","value":1,"type":"integer"} {"name":"two","value":2.002,"type":"float"}`, false}, {"structSubSliceStepOdd", `{ .structs[::2] }`, types, `{"name":"one","value":1,"type":"integer"} {"name":"three","value":3,"type":"integer"}`, false}, {"structSubSliceStepEven", `{ .structs[1::2] }`, types, `{"name":"two","value":2.002,"type":"float"} {"name":"four","value":4.004,"type":"float"}`, false}, } testJSONPath(sliceTests, false, t) } type book struct { Category string Author string Title string Price float32 } func (b book) String() string { return fmt.Sprintf("{Category: %s, Author: %s, Title: %s, Price: %v}", b.Category, b.Author, b.Title, b.Price) } type bicycle struct { Color string Price float32 IsNew bool } type empName string type job string type store struct { Book []book Bicycle []bicycle Name string Labels map[string]int Employees map[empName]job } func TestStructInput(t *testing.T) { storeData := store{ Name: "jsonpath", Book: []book{ {"reference", "Nigel Rees", "Sayings of the Centurey", 8.95}, {"fiction", "Evelyn Waugh", "Sword of Honour", 12.99}, {"fiction", "Herman Melville", "Moby Dick", 8.99}, }, Bicycle: []bicycle{ {"red", 19.95, true}, {"green", 20.01, false}, }, Labels: map[string]int{ "engieer": 10, "web/html": 15, "k8s-app": 20, }, Employees: map[empName]job{ "jason": "manager", "dan": "clerk", }, } storeTests := []jsonpathTest{ {"plain", "hello jsonpath", nil, "hello jsonpath", false}, {"recursive", "{..}", []int{1, 2, 3}, "[1,2,3]", false}, {"filter", "{[?(@<5)]}", []int{2, 6, 3, 7}, "2 3", false}, {"quote", `{"{"}`, nil, "{", false}, {"union", "{[1,3,4]}", []int{0, 1, 2, 3, 4}, "1 3 4", false}, {"array", "{[0:2]}", []string{"Monday", "Tudesday"}, "Monday Tudesday", false}, {"variable", "hello {.Name}", storeData, "hello jsonpath", false}, {"dict/", "{$.Labels.web/html}", storeData, "15", false}, {"dict/", "{$.Employees.jason}", storeData, "manager", false}, {"dict/", "{$.Employees.dan}", storeData, "clerk", false}, {"dict-", "{.Labels.k8s-app}", storeData, "20", false}, {"nest", "{.Bicycle[*].Color}", storeData, "red green", false}, {"allarray", "{.Book[*].Author}", storeData, "Nigel Rees Evelyn Waugh Herman Melville", false}, {"allfields", `{range .Bicycle[*]}{ "{" }{ @.* }{ "} " }{end}`, storeData, "{red 19.95 true} {green 20.01 false} ", false}, {"recurfields", "{..Price}", storeData, "8.95 12.99 8.99 19.95 20.01", false}, {"recurdotfields", "{...Price}", storeData, "8.95 12.99 8.99 19.95 20.01", false}, {"superrecurfields", "{............................................................Price}", storeData, "", true}, {"allstructsSlice", "{.Bicycle}", storeData, `[{"Color":"red","Price":19.95,"IsNew":true},{"Color":"green","Price":20.01,"IsNew":false}]`, false}, {"allstructs", `{range .Bicycle[*]}{ @ }{ " " }{end}`, storeData, `{"Color":"red","Price":19.95,"IsNew":true} {"Color":"green","Price":20.01,"IsNew":false} `, false}, {"lastarray", "{.Book[-1:]}", storeData, `{"Category":"fiction","Author":"Herman Melville","Title":"Moby Dick","Price":8.99}`, false}, {"recurarray", "{..Book[2]}", storeData, `{"Category":"fiction","Author":"Herman Melville","Title":"Moby Dick","Price":8.99}`, false}, {"bool", "{.Bicycle[?(@.IsNew==true)]}", storeData, `{"Color":"red","Price":19.95,"IsNew":true}`, false}, } testJSONPath(storeTests, false, t) missingKeyTests := []jsonpathTest{ {"nonexistent field", "{.hello}", storeData, "", false}, {"nonexistent field 2", "before-{.hello}after", storeData, "before-after", false}, } testJSONPath(missingKeyTests, true, t) failStoreTests := []jsonpathTest{ {"invalid identifier", "{hello}", storeData, "unrecognized identifier hello", false}, {"nonexistent field", "{.hello}", storeData, "hello is not found", false}, {"invalid array", "{.Labels[0]}", storeData, "map[string]int is not array or slice", false}, {"invalid filter operator", "{.Book[?(@.Price<>10)]}", storeData, "unrecognized filter operator <>", false}, {"redundant end", "{range .Labels.*}{@}{end}{end}", storeData, "not in range, nothing to end", false}, } testFailJSONPath(failStoreTests, t) } func TestJSONInput(t *testing.T) { var pointsJSON = []byte(`[ {"id": "i1", "x":4, "y":-5}, {"id": "i2", "x":-2, "y":-5, "z":1}, {"id": "i3", "x": 8, "y": 3 }, {"id": "i4", "x": -6, "y": -1 }, {"id": "i5", "x": 0, "y": 2, "z": 1 }, {"id": "i6", "x": 1, "y": 4 }, {"id": "i7", "x": null, "y": 4 } ]`) var pointsData interface{} err := json.Unmarshal(pointsJSON, &pointsData) if err != nil { t.Error(err) } pointsTests := []jsonpathTest{ {"exists filter", "{[?(@.z)].id}", pointsData, "i2 i5", false}, {"bracket key", "{[0]['id']}", pointsData, "i1", false}, {"nil value", "{[-1]['x']}", pointsData, "null", false}, } testJSONPath(pointsTests, false, t) } // TestKubernetes tests some use cases from kubernetes func TestKubernetes(t *testing.T) { var input = []byte(`{ "kind": "List", "items":[ { "kind":"None", "metadata":{ "name":"127.0.0.1", "labels":{ "kubernetes.io/hostname":"127.0.0.1" } }, "status":{ "capacity":{"cpu":"4"}, "ready": true, "addresses":[{"type": "LegacyHostIP", "address":"127.0.0.1"}] } }, { "kind":"None", "metadata":{ "name":"127.0.0.2", "labels":{ "kubernetes.io/hostname":"127.0.0.2" } }, "status":{ "capacity":{"cpu":"8"}, "ready": false, "addresses":[ {"type": "LegacyHostIP", "address":"127.0.0.2"}, {"type": "another", "address":"127.0.0.3"} ] } } ], "users":[ { "name": "myself", "user": {} }, { "name": "e2e", "user": {"username": "admin", "password": "secret"} } ] }`) var nodesData interface{} err := json.Unmarshal(input, &nodesData) if err != nil { t.Error(err) } nodesTests := []jsonpathTest{ {"range item", `{range .items[*]}{.metadata.name}, {end}{.kind}`, nodesData, "127.0.0.1, 127.0.0.2, List", false}, {"range item with quote", `{range .items[*]}{.metadata.name}{"\t"}{end}`, nodesData, "127.0.0.1\t127.0.0.2\t", false}, {"range addresss", `{.items[*].status.addresses[*].address}`, nodesData, "127.0.0.1 127.0.0.2 127.0.0.3", false}, {"double range", `{range .items[*]}{range .status.addresses[*]}{.address}, {end}{end}`, nodesData, "127.0.0.1, 127.0.0.2, 127.0.0.3, ", false}, {"item name", `{.items[*].metadata.name}`, nodesData, "127.0.0.1 127.0.0.2", false}, {"union nodes capacity", `{.items[*]['metadata.name', 'status.capacity']}`, nodesData, `127.0.0.1 127.0.0.2 {"cpu":"4"} {"cpu":"8"}`, false}, {"range nodes capacity", `{range .items[*]}[{.metadata.name}, {.status.capacity}] {end}`, nodesData, `[127.0.0.1, {"cpu":"4"}] [127.0.0.2, {"cpu":"8"}] `, false}, {"user password", `{.users[?(@.name=="e2e")].user.password}`, &nodesData, "secret", false}, {"hostname", `{.items[0].metadata.labels.kubernetes\.io/hostname}`, &nodesData, "127.0.0.1", false}, {"hostname filter", `{.items[?(@.metadata.labels.kubernetes\.io/hostname=="127.0.0.1")].kind}`, &nodesData, "None", false}, {"bool item", `{.items[?(@..ready==true)].metadata.name}`, &nodesData, "127.0.0.1", false}, } testJSONPath(nodesTests, false, t) randomPrintOrderTests := []jsonpathTest{ {"recursive name", "{..name}", nodesData, `127.0.0.1 127.0.0.2 myself e2e`, false}, } testJSONPathSortOutput(randomPrintOrderTests, t) } func TestEmptyRange(t *testing.T) { var input = []byte(`{"items":[]}`) var emptyList interface{} err := json.Unmarshal(input, &emptyList) if err != nil { t.Error(err) } tests := []jsonpathTest{ {"empty range", `{range .items[*]}{.metadata.name}{end}`, &emptyList, "", false}, {"empty nested range", `{range .items[*]}{.metadata.name}{":"}{range @.spec.containers[*]}{.name}{","}{end}{"+"}{end}`, &emptyList, "", false}, } testJSONPath(tests, true, t) } func TestNestedRanges(t *testing.T) { var input = []byte(`{ "items": [ { "metadata": { "name": "pod1" }, "spec": { "containers": [ { "name": "foo", "another": [ { "name": "value1" }, { "name": "value2" } ] }, { "name": "bar", "another": [ { "name": "value1" }, { "name": "value2" } ] } ] } }, { "metadata": { "name": "pod2" }, "spec": { "containers": [ { "name": "baz", "another": [ { "name": "value1" }, { "name": "value2" } ] } ] } } ] }`) var data interface{} err := json.Unmarshal(input, &data) if err != nil { t.Error(err) } testJSONPath( []jsonpathTest{ { "nested range with a trailing newline", `{range .items[*]}` + `{.metadata.name}` + `{":"}` + `{range @.spec.containers[*]}` + `{.name}` + `{","}` + `{end}` + `{"+"}` + `{end}`, data, "pod1:foo,bar,+pod2:baz,+", false, }, }, false, t, ) testJSONPath( []jsonpathTest{ { "nested range with a trailing character within another nested range with a trailing newline", `{range .items[*]}` + `{.metadata.name}` + `{"~"}` + `{range @.spec.containers[*]}` + `{.name}` + `{":"}` + `{range @.another[*]}` + `{.name}` + `{","}` + `{end}` + `{"+"}` + `{end}` + `{"#"}` + `{end}`, data, "pod1~foo:value1,value2,+bar:value1,value2,+#pod2~baz:value1,value2,+#", false, }, }, false, t, ) testJSONPath( []jsonpathTest{ { "two nested ranges at the same level with a trailing newline", `{range .items[*]}` + `{.metadata.name}` + `{"\t"}` + `{range @.spec.containers[*]}` + `{.name}` + `{" "}` + `{end}` + `{"\t"}` + `{range @.spec.containers[*]}` + `{.name}` + `{" "}` + `{end}` + `{"\n"}` + `{end}`, data, "pod1\tfoo bar \tfoo bar \npod2\tbaz \tbaz \n", false, }, }, false, t, ) } func TestFilterPartialMatchesSometimesMissingAnnotations(t *testing.T) { // for https://issues.k8s.io/45546 var input = []byte(`{ "kind": "List", "items": [ { "kind": "Pod", "metadata": { "name": "pod1", "annotations": { "color": "blue" } } }, { "kind": "Pod", "metadata": { "name": "pod2" } }, { "kind": "Pod", "metadata": { "name": "pod3", "annotations": { "color": "green" } } }, { "kind": "Pod", "metadata": { "name": "pod4", "annotations": { "color": "blue" } } } ] }`) var data interface{} err := json.Unmarshal(input, &data) if err != nil { t.Fatal(err) } testJSONPath( []jsonpathTest{ { "filter, should only match a subset, some items don't have annotations, tolerate missing items", `{.items[?(@.metadata.annotations.color=="blue")].metadata.name}`, data, "pod1 pod4", false, // expect no error }, }, true, // allow missing keys t, ) testJSONPath( []jsonpathTest{ { "filter, should only match a subset, some items don't have annotations, error on missing items", `{.items[?(@.metadata.annotations.color=="blue")].metadata.name}`, data, "", true, // expect an error }, }, false, // don't allow missing keys t, ) } func TestNegativeIndex(t *testing.T) { var input = []byte( `{ "apiVersion": "v1", "kind": "Pod", "spec": { "containers": [ { "image": "radial/busyboxplus:curl", "name": "fake0" }, { "image": "radial/busyboxplus:curl", "name": "fake1" }, { "image": "radial/busyboxplus:curl", "name": "fake2" }, { "image": "radial/busyboxplus:curl", "name": "fake3" }]}}`) var data interface{} err := json.Unmarshal(input, &data) if err != nil { t.Fatal(err) } testJSONPath( []jsonpathTest{ { "test containers[0], it equals containers[0]", `{.spec.containers[0].name}`, data, "fake0", false, }, { "test containers[0:0], it equals the empty set", `{.spec.containers[0:0].name}`, data, "", false, }, { "test containers[0:-1], it equals containers[0:3]", `{.spec.containers[0:-1].name}`, data, "fake0 fake1 fake2", false, }, { "test containers[-1:0], expect error", `{.spec.containers[-1:0].name}`, data, "", true, }, { "test containers[-1], it equals containers[3]", `{.spec.containers[-1].name}`, data, "fake3", false, }, { "test containers[-1:], it equals containers[3:]", `{.spec.containers[-1:].name}`, data, "fake3", false, }, { "test containers[-2], it equals containers[2]", `{.spec.containers[-2].name}`, data, "fake2", false, }, { "test containers[-2:], it equals containers[2:]", `{.spec.containers[-2:].name}`, data, "fake2 fake3", false, }, { "test containers[-3], it equals containers[1]", `{.spec.containers[-3].name}`, data, "fake1", false, }, { "test containers[-4], it equals containers[0]", `{.spec.containers[-4].name}`, data, "fake0", false, }, { "test containers[-4:], it equals containers[0:]", `{.spec.containers[-4:].name}`, data, "fake0 fake1 fake2 fake3", false, }, { "test containers[-5], expect a error cause it out of bounds", `{.spec.containers[-5].name}`, data, "", true, // expect error }, { "test containers[5:5], expect empty set", `{.spec.containers[5:5].name}`, data, "", false, }, { "test containers[-5:-5], expect empty set", `{.spec.containers[-5:-5].name}`, data, "", false, }, { "test containers[3:1], expect a error cause start index is greater than end index", `{.spec.containers[3:1].name}`, data, "", true, }, { "test containers[-1:-2], it equals containers[3:2], expect a error cause start index is greater than end index", `{.spec.containers[-1:-2].name}`, data, "", true, }, }, false, t, ) } func TestRunningPodsJSONPathOutput(t *testing.T) { var input = []byte(`{ "kind": "List", "items": [ { "kind": "Pod", "metadata": { "name": "pod1" }, "status": { "phase": "Running" } }, { "kind": "Pod", "metadata": { "name": "pod2" }, "status": { "phase": "Running" } }, { "kind": "Pod", "metadata": { "name": "pod3" }, "status": { "phase": "Running" } }, { "resourceVersion": "" } ] }`) var data interface{} err := json.Unmarshal(input, &data) if err != nil { t.Fatal(err) } testJSONPath( []jsonpathTest{ { "range over pods without selecting the last one", `{range .items[?(.status.phase=="Running")]}{.metadata.name}{" is Running\n"}{end}`, data, "pod1 is Running\npod2 is Running\npod3 is Running\n", false, // expect no error }, }, true, // allow missing keys t, ) } func TestStep(t *testing.T) { var input = []byte( `{ "apiVersion": "v1", "kind": "Pod", "spec": { "containers": [ { "image": "radial/busyboxplus:curl", "name": "fake0" }, { "image": "radial/busyboxplus:curl", "name": "fake1" }, { "image": "radial/busyboxplus:curl", "name": "fake2" }, { "image": "radial/busyboxplus:curl", "name": "fake3" }, { "image": "radial/busyboxplus:curl", "name": "fake4" }, { "image": "radial/busyboxplus:curl", "name": "fake5" }]}}`) var data interface{} err := json.Unmarshal(input, &data) if err != nil { t.Fatal(err) } testJSONPath( []jsonpathTest{ { "test containers[0:], it equals containers[0:6:1]", `{.spec.containers[0:].name}`, data, "fake0 fake1 fake2 fake3 fake4 fake5", false, }, { "test containers[0:6:], it equals containers[0:6:1]", `{.spec.containers[0:6:].name}`, data, "fake0 fake1 fake2 fake3 fake4 fake5", false, }, { "test containers[0:6:1]", `{.spec.containers[0:6:1].name}`, data, "fake0 fake1 fake2 fake3 fake4 fake5", false, }, { "test containers[0:6:0], it errors", `{.spec.containers[0:6:0].name}`, data, "", true, }, { "test containers[0:6:-1], it errors", `{.spec.containers[0:6:-1].name}`, data, "", true, }, { "test containers[1:4:2]", `{.spec.containers[1:4:2].name}`, data, "fake1 fake3", false, }, { "test containers[1:4:3]", `{.spec.containers[1:4:3].name}`, data, "fake1", false, }, { "test containers[1:4:4]", `{.spec.containers[1:4:4].name}`, data, "fake1", false, }, { "test containers[0:6:2]", `{.spec.containers[0:6:2].name}`, data, "fake0 fake2 fake4", false, }, { "test containers[0:6:3]", `{.spec.containers[0:6:3].name}`, data, "fake0 fake3", false, }, { "test containers[0:6:5]", `{.spec.containers[0:6:5].name}`, data, "fake0 fake5", false, }, { "test containers[0:6:6]", `{.spec.containers[0:6:6].name}`, data, "fake0", false, }, }, false, t, ) } kubernetes-client-go-a2dfcab/util/jsonpath/node.go000066400000000000000000000121211472614177300224540ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package jsonpath import "fmt" // NodeType identifies the type of a parse tree node. type NodeType int // Type returns itself and provides an easy default implementation func (t NodeType) Type() NodeType { return t } func (t NodeType) String() string { return NodeTypeName[t] } const ( NodeText NodeType = iota NodeArray NodeList NodeField NodeIdentifier NodeFilter NodeInt NodeFloat NodeWildcard NodeRecursive NodeUnion NodeBool ) var NodeTypeName = map[NodeType]string{ NodeText: "NodeText", NodeArray: "NodeArray", NodeList: "NodeList", NodeField: "NodeField", NodeIdentifier: "NodeIdentifier", NodeFilter: "NodeFilter", NodeInt: "NodeInt", NodeFloat: "NodeFloat", NodeWildcard: "NodeWildcard", NodeRecursive: "NodeRecursive", NodeUnion: "NodeUnion", NodeBool: "NodeBool", } type Node interface { Type() NodeType String() string } // ListNode holds a sequence of nodes. type ListNode struct { NodeType Nodes []Node // The element nodes in lexical order. } func newList() *ListNode { return &ListNode{NodeType: NodeList} } func (l *ListNode) append(n Node) { l.Nodes = append(l.Nodes, n) } func (l *ListNode) String() string { return l.Type().String() } // TextNode holds plain text. type TextNode struct { NodeType Text string // The text; may span newlines. } func newText(text string) *TextNode { return &TextNode{NodeType: NodeText, Text: text} } func (t *TextNode) String() string { return fmt.Sprintf("%s: %s", t.Type(), t.Text) } // FieldNode holds field of struct type FieldNode struct { NodeType Value string } func newField(value string) *FieldNode { return &FieldNode{NodeType: NodeField, Value: value} } func (f *FieldNode) String() string { return fmt.Sprintf("%s: %s", f.Type(), f.Value) } // IdentifierNode holds an identifier type IdentifierNode struct { NodeType Name string } func newIdentifier(value string) *IdentifierNode { return &IdentifierNode{ NodeType: NodeIdentifier, Name: value, } } func (f *IdentifierNode) String() string { return fmt.Sprintf("%s: %s", f.Type(), f.Name) } // ParamsEntry holds param information for ArrayNode type ParamsEntry struct { Value int Known bool // whether the value is known when parse it Derived bool } // ArrayNode holds start, end, step information for array index selection type ArrayNode struct { NodeType Params [3]ParamsEntry // start, end, step } func newArray(params [3]ParamsEntry) *ArrayNode { return &ArrayNode{ NodeType: NodeArray, Params: params, } } func (a *ArrayNode) String() string { return fmt.Sprintf("%s: %v", a.Type(), a.Params) } // FilterNode holds operand and operator information for filter type FilterNode struct { NodeType Left *ListNode Right *ListNode Operator string } func newFilter(left, right *ListNode, operator string) *FilterNode { return &FilterNode{ NodeType: NodeFilter, Left: left, Right: right, Operator: operator, } } func (f *FilterNode) String() string { return fmt.Sprintf("%s: %s %s %s", f.Type(), f.Left, f.Operator, f.Right) } // IntNode holds integer value type IntNode struct { NodeType Value int } func newInt(num int) *IntNode { return &IntNode{NodeType: NodeInt, Value: num} } func (i *IntNode) String() string { return fmt.Sprintf("%s: %d", i.Type(), i.Value) } // FloatNode holds float value type FloatNode struct { NodeType Value float64 } func newFloat(num float64) *FloatNode { return &FloatNode{NodeType: NodeFloat, Value: num} } func (i *FloatNode) String() string { return fmt.Sprintf("%s: %f", i.Type(), i.Value) } // WildcardNode means a wildcard type WildcardNode struct { NodeType } func newWildcard() *WildcardNode { return &WildcardNode{NodeType: NodeWildcard} } func (i *WildcardNode) String() string { return i.Type().String() } // RecursiveNode means a recursive descent operator type RecursiveNode struct { NodeType } func newRecursive() *RecursiveNode { return &RecursiveNode{NodeType: NodeRecursive} } func (r *RecursiveNode) String() string { return r.Type().String() } // UnionNode is union of ListNode type UnionNode struct { NodeType Nodes []*ListNode } func newUnion(nodes []*ListNode) *UnionNode { return &UnionNode{NodeType: NodeUnion, Nodes: nodes} } func (u *UnionNode) String() string { return u.Type().String() } // BoolNode holds bool value type BoolNode struct { NodeType Value bool } func newBool(value bool) *BoolNode { return &BoolNode{NodeType: NodeBool, Value: value} } func (b *BoolNode) String() string { return fmt.Sprintf("%s: %t", b.Type(), b.Value) } kubernetes-client-go-a2dfcab/util/jsonpath/parser.go000066400000000000000000000267761472614177300230500ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package jsonpath import ( "errors" "fmt" "regexp" "strconv" "strings" "unicode" "unicode/utf8" ) const eof = -1 const ( leftDelim = "{" rightDelim = "}" ) type Parser struct { Name string Root *ListNode input string pos int start int width int } var ( ErrSyntax = errors.New("invalid syntax") dictKeyRex = regexp.MustCompile(`^'([^']*)'$`) sliceOperatorRex = regexp.MustCompile(`^(-?[\d]*)(:-?[\d]*)?(:-?[\d]*)?$`) ) // Parse parsed the given text and return a node Parser. // If an error is encountered, parsing stops and an empty // Parser is returned with the error func Parse(name, text string) (*Parser, error) { p := NewParser(name) err := p.Parse(text) if err != nil { p = nil } return p, err } func NewParser(name string) *Parser { return &Parser{ Name: name, } } // parseAction parsed the expression inside delimiter func parseAction(name, text string) (*Parser, error) { p, err := Parse(name, fmt.Sprintf("%s%s%s", leftDelim, text, rightDelim)) // when error happens, p will be nil, so we need to return here if err != nil { return p, err } p.Root = p.Root.Nodes[0].(*ListNode) return p, nil } func (p *Parser) Parse(text string) error { p.input = text p.Root = newList() p.pos = 0 return p.parseText(p.Root) } // consumeText return the parsed text since last cosumeText func (p *Parser) consumeText() string { value := p.input[p.start:p.pos] p.start = p.pos return value } // next returns the next rune in the input. func (p *Parser) next() rune { if p.pos >= len(p.input) { p.width = 0 return eof } r, w := utf8.DecodeRuneInString(p.input[p.pos:]) p.width = w p.pos += p.width return r } // peek returns but does not consume the next rune in the input. func (p *Parser) peek() rune { r := p.next() p.backup() return r } // backup steps back one rune. Can only be called once per call of next. func (p *Parser) backup() { p.pos -= p.width } func (p *Parser) parseText(cur *ListNode) error { for { if strings.HasPrefix(p.input[p.pos:], leftDelim) { if p.pos > p.start { cur.append(newText(p.consumeText())) } return p.parseLeftDelim(cur) } if p.next() == eof { break } } // Correctly reached EOF. if p.pos > p.start { cur.append(newText(p.consumeText())) } return nil } // parseLeftDelim scans the left delimiter, which is known to be present. func (p *Parser) parseLeftDelim(cur *ListNode) error { p.pos += len(leftDelim) p.consumeText() newNode := newList() cur.append(newNode) cur = newNode return p.parseInsideAction(cur) } func (p *Parser) parseInsideAction(cur *ListNode) error { prefixMap := map[string]func(*ListNode) error{ rightDelim: p.parseRightDelim, "[?(": p.parseFilter, "..": p.parseRecursive, } for prefix, parseFunc := range prefixMap { if strings.HasPrefix(p.input[p.pos:], prefix) { return parseFunc(cur) } } switch r := p.next(); { case r == eof || isEndOfLine(r): return fmt.Errorf("unclosed action") case r == ' ': p.consumeText() case r == '@' || r == '$': //the current object, just pass it p.consumeText() case r == '[': return p.parseArray(cur) case r == '"' || r == '\'': return p.parseQuote(cur, r) case r == '.': return p.parseField(cur) case r == '+' || r == '-' || unicode.IsDigit(r): p.backup() return p.parseNumber(cur) case isAlphaNumeric(r): p.backup() return p.parseIdentifier(cur) default: return fmt.Errorf("unrecognized character in action: %#U", r) } return p.parseInsideAction(cur) } // parseRightDelim scans the right delimiter, which is known to be present. func (p *Parser) parseRightDelim(cur *ListNode) error { p.pos += len(rightDelim) p.consumeText() return p.parseText(p.Root) } // parseIdentifier scans build-in keywords, like "range" "end" func (p *Parser) parseIdentifier(cur *ListNode) error { var r rune for { r = p.next() if isTerminator(r) { p.backup() break } } value := p.consumeText() if isBool(value) { v, err := strconv.ParseBool(value) if err != nil { return fmt.Errorf("can not parse bool '%s': %s", value, err.Error()) } cur.append(newBool(v)) } else { cur.append(newIdentifier(value)) } return p.parseInsideAction(cur) } // parseRecursive scans the recursive descent operator .. func (p *Parser) parseRecursive(cur *ListNode) error { if lastIndex := len(cur.Nodes) - 1; lastIndex >= 0 && cur.Nodes[lastIndex].Type() == NodeRecursive { return fmt.Errorf("invalid multiple recursive descent") } p.pos += len("..") p.consumeText() cur.append(newRecursive()) if r := p.peek(); isAlphaNumeric(r) { return p.parseField(cur) } return p.parseInsideAction(cur) } // parseNumber scans number func (p *Parser) parseNumber(cur *ListNode) error { r := p.peek() if r == '+' || r == '-' { p.next() } for { r = p.next() if r != '.' && !unicode.IsDigit(r) { p.backup() break } } value := p.consumeText() i, err := strconv.Atoi(value) if err == nil { cur.append(newInt(i)) return p.parseInsideAction(cur) } d, err := strconv.ParseFloat(value, 64) if err == nil { cur.append(newFloat(d)) return p.parseInsideAction(cur) } return fmt.Errorf("cannot parse number %s", value) } // parseArray scans array index selection func (p *Parser) parseArray(cur *ListNode) error { Loop: for { switch p.next() { case eof, '\n': return fmt.Errorf("unterminated array") case ']': break Loop } } text := p.consumeText() text = text[1 : len(text)-1] if text == "*" { text = ":" } //union operator strs := strings.Split(text, ",") if len(strs) > 1 { union := []*ListNode{} for _, str := range strs { parser, err := parseAction("union", fmt.Sprintf("[%s]", strings.Trim(str, " "))) if err != nil { return err } union = append(union, parser.Root) } cur.append(newUnion(union)) return p.parseInsideAction(cur) } // dict key value := dictKeyRex.FindStringSubmatch(text) if value != nil { parser, err := parseAction("arraydict", fmt.Sprintf(".%s", value[1])) if err != nil { return err } for _, node := range parser.Root.Nodes { cur.append(node) } return p.parseInsideAction(cur) } //slice operator value = sliceOperatorRex.FindStringSubmatch(text) if value == nil { return fmt.Errorf("invalid array index %s", text) } value = value[1:] params := [3]ParamsEntry{} for i := 0; i < 3; i++ { if value[i] != "" { if i > 0 { value[i] = value[i][1:] } if i > 0 && value[i] == "" { params[i].Known = false } else { var err error params[i].Known = true params[i].Value, err = strconv.Atoi(value[i]) if err != nil { return fmt.Errorf("array index %s is not a number", value[i]) } } } else { if i == 1 { params[i].Known = true params[i].Value = params[0].Value + 1 params[i].Derived = true } else { params[i].Known = false params[i].Value = 0 } } } cur.append(newArray(params)) return p.parseInsideAction(cur) } // parseFilter scans filter inside array selection func (p *Parser) parseFilter(cur *ListNode) error { p.pos += len("[?(") p.consumeText() begin := false end := false var pair rune Loop: for { r := p.next() switch r { case eof, '\n': return fmt.Errorf("unterminated filter") case '"', '\'': if begin == false { //save the paired rune begin = true pair = r continue } //only add when met paired rune if p.input[p.pos-2] != '\\' && r == pair { end = true } case ')': //in rightParser below quotes only appear zero or once //and must be paired at the beginning and end if begin == end { break Loop } } } if p.next() != ']' { return fmt.Errorf("unclosed array expect ]") } reg := regexp.MustCompile(`^([^!<>=]+)([!<>=]+)(.+?)$`) text := p.consumeText() text = text[:len(text)-2] value := reg.FindStringSubmatch(text) if value == nil { parser, err := parseAction("text", text) if err != nil { return err } cur.append(newFilter(parser.Root, newList(), "exists")) } else { leftParser, err := parseAction("left", value[1]) if err != nil { return err } rightParser, err := parseAction("right", value[3]) if err != nil { return err } cur.append(newFilter(leftParser.Root, rightParser.Root, value[2])) } return p.parseInsideAction(cur) } // parseQuote unquotes string inside double or single quote func (p *Parser) parseQuote(cur *ListNode, end rune) error { Loop: for { switch p.next() { case eof, '\n': return fmt.Errorf("unterminated quoted string") case end: //if it's not escape break the Loop if p.input[p.pos-2] != '\\' { break Loop } } } value := p.consumeText() s, err := UnquoteExtend(value) if err != nil { return fmt.Errorf("unquote string %s error %v", value, err) } cur.append(newText(s)) return p.parseInsideAction(cur) } // parseField scans a field until a terminator func (p *Parser) parseField(cur *ListNode) error { p.consumeText() for p.advance() { } value := p.consumeText() if value == "*" { cur.append(newWildcard()) } else { cur.append(newField(strings.Replace(value, "\\", "", -1))) } return p.parseInsideAction(cur) } // advance scans until next non-escaped terminator func (p *Parser) advance() bool { r := p.next() if r == '\\' { p.next() } else if isTerminator(r) { p.backup() return false } return true } // isTerminator reports whether the input is at valid termination character to appear after an identifier. func isTerminator(r rune) bool { if isSpace(r) || isEndOfLine(r) { return true } switch r { case eof, '.', ',', '[', ']', '$', '@', '{', '}': return true } return false } // isSpace reports whether r is a space character. func isSpace(r rune) bool { return r == ' ' || r == '\t' } // isEndOfLine reports whether r is an end-of-line character. func isEndOfLine(r rune) bool { return r == '\r' || r == '\n' } // isAlphaNumeric reports whether r is an alphabetic, digit, or underscore. func isAlphaNumeric(r rune) bool { return r == '_' || unicode.IsLetter(r) || unicode.IsDigit(r) } // isBool reports whether s is a boolean value. func isBool(s string) bool { return s == "true" || s == "false" } // UnquoteExtend is almost same as strconv.Unquote(), but it support parse single quotes as a string func UnquoteExtend(s string) (string, error) { n := len(s) if n < 2 { return "", ErrSyntax } quote := s[0] if quote != s[n-1] { return "", ErrSyntax } s = s[1 : n-1] if quote != '"' && quote != '\'' { return "", ErrSyntax } // Is it trivial? Avoid allocation. if !contains(s, '\\') && !contains(s, quote) { return s, nil } var runeTmp [utf8.UTFMax]byte buf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations. for len(s) > 0 { c, multibyte, ss, err := strconv.UnquoteChar(s, quote) if err != nil { return "", err } s = ss if c < utf8.RuneSelf || !multibyte { buf = append(buf, byte(c)) } else { n := utf8.EncodeRune(runeTmp[:], c) buf = append(buf, runeTmp[:n]...) } } return string(buf), nil } func contains(s string, c byte) bool { for i := 0; i < len(s); i++ { if s[i] == c { return true } } return false } kubernetes-client-go-a2dfcab/util/jsonpath/parser_test.go000066400000000000000000000154571472614177300241010ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package jsonpath import ( "testing" ) type parserTest struct { name string text string nodes []Node shouldError bool } var parserTests = []parserTest{ {"plain", `hello jsonpath`, []Node{newText("hello jsonpath")}, false}, {"variable", `hello {.jsonpath}`, []Node{newText("hello "), newList(), newField("jsonpath")}, false}, {"arrayfiled", `hello {['jsonpath']}`, []Node{newText("hello "), newList(), newField("jsonpath")}, false}, {"quote", `{"{"}`, []Node{newList(), newText("{")}, false}, {"array", `{[1:3]}`, []Node{newList(), newArray([3]ParamsEntry{{1, true, false}, {3, true, false}, {0, false, false}})}, false}, {"allarray", `{.book[*].author}`, []Node{newList(), newField("book"), newArray([3]ParamsEntry{{0, false, false}, {0, false, false}, {0, false, false}}), newField("author")}, false}, {"wildcard", `{.bicycle.*}`, []Node{newList(), newField("bicycle"), newWildcard()}, false}, {"filter", `{[?(@.price<3)]}`, []Node{newList(), newFilter(newList(), newList(), "<"), newList(), newField("price"), newList(), newInt(3)}, false}, {"recursive", `{..}`, []Node{newList(), newRecursive()}, false}, {"recurField", `{..price}`, []Node{newList(), newRecursive(), newField("price")}, false}, {"arraydict", `{['book.price']}`, []Node{newList(), newField("book"), newField("price"), }, false}, {"union", `{['bicycle.price', 3, 'book.price']}`, []Node{newList(), newUnion([]*ListNode{}), newList(), newField("bicycle"), newField("price"), newList(), newArray([3]ParamsEntry{{3, true, false}, {4, true, true}, {0, false, false}}), newList(), newField("book"), newField("price"), }, false}, {"range", `{range .items}{.name},{end}`, []Node{ newList(), newIdentifier("range"), newField("items"), newList(), newField("name"), newText(","), newList(), newIdentifier("end"), }, false}, {"malformat input", `{\\\}`, []Node{}, true}, {"paired parentheses in quotes", `{[?(@.status.nodeInfo.osImage == "()")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("()")}, false}, {"paired parentheses in double quotes and with double quotes escape", `{[?(@.status.nodeInfo.osImage == "(\"\")")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("(\"\")")}, false}, {"unregular parentheses in double quotes", `{[?(@.test == "())(")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("test"), newList(), newText("())(")}, false}, {"plain text in single quotes", `{[?(@.status.nodeInfo.osImage == 'Linux')]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("Linux")}, false}, {"test filter suffix", `{[?(@.status.nodeInfo.osImage == "{[()]}")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("{[()]}")}, false}, {"double inside single", `{[?(@.status.nodeInfo.osImage == "''")]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("''")}, false}, {"single inside double", `{[?(@.status.nodeInfo.osImage == '""')]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("\"\"")}, false}, {"single containing escaped single", `{[?(@.status.nodeInfo.osImage == '\\\'')]}`, []Node{newList(), newFilter(newList(), newList(), "=="), newList(), newField("status"), newField("nodeInfo"), newField("osImage"), newList(), newText("\\'")}, false}, {"negative index slice, equals a[len-5] to a[len-1]", `{[-5:]}`, []Node{newList(), newArray([3]ParamsEntry{{-5, true, false}, {0, false, false}, {0, false, false}})}, false}, {"negative index slice, equals a[len-1]", `{[-1]}`, []Node{newList(), newArray([3]ParamsEntry{{-1, true, false}, {0, true, true}, {0, false, false}})}, false}, {"negative index slice, equals a[1] to a[len-1]", `{[1:-1]}`, []Node{newList(), newArray([3]ParamsEntry{{1, true, false}, {-1, true, false}, {0, false, false}})}, false}, } func collectNode(nodes []Node, cur Node) []Node { nodes = append(nodes, cur) switch cur.Type() { case NodeList: for _, node := range cur.(*ListNode).Nodes { nodes = collectNode(nodes, node) } case NodeFilter: nodes = collectNode(nodes, cur.(*FilterNode).Left) nodes = collectNode(nodes, cur.(*FilterNode).Right) case NodeUnion: for _, node := range cur.(*UnionNode).Nodes { nodes = collectNode(nodes, node) } } return nodes } func TestParser(t *testing.T) { for _, test := range parserTests { parser, err := Parse(test.name, test.text) if test.shouldError { if err == nil { t.Errorf("unexpected non-error when parsing %s", test.name) } continue } if err != nil { t.Errorf("parse %s error %v", test.name, err) } result := collectNode([]Node{}, parser.Root)[1:] if len(result) != len(test.nodes) { t.Errorf("in %s, expect to get %d nodes, got %d nodes", test.name, len(test.nodes), len(result)) t.Error(result) } for i, expect := range test.nodes { if result[i].String() != expect.String() { t.Errorf("in %s, %dth node, expect %v, got %v", test.name, i, expect, result[i]) } } } } type failParserTest struct { name string text string err string } func TestFailParser(t *testing.T) { failParserTests := []failParserTest{ {"unclosed action", "{.hello", "unclosed action"}, {"unrecognized character", "{*}", "unrecognized character in action: U+002A '*'"}, {"invalid number", "{+12.3.0}", "cannot parse number +12.3.0"}, {"unterminated array", "{[1}", "unterminated array"}, {"unterminated filter", "{[?(.price]}", "unterminated filter"}, {"invalid multiple recursive descent", "{........}", "invalid multiple recursive descent"}, } for _, test := range failParserTests { _, err := Parse(test.name, test.text) var out string if err == nil { out = "nil" } else { out = err.Error() } if out != test.err { t.Errorf("in %s, expect to get error %v, got %v", test.name, test.err, out) } } } kubernetes-client-go-a2dfcab/util/keyutil/000077500000000000000000000000001472614177300210435ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/keyutil/OWNERS000066400000000000000000000001631472614177300220030ustar00rootroot00000000000000approvers: - sig-auth-certificates-approvers reviewers: - sig-auth-certificates-reviewers labels: - sig/auth kubernetes-client-go-a2dfcab/util/keyutil/key.go000066400000000000000000000231601472614177300221640ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package keyutil contains utilities for managing public/private key pairs. package keyutil import ( "crypto" "crypto/ecdsa" "crypto/elliptic" cryptorand "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" "os" "path/filepath" ) const ( // ECPrivateKeyBlockType is a possible value for pem.Block.Type. ECPrivateKeyBlockType = "EC PRIVATE KEY" // RSAPrivateKeyBlockType is a possible value for pem.Block.Type. RSAPrivateKeyBlockType = "RSA PRIVATE KEY" // PrivateKeyBlockType is a possible value for pem.Block.Type. PrivateKeyBlockType = "PRIVATE KEY" // PublicKeyBlockType is a possible value for pem.Block.Type. PublicKeyBlockType = "PUBLIC KEY" ) // MakeEllipticPrivateKeyPEM creates an ECDSA private key func MakeEllipticPrivateKeyPEM() ([]byte, error) { privateKey, err := ecdsa.GenerateKey(elliptic.P256(), cryptorand.Reader) if err != nil { return nil, err } derBytes, err := x509.MarshalECPrivateKey(privateKey) if err != nil { return nil, err } privateKeyPemBlock := &pem.Block{ Type: ECPrivateKeyBlockType, Bytes: derBytes, } return pem.EncodeToMemory(privateKeyPemBlock), nil } // WriteKey writes the pem-encoded key data to keyPath. // The key file will be created with file mode 0600. // If the key file already exists, it will be overwritten. // The parent directory of the keyPath will be created as needed with file mode 0755. func WriteKey(keyPath string, data []byte) error { if err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil { return err } return os.WriteFile(keyPath, data, os.FileMode(0600)) } // LoadOrGenerateKeyFile looks for a key in the file at the given path. If it // can't find one, it will generate a new key and store it there. func LoadOrGenerateKeyFile(keyPath string) (data []byte, wasGenerated bool, err error) { loadedData, err := os.ReadFile(keyPath) // Call verifyKeyData to ensure the file wasn't empty/corrupt. if err == nil && verifyKeyData(loadedData) { return loadedData, false, err } if !os.IsNotExist(err) { return nil, false, fmt.Errorf("error loading key from %s: %v", keyPath, err) } generatedData, err := MakeEllipticPrivateKeyPEM() if err != nil { return nil, false, fmt.Errorf("error generating key: %v", err) } if err := WriteKey(keyPath, generatedData); err != nil { return nil, false, fmt.Errorf("error writing key to %s: %v", keyPath, err) } return generatedData, true, nil } // MarshalPrivateKeyToPEM converts a known private key type of RSA or ECDSA to // a PEM encoded block or returns an error. func MarshalPrivateKeyToPEM(privateKey crypto.PrivateKey) ([]byte, error) { switch t := privateKey.(type) { case *ecdsa.PrivateKey: derBytes, err := x509.MarshalECPrivateKey(t) if err != nil { return nil, err } block := &pem.Block{ Type: ECPrivateKeyBlockType, Bytes: derBytes, } return pem.EncodeToMemory(block), nil case *rsa.PrivateKey: block := &pem.Block{ Type: RSAPrivateKeyBlockType, Bytes: x509.MarshalPKCS1PrivateKey(t), } return pem.EncodeToMemory(block), nil default: return nil, fmt.Errorf("private key is not a recognized type: %T", privateKey) } } // PrivateKeyFromFile returns the private key in rsa.PrivateKey or ecdsa.PrivateKey format from a given PEM-encoded file. // Returns an error if the file could not be read or if the private key could not be parsed. func PrivateKeyFromFile(file string) (interface{}, error) { data, err := os.ReadFile(file) if err != nil { return nil, err } key, err := ParsePrivateKeyPEM(data) if err != nil { return nil, fmt.Errorf("error reading private key file %s: %v", file, err) } return key, nil } // PublicKeysFromFile returns the public keys in rsa.PublicKey or ecdsa.PublicKey format from a given PEM-encoded file. // Reads public keys from both public and private key files. func PublicKeysFromFile(file string) ([]interface{}, error) { data, err := os.ReadFile(file) if err != nil { return nil, err } keys, err := ParsePublicKeysPEM(data) if err != nil { return nil, fmt.Errorf("error reading public key file %s: %v", file, err) } return keys, nil } // verifyKeyData returns true if the provided data appears to be a valid private key. func verifyKeyData(data []byte) bool { if len(data) == 0 { return false } _, err := ParsePrivateKeyPEM(data) return err == nil } // ParsePrivateKeyPEM returns a private key parsed from a PEM block in the supplied data. // Recognizes PEM blocks for "EC PRIVATE KEY", "RSA PRIVATE KEY", or "PRIVATE KEY" func ParsePrivateKeyPEM(keyData []byte) (interface{}, error) { var privateKeyPemBlock *pem.Block for { privateKeyPemBlock, keyData = pem.Decode(keyData) if privateKeyPemBlock == nil { break } switch privateKeyPemBlock.Type { case ECPrivateKeyBlockType: // ECDSA Private Key in ASN.1 format if key, err := x509.ParseECPrivateKey(privateKeyPemBlock.Bytes); err == nil { return key, nil } case RSAPrivateKeyBlockType: // RSA Private Key in PKCS#1 format if key, err := x509.ParsePKCS1PrivateKey(privateKeyPemBlock.Bytes); err == nil { return key, nil } case PrivateKeyBlockType: // RSA or ECDSA Private Key in unencrypted PKCS#8 format if key, err := x509.ParsePKCS8PrivateKey(privateKeyPemBlock.Bytes); err == nil { return key, nil } } // tolerate non-key PEM blocks for compatibility with things like "EC PARAMETERS" blocks // originally, only the first PEM block was parsed and expected to be a key block } // we read all the PEM blocks and didn't recognize one return nil, fmt.Errorf("data does not contain a valid RSA or ECDSA private key") } // ParsePublicKeysPEM is a helper function for reading an array of rsa.PublicKey or ecdsa.PublicKey from a PEM-encoded byte array. // Reads public keys from both public and private key files. func ParsePublicKeysPEM(keyData []byte) ([]interface{}, error) { var block *pem.Block keys := []interface{}{} for { // read the next block block, keyData = pem.Decode(keyData) if block == nil { break } // test block against parsing functions if privateKey, err := parseRSAPrivateKey(block.Bytes); err == nil { keys = append(keys, &privateKey.PublicKey) continue } if publicKey, err := parseRSAPublicKey(block.Bytes); err == nil { keys = append(keys, publicKey) continue } if privateKey, err := parseECPrivateKey(block.Bytes); err == nil { keys = append(keys, &privateKey.PublicKey) continue } if publicKey, err := parseECPublicKey(block.Bytes); err == nil { keys = append(keys, publicKey) continue } // tolerate non-key PEM blocks for backwards compatibility // originally, only the first PEM block was parsed and expected to be a key block } if len(keys) == 0 { return nil, fmt.Errorf("data does not contain any valid RSA or ECDSA public keys") } return keys, nil } // parseRSAPublicKey parses a single RSA public key from the provided data func parseRSAPublicKey(data []byte) (*rsa.PublicKey, error) { var err error // Parse the key var parsedKey interface{} if parsedKey, err = x509.ParsePKIXPublicKey(data); err != nil { if cert, err := x509.ParseCertificate(data); err == nil { parsedKey = cert.PublicKey } else { return nil, err } } // Test if parsed key is an RSA Public Key var pubKey *rsa.PublicKey var ok bool if pubKey, ok = parsedKey.(*rsa.PublicKey); !ok { return nil, fmt.Errorf("data doesn't contain valid RSA Public Key") } return pubKey, nil } // parseRSAPrivateKey parses a single RSA private key from the provided data func parseRSAPrivateKey(data []byte) (*rsa.PrivateKey, error) { var err error // Parse the key var parsedKey interface{} if parsedKey, err = x509.ParsePKCS1PrivateKey(data); err != nil { if parsedKey, err = x509.ParsePKCS8PrivateKey(data); err != nil { return nil, err } } // Test if parsed key is an RSA Private Key var privKey *rsa.PrivateKey var ok bool if privKey, ok = parsedKey.(*rsa.PrivateKey); !ok { return nil, fmt.Errorf("data doesn't contain valid RSA Private Key") } return privKey, nil } // parseECPublicKey parses a single ECDSA public key from the provided data func parseECPublicKey(data []byte) (*ecdsa.PublicKey, error) { var err error // Parse the key var parsedKey interface{} if parsedKey, err = x509.ParsePKIXPublicKey(data); err != nil { if cert, err := x509.ParseCertificate(data); err == nil { parsedKey = cert.PublicKey } else { return nil, err } } // Test if parsed key is an ECDSA Public Key var pubKey *ecdsa.PublicKey var ok bool if pubKey, ok = parsedKey.(*ecdsa.PublicKey); !ok { return nil, fmt.Errorf("data doesn't contain valid ECDSA Public Key") } return pubKey, nil } // parseECPrivateKey parses a single ECDSA private key from the provided data func parseECPrivateKey(data []byte) (*ecdsa.PrivateKey, error) { var err error // Parse the key var parsedKey interface{} if parsedKey, err = x509.ParseECPrivateKey(data); err != nil { return nil, err } // Test if parsed key is an ECDSA Private Key var privKey *ecdsa.PrivateKey var ok bool if privKey, ok = parsedKey.(*ecdsa.PrivateKey); !ok { return nil, fmt.Errorf("data doesn't contain valid ECDSA Private Key") } return privKey, nil } kubernetes-client-go-a2dfcab/util/keyutil/key_test.go000066400000000000000000000203151472614177300232220ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package keyutil import ( "os" "testing" ) const ( // rsaPrivateKey is a RSA Private Key in PKCS#1 format // openssl genrsa -out rsa2048.pem 2048 rsaPrivateKey = `-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA92mVjhBKOFsdxFzb/Pjq+7b5TJlODAdY5hK+WxLZTIrfhDPq FWrGKdjSNiHbXrdEtwJh9V+RqPZVSN3aWy1224RgkyNdMJsXhJKuCC24ZKY8SXtW xuTYmMRaMnCsv6QBGRTIbZ2EFbAObVM7lDyv1VqY3amZIWFQMlZ9CNpxDSPa5yi4 3gopbXkne0oGNmey9X0qtpk7NMZIgAL6Zz4rZ30bcfC2ag6RLOFI2E/c4n8c38R8 9MfXfLkj8/Cxo4JfI9NvRCpPOpFO8d/ZtWVUuIrBQN+Y7tkN2T60Qq/TkKXUrhDe fwlTlktZVJ/GztLYU41b2GcWsh/XO+PH831rmwIDAQABAoIBAQCC9c6GDjVbM0/E WurPMusfJjE7zII1d8YkspM0HfwLug6qKdikUYpnKC/NG4rEzfl/bbFwco/lgc6O 7W/hh2U8uQttlvCDA/Uk5YddKOZL0Hpk4vaB/SxxYK3luSKXpjY2knutGg2KdVCN qdsFkkH4iyYTXuyBcMNEgedZQldI/kEujIH/L7FE+DF5TMzT4lHhozDoG+fy564q qVGUZXJn0ubc3GaPn2QOLNNM44sfYA4UJCpKBXPu85bvNObjxVQO4WqwwxU1vRnL UUsaGaelhSVJCo0dVPRvrfPPKZ09HTwpy40EkgQo6VriFc1EBoQDjENLbAJv9OfQ aCc9wiZhAoGBAP/8oEy48Zbb0P8Vdy4djf5tfBW8yXFLWzXewJ4l3itKS1r42nbX 9q3cJsgRTQm8uRcMIpWxsc3n6zG+lREvTkoTB3ViI7+uQPiqA+BtWyNy7jzufFke ONKZfg7QxxmYRWZBRnoNGNbMpNeERuLmhvQuom9D1WbhzAYJbfs/O4WTAoGBAPds 2FNDU0gaesFDdkIUGq1nIJqRQDW485LXZm4pFqBFxdOpbdWRuYT2XZjd3fD0XY98 Nhkpb7NTMCuK3BdKcqIptt+cK+quQgYid0hhhgZbpCQ5AL6c6KgyjgpYlh2enzU9 Zo3yg8ej1zbbA11sBlhX+5iO2P1u5DG+JHLwUUbZAoGAUwaU102EzfEtsA4+QW7E hyjrfgFlNKHES4yb3K9bh57pIfBkqvcQwwMMcQdrfSUAw0DkVrjzel0mI1Q09QXq 1ould6UFAz55RC2gZEITtUOpkYmoOx9aPrQZ9qQwb1S77ZZuTVfCHqjxLhVxCFbM npYhiQTvShciHTMhwMOZgpECgYAVV5EtVXBYltgh1YTc3EkUzgF087R7LdHsx6Gx POATwRD4WfP8aQ58lpeqOPEM+LcdSlSMRRO6fyF3kAm+BJDwxfJdRWZQXumZB94M I0VhRQRaj4Qt7PDwmTPBVrTUJzuKZxpyggm17b8Bn1Ch/VBqzGQKW8AB1E/grosM UwhfuQKBgQC2JO/iqTQScHClf0qlItCJsBuVukFmSAVCkpOD8YdbdlPdOOwSk1wQ C0eAlsC3BCMvkpidKQmra6IqIrvTGI6EFgkrb3aknWdup2w8j2udYCNqyE3W+fVe p8FdYQ1FkACQ+daO5VlClL/9l0sGjKXlNKbpmJ2H4ngZmXj5uGmxuQ== -----END RSA PRIVATE KEY-----` // rsaPublicKey is a RSA Public Key in PEM encoded format // openssl rsa -in rsa2048.pem -pubout -out rsa2048pub.pem rsaPublicKey = `-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA92mVjhBKOFsdxFzb/Pjq +7b5TJlODAdY5hK+WxLZTIrfhDPqFWrGKdjSNiHbXrdEtwJh9V+RqPZVSN3aWy12 24RgkyNdMJsXhJKuCC24ZKY8SXtWxuTYmMRaMnCsv6QBGRTIbZ2EFbAObVM7lDyv 1VqY3amZIWFQMlZ9CNpxDSPa5yi43gopbXkne0oGNmey9X0qtpk7NMZIgAL6Zz4r Z30bcfC2ag6RLOFI2E/c4n8c38R89MfXfLkj8/Cxo4JfI9NvRCpPOpFO8d/ZtWVU uIrBQN+Y7tkN2T60Qq/TkKXUrhDefwlTlktZVJ/GztLYU41b2GcWsh/XO+PH831r mwIDAQAB -----END PUBLIC KEY-----` // certificate is an x509 certificate in PEM encoded format // openssl req -new -key rsa2048.pem -sha256 -nodes -x509 -days 1826 -out x509certificate.pem -subj "/C=US/CN=not-valid" certificate = `-----BEGIN CERTIFICATE----- MIIDFTCCAf2gAwIBAgIJAN8B8NOwtiUCMA0GCSqGSIb3DQEBCwUAMCExCzAJBgNV BAYTAlVTMRIwEAYDVQQDDAlub3QtdmFsaWQwHhcNMTcwMzIyMDI1NjM2WhcNMjIw MzIyMDI1NjM2WjAhMQswCQYDVQQGEwJVUzESMBAGA1UEAwwJbm90LXZhbGlkMIIB IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA92mVjhBKOFsdxFzb/Pjq+7b5 TJlODAdY5hK+WxLZTIrfhDPqFWrGKdjSNiHbXrdEtwJh9V+RqPZVSN3aWy1224Rg kyNdMJsXhJKuCC24ZKY8SXtWxuTYmMRaMnCsv6QBGRTIbZ2EFbAObVM7lDyv1VqY 3amZIWFQMlZ9CNpxDSPa5yi43gopbXkne0oGNmey9X0qtpk7NMZIgAL6Zz4rZ30b cfC2ag6RLOFI2E/c4n8c38R89MfXfLkj8/Cxo4JfI9NvRCpPOpFO8d/ZtWVUuIrB QN+Y7tkN2T60Qq/TkKXUrhDefwlTlktZVJ/GztLYU41b2GcWsh/XO+PH831rmwID AQABo1AwTjAdBgNVHQ4EFgQU1I5GfinLF7ta+dBJ6UWcrYaexLswHwYDVR0jBBgw FoAU1I5GfinLF7ta+dBJ6UWcrYaexLswDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B AQsFAAOCAQEAUl0wUD4y41juHFOVMYiziPYr1ShSpQXdwp8FfaHrzI5hsr8UMe8D dzb9QzZ4bx3yZhiG3ahrSBh956thMTHrKTEwAfJIEXI4cuSVWQAaOJ4Em5SDFxQe d0E6Ui2nGh1SFGF7oyuEXyzqgRMWFNDFw9HLUNgXaO18Zfouw8+K0BgbfEWEcSi1 JLQbyhCjz088gltrliQGPWDFAg9cHBKtJhuTzZkvuqK1CLEmBhtzP1zFiGBfOJc8 v+aKjAwrPUNX11cXOCPxBv2qXMetxaovBem6AI2hvypCInXaVQfP+yOLubzlTDjS Y708SlY38hmS1uTwDpyLOn8AKkZ8jtx75g== -----END CERTIFICATE-----` // ecdsaPrivateKeyWithParams is a ECDSA Private Key with included EC Parameters block // openssl ecparam -name prime256v1 -genkey -out ecdsa256params.pem ecdsaPrivateKeyWithParams = `-----BEGIN EC PARAMETERS----- BggqhkjOPQMBBw== -----END EC PARAMETERS----- -----BEGIN EC PRIVATE KEY----- MHcCAQEEIAwSOWQqlMTZNqNF7tgua812Jxib1DVOgb2pHHyIEyNNoAoGCCqGSM49 AwEHoUQDQgAEyxYNrs6a6tsNCFNYn+l+JDUZ0PnUZbcsDgJn2O62D1se8M5iQ5rY iIv6RpxE3VHvlHEIvYgCZkG0jHszTUopBg== -----END EC PRIVATE KEY-----` // ecdsaPrivateKey is a ECDSA Private Key in ASN.1 format // openssl ecparam -name prime256v1 -genkey -noout -out ecdsa256.pem ecdsaPrivateKey = `-----BEGIN EC PRIVATE KEY----- MHcCAQEEIP6Qw6dHDiLsSnLXUhQVTPE0fTQQrj3XSbiQAZPXnk5+oAoGCCqGSM49 AwEHoUQDQgAEZZzi1u5f2/AEGFI/HYUhU+u6cTK1q2bbtE7r1JMK+/sQA5sNAp+7 Vdc3psr1OaNzyTyuhTECyRdFKXm63cMnGg== -----END EC PRIVATE KEY-----` // ecdsaPublicKey is a ECDSA Public Key in PEM encoded format // openssl ec -in ecdsa256.pem -pubout -out ecdsa256pub.pem ecdsaPublicKey = `-----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZZzi1u5f2/AEGFI/HYUhU+u6cTK1 q2bbtE7r1JMK+/sQA5sNAp+7Vdc3psr1OaNzyTyuhTECyRdFKXm63cMnGg== -----END PUBLIC KEY-----` ) func TestReadPrivateKey(t *testing.T) { f, err := os.CreateTemp("", "") if err != nil { t.Fatalf("error creating tmpfile: %v", err) } defer os.Remove(f.Name()) if _, err := PrivateKeyFromFile(f.Name()); err == nil { t.Fatalf("Expected error reading key from empty file, got none") } if err := os.WriteFile(f.Name(), []byte(rsaPrivateKey), os.FileMode(0600)); err != nil { t.Fatalf("error writing private key to tmpfile: %v", err) } if _, err := PrivateKeyFromFile(f.Name()); err != nil { t.Fatalf("error reading private RSA key: %v", err) } if err := os.WriteFile(f.Name(), []byte(ecdsaPrivateKey), os.FileMode(0600)); err != nil { t.Fatalf("error writing private key to tmpfile: %v", err) } if _, err := PrivateKeyFromFile(f.Name()); err != nil { t.Fatalf("error reading private ECDSA key: %v", err) } if err := os.WriteFile(f.Name(), []byte(ecdsaPrivateKeyWithParams), os.FileMode(0600)); err != nil { t.Fatalf("error writing private key to tmpfile: %v", err) } if _, err := PrivateKeyFromFile(f.Name()); err != nil { t.Fatalf("error reading private ECDSA key with params: %v", err) } } func TestReadPublicKeys(t *testing.T) { f, err := os.CreateTemp("", "") if err != nil { t.Fatalf("error creating tmpfile: %v", err) } defer os.Remove(f.Name()) if _, err := PublicKeysFromFile(f.Name()); err == nil { t.Fatalf("Expected error reading keys from empty file, got none") } if err := os.WriteFile(f.Name(), []byte(rsaPublicKey), os.FileMode(0600)); err != nil { t.Fatalf("error writing public key to tmpfile: %v", err) } if keys, err := PublicKeysFromFile(f.Name()); err != nil { t.Fatalf("error reading RSA public key: %v", err) } else if len(keys) != 1 { t.Fatalf("expected 1 key, got %d", len(keys)) } if err := os.WriteFile(f.Name(), []byte(ecdsaPublicKey), os.FileMode(0600)); err != nil { t.Fatalf("error writing public key to tmpfile: %v", err) } if keys, err := PublicKeysFromFile(f.Name()); err != nil { t.Fatalf("error reading ECDSA public key: %v", err) } else if len(keys) != 1 { t.Fatalf("expected 1 key, got %d", len(keys)) } if err := os.WriteFile(f.Name(), []byte(rsaPublicKey+"\n"+ecdsaPublicKey), os.FileMode(0600)); err != nil { t.Fatalf("error writing public key to tmpfile: %v", err) } if keys, err := PublicKeysFromFile(f.Name()); err != nil { t.Fatalf("error reading combined RSA/ECDSA public key file: %v", err) } else if len(keys) != 2 { t.Fatalf("expected 2 keys, got %d", len(keys)) } if err := os.WriteFile(f.Name(), []byte(certificate), os.FileMode(0600)); err != nil { t.Fatalf("error writing certificate to tmpfile: %v", err) } if keys, err := PublicKeysFromFile(f.Name()); err != nil { t.Fatalf("error reading public key from certificate file: %v", err) } else if len(keys) != 1 { t.Fatalf("expected 1 keys, got %d", len(keys)) } } kubernetes-client-go-a2dfcab/util/retry/000077500000000000000000000000001472614177300205225ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/retry/OWNERS000066400000000000000000000001171472614177300214610ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners reviewers: - caesarxuchao kubernetes-client-go-a2dfcab/util/retry/util.go000066400000000000000000000070511472614177300220310ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package retry import ( "time" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/util/wait" ) // DefaultRetry is the recommended retry for a conflict where multiple clients // are making changes to the same resource. var DefaultRetry = wait.Backoff{ Steps: 5, Duration: 10 * time.Millisecond, Factor: 1.0, Jitter: 0.1, } // DefaultBackoff is the recommended backoff for a conflict where a client // may be attempting to make an unrelated modification to a resource under // active management by one or more controllers. var DefaultBackoff = wait.Backoff{ Steps: 4, Duration: 10 * time.Millisecond, Factor: 5.0, Jitter: 0.1, } // OnError allows the caller to retry fn in case the error returned by fn is retriable // according to the provided function. backoff defines the maximum retries and the wait // interval between two retries. func OnError(backoff wait.Backoff, retriable func(error) bool, fn func() error) error { var lastErr error err := wait.ExponentialBackoff(backoff, func() (bool, error) { err := fn() switch { case err == nil: return true, nil case retriable(err): lastErr = err return false, nil default: return false, err } }) if err == wait.ErrWaitTimeout { err = lastErr } return err } // RetryOnConflict is used to make an update to a resource when you have to worry about // conflicts caused by other code making unrelated updates to the resource at the same // time. fn should fetch the resource to be modified, make appropriate changes to it, try // to update it, and return (unmodified) the error from the update function. On a // successful update, RetryOnConflict will return nil. If the update function returns a // "Conflict" error, RetryOnConflict will wait some amount of time as described by // backoff, and then try again. On a non-"Conflict" error, or if it retries too many times // and gives up, RetryOnConflict will return an error to the caller. // // err := retry.RetryOnConflict(retry.DefaultRetry, func() error { // // Fetch the resource here; you need to refetch it on every try, since // // if you got a conflict on the last update attempt then you need to get // // the current version before making your own changes. // pod, err := c.Pods("mynamespace").Get(name, metav1.GetOptions{}) // if err != nil { // return err // } // // // Make whatever updates to the resource are needed // pod.Status.Phase = v1.PodFailed // // // Try to update // _, err = c.Pods("mynamespace").UpdateStatus(pod) // // You have to return err itself here (not wrapped inside another error) // // so that RetryOnConflict can identify it correctly. // return err // }) // if err != nil { // // May be conflict if max retries were hit, or may be something unrelated // // like permissions or a network error // return err // } // ... // // TODO: Make Backoff an interface? func RetryOnConflict(backoff wait.Backoff, fn func() error) error { return OnError(backoff, errors.IsConflict, fn) } kubernetes-client-go-a2dfcab/util/retry/util_test.go000066400000000000000000000032551472614177300230720ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package retry import ( "fmt" "testing" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/wait" ) func TestRetryOnConflict(t *testing.T) { opts := wait.Backoff{Factor: 1.0, Steps: 3} conflictErr := errors.NewConflict(schema.GroupResource{Resource: "test"}, "other", nil) // never returns err := RetryOnConflict(opts, func() error { return conflictErr }) if err != conflictErr { t.Errorf("unexpected error: %v", err) } // returns immediately i := 0 err = RetryOnConflict(opts, func() error { i++ return nil }) if err != nil || i != 1 { t.Errorf("unexpected error: %v", err) } // returns immediately on error testErr := fmt.Errorf("some other error") err = RetryOnConflict(opts, func() error { return testErr }) if err != testErr { t.Errorf("unexpected error: %v", err) } // keeps retrying i = 0 err = RetryOnConflict(opts, func() error { if i < 2 { i++ return errors.NewConflict(schema.GroupResource{Resource: "test"}, "other", nil) } return nil }) if err != nil || i != 2 { t.Errorf("unexpected error: %v", err) } } kubernetes-client-go-a2dfcab/util/testing/000077500000000000000000000000001472614177300210325ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/testing/fake_handler.go000066400000000000000000000103341472614177300237650ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "io" "net/http" "net/url" "reflect" "sync" ) // TestInterface is a simple interface providing Errorf, to make injection for // testing easier (insert 'yo dawg' meme here). type TestInterface interface { Errorf(format string, args ...interface{}) Logf(format string, args ...interface{}) } // LogInterface is a simple interface to allow injection of Logf to report serving errors. type LogInterface interface { Logf(format string, args ...interface{}) } // FakeHandler is to assist in testing HTTP requests. Notice that FakeHandler is // not thread safe and you must not direct traffic to except for the request // you want to test. You can do this by hiding it in an http.ServeMux. type FakeHandler struct { RequestReceived *http.Request RequestBody string StatusCode int ResponseBody string // For logging - you can use a *testing.T // This will keep log messages associated with the test. T LogInterface // Enforce "only one use" constraint. lock sync.Mutex requestCount int hasBeenChecked bool SkipRequestFn func(verb string, url url.URL) bool } func (f *FakeHandler) SetResponseBody(responseBody string) { f.lock.Lock() defer f.lock.Unlock() f.ResponseBody = responseBody } func (f *FakeHandler) ServeHTTP(response http.ResponseWriter, request *http.Request) { f.lock.Lock() defer f.lock.Unlock() if f.SkipRequestFn != nil && f.SkipRequestFn(request.Method, *request.URL) { response.Header().Set("Content-Type", "application/json") response.WriteHeader(f.StatusCode) response.Write([]byte(f.ResponseBody)) return } f.requestCount++ if f.hasBeenChecked { panic("got request after having been validated") } f.RequestReceived = request response.Header().Set("Content-Type", "application/json") response.WriteHeader(f.StatusCode) response.Write([]byte(f.ResponseBody)) bodyReceived, err := io.ReadAll(request.Body) if err != nil && f.T != nil { f.T.Logf("Received read error: %v", err) } f.RequestBody = string(bodyReceived) if f.T != nil { f.T.Logf("request body: %s", f.RequestBody) } } func (f *FakeHandler) ValidateRequestCount(t TestInterface, count int) bool { ok := true f.lock.Lock() defer f.lock.Unlock() if f.requestCount != count { ok = false t.Errorf("Expected %d call, but got %d. Only the last call is recorded and checked.", count, f.requestCount) } f.hasBeenChecked = true return ok } // ValidateRequest verifies that FakeHandler received a request with expected path, method, and body. func (f *FakeHandler) ValidateRequest(t TestInterface, expectedPath, expectedMethod string, body *string) { f.lock.Lock() defer f.lock.Unlock() if f.requestCount != 1 { t.Logf("Expected 1 call, but got %v. Only the last call is recorded and checked.", f.requestCount) } f.hasBeenChecked = true expectURL, err := url.Parse(expectedPath) if err != nil { t.Errorf("Couldn't parse %v as a URL.", expectedPath) } if f.RequestReceived == nil { t.Errorf("Unexpected nil request received for %s", expectedPath) return } if f.RequestReceived.URL.Path != expectURL.Path { t.Errorf("Unexpected request path for request %#v, received: %q, expected: %q", f.RequestReceived, f.RequestReceived.URL.Path, expectURL.Path) } if e, a := expectURL.Query(), f.RequestReceived.URL.Query(); !reflect.DeepEqual(e, a) { t.Errorf("Unexpected query for request %#v, received: %q, expected: %q", f.RequestReceived, a, e) } if f.RequestReceived.Method != expectedMethod { t.Errorf("Unexpected method: %q, expected: %q", f.RequestReceived.Method, expectedMethod) } if body != nil { if *body != f.RequestBody { t.Errorf("Received body:\n%s\n Doesn't match expected body:\n%s", f.RequestBody, *body) } } } kubernetes-client-go-a2dfcab/util/testing/fake_handler_test.go000066400000000000000000000103541472614177300250260ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "bytes" "net/http" "net/http/httptest" "testing" ) func TestFakeHandlerPath(t *testing.T) { handler := FakeHandler{StatusCode: http.StatusOK} server := httptest.NewServer(&handler) defer server.Close() method := "GET" path := "/foo/bar" body := "somebody" req, err := http.NewRequest(method, server.URL+path, bytes.NewBufferString(body)) if err != nil { t.Errorf("unexpected error: %v", err) } client := http.Client{} _, err = client.Do(req) if err != nil { t.Errorf("unexpected error: %v", err) } handler.ValidateRequest(t, path, method, &body) } func TestFakeHandlerPathNoBody(t *testing.T) { handler := FakeHandler{StatusCode: http.StatusOK} server := httptest.NewServer(&handler) defer server.Close() method := "GET" path := "/foo/bar" req, err := http.NewRequest(method, server.URL+path, nil) if err != nil { t.Errorf("unexpected error: %v", err) } client := http.Client{} _, err = client.Do(req) if err != nil { t.Errorf("unexpected error: %v", err) } handler.ValidateRequest(t, path, method, nil) } type fakeError struct { errors []string } func (f *fakeError) Errorf(format string, args ...interface{}) { f.errors = append(f.errors, format) } func (f *fakeError) Logf(format string, args ...interface{}) {} func TestFakeHandlerWrongPath(t *testing.T) { handler := FakeHandler{StatusCode: http.StatusOK} server := httptest.NewServer(&handler) defer server.Close() method := "GET" path := "/foo/bar" fakeT := fakeError{} req, err := http.NewRequest(method, server.URL+"/foo/baz", nil) if err != nil { t.Errorf("unexpected error: %v", err) } client := http.Client{} _, err = client.Do(req) if err != nil { t.Errorf("unexpected error: %v", err) } handler.ValidateRequest(&fakeT, path, method, nil) if len(fakeT.errors) != 1 { t.Errorf("Unexpected error set: %#v", fakeT.errors) } } func TestFakeHandlerWrongMethod(t *testing.T) { handler := FakeHandler{StatusCode: http.StatusOK} server := httptest.NewServer(&handler) defer server.Close() method := "GET" path := "/foo/bar" fakeT := fakeError{} req, err := http.NewRequest("PUT", server.URL+path, nil) if err != nil { t.Errorf("unexpected error: %v", err) } client := http.Client{} _, err = client.Do(req) if err != nil { t.Errorf("unexpected error: %v", err) } handler.ValidateRequest(&fakeT, path, method, nil) if len(fakeT.errors) != 1 { t.Errorf("Unexpected error set: %#v", fakeT.errors) } } func TestFakeHandlerWrongBody(t *testing.T) { handler := FakeHandler{StatusCode: http.StatusOK} server := httptest.NewServer(&handler) defer server.Close() method := "GET" path := "/foo/bar" body := "somebody" fakeT := fakeError{} req, err := http.NewRequest(method, server.URL+path, bytes.NewBufferString(body)) if err != nil { t.Errorf("unexpected error: %v", err) } client := http.Client{} _, err = client.Do(req) if err != nil { t.Errorf("unexpected error: %v", err) } otherbody := "otherbody" handler.ValidateRequest(&fakeT, path, method, &otherbody) if len(fakeT.errors) != 1 { t.Errorf("Unexpected error set: %#v", fakeT.errors) } } func TestFakeHandlerNilBody(t *testing.T) { handler := FakeHandler{StatusCode: http.StatusOK} server := httptest.NewServer(&handler) defer server.Close() method := "GET" path := "/foo/bar" body := "somebody" fakeT := fakeError{} req, err := http.NewRequest(method, server.URL+path, nil) if err != nil { t.Errorf("unexpected error: %v", err) } client := http.Client{} _, err = client.Do(req) if err != nil { t.Errorf("unexpected error: %v", err) } handler.ValidateRequest(&fakeT, path, method, &body) if len(fakeT.errors) != 1 { t.Errorf("Unexpected error set: %#v", fakeT.errors) } } kubernetes-client-go-a2dfcab/util/testing/fake_openapi_handler.go000066400000000000000000000074311472614177300255040ustar00rootroot00000000000000/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "encoding/json" "io" "io/fs" "net/http" "net/http/httptest" "os" "path/filepath" "strings" "sync" "k8s.io/kube-openapi/pkg/handler3" "k8s.io/kube-openapi/pkg/spec3" ) type FakeOpenAPIServer struct { HttpServer *httptest.Server ServedDocuments map[string]*spec3.OpenAPI RequestCounters map[string]int } // Creates a mock OpenAPIV3 server as it would be on a standing kubernetes // API server. // // specsPath - Give a path to some test data organized so that each GroupVersion // has its own OpenAPI V3 JSON file. // // i.e. apps/v1beta1 is stored in /apps/v1beta1.json func NewFakeOpenAPIV3Server(specsPath string) (*FakeOpenAPIServer, error) { mux := &testMux{ counts: map[string]int{}, } server := httptest.NewServer(mux) openAPIVersionedService := handler3.NewOpenAPIService() err := openAPIVersionedService.RegisterOpenAPIV3VersionedService("/openapi/v3", mux) if err != nil { return nil, err } grouped := make(map[string][]byte) var testV3Specs = make(map[string]*spec3.OpenAPI) addSpec := func(path string) { file, err := os.Open(path) if err != nil { panic(err) } defer file.Close() vals, err := io.ReadAll(file) if err != nil { panic(err) } rel, err := filepath.Rel(specsPath, path) if err == nil { grouped[rel[:(len(rel)-len(filepath.Ext(rel)))]] = vals } } filepath.WalkDir(specsPath, func(path string, d fs.DirEntry, err error) error { if filepath.Ext(path) != ".json" || d.IsDir() { return nil } addSpec(path) return nil }) for gv, jsonSpec := range grouped { spec := &spec3.OpenAPI{} err = json.Unmarshal(jsonSpec, spec) if err != nil { return nil, err } testV3Specs[gv] = spec openAPIVersionedService.UpdateGroupVersion(gv, spec) } return &FakeOpenAPIServer{ HttpServer: server, ServedDocuments: testV3Specs, RequestCounters: mux.counts, }, nil } //////////////////////////////////////////////////////////////////////////////// // Tiny Test HTTP Mux //////////////////////////////////////////////////////////////////////////////// // Implements the mux interface used by handler3 for registering the OpenAPI // handlers type testMux struct { lock sync.Mutex prefixMap map[string]http.Handler pathMap map[string]http.Handler counts map[string]int } func (t *testMux) Handle(path string, handler http.Handler) { t.lock.Lock() defer t.lock.Unlock() if t.pathMap == nil { t.pathMap = make(map[string]http.Handler) } t.pathMap[path] = handler } func (t *testMux) HandlePrefix(path string, handler http.Handler) { t.lock.Lock() defer t.lock.Unlock() if t.prefixMap == nil { t.prefixMap = make(map[string]http.Handler) } t.prefixMap[path] = handler } func (t *testMux) ServeHTTP(w http.ResponseWriter, req *http.Request) { t.lock.Lock() defer t.lock.Unlock() if t.counts == nil { t.counts = make(map[string]int) } if val, exists := t.counts[req.URL.Path]; exists { t.counts[req.URL.Path] = val + 1 } else { t.counts[req.URL.Path] = 1 } if handler, ok := t.pathMap[req.URL.Path]; ok { handler.ServeHTTP(w, req) return } for k, v := range t.prefixMap { if strings.HasPrefix(req.URL.Path, k) { v.ServeHTTP(w, req) return } } w.WriteHeader(http.StatusNotFound) } kubernetes-client-go-a2dfcab/util/testing/remove_file.go000066400000000000000000000021671472614177300236630ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "os" "testing" ) // CloseAndRemove is a helper to close and remove test file. func CloseAndRemove(t *testing.T, files ...*os.File) { t.Helper() // We should close it first before remove a file, it's not only a good practice, // but also can avoid failed file removing on Windows OS. for _, f := range files { if f == nil { continue } if err := f.Close(); err != nil { t.Fatalf("Error closing %s: %v", f.Name(), err) } if err := os.Remove(f.Name()); err != nil { t.Fatalf("Error removing %s: %v", f.Name(), err) } } } kubernetes-client-go-a2dfcab/util/testing/tmpdir.go000066400000000000000000000023541472614177300226640ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package testing import ( "os" ) // MkTmpdir creates a temporary directory based upon the prefix passed in. // If successful, it returns the temporary directory path. The directory can be // deleted with a call to "os.RemoveAll(...)". // In case of error, it'll return an empty string and the error. func MkTmpdir(prefix string) (string, error) { tmpDir, err := os.MkdirTemp(os.TempDir(), prefix) if err != nil { return "", err } return tmpDir, nil } // MkTmpdirOrDie does the same work as "MkTmpdir", except in case of // errors, it'll trigger a panic. func MkTmpdirOrDie(prefix string) string { tmpDir, err := MkTmpdir(prefix) if err != nil { panic(err) } return tmpDir } kubernetes-client-go-a2dfcab/util/watchlist/000077500000000000000000000000001472614177300213575ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/watchlist/watch_list.go000066400000000000000000000061711472614177300240540ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package watchlist import ( metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metainternalversionvalidation "k8s.io/apimachinery/pkg/apis/meta/internalversion/validation" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientfeatures "k8s.io/client-go/features" "k8s.io/utils/ptr" ) var scheme = runtime.NewScheme() func init() { utilruntime.Must(metainternalversion.AddToScheme(scheme)) } // PrepareWatchListOptionsFromListOptions creates a new ListOptions // that can be used for a watch-list request from the given listOptions. // // This function also determines if the given listOptions can be used to form a watch-list request, // which would result in streaming semantically equivalent data from the server. func PrepareWatchListOptionsFromListOptions(listOptions metav1.ListOptions) (metav1.ListOptions, bool, error) { if !clientfeatures.FeatureGates().Enabled(clientfeatures.WatchListClient) { return metav1.ListOptions{}, false, nil } internalListOptions := &metainternalversion.ListOptions{} if err := scheme.Convert(&listOptions, internalListOptions, nil); err != nil { return metav1.ListOptions{}, false, err } if errs := metainternalversionvalidation.ValidateListOptions(internalListOptions, true); len(errs) > 0 { return metav1.ListOptions{}, false, nil } watchListOptions := listOptions // this is our legacy case, the cache ignores LIMIT for // ResourceVersion == 0 and RVM=unset|NotOlderThan if listOptions.Limit > 0 && listOptions.ResourceVersion != "0" { return metav1.ListOptions{}, false, nil } watchListOptions.Limit = 0 // to ensure that we can create a watch-list request that returns // semantically equivalent data for the given listOptions, // we need to validate that the RVM for the list is supported by watch-list requests. if listOptions.ResourceVersionMatch == metav1.ResourceVersionMatchExact { return metav1.ListOptions{}, false, nil } watchListOptions.ResourceVersionMatch = metav1.ResourceVersionMatchNotOlderThan watchListOptions.Watch = true watchListOptions.AllowWatchBookmarks = true watchListOptions.SendInitialEvents = ptr.To(true) internalWatchListOptions := &metainternalversion.ListOptions{} if err := scheme.Convert(&watchListOptions, internalWatchListOptions, nil); err != nil { return metav1.ListOptions{}, false, err } if errs := metainternalversionvalidation.ValidateListOptions(internalWatchListOptions, true); len(errs) > 0 { return metav1.ListOptions{}, false, nil } return watchListOptions, true, nil } kubernetes-client-go-a2dfcab/util/watchlist/watch_list_test.go000066400000000000000000000235631472614177300251170ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package watchlist import ( "testing" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientfeatures "k8s.io/client-go/features" clientfeaturestesting "k8s.io/client-go/features/testing" "k8s.io/utils/ptr" ) // TestPrepareWatchListOptionsFromListOptions test the following cases: // // +--------------------------+-----------------+---------+-----------------+ // | ResourceVersionMatch | ResourceVersion | Limit | Continuation | // +--------------------------+-----------------+---------+-----------------+ // | unset/NotOlderThan/Exact | unset/0/100 | unset/4 | unset/FakeToken | // +--------------------------+-----------------+---------+-----------------+ func TestPrepareWatchListOptionsFromListOptions(t *testing.T) { scenarios := []struct { name string listOptions metav1.ListOptions enableWatchListFG bool expectToPrepareWatchListOptions bool expectedWatchListOptions metav1.ListOptions }{ { name: "can't enable watch list for: WatchListClient=off, RVM=unset, RV=unset, Limit=unset, Continuation=unset", enableWatchListFG: false, expectToPrepareWatchListOptions: false, }, // +----------------------+-----------------+-------+--------------+ // | ResourceVersionMatch | ResourceVersion | Limit | Continuation | // +----------------------+-----------------+-------+--------------+ // | unset | unset | unset | unset | // | unset | 0 | unset | unset | // | unset | 100 | unset | unset | // | unset | 0 | 4 | unset | // | unset | 0 | unset | FakeToken | // +----------------------+-----------------+-------+--------------+ { name: "can enable watch list for: RVM=unset, RV=unset, Limit=unset, Continuation=unset", enableWatchListFG: true, expectToPrepareWatchListOptions: true, expectedWatchListOptions: expectedWatchListOptionsFor(""), }, { name: "can enable watch list for: RVM=unset, RV=0, Limit=unset, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersion: "0"}, enableWatchListFG: true, expectToPrepareWatchListOptions: true, expectedWatchListOptions: expectedWatchListOptionsFor("0"), }, { name: "can enable watch list for: RVM=unset, RV=100, Limit=unset, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersion: "100"}, enableWatchListFG: true, expectToPrepareWatchListOptions: true, expectedWatchListOptions: expectedWatchListOptionsFor("100"), }, { name: "legacy: can enable watch list for: RVM=unset, RV=0, Limit=4, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersion: "0", Limit: 4}, enableWatchListFG: true, expectToPrepareWatchListOptions: true, expectedWatchListOptions: expectedWatchListOptionsFor("0"), }, { name: "can't enable watch list for: RVM=unset, RV=0, Limit=unset, Continuation=FakeToken", listOptions: metav1.ListOptions{ResourceVersion: "0", Continue: "FakeToken"}, enableWatchListFG: true, expectToPrepareWatchListOptions: false, }, // +----------------------+-----------------+-------+--------------+ // | ResourceVersionMatch | ResourceVersion | Limit | Continuation | // +----------------------+-----------------+-------+--------------+ // | NotOlderThan | unset | unset | unset | // | NotOlderThan | 0 | unset | unset | // | NotOlderThan | 100 | unset | unset | // | NotOlderThan | 0 | 4 | unset | // | NotOlderThan | 0 | unset | FakeToken | // +----------------------+-----------------+-------+--------------+ { name: "can't enable watch list for: RVM=NotOlderThan, RV=unset, Limit=unset, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan}, enableWatchListFG: true, expectToPrepareWatchListOptions: false, }, { name: "can enable watch list for: RVM=NotOlderThan, RV=0, Limit=unset, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, ResourceVersion: "0"}, enableWatchListFG: true, expectToPrepareWatchListOptions: true, expectedWatchListOptions: expectedWatchListOptionsFor("0"), }, { name: "can enable watch list for: RVM=NotOlderThan, RV=100, Limit=unset, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, ResourceVersion: "100"}, enableWatchListFG: true, expectToPrepareWatchListOptions: true, expectedWatchListOptions: expectedWatchListOptionsFor("100"), }, { name: "legacy: can enable watch list for: RVM=NotOlderThan, RV=0, Limit=4, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, ResourceVersion: "0", Limit: 4}, enableWatchListFG: true, expectToPrepareWatchListOptions: true, expectedWatchListOptions: expectedWatchListOptionsFor("0"), }, { name: "can't enable watch list for: RVM=NotOlderThan, RV=0, Limit=unset, Continuation=FakeToken", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, ResourceVersion: "0", Continue: "FakeToken"}, enableWatchListFG: true, expectToPrepareWatchListOptions: false, }, // +----------------------+-----------------+-------+--------------+ // | ResourceVersionMatch | ResourceVersion | Limit | Continuation | // +----------------------+-----------------+-------+--------------+ // | Exact | unset | unset | unset | // | Exact | 0 | unset | unset | // | Exact | 100 | unset | unset | // | Exact | 0 | 4 | unset | // | Exact | 0 | unset | FakeToken | // +----------------------+-----------------+-------+--------------+ { name: "can't enable watch list for: RVM=Exact, RV=unset, Limit=unset, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact}, enableWatchListFG: true, expectToPrepareWatchListOptions: false, }, { name: "can enable watch list for: RVM=Exact, RV=0, Limit=unset, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact, ResourceVersion: "0"}, enableWatchListFG: true, expectToPrepareWatchListOptions: false, }, { name: "can enable watch list for: RVM=Exact, RV=100, Limit=unset, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact, ResourceVersion: "100"}, enableWatchListFG: true, expectToPrepareWatchListOptions: false, }, { name: "can't enable watch list for: RVM=Exact, RV=0, Limit=4, Continuation=unset", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact, ResourceVersion: "0", Limit: 4}, enableWatchListFG: true, expectToPrepareWatchListOptions: false, }, { name: "can't enable watch list for: RVM=Exact, RV=0, Limit=unset, Continuation=FakeToken", listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact, ResourceVersion: "0", Continue: "FakeToken"}, enableWatchListFG: true, expectToPrepareWatchListOptions: false, }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, scenario.enableWatchListFG) watchListOptions, hasWatchListOptionsPrepared, err := PrepareWatchListOptionsFromListOptions(scenario.listOptions) require.NoError(t, err) require.Equal(t, scenario.expectToPrepareWatchListOptions, hasWatchListOptionsPrepared) require.Equal(t, scenario.expectedWatchListOptions, watchListOptions) }) } } func expectedWatchListOptionsFor(rv string) metav1.ListOptions { var watchListOptions metav1.ListOptions watchListOptions.ResourceVersion = rv watchListOptions.ResourceVersionMatch = metav1.ResourceVersionMatchNotOlderThan watchListOptions.Watch = true watchListOptions.AllowWatchBookmarks = true watchListOptions.SendInitialEvents = ptr.To(true) return watchListOptions } kubernetes-client-go-a2dfcab/util/workqueue/000077500000000000000000000000001472614177300214045ustar00rootroot00000000000000kubernetes-client-go-a2dfcab/util/workqueue/default_rate_limiters.go000066400000000000000000000225471472614177300263140ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "math" "sync" "time" "golang.org/x/time/rate" ) // Deprecated: RateLimiter is deprecated, use TypedRateLimiter instead. type RateLimiter TypedRateLimiter[any] type TypedRateLimiter[T comparable] interface { // When gets an item and gets to decide how long that item should wait When(item T) time.Duration // Forget indicates that an item is finished being retried. Doesn't matter whether it's for failing // or for success, we'll stop tracking it Forget(item T) // NumRequeues returns back how many failures the item has had NumRequeues(item T) int } // DefaultControllerRateLimiter is a no-arg constructor for a default rate limiter for a workqueue. It has // both overall and per-item rate limiting. The overall is a token bucket and the per-item is exponential // // Deprecated: Use DefaultTypedControllerRateLimiter instead. func DefaultControllerRateLimiter() RateLimiter { return DefaultTypedControllerRateLimiter[any]() } // DefaultTypedControllerRateLimiter is a no-arg constructor for a default rate limiter for a workqueue. It has // both overall and per-item rate limiting. The overall is a token bucket and the per-item is exponential func DefaultTypedControllerRateLimiter[T comparable]() TypedRateLimiter[T] { return NewTypedMaxOfRateLimiter( NewTypedItemExponentialFailureRateLimiter[T](5*time.Millisecond, 1000*time.Second), // 10 qps, 100 bucket size. This is only for retry speed and its only the overall factor (not per item) &TypedBucketRateLimiter[T]{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, ) } // Deprecated: BucketRateLimiter is deprecated, use TypedBucketRateLimiter instead. type BucketRateLimiter = TypedBucketRateLimiter[any] // TypedBucketRateLimiter adapts a standard bucket to the workqueue ratelimiter API type TypedBucketRateLimiter[T comparable] struct { *rate.Limiter } var _ RateLimiter = &BucketRateLimiter{} func (r *TypedBucketRateLimiter[T]) When(item T) time.Duration { return r.Limiter.Reserve().Delay() } func (r *TypedBucketRateLimiter[T]) NumRequeues(item T) int { return 0 } func (r *TypedBucketRateLimiter[T]) Forget(item T) { } // Deprecated: ItemExponentialFailureRateLimiter is deprecated, use TypedItemExponentialFailureRateLimiter instead. type ItemExponentialFailureRateLimiter = TypedItemExponentialFailureRateLimiter[any] // TypedItemExponentialFailureRateLimiter does a simple baseDelay*2^ limit // dealing with max failures and expiration are up to the caller type TypedItemExponentialFailureRateLimiter[T comparable] struct { failuresLock sync.Mutex failures map[T]int baseDelay time.Duration maxDelay time.Duration } var _ RateLimiter = &ItemExponentialFailureRateLimiter{} // Deprecated: NewItemExponentialFailureRateLimiter is deprecated, use NewTypedItemExponentialFailureRateLimiter instead. func NewItemExponentialFailureRateLimiter(baseDelay time.Duration, maxDelay time.Duration) RateLimiter { return NewTypedItemExponentialFailureRateLimiter[any](baseDelay, maxDelay) } func NewTypedItemExponentialFailureRateLimiter[T comparable](baseDelay time.Duration, maxDelay time.Duration) TypedRateLimiter[T] { return &TypedItemExponentialFailureRateLimiter[T]{ failures: map[T]int{}, baseDelay: baseDelay, maxDelay: maxDelay, } } // Deprecated: DefaultItemBasedRateLimiter is deprecated, use DefaultTypedItemBasedRateLimiter instead. func DefaultItemBasedRateLimiter() RateLimiter { return DefaultTypedItemBasedRateLimiter[any]() } func DefaultTypedItemBasedRateLimiter[T comparable]() TypedRateLimiter[T] { return NewTypedItemExponentialFailureRateLimiter[T](time.Millisecond, 1000*time.Second) } func (r *TypedItemExponentialFailureRateLimiter[T]) When(item T) time.Duration { r.failuresLock.Lock() defer r.failuresLock.Unlock() exp := r.failures[item] r.failures[item] = r.failures[item] + 1 // The backoff is capped such that 'calculated' value never overflows. backoff := float64(r.baseDelay.Nanoseconds()) * math.Pow(2, float64(exp)) if backoff > math.MaxInt64 { return r.maxDelay } calculated := time.Duration(backoff) if calculated > r.maxDelay { return r.maxDelay } return calculated } func (r *TypedItemExponentialFailureRateLimiter[T]) NumRequeues(item T) int { r.failuresLock.Lock() defer r.failuresLock.Unlock() return r.failures[item] } func (r *TypedItemExponentialFailureRateLimiter[T]) Forget(item T) { r.failuresLock.Lock() defer r.failuresLock.Unlock() delete(r.failures, item) } // ItemFastSlowRateLimiter does a quick retry for a certain number of attempts, then a slow retry after that // Deprecated: Use TypedItemFastSlowRateLimiter instead. type ItemFastSlowRateLimiter = TypedItemFastSlowRateLimiter[any] // TypedItemFastSlowRateLimiter does a quick retry for a certain number of attempts, then a slow retry after that type TypedItemFastSlowRateLimiter[T comparable] struct { failuresLock sync.Mutex failures map[T]int maxFastAttempts int fastDelay time.Duration slowDelay time.Duration } var _ RateLimiter = &ItemFastSlowRateLimiter{} // Deprecated: NewItemFastSlowRateLimiter is deprecated, use NewTypedItemFastSlowRateLimiter instead. func NewItemFastSlowRateLimiter(fastDelay, slowDelay time.Duration, maxFastAttempts int) RateLimiter { return NewTypedItemFastSlowRateLimiter[any](fastDelay, slowDelay, maxFastAttempts) } func NewTypedItemFastSlowRateLimiter[T comparable](fastDelay, slowDelay time.Duration, maxFastAttempts int) TypedRateLimiter[T] { return &TypedItemFastSlowRateLimiter[T]{ failures: map[T]int{}, fastDelay: fastDelay, slowDelay: slowDelay, maxFastAttempts: maxFastAttempts, } } func (r *TypedItemFastSlowRateLimiter[T]) When(item T) time.Duration { r.failuresLock.Lock() defer r.failuresLock.Unlock() r.failures[item] = r.failures[item] + 1 if r.failures[item] <= r.maxFastAttempts { return r.fastDelay } return r.slowDelay } func (r *TypedItemFastSlowRateLimiter[T]) NumRequeues(item T) int { r.failuresLock.Lock() defer r.failuresLock.Unlock() return r.failures[item] } func (r *TypedItemFastSlowRateLimiter[T]) Forget(item T) { r.failuresLock.Lock() defer r.failuresLock.Unlock() delete(r.failures, item) } // MaxOfRateLimiter calls every RateLimiter and returns the worst case response // When used with a token bucket limiter, the burst could be apparently exceeded in cases where particular items // were separately delayed a longer time. // // Deprecated: Use TypedMaxOfRateLimiter instead. type MaxOfRateLimiter = TypedMaxOfRateLimiter[any] // TypedMaxOfRateLimiter calls every RateLimiter and returns the worst case response // When used with a token bucket limiter, the burst could be apparently exceeded in cases where particular items // were separately delayed a longer time. type TypedMaxOfRateLimiter[T comparable] struct { limiters []TypedRateLimiter[T] } func (r *TypedMaxOfRateLimiter[T]) When(item T) time.Duration { ret := time.Duration(0) for _, limiter := range r.limiters { curr := limiter.When(item) if curr > ret { ret = curr } } return ret } // Deprecated: NewMaxOfRateLimiter is deprecated, use NewTypedMaxOfRateLimiter instead. func NewMaxOfRateLimiter(limiters ...TypedRateLimiter[any]) RateLimiter { return NewTypedMaxOfRateLimiter(limiters...) } func NewTypedMaxOfRateLimiter[T comparable](limiters ...TypedRateLimiter[T]) TypedRateLimiter[T] { return &TypedMaxOfRateLimiter[T]{limiters: limiters} } func (r *TypedMaxOfRateLimiter[T]) NumRequeues(item T) int { ret := 0 for _, limiter := range r.limiters { curr := limiter.NumRequeues(item) if curr > ret { ret = curr } } return ret } func (r *TypedMaxOfRateLimiter[T]) Forget(item T) { for _, limiter := range r.limiters { limiter.Forget(item) } } // WithMaxWaitRateLimiter have maxDelay which avoids waiting too long // Deprecated: Use TypedWithMaxWaitRateLimiter instead. type WithMaxWaitRateLimiter = TypedWithMaxWaitRateLimiter[any] // TypedWithMaxWaitRateLimiter have maxDelay which avoids waiting too long type TypedWithMaxWaitRateLimiter[T comparable] struct { limiter TypedRateLimiter[T] maxDelay time.Duration } // Deprecated: NewWithMaxWaitRateLimiter is deprecated, use NewTypedWithMaxWaitRateLimiter instead. func NewWithMaxWaitRateLimiter(limiter RateLimiter, maxDelay time.Duration) RateLimiter { return NewTypedWithMaxWaitRateLimiter[any](limiter, maxDelay) } func NewTypedWithMaxWaitRateLimiter[T comparable](limiter TypedRateLimiter[T], maxDelay time.Duration) TypedRateLimiter[T] { return &TypedWithMaxWaitRateLimiter[T]{limiter: limiter, maxDelay: maxDelay} } func (w TypedWithMaxWaitRateLimiter[T]) When(item T) time.Duration { delay := w.limiter.When(item) if delay > w.maxDelay { return w.maxDelay } return delay } func (w TypedWithMaxWaitRateLimiter[T]) Forget(item T) { w.limiter.Forget(item) } func (w TypedWithMaxWaitRateLimiter[T]) NumRequeues(item T) int { return w.limiter.NumRequeues(item) } kubernetes-client-go-a2dfcab/util/workqueue/default_rate_limiters_test.go000066400000000000000000000145761472614177300273560ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "testing" "time" ) func TestItemExponentialFailureRateLimiter(t *testing.T) { limiter := NewItemExponentialFailureRateLimiter(1*time.Millisecond, 1*time.Second) if e, a := 1*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 4*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 8*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 16*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5, limiter.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 1*time.Millisecond, limiter.When("two"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2*time.Millisecond, limiter.When("two"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2, limiter.NumRequeues("two"); e != a { t.Errorf("expected %v, got %v", e, a) } limiter.Forget("one") if e, a := 0, limiter.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 1*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } } func TestItemExponentialFailureRateLimiterOverFlow(t *testing.T) { limiter := NewItemExponentialFailureRateLimiter(1*time.Millisecond, 1000*time.Second) for i := 0; i < 5; i++ { limiter.When("one") } if e, a := 32*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } for i := 0; i < 1000; i++ { limiter.When("overflow1") } if e, a := 1000*time.Second, limiter.When("overflow1"); e != a { t.Errorf("expected %v, got %v", e, a) } limiter = NewItemExponentialFailureRateLimiter(1*time.Minute, 1000*time.Hour) for i := 0; i < 2; i++ { limiter.When("two") } if e, a := 4*time.Minute, limiter.When("two"); e != a { t.Errorf("expected %v, got %v", e, a) } for i := 0; i < 1000; i++ { limiter.When("overflow2") } if e, a := 1000*time.Hour, limiter.When("overflow2"); e != a { t.Errorf("expected %v, got %v", e, a) } } func TestItemFastSlowRateLimiter(t *testing.T) { limiter := NewItemFastSlowRateLimiter(5*time.Millisecond, 10*time.Second, 3) if e, a := 5*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 10*time.Second, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 10*time.Second, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5, limiter.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("two"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("two"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2, limiter.NumRequeues("two"); e != a { t.Errorf("expected %v, got %v", e, a) } limiter.Forget("one") if e, a := 0, limiter.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } } func TestMaxOfRateLimiter(t *testing.T) { limiter := NewMaxOfRateLimiter( NewItemFastSlowRateLimiter(5*time.Millisecond, 3*time.Second, 3), NewItemExponentialFailureRateLimiter(1*time.Millisecond, 1*time.Second), ) if e, a := 5*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 3*time.Second, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 3*time.Second, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5, limiter.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("two"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("two"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2, limiter.NumRequeues("two"); e != a { t.Errorf("expected %v, got %v", e, a) } limiter.Forget("one") if e, a := 0, limiter.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 5*time.Millisecond, limiter.When("one"); e != a { t.Errorf("expected %v, got %v", e, a) } } func TestWithMaxWaitRateLimiter(t *testing.T) { limiter := NewWithMaxWaitRateLimiter(NewStepRateLimiter(5*time.Millisecond, 1000*time.Second, 100), 500*time.Second) for i := 0; i < 100; i++ { if e, a := 5*time.Millisecond, limiter.When(i); e != a { t.Errorf("expected %v, got %v ", e, a) } } for i := 100; i < 200; i++ { if e, a := 500*time.Second, limiter.When(i); e != a { t.Errorf("expected %v, got %v", e, a) } } } var _ RateLimiter = &StepRateLimiter{} func NewStepRateLimiter(baseDelay time.Duration, maxDelay time.Duration, threshold int) RateLimiter { return &StepRateLimiter{ baseDelay: baseDelay, maxDelay: maxDelay, threshold: threshold, } } type StepRateLimiter struct { count int threshold int baseDelay time.Duration maxDelay time.Duration } func (r *StepRateLimiter) When(item interface{}) time.Duration { r.count += 1 if r.count <= r.threshold { return r.baseDelay } return r.maxDelay } func (r *StepRateLimiter) NumRequeues(item interface{}) int { return 0 } func (r *StepRateLimiter) Forget(item interface{}) { } kubernetes-client-go-a2dfcab/util/workqueue/delaying_queue.go000066400000000000000000000255071472614177300247440ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "container/heap" "sync" "time" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/utils/clock" ) // DelayingInterface is an Interface that can Add an item at a later time. This makes it easier to // requeue items after failures without ending up in a hot-loop. // // Deprecated: use TypedDelayingInterface instead. type DelayingInterface TypedDelayingInterface[any] // TypedDelayingInterface is an Interface that can Add an item at a later time. This makes it easier to // requeue items after failures without ending up in a hot-loop. type TypedDelayingInterface[T comparable] interface { TypedInterface[T] // AddAfter adds an item to the workqueue after the indicated duration has passed AddAfter(item T, duration time.Duration) } // DelayingQueueConfig specifies optional configurations to customize a DelayingInterface. // // Deprecated: use TypedDelayingQueueConfig instead. type DelayingQueueConfig = TypedDelayingQueueConfig[any] // TypedDelayingQueueConfig specifies optional configurations to customize a DelayingInterface. type TypedDelayingQueueConfig[T comparable] struct { // Name for the queue. If unnamed, the metrics will not be registered. Name string // MetricsProvider optionally allows specifying a metrics provider to use for the queue // instead of the global provider. MetricsProvider MetricsProvider // Clock optionally allows injecting a real or fake clock for testing purposes. Clock clock.WithTicker // Queue optionally allows injecting custom queue Interface instead of the default one. Queue TypedInterface[T] } // NewDelayingQueue constructs a new workqueue with delayed queuing ability. // NewDelayingQueue does not emit metrics. For use with a MetricsProvider, please use // NewDelayingQueueWithConfig instead and specify a name. // // Deprecated: use TypedNewDelayingQueue instead. func NewDelayingQueue() DelayingInterface { return NewDelayingQueueWithConfig(DelayingQueueConfig{}) } // TypedNewDelayingQueue constructs a new workqueue with delayed queuing ability. // TypedNewDelayingQueue does not emit metrics. For use with a MetricsProvider, please use // TypedNewDelayingQueueWithConfig instead and specify a name. func TypedNewDelayingQueue[T comparable]() TypedDelayingInterface[T] { return NewTypedDelayingQueueWithConfig(TypedDelayingQueueConfig[T]{}) } // NewDelayingQueueWithConfig constructs a new workqueue with options to // customize different properties. // // Deprecated: use TypedNewDelayingQueueWithConfig instead. func NewDelayingQueueWithConfig(config DelayingQueueConfig) DelayingInterface { return NewTypedDelayingQueueWithConfig[any](config) } // NewTypedDelayingQueueWithConfig constructs a new workqueue with options to // customize different properties. func NewTypedDelayingQueueWithConfig[T comparable](config TypedDelayingQueueConfig[T]) TypedDelayingInterface[T] { if config.Clock == nil { config.Clock = clock.RealClock{} } if config.Queue == nil { config.Queue = NewTypedWithConfig[T](TypedQueueConfig[T]{ Name: config.Name, MetricsProvider: config.MetricsProvider, Clock: config.Clock, }) } return newDelayingQueue(config.Clock, config.Queue, config.Name, config.MetricsProvider) } // NewDelayingQueueWithCustomQueue constructs a new workqueue with ability to // inject custom queue Interface instead of the default one // Deprecated: Use NewDelayingQueueWithConfig instead. func NewDelayingQueueWithCustomQueue(q Interface, name string) DelayingInterface { return NewDelayingQueueWithConfig(DelayingQueueConfig{ Name: name, Queue: q, }) } // NewNamedDelayingQueue constructs a new named workqueue with delayed queuing ability. // Deprecated: Use NewDelayingQueueWithConfig instead. func NewNamedDelayingQueue(name string) DelayingInterface { return NewDelayingQueueWithConfig(DelayingQueueConfig{Name: name}) } // NewDelayingQueueWithCustomClock constructs a new named workqueue // with ability to inject real or fake clock for testing purposes. // Deprecated: Use NewDelayingQueueWithConfig instead. func NewDelayingQueueWithCustomClock(clock clock.WithTicker, name string) DelayingInterface { return NewDelayingQueueWithConfig(DelayingQueueConfig{ Name: name, Clock: clock, }) } func newDelayingQueue[T comparable](clock clock.WithTicker, q TypedInterface[T], name string, provider MetricsProvider) *delayingType[T] { ret := &delayingType[T]{ TypedInterface: q, clock: clock, heartbeat: clock.NewTicker(maxWait), stopCh: make(chan struct{}), waitingForAddCh: make(chan *waitFor, 1000), metrics: newRetryMetrics(name, provider), } go ret.waitingLoop() return ret } // delayingType wraps an Interface and provides delayed re-enquing type delayingType[T comparable] struct { TypedInterface[T] // clock tracks time for delayed firing clock clock.Clock // stopCh lets us signal a shutdown to the waiting loop stopCh chan struct{} // stopOnce guarantees we only signal shutdown a single time stopOnce sync.Once // heartbeat ensures we wait no more than maxWait before firing heartbeat clock.Ticker // waitingForAddCh is a buffered channel that feeds waitingForAdd waitingForAddCh chan *waitFor // metrics counts the number of retries metrics retryMetrics } // waitFor holds the data to add and the time it should be added type waitFor struct { data t readyAt time.Time // index in the priority queue (heap) index int } // waitForPriorityQueue implements a priority queue for waitFor items. // // waitForPriorityQueue implements heap.Interface. The item occurring next in // time (i.e., the item with the smallest readyAt) is at the root (index 0). // Peek returns this minimum item at index 0. Pop returns the minimum item after // it has been removed from the queue and placed at index Len()-1 by // container/heap. Push adds an item at index Len(), and container/heap // percolates it into the correct location. type waitForPriorityQueue []*waitFor func (pq waitForPriorityQueue) Len() int { return len(pq) } func (pq waitForPriorityQueue) Less(i, j int) bool { return pq[i].readyAt.Before(pq[j].readyAt) } func (pq waitForPriorityQueue) Swap(i, j int) { pq[i], pq[j] = pq[j], pq[i] pq[i].index = i pq[j].index = j } // Push adds an item to the queue. Push should not be called directly; instead, // use `heap.Push`. func (pq *waitForPriorityQueue) Push(x interface{}) { n := len(*pq) item := x.(*waitFor) item.index = n *pq = append(*pq, item) } // Pop removes an item from the queue. Pop should not be called directly; // instead, use `heap.Pop`. func (pq *waitForPriorityQueue) Pop() interface{} { n := len(*pq) item := (*pq)[n-1] item.index = -1 *pq = (*pq)[0:(n - 1)] return item } // Peek returns the item at the beginning of the queue, without removing the // item or otherwise mutating the queue. It is safe to call directly. func (pq waitForPriorityQueue) Peek() interface{} { return pq[0] } // ShutDown stops the queue. After the queue drains, the returned shutdown bool // on Get() will be true. This method may be invoked more than once. func (q *delayingType[T]) ShutDown() { q.stopOnce.Do(func() { q.TypedInterface.ShutDown() close(q.stopCh) q.heartbeat.Stop() }) } // AddAfter adds the given item to the work queue after the given delay func (q *delayingType[T]) AddAfter(item T, duration time.Duration) { // don't add if we're already shutting down if q.ShuttingDown() { return } q.metrics.retry() // immediately add things with no delay if duration <= 0 { q.Add(item) return } select { case <-q.stopCh: // unblock if ShutDown() is called case q.waitingForAddCh <- &waitFor{data: item, readyAt: q.clock.Now().Add(duration)}: } } // maxWait keeps a max bound on the wait time. It's just insurance against weird things happening. // Checking the queue every 10 seconds isn't expensive and we know that we'll never end up with an // expired item sitting for more than 10 seconds. const maxWait = 10 * time.Second // waitingLoop runs until the workqueue is shutdown and keeps a check on the list of items to be added. func (q *delayingType[T]) waitingLoop() { defer utilruntime.HandleCrash() // Make a placeholder channel to use when there are no items in our list never := make(<-chan time.Time) // Make a timer that expires when the item at the head of the waiting queue is ready var nextReadyAtTimer clock.Timer waitingForQueue := &waitForPriorityQueue{} heap.Init(waitingForQueue) waitingEntryByData := map[t]*waitFor{} for { if q.TypedInterface.ShuttingDown() { return } now := q.clock.Now() // Add ready entries for waitingForQueue.Len() > 0 { entry := waitingForQueue.Peek().(*waitFor) if entry.readyAt.After(now) { break } entry = heap.Pop(waitingForQueue).(*waitFor) q.Add(entry.data.(T)) delete(waitingEntryByData, entry.data) } // Set up a wait for the first item's readyAt (if one exists) nextReadyAt := never if waitingForQueue.Len() > 0 { if nextReadyAtTimer != nil { nextReadyAtTimer.Stop() } entry := waitingForQueue.Peek().(*waitFor) nextReadyAtTimer = q.clock.NewTimer(entry.readyAt.Sub(now)) nextReadyAt = nextReadyAtTimer.C() } select { case <-q.stopCh: return case <-q.heartbeat.C(): // continue the loop, which will add ready items case <-nextReadyAt: // continue the loop, which will add ready items case waitEntry := <-q.waitingForAddCh: if waitEntry.readyAt.After(q.clock.Now()) { insert(waitingForQueue, waitingEntryByData, waitEntry) } else { q.Add(waitEntry.data.(T)) } drained := false for !drained { select { case waitEntry := <-q.waitingForAddCh: if waitEntry.readyAt.After(q.clock.Now()) { insert(waitingForQueue, waitingEntryByData, waitEntry) } else { q.Add(waitEntry.data.(T)) } default: drained = true } } } } } // insert adds the entry to the priority queue, or updates the readyAt if it already exists in the queue func insert(q *waitForPriorityQueue, knownEntries map[t]*waitFor, entry *waitFor) { // if the entry already exists, update the time only if it would cause the item to be queued sooner existing, exists := knownEntries[entry.data] if exists { if existing.readyAt.After(entry.readyAt) { existing.readyAt = entry.readyAt heap.Fix(q, existing.index) } return } heap.Push(q, entry) knownEntries[entry.data] = entry } kubernetes-client-go-a2dfcab/util/workqueue/delaying_queue_test.go000066400000000000000000000140131472614177300257710ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "fmt" "math/rand" "reflect" "testing" "time" "k8s.io/apimachinery/pkg/util/wait" testingclock "k8s.io/utils/clock/testing" ) func TestSimpleQueue(t *testing.T) { fakeClock := testingclock.NewFakeClock(time.Now()) q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock}) first := "foo" q.AddAfter(first, 50*time.Millisecond) if err := waitForWaitingQueueToFill(q); err != nil { t.Fatalf("unexpected err: %v", err) } if q.Len() != 0 { t.Errorf("should not have added") } fakeClock.Step(60 * time.Millisecond) if err := waitForAdded(q, 1); err != nil { t.Errorf("should have added") } item, _ := q.Get() q.Done(item) // step past the next heartbeat fakeClock.Step(10 * time.Second) err := wait.Poll(1*time.Millisecond, 30*time.Millisecond, func() (done bool, err error) { if q.Len() > 0 { return false, fmt.Errorf("added to queue") } return false, nil }) if err != wait.ErrWaitTimeout { t.Errorf("expected timeout, got: %v", err) } if q.Len() != 0 { t.Errorf("should not have added") } } func TestDeduping(t *testing.T) { fakeClock := testingclock.NewFakeClock(time.Now()) q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock}) first := "foo" q.AddAfter(first, 50*time.Millisecond) if err := waitForWaitingQueueToFill(q); err != nil { t.Fatalf("unexpected err: %v", err) } q.AddAfter(first, 70*time.Millisecond) if err := waitForWaitingQueueToFill(q); err != nil { t.Fatalf("unexpected err: %v", err) } if q.Len() != 0 { t.Errorf("should not have added") } // step past the first block, we should receive now fakeClock.Step(60 * time.Millisecond) if err := waitForAdded(q, 1); err != nil { t.Errorf("should have added") } item, _ := q.Get() q.Done(item) // step past the second add fakeClock.Step(20 * time.Millisecond) if q.Len() != 0 { t.Errorf("should not have added") } // test again, but this time the earlier should override q.AddAfter(first, 50*time.Millisecond) q.AddAfter(first, 30*time.Millisecond) if err := waitForWaitingQueueToFill(q); err != nil { t.Fatalf("unexpected err: %v", err) } if q.Len() != 0 { t.Errorf("should not have added") } fakeClock.Step(40 * time.Millisecond) if err := waitForAdded(q, 1); err != nil { t.Errorf("should have added") } item, _ = q.Get() q.Done(item) // step past the second add fakeClock.Step(20 * time.Millisecond) if q.Len() != 0 { t.Errorf("should not have added") } } func TestAddTwoFireEarly(t *testing.T) { fakeClock := testingclock.NewFakeClock(time.Now()) q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock}) first := "foo" second := "bar" third := "baz" q.AddAfter(first, 1*time.Second) q.AddAfter(second, 50*time.Millisecond) if err := waitForWaitingQueueToFill(q); err != nil { t.Fatalf("unexpected err: %v", err) } if q.Len() != 0 { t.Errorf("should not have added") } fakeClock.Step(60 * time.Millisecond) if err := waitForAdded(q, 1); err != nil { t.Fatalf("unexpected err: %v", err) } item, _ := q.Get() if !reflect.DeepEqual(item, second) { t.Errorf("expected %v, got %v", second, item) } q.AddAfter(third, 2*time.Second) fakeClock.Step(1 * time.Second) if err := waitForAdded(q, 1); err != nil { t.Fatalf("unexpected err: %v", err) } item, _ = q.Get() if !reflect.DeepEqual(item, first) { t.Errorf("expected %v, got %v", first, item) } fakeClock.Step(2 * time.Second) if err := waitForAdded(q, 1); err != nil { t.Fatalf("unexpected err: %v", err) } item, _ = q.Get() if !reflect.DeepEqual(item, third) { t.Errorf("expected %v, got %v", third, item) } } func TestCopyShifting(t *testing.T) { fakeClock := testingclock.NewFakeClock(time.Now()) q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock}) first := "foo" second := "bar" third := "baz" q.AddAfter(first, 1*time.Second) q.AddAfter(second, 500*time.Millisecond) q.AddAfter(third, 250*time.Millisecond) if err := waitForWaitingQueueToFill(q); err != nil { t.Fatalf("unexpected err: %v", err) } if q.Len() != 0 { t.Errorf("should not have added") } fakeClock.Step(2 * time.Second) if err := waitForAdded(q, 3); err != nil { t.Fatalf("unexpected err: %v", err) } actualFirst, _ := q.Get() if !reflect.DeepEqual(actualFirst, third) { t.Errorf("expected %v, got %v", third, actualFirst) } actualSecond, _ := q.Get() if !reflect.DeepEqual(actualSecond, second) { t.Errorf("expected %v, got %v", second, actualSecond) } actualThird, _ := q.Get() if !reflect.DeepEqual(actualThird, first) { t.Errorf("expected %v, got %v", first, actualThird) } } func BenchmarkDelayingQueue_AddAfter(b *testing.B) { fakeClock := testingclock.NewFakeClock(time.Now()) q := NewDelayingQueueWithConfig(DelayingQueueConfig{Clock: fakeClock}) // Add items for n := 0; n < b.N; n++ { data := fmt.Sprintf("%d", n) q.AddAfter(data, time.Duration(rand.Int63n(int64(10*time.Minute)))) } // Exercise item removal as well fakeClock.Step(11 * time.Minute) for n := 0; n < b.N; n++ { _, _ = q.Get() } } func waitForAdded(q DelayingInterface, depth int) error { return wait.Poll(1*time.Millisecond, 10*time.Second, func() (done bool, err error) { if q.Len() == depth { return true, nil } return false, nil }) } func waitForWaitingQueueToFill(q DelayingInterface) error { return wait.Poll(1*time.Millisecond, 10*time.Second, func() (done bool, err error) { if len(q.(*delayingType[any]).waitingForAddCh) == 0 { return true, nil } return false, nil }) } kubernetes-client-go-a2dfcab/util/workqueue/doc.go000066400000000000000000000021711472614177300225010ustar00rootroot00000000000000/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package workqueue provides a simple queue that supports the following // features: // - Fair: items processed in the order in which they are added. // - Stingy: a single item will not be processed multiple times concurrently, // and if an item is added multiple times before it can be processed, it // will only be processed once. // - Multiple consumers and producers. In particular, it is allowed for an // item to be reenqueued while it is being processed. // - Shutdown notifications. package workqueue // import "k8s.io/client-go/util/workqueue" kubernetes-client-go-a2dfcab/util/workqueue/main_test.go000066400000000000000000000012351472614177300237170ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "os" "testing" ) func TestMain(m *testing.M) { os.Exit(m.Run()) } kubernetes-client-go-a2dfcab/util/workqueue/metrics.go000066400000000000000000000152321472614177300234040ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "sync" "time" "k8s.io/utils/clock" ) // This file provides abstractions for setting the provider (e.g., prometheus) // of metrics. type queueMetrics interface { add(item t) get(item t) done(item t) updateUnfinishedWork() } // GaugeMetric represents a single numerical value that can arbitrarily go up // and down. type GaugeMetric interface { Inc() Dec() } // SettableGaugeMetric represents a single numerical value that can arbitrarily go up // and down. (Separate from GaugeMetric to preserve backwards compatibility.) type SettableGaugeMetric interface { Set(float64) } // CounterMetric represents a single numerical value that only ever // goes up. type CounterMetric interface { Inc() } // SummaryMetric captures individual observations. type SummaryMetric interface { Observe(float64) } // HistogramMetric counts individual observations. type HistogramMetric interface { Observe(float64) } type noopMetric struct{} func (noopMetric) Inc() {} func (noopMetric) Dec() {} func (noopMetric) Set(float64) {} func (noopMetric) Observe(float64) {} // defaultQueueMetrics expects the caller to lock before setting any metrics. type defaultQueueMetrics struct { clock clock.Clock // current depth of a workqueue depth GaugeMetric // total number of adds handled by a workqueue adds CounterMetric // how long an item stays in a workqueue latency HistogramMetric // how long processing an item from a workqueue takes workDuration HistogramMetric addTimes map[t]time.Time processingStartTimes map[t]time.Time // how long have current threads been working? unfinishedWorkSeconds SettableGaugeMetric longestRunningProcessor SettableGaugeMetric } func (m *defaultQueueMetrics) add(item t) { if m == nil { return } m.adds.Inc() m.depth.Inc() if _, exists := m.addTimes[item]; !exists { m.addTimes[item] = m.clock.Now() } } func (m *defaultQueueMetrics) get(item t) { if m == nil { return } m.depth.Dec() m.processingStartTimes[item] = m.clock.Now() if startTime, exists := m.addTimes[item]; exists { m.latency.Observe(m.sinceInSeconds(startTime)) delete(m.addTimes, item) } } func (m *defaultQueueMetrics) done(item t) { if m == nil { return } if startTime, exists := m.processingStartTimes[item]; exists { m.workDuration.Observe(m.sinceInSeconds(startTime)) delete(m.processingStartTimes, item) } } func (m *defaultQueueMetrics) updateUnfinishedWork() { // Note that a summary metric would be better for this, but prometheus // doesn't seem to have non-hacky ways to reset the summary metrics. var total float64 var oldest float64 for _, t := range m.processingStartTimes { age := m.sinceInSeconds(t) total += age if age > oldest { oldest = age } } m.unfinishedWorkSeconds.Set(total) m.longestRunningProcessor.Set(oldest) } type noMetrics struct{} func (noMetrics) add(item t) {} func (noMetrics) get(item t) {} func (noMetrics) done(item t) {} func (noMetrics) updateUnfinishedWork() {} // Gets the time since the specified start in seconds. func (m *defaultQueueMetrics) sinceInSeconds(start time.Time) float64 { return m.clock.Since(start).Seconds() } type retryMetrics interface { retry() } type defaultRetryMetrics struct { retries CounterMetric } func (m *defaultRetryMetrics) retry() { if m == nil { return } m.retries.Inc() } // MetricsProvider generates various metrics used by the queue. type MetricsProvider interface { NewDepthMetric(name string) GaugeMetric NewAddsMetric(name string) CounterMetric NewLatencyMetric(name string) HistogramMetric NewWorkDurationMetric(name string) HistogramMetric NewUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric NewLongestRunningProcessorSecondsMetric(name string) SettableGaugeMetric NewRetriesMetric(name string) CounterMetric } type noopMetricsProvider struct{} func (_ noopMetricsProvider) NewDepthMetric(name string) GaugeMetric { return noopMetric{} } func (_ noopMetricsProvider) NewAddsMetric(name string) CounterMetric { return noopMetric{} } func (_ noopMetricsProvider) NewLatencyMetric(name string) HistogramMetric { return noopMetric{} } func (_ noopMetricsProvider) NewWorkDurationMetric(name string) HistogramMetric { return noopMetric{} } func (_ noopMetricsProvider) NewUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric { return noopMetric{} } func (_ noopMetricsProvider) NewLongestRunningProcessorSecondsMetric(name string) SettableGaugeMetric { return noopMetric{} } func (_ noopMetricsProvider) NewRetriesMetric(name string) CounterMetric { return noopMetric{} } var globalMetricsFactory = queueMetricsFactory{ metricsProvider: noopMetricsProvider{}, } type queueMetricsFactory struct { metricsProvider MetricsProvider onlyOnce sync.Once } func (f *queueMetricsFactory) setProvider(mp MetricsProvider) { f.onlyOnce.Do(func() { f.metricsProvider = mp }) } func (f *queueMetricsFactory) newQueueMetrics(name string, clock clock.Clock) queueMetrics { mp := f.metricsProvider if len(name) == 0 || mp == (noopMetricsProvider{}) { return noMetrics{} } return &defaultQueueMetrics{ clock: clock, depth: mp.NewDepthMetric(name), adds: mp.NewAddsMetric(name), latency: mp.NewLatencyMetric(name), workDuration: mp.NewWorkDurationMetric(name), unfinishedWorkSeconds: mp.NewUnfinishedWorkSecondsMetric(name), longestRunningProcessor: mp.NewLongestRunningProcessorSecondsMetric(name), addTimes: map[t]time.Time{}, processingStartTimes: map[t]time.Time{}, } } func newRetryMetrics(name string, provider MetricsProvider) retryMetrics { var ret *defaultRetryMetrics if len(name) == 0 { return ret } if provider == nil { provider = globalMetricsFactory.metricsProvider } return &defaultRetryMetrics{ retries: provider.NewRetriesMetric(name), } } // SetProvider sets the metrics provider for all subsequently created work // queues. Only the first call has an effect. func SetProvider(metricsProvider MetricsProvider) { globalMetricsFactory.setProvider(metricsProvider) } kubernetes-client-go-a2dfcab/util/workqueue/metrics_test.go000066400000000000000000000141401472614177300244400ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "sync" "testing" "time" testingclock "k8s.io/utils/clock/testing" ) type testMetrics struct { added, gotten, finished int64 updateCalled chan<- struct{} } func (m *testMetrics) add(item t) { m.added++ } func (m *testMetrics) get(item t) { m.gotten++ } func (m *testMetrics) done(item t) { m.finished++ } func (m *testMetrics) updateUnfinishedWork() { m.updateCalled <- struct{}{} } func TestMetricShutdown(t *testing.T) { ch := make(chan struct{}) m := &testMetrics{ updateCalled: ch, } c := testingclock.NewFakeClock(time.Now()) q := newQueue[any](c, DefaultQueue[any](), m, time.Millisecond) for !c.HasWaiters() { // Wait for the go routine to call NewTicker() time.Sleep(time.Millisecond) } c.Step(time.Millisecond) <-ch q.ShutDown() c.Step(time.Hour) select { default: return case <-ch: t.Errorf("Unexpected update after shutdown was called.") } } type testMetric struct { inc int64 dec int64 set float64 observedValue float64 observedCount int notifyCh chan<- struct{} lock sync.Mutex } func (m *testMetric) Inc() { m.lock.Lock() defer m.lock.Unlock() m.inc++ m.notify() } func (m *testMetric) Dec() { m.lock.Lock() defer m.lock.Unlock() m.dec++ m.notify() } func (m *testMetric) Set(f float64) { m.lock.Lock() defer m.lock.Unlock() m.set = f m.notify() } func (m *testMetric) Observe(f float64) { m.lock.Lock() defer m.lock.Unlock() m.observedValue = f m.observedCount++ m.notify() } func (m *testMetric) gaugeValue() float64 { m.lock.Lock() defer m.lock.Unlock() if m.set != 0 { return m.set } return float64(m.inc - m.dec) } func (m *testMetric) observationValue() float64 { m.lock.Lock() defer m.lock.Unlock() return m.observedValue } func (m *testMetric) observationCount() int { m.lock.Lock() defer m.lock.Unlock() return m.observedCount } func (m *testMetric) notify() { if m.notifyCh != nil { m.notifyCh <- struct{}{} } } type testMetricsProvider struct { depth testMetric adds testMetric latency testMetric duration testMetric unfinished testMetric longest testMetric retries testMetric } func (m *testMetricsProvider) NewDepthMetric(name string) GaugeMetric { return &m.depth } func (m *testMetricsProvider) NewAddsMetric(name string) CounterMetric { return &m.adds } func (m *testMetricsProvider) NewLatencyMetric(name string) HistogramMetric { return &m.latency } func (m *testMetricsProvider) NewWorkDurationMetric(name string) HistogramMetric { return &m.duration } func (m *testMetricsProvider) NewUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric { return &m.unfinished } func (m *testMetricsProvider) NewLongestRunningProcessorSecondsMetric(name string) SettableGaugeMetric { return &m.longest } func (m *testMetricsProvider) NewRetriesMetric(name string) CounterMetric { return &m.retries } func TestMetrics(t *testing.T) { mp := testMetricsProvider{} t0 := time.Unix(0, 0) c := testingclock.NewFakeClock(t0) config := QueueConfig{ Name: "test", Clock: c, MetricsProvider: &mp, } q := newQueueWithConfig[any](config, time.Millisecond) defer q.ShutDown() for !c.HasWaiters() { // Wait for the go routine to call NewTicker() time.Sleep(time.Millisecond) } q.Add("foo") if e, a := 1.0, mp.adds.gaugeValue(); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 1.0, mp.depth.gaugeValue(); e != a { t.Errorf("expected %v, got %v", e, a) } c.Step(50 * time.Microsecond) // Start processing i, _ := q.Get() if i != "foo" { t.Errorf("Expected %v, got %v", "foo", i) } if e, a := 5e-05, mp.latency.observationValue(); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 1, mp.latency.observationCount(); e != a { t.Errorf("expected %v, got %v", e, a) } // Add it back while processing; multiple adds of the same item are // de-duped. q.Add(i) q.Add(i) q.Add(i) q.Add(i) q.Add(i) if e, a := 2.0, mp.adds.gaugeValue(); e != a { t.Errorf("expected %v, got %v", e, a) } // One thing remains in the queue if e, a := 1.0, mp.depth.gaugeValue(); e != a { t.Errorf("expected %v, got %v", e, a) } c.Step(25 * time.Microsecond) // Finish it up q.Done(i) if e, a := 2.5e-05, mp.duration.observationValue(); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 1, mp.duration.observationCount(); e != a { t.Errorf("expected %v, got %v", e, a) } // One thing remains in the queue if e, a := 1.0, mp.depth.gaugeValue(); e != a { t.Errorf("expected %v, got %v", e, a) } // It should be back on the queue i, _ = q.Get() if i != "foo" { t.Errorf("Expected %v, got %v", "foo", i) } if e, a := 2.5e-05, mp.latency.observationValue(); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2, mp.latency.observationCount(); e != a { t.Errorf("expected %v, got %v", e, a) } // use a channel to ensure we don't look at the metric before it's // been set. ch := make(chan struct{}, 1) longestCh := make(chan struct{}, 1) mp.unfinished.notifyCh = ch mp.longest.notifyCh = longestCh c.Step(time.Millisecond) <-ch mp.unfinished.notifyCh = nil if e, a := .001, mp.unfinished.gaugeValue(); e != a { t.Errorf("expected %v, got %v", e, a) } <-longestCh mp.longest.notifyCh = nil if e, a := .001, mp.longest.gaugeValue(); e != a { t.Errorf("expected %v, got %v", e, a) } // Finish that one up q.Done(i) if e, a := .001, mp.duration.observationValue(); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2, mp.duration.observationCount(); e != a { t.Errorf("expected %v, got %v", e, a) } } kubernetes-client-go-a2dfcab/util/workqueue/parallelizer.go000066400000000000000000000043571472614177300244320ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "context" "sync" utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) type DoWorkPieceFunc func(piece int) type options struct { chunkSize int } type Options func(*options) // WithChunkSize allows to set chunks of work items to the workers, rather than // processing one by one. // It is recommended to use this option if the number of pieces significantly // higher than the number of workers and the work done for each item is small. func WithChunkSize(c int) func(*options) { return func(o *options) { o.chunkSize = c } } // ParallelizeUntil is a framework that allows for parallelizing N // independent pieces of work until done or the context is canceled. func ParallelizeUntil(ctx context.Context, workers, pieces int, doWorkPiece DoWorkPieceFunc, opts ...Options) { if pieces == 0 { return } o := options{} for _, opt := range opts { opt(&o) } chunkSize := o.chunkSize if chunkSize < 1 { chunkSize = 1 } chunks := ceilDiv(pieces, chunkSize) toProcess := make(chan int, chunks) for i := 0; i < chunks; i++ { toProcess <- i } close(toProcess) var stop <-chan struct{} if ctx != nil { stop = ctx.Done() } if chunks < workers { workers = chunks } wg := sync.WaitGroup{} wg.Add(workers) for i := 0; i < workers; i++ { go func() { defer utilruntime.HandleCrash() defer wg.Done() for chunk := range toProcess { start := chunk * chunkSize end := start + chunkSize if end > pieces { end = pieces } for p := start; p < end; p++ { select { case <-stop: return default: doWorkPiece(p) } } } }() } wg.Wait() } func ceilDiv(a, b int) int { return (a + b - 1) / b } kubernetes-client-go-a2dfcab/util/workqueue/parallelizer_test.go000066400000000000000000000046251472614177300254670ustar00rootroot00000000000000/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "context" "fmt" "sync/atomic" "testing" "github.com/google/go-cmp/cmp" ) type testCase struct { pieces int workers int chunkSize int } func (c testCase) String() string { return fmt.Sprintf("pieces:%d,workers:%d,chunkSize:%d", c.pieces, c.workers, c.chunkSize) } var cases = []testCase{ { pieces: 1000, workers: 10, chunkSize: 1, }, { pieces: 1000, workers: 10, chunkSize: 10, }, { pieces: 1000, workers: 10, chunkSize: 100, }, { pieces: 999, workers: 10, chunkSize: 13, }, } func TestParallelizeUntil(t *testing.T) { for _, tc := range cases { t.Run(tc.String(), func(t *testing.T) { seen := make([]int32, tc.pieces) ctx := context.Background() ParallelizeUntil(ctx, tc.workers, tc.pieces, func(p int) { atomic.AddInt32(&seen[p], 1) }, WithChunkSize(tc.chunkSize)) wantSeen := make([]int32, tc.pieces) for i := 0; i < tc.pieces; i++ { wantSeen[i] = 1 } if diff := cmp.Diff(wantSeen, seen); diff != "" { t.Errorf("bad number of visits (-want,+got):\n%s", diff) } }) } } func BenchmarkParallelizeUntil(b *testing.B) { for _, tc := range cases { b.Run(tc.String(), func(b *testing.B) { ctx := context.Background() isPrime := make([]bool, tc.pieces) b.ResetTimer() for c := 0; c < b.N; c++ { ParallelizeUntil(ctx, tc.workers, tc.pieces, func(p int) { isPrime[p] = calPrime(p) }, WithChunkSize(tc.chunkSize)) } b.StopTimer() want := []bool{false, false, true, true, false, true, false, true, false, false, false, true} if diff := cmp.Diff(want, isPrime[:len(want)]); diff != "" { b.Errorf("miscalculated isPrime (-want,+got):\n%s", diff) } }) } } func calPrime(p int) bool { if p <= 1 { return false } for i := 2; i*i <= p; i++ { if p%i == 0 { return false } } return true } kubernetes-client-go-a2dfcab/util/workqueue/queue.go000066400000000000000000000224561472614177300230700ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "sync" "time" "k8s.io/utils/clock" ) // Deprecated: Interface is deprecated, use TypedInterface instead. type Interface TypedInterface[any] type TypedInterface[T comparable] interface { Add(item T) Len() int Get() (item T, shutdown bool) Done(item T) ShutDown() ShutDownWithDrain() ShuttingDown() bool } // Queue is the underlying storage for items. The functions below are always // called from the same goroutine. type Queue[T comparable] interface { // Touch can be hooked when an existing item is added again. This may be // useful if the implementation allows priority change for the given item. Touch(item T) // Push adds a new item. Push(item T) // Len tells the total number of items. Len() int // Pop retrieves an item. Pop() (item T) } // DefaultQueue is a slice based FIFO queue. func DefaultQueue[T comparable]() Queue[T] { return new(queue[T]) } // queue is a slice which implements Queue. type queue[T comparable] []T func (q *queue[T]) Touch(item T) {} func (q *queue[T]) Push(item T) { *q = append(*q, item) } func (q *queue[T]) Len() int { return len(*q) } func (q *queue[T]) Pop() (item T) { item = (*q)[0] // The underlying array still exists and reference this object, so the object will not be garbage collected. (*q)[0] = *new(T) *q = (*q)[1:] return item } // QueueConfig specifies optional configurations to customize an Interface. // Deprecated: use TypedQueueConfig instead. type QueueConfig = TypedQueueConfig[any] type TypedQueueConfig[T comparable] struct { // Name for the queue. If unnamed, the metrics will not be registered. Name string // MetricsProvider optionally allows specifying a metrics provider to use for the queue // instead of the global provider. MetricsProvider MetricsProvider // Clock ability to inject real or fake clock for testing purposes. Clock clock.WithTicker // Queue provides the underlying queue to use. It is optional and defaults to slice based FIFO queue. Queue Queue[T] } // New constructs a new work queue (see the package comment). // // Deprecated: use NewTyped instead. func New() *Type { return NewWithConfig(QueueConfig{ Name: "", }) } // NewTyped constructs a new work queue (see the package comment). func NewTyped[T comparable]() *Typed[T] { return NewTypedWithConfig(TypedQueueConfig[T]{ Name: "", }) } // NewWithConfig constructs a new workqueue with ability to // customize different properties. // // Deprecated: use NewTypedWithConfig instead. func NewWithConfig(config QueueConfig) *Type { return NewTypedWithConfig(config) } // NewTypedWithConfig constructs a new workqueue with ability to // customize different properties. func NewTypedWithConfig[T comparable](config TypedQueueConfig[T]) *Typed[T] { return newQueueWithConfig(config, defaultUnfinishedWorkUpdatePeriod) } // NewNamed creates a new named queue. // Deprecated: Use NewWithConfig instead. func NewNamed(name string) *Type { return NewWithConfig(QueueConfig{ Name: name, }) } // newQueueWithConfig constructs a new named workqueue // with the ability to customize different properties for testing purposes func newQueueWithConfig[T comparable](config TypedQueueConfig[T], updatePeriod time.Duration) *Typed[T] { var metricsFactory *queueMetricsFactory if config.MetricsProvider != nil { metricsFactory = &queueMetricsFactory{ metricsProvider: config.MetricsProvider, } } else { metricsFactory = &globalMetricsFactory } if config.Clock == nil { config.Clock = clock.RealClock{} } if config.Queue == nil { config.Queue = DefaultQueue[T]() } return newQueue( config.Clock, config.Queue, metricsFactory.newQueueMetrics(config.Name, config.Clock), updatePeriod, ) } func newQueue[T comparable](c clock.WithTicker, queue Queue[T], metrics queueMetrics, updatePeriod time.Duration) *Typed[T] { t := &Typed[T]{ clock: c, queue: queue, dirty: set[T]{}, processing: set[T]{}, cond: sync.NewCond(&sync.Mutex{}), metrics: metrics, unfinishedWorkUpdatePeriod: updatePeriod, } // Don't start the goroutine for a type of noMetrics so we don't consume // resources unnecessarily if _, ok := metrics.(noMetrics); !ok { go t.updateUnfinishedWorkLoop() } return t } const defaultUnfinishedWorkUpdatePeriod = 500 * time.Millisecond // Type is a work queue (see the package comment). // Deprecated: Use Typed instead. type Type = Typed[any] type Typed[t comparable] struct { // queue defines the order in which we will work on items. Every // element of queue should be in the dirty set and not in the // processing set. queue Queue[t] // dirty defines all of the items that need to be processed. dirty set[t] // Things that are currently being processed are in the processing set. // These things may be simultaneously in the dirty set. When we finish // processing something and remove it from this set, we'll check if // it's in the dirty set, and if so, add it to the queue. processing set[t] cond *sync.Cond shuttingDown bool drain bool metrics queueMetrics unfinishedWorkUpdatePeriod time.Duration clock clock.WithTicker } type empty struct{} type t interface{} type set[t comparable] map[t]empty func (s set[t]) has(item t) bool { _, exists := s[item] return exists } func (s set[t]) insert(item t) { s[item] = empty{} } func (s set[t]) delete(item t) { delete(s, item) } func (s set[t]) len() int { return len(s) } // Add marks item as needing processing. func (q *Typed[T]) Add(item T) { q.cond.L.Lock() defer q.cond.L.Unlock() if q.shuttingDown { return } if q.dirty.has(item) { // the same item is added again before it is processed, call the Touch // function if the queue cares about it (for e.g, reset its priority) if !q.processing.has(item) { q.queue.Touch(item) } return } q.metrics.add(item) q.dirty.insert(item) if q.processing.has(item) { return } q.queue.Push(item) q.cond.Signal() } // Len returns the current queue length, for informational purposes only. You // shouldn't e.g. gate a call to Add() or Get() on Len() being a particular // value, that can't be synchronized properly. func (q *Typed[T]) Len() int { q.cond.L.Lock() defer q.cond.L.Unlock() return q.queue.Len() } // Get blocks until it can return an item to be processed. If shutdown = true, // the caller should end their goroutine. You must call Done with item when you // have finished processing it. func (q *Typed[T]) Get() (item T, shutdown bool) { q.cond.L.Lock() defer q.cond.L.Unlock() for q.queue.Len() == 0 && !q.shuttingDown { q.cond.Wait() } if q.queue.Len() == 0 { // We must be shutting down. return *new(T), true } item = q.queue.Pop() q.metrics.get(item) q.processing.insert(item) q.dirty.delete(item) return item, false } // Done marks item as done processing, and if it has been marked as dirty again // while it was being processed, it will be re-added to the queue for // re-processing. func (q *Typed[T]) Done(item T) { q.cond.L.Lock() defer q.cond.L.Unlock() q.metrics.done(item) q.processing.delete(item) if q.dirty.has(item) { q.queue.Push(item) q.cond.Signal() } else if q.processing.len() == 0 { q.cond.Signal() } } // ShutDown will cause q to ignore all new items added to it and // immediately instruct the worker goroutines to exit. func (q *Typed[T]) ShutDown() { q.cond.L.Lock() defer q.cond.L.Unlock() q.drain = false q.shuttingDown = true q.cond.Broadcast() } // ShutDownWithDrain will cause q to ignore all new items added to it. As soon // as the worker goroutines have "drained", i.e: finished processing and called // Done on all existing items in the queue; they will be instructed to exit and // ShutDownWithDrain will return. Hence: a strict requirement for using this is; // your workers must ensure that Done is called on all items in the queue once // the shut down has been initiated, if that is not the case: this will block // indefinitely. It is, however, safe to call ShutDown after having called // ShutDownWithDrain, as to force the queue shut down to terminate immediately // without waiting for the drainage. func (q *Typed[T]) ShutDownWithDrain() { q.cond.L.Lock() defer q.cond.L.Unlock() q.drain = true q.shuttingDown = true q.cond.Broadcast() for q.processing.len() != 0 && q.drain { q.cond.Wait() } } func (q *Typed[T]) ShuttingDown() bool { q.cond.L.Lock() defer q.cond.L.Unlock() return q.shuttingDown } func (q *Typed[T]) updateUnfinishedWorkLoop() { t := q.clock.NewTicker(q.unfinishedWorkUpdatePeriod) defer t.Stop() for range t.C() { if !func() bool { q.cond.L.Lock() defer q.cond.L.Unlock() if !q.shuttingDown { q.metrics.updateUnfinishedWork() return true } return false }() { return } } } kubernetes-client-go-a2dfcab/util/workqueue/queue_test.go000066400000000000000000000242001472614177300241140ustar00rootroot00000000000000/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue_test import ( "runtime" "sync" "sync/atomic" "testing" "time" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/workqueue" ) // traceQueue traces whether items are touched type traceQueue struct { workqueue.Queue[any] touched map[interface{}]struct{} } func (t *traceQueue) Touch(item interface{}) { t.Queue.Touch(item) if t.touched == nil { t.touched = make(map[interface{}]struct{}) } t.touched[item] = struct{}{} } var _ workqueue.Queue[any] = &traceQueue{} func TestBasic(t *testing.T) { tests := []struct { queue *workqueue.Type queueShutDown func(workqueue.Interface) }{ { queue: workqueue.New(), queueShutDown: workqueue.Interface.ShutDown, }, { queue: workqueue.New(), queueShutDown: workqueue.Interface.ShutDownWithDrain, }, } for _, test := range tests { // If something is seriously wrong this test will never complete. // Start producers const producers = 50 producerWG := sync.WaitGroup{} producerWG.Add(producers) for i := 0; i < producers; i++ { go func(i int) { defer producerWG.Done() for j := 0; j < 50; j++ { test.queue.Add(i) time.Sleep(time.Millisecond) } }(i) } // Start consumers const consumers = 10 consumerWG := sync.WaitGroup{} consumerWG.Add(consumers) for i := 0; i < consumers; i++ { go func(i int) { defer consumerWG.Done() for { item, quit := test.queue.Get() if item == "added after shutdown!" { t.Errorf("Got an item added after shutdown.") } if quit { return } t.Logf("Worker %v: begin processing %v", i, item) time.Sleep(3 * time.Millisecond) t.Logf("Worker %v: done processing %v", i, item) test.queue.Done(item) } }(i) } producerWG.Wait() test.queueShutDown(test.queue) test.queue.Add("added after shutdown!") consumerWG.Wait() if test.queue.Len() != 0 { t.Errorf("Expected the queue to be empty, had: %v items", test.queue.Len()) } } } func TestAddWhileProcessing(t *testing.T) { tests := []struct { queue *workqueue.Type queueShutDown func(workqueue.Interface) }{ { queue: workqueue.New(), queueShutDown: workqueue.Interface.ShutDown, }, { queue: workqueue.New(), queueShutDown: workqueue.Interface.ShutDownWithDrain, }, } for _, test := range tests { // Start producers const producers = 50 producerWG := sync.WaitGroup{} producerWG.Add(producers) for i := 0; i < producers; i++ { go func(i int) { defer producerWG.Done() test.queue.Add(i) }(i) } // Start consumers const consumers = 10 consumerWG := sync.WaitGroup{} consumerWG.Add(consumers) for i := 0; i < consumers; i++ { go func(i int) { defer consumerWG.Done() // Every worker will re-add every item up to two times. // This tests the dirty-while-processing case. counters := map[interface{}]int{} for { item, quit := test.queue.Get() if quit { return } counters[item]++ if counters[item] < 2 { test.queue.Add(item) } test.queue.Done(item) } }(i) } producerWG.Wait() test.queueShutDown(test.queue) consumerWG.Wait() if test.queue.Len() != 0 { t.Errorf("Expected the queue to be empty, had: %v items", test.queue.Len()) } } } func TestLen(t *testing.T) { q := workqueue.New() q.Add("foo") if e, a := 1, q.Len(); e != a { t.Errorf("Expected %v, got %v", e, a) } q.Add("bar") if e, a := 2, q.Len(); e != a { t.Errorf("Expected %v, got %v", e, a) } q.Add("foo") // should not increase the queue length. if e, a := 2, q.Len(); e != a { t.Errorf("Expected %v, got %v", e, a) } } func TestReinsert(t *testing.T) { q := workqueue.New() q.Add("foo") // Start processing i, _ := q.Get() if i != "foo" { t.Errorf("Expected %v, got %v", "foo", i) } // Add it back while processing q.Add(i) // Finish it up q.Done(i) // It should be back on the queue i, _ = q.Get() if i != "foo" { t.Errorf("Expected %v, got %v", "foo", i) } // Finish that one up q.Done(i) if a := q.Len(); a != 0 { t.Errorf("Expected queue to be empty. Has %v items", a) } } func TestCollapse(t *testing.T) { tq := &traceQueue{Queue: workqueue.DefaultQueue[any]()} q := workqueue.NewWithConfig(workqueue.QueueConfig{ Name: "", Queue: tq, }) // Add a new one twice q.Add("bar") q.Add("bar") // It should get the new one i, _ := q.Get() if i != "bar" { t.Errorf("Expected %v, got %v", "bar", i) } // Finish that one up q.Done(i) // There should be no more objects in the queue if a := q.Len(); a != 0 { t.Errorf("Expected queue to be empty. Has %v items", a) } if _, ok := tq.touched["bar"]; !ok { t.Errorf("Expected bar to be Touched") } } func TestCollapseWhileProcessing(t *testing.T) { tq := &traceQueue{Queue: workqueue.DefaultQueue[any]()} q := workqueue.NewWithConfig(workqueue.QueueConfig{ Name: "", Queue: tq, }) q.Add("foo") // Start processing i, _ := q.Get() if i != "foo" { t.Errorf("Expected %v, got %v", "foo", i) } // Add the same one twice q.Add("foo") q.Add("foo") waitCh := make(chan struct{}) // simulate another worker consuming the queue go func() { defer close(waitCh) i, _ := q.Get() if i != "foo" { t.Errorf("Expected %v, got %v", "foo", i) } // Finish that one up q.Done(i) }() // give the worker some head start to avoid races // on the select statement that cause flakiness time.Sleep(100 * time.Millisecond) // Finish the first one to unblock the other worker select { case <-waitCh: t.Errorf("worker should be blocked until we are done") default: q.Done("foo") } // wait for the worker to consume the new object // There should be no more objects in the queue <-waitCh if a := q.Len(); a != 0 { t.Errorf("Expected queue to be empty. Has %v items", a) } if _, ok := tq.touched["foo"]; ok { t.Errorf("Unexpected Touch") } } func TestQueueDrainageUsingShutDownWithDrain(t *testing.T) { q := workqueue.New() q.Add("foo") q.Add("bar") firstItem, _ := q.Get() secondItem, _ := q.Get() finishedWG := sync.WaitGroup{} finishedWG.Add(1) go func() { defer finishedWG.Done() q.ShutDownWithDrain() }() // This is done as to simulate a sequence of events where ShutDownWithDrain // is called before we start marking all items as done - thus simulating a // drain where we wait for all items to finish processing. shuttingDown := false for !shuttingDown { _, shuttingDown = q.Get() } // Mark the first two items as done, as to finish up q.Done(firstItem) q.Done(secondItem) finishedWG.Wait() } func TestNoQueueDrainageUsingShutDown(t *testing.T) { q := workqueue.New() q.Add("foo") q.Add("bar") q.Get() q.Get() finishedWG := sync.WaitGroup{} finishedWG.Add(1) go func() { defer finishedWG.Done() // Invoke ShutDown: suspending the execution immediately. q.ShutDown() }() // We can now do this and not have the test timeout because we didn't call // Done on the first two items before arriving here. finishedWG.Wait() } func TestForceQueueShutdownUsingShutDown(t *testing.T) { q := workqueue.New() q.Add("foo") q.Add("bar") q.Get() q.Get() finishedWG := sync.WaitGroup{} finishedWG.Add(1) go func() { defer finishedWG.Done() q.ShutDownWithDrain() }() // This is done as to simulate a sequence of events where ShutDownWithDrain // is called before ShutDown shuttingDown := false for !shuttingDown { _, shuttingDown = q.Get() } // Use ShutDown to force the queue to shut down (simulating a caller // which can invoke this function on a second SIGTERM/SIGINT) q.ShutDown() // We can now do this and not have the test timeout because we didn't call // done on any of the items before arriving here. finishedWG.Wait() } func TestQueueDrainageUsingShutDownWithDrainWithDirtyItem(t *testing.T) { q := workqueue.New() q.Add("foo") gotten, _ := q.Get() q.Add("foo") finishedWG := sync.WaitGroup{} finishedWG.Add(1) go func() { defer finishedWG.Done() q.ShutDownWithDrain() }() // Ensure that ShutDownWithDrain has started and is blocked. shuttingDown := false for !shuttingDown { _, shuttingDown = q.Get() } // Finish "working". q.Done(gotten) // `shuttingDown` becomes false because Done caused an item to go back into // the queue. again, shuttingDown := q.Get() if shuttingDown { t.Fatalf("should not have been done") } q.Done(again) // Now we are really done. _, shuttingDown = q.Get() if !shuttingDown { t.Fatalf("should have been done") } finishedWG.Wait() } // TestGarbageCollection ensures that objects that are added then removed from the queue are // able to be garbage collected. func TestGarbageCollection(t *testing.T) { type bigObject struct { data []byte } leakQueue := workqueue.New() t.Cleanup(func() { // Make sure leakQueue doesn't go out of scope too early runtime.KeepAlive(leakQueue) }) c := &bigObject{data: []byte("hello")} mustGarbageCollect(t, c) leakQueue.Add(c) o, _ := leakQueue.Get() leakQueue.Done(o) } // mustGarbageCollect asserts than an object was garbage collected by the end of the test. // The input must be a pointer to an object. func mustGarbageCollect(t *testing.T, i interface{}) { t.Helper() var collected int32 = 0 runtime.SetFinalizer(i, func(x interface{}) { atomic.StoreInt32(&collected, 1) }) t.Cleanup(func() { if err := wait.PollImmediate(time.Millisecond*100, wait.ForeverTestTimeout, func() (done bool, err error) { // Trigger GC explicitly, otherwise we may need to wait a long time for it to run runtime.GC() return atomic.LoadInt32(&collected) == 1, nil }); err != nil { t.Errorf("object was not garbage collected") } }) } kubernetes-client-go-a2dfcab/util/workqueue/rate_limiting_queue.go000066400000000000000000000140241472614177300257670ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import "k8s.io/utils/clock" // RateLimitingInterface is an interface that rate limits items being added to the queue. // // Deprecated: Use TypedRateLimitingInterface instead. type RateLimitingInterface TypedRateLimitingInterface[any] // TypedRateLimitingInterface is an interface that rate limits items being added to the queue. type TypedRateLimitingInterface[T comparable] interface { TypedDelayingInterface[T] // AddRateLimited adds an item to the workqueue after the rate limiter says it's ok AddRateLimited(item T) // Forget indicates that an item is finished being retried. Doesn't matter whether it's for perm failing // or for success, we'll stop the rate limiter from tracking it. This only clears the `rateLimiter`, you // still have to call `Done` on the queue. Forget(item T) // NumRequeues returns back how many times the item was requeued NumRequeues(item T) int } // RateLimitingQueueConfig specifies optional configurations to customize a RateLimitingInterface. // // Deprecated: Use TypedRateLimitingQueueConfig instead. type RateLimitingQueueConfig = TypedRateLimitingQueueConfig[any] // TypedRateLimitingQueueConfig specifies optional configurations to customize a TypedRateLimitingInterface. type TypedRateLimitingQueueConfig[T comparable] struct { // Name for the queue. If unnamed, the metrics will not be registered. Name string // MetricsProvider optionally allows specifying a metrics provider to use for the queue // instead of the global provider. MetricsProvider MetricsProvider // Clock optionally allows injecting a real or fake clock for testing purposes. Clock clock.WithTicker // DelayingQueue optionally allows injecting custom delaying queue DelayingInterface instead of the default one. DelayingQueue TypedDelayingInterface[T] } // NewRateLimitingQueue constructs a new workqueue with rateLimited queuing ability // Remember to call Forget! If you don't, you may end up tracking failures forever. // NewRateLimitingQueue does not emit metrics. For use with a MetricsProvider, please use // NewRateLimitingQueueWithConfig instead and specify a name. // // Deprecated: Use NewTypedRateLimitingQueue instead. func NewRateLimitingQueue(rateLimiter RateLimiter) RateLimitingInterface { return NewRateLimitingQueueWithConfig(rateLimiter, RateLimitingQueueConfig{}) } // NewTypedRateLimitingQueue constructs a new workqueue with rateLimited queuing ability // Remember to call Forget! If you don't, you may end up tracking failures forever. // NewTypedRateLimitingQueue does not emit metrics. For use with a MetricsProvider, please use // NewTypedRateLimitingQueueWithConfig instead and specify a name. func NewTypedRateLimitingQueue[T comparable](rateLimiter TypedRateLimiter[T]) TypedRateLimitingInterface[T] { return NewTypedRateLimitingQueueWithConfig(rateLimiter, TypedRateLimitingQueueConfig[T]{}) } // NewRateLimitingQueueWithConfig constructs a new workqueue with rateLimited queuing ability // with options to customize different properties. // Remember to call Forget! If you don't, you may end up tracking failures forever. // // Deprecated: Use NewTypedRateLimitingQueueWithConfig instead. func NewRateLimitingQueueWithConfig(rateLimiter RateLimiter, config RateLimitingQueueConfig) RateLimitingInterface { return NewTypedRateLimitingQueueWithConfig(rateLimiter, config) } // NewTypedRateLimitingQueueWithConfig constructs a new workqueue with rateLimited queuing ability // with options to customize different properties. // Remember to call Forget! If you don't, you may end up tracking failures forever. func NewTypedRateLimitingQueueWithConfig[T comparable](rateLimiter TypedRateLimiter[T], config TypedRateLimitingQueueConfig[T]) TypedRateLimitingInterface[T] { if config.Clock == nil { config.Clock = clock.RealClock{} } if config.DelayingQueue == nil { config.DelayingQueue = NewTypedDelayingQueueWithConfig(TypedDelayingQueueConfig[T]{ Name: config.Name, MetricsProvider: config.MetricsProvider, Clock: config.Clock, }) } return &rateLimitingType[T]{ TypedDelayingInterface: config.DelayingQueue, rateLimiter: rateLimiter, } } // NewNamedRateLimitingQueue constructs a new named workqueue with rateLimited queuing ability. // Deprecated: Use NewRateLimitingQueueWithConfig instead. func NewNamedRateLimitingQueue(rateLimiter RateLimiter, name string) RateLimitingInterface { return NewRateLimitingQueueWithConfig(rateLimiter, RateLimitingQueueConfig{ Name: name, }) } // NewRateLimitingQueueWithDelayingInterface constructs a new named workqueue with rateLimited queuing ability // with the option to inject a custom delaying queue instead of the default one. // Deprecated: Use NewRateLimitingQueueWithConfig instead. func NewRateLimitingQueueWithDelayingInterface(di DelayingInterface, rateLimiter RateLimiter) RateLimitingInterface { return NewRateLimitingQueueWithConfig(rateLimiter, RateLimitingQueueConfig{ DelayingQueue: di, }) } // rateLimitingType wraps an Interface and provides rateLimited re-enquing type rateLimitingType[T comparable] struct { TypedDelayingInterface[T] rateLimiter TypedRateLimiter[T] } // AddRateLimited AddAfter's the item based on the time when the rate limiter says it's ok func (q *rateLimitingType[T]) AddRateLimited(item T) { q.TypedDelayingInterface.AddAfter(item, q.rateLimiter.When(item)) } func (q *rateLimitingType[T]) NumRequeues(item T) int { return q.rateLimiter.NumRequeues(item) } func (q *rateLimitingType[T]) Forget(item T) { q.rateLimiter.Forget(item) } kubernetes-client-go-a2dfcab/util/workqueue/rate_limiting_queue_test.go000066400000000000000000000046041472614177300270310ustar00rootroot00000000000000/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package workqueue import ( "testing" "time" testingclock "k8s.io/utils/clock/testing" ) func TestRateLimitingQueue(t *testing.T) { limiter := NewItemExponentialFailureRateLimiter(1*time.Millisecond, 1*time.Second) queue := NewRateLimitingQueue(limiter).(*rateLimitingType[any]) fakeClock := testingclock.NewFakeClock(time.Now()) delayingQueue := &delayingType[any]{ TypedInterface: New(), clock: fakeClock, heartbeat: fakeClock.NewTicker(maxWait), stopCh: make(chan struct{}), waitingForAddCh: make(chan *waitFor, 1000), metrics: newRetryMetrics("", nil), } queue.TypedDelayingInterface = delayingQueue queue.AddRateLimited("one") waitEntry := <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("one") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 2*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2, queue.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("two") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("two") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 2*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.Forget("one") if e, a := 0, queue.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("one") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } }